Skip to content

Commit

Permalink
Merge pull request #115 from SBNSoftware/feature/hlay_crt_clustering
Browse files Browse the repository at this point in the history
CRT Clustering CAF Objects
  • Loading branch information
fjnicolas authored Jan 23, 2024
2 parents ff6d390 + be0a747 commit 3f7c396
Show file tree
Hide file tree
Showing 12 changed files with 230 additions and 17 deletions.
18 changes: 18 additions & 0 deletions sbnanaobj/StandardRecord/SRCRTSpacePoint.cxx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
////////////////////////////////////////////////////////////////////////
// \file SRCRTSpacePoint.cxx
////////////////////////////////////////////////////////////////////////

#include "sbnanaobj/StandardRecord/SRCRTSpacePoint.h"

#include <climits>

namespace caf
{
SRCRTSpacePoint::SRCRTSpacePoint():
pe(std::numeric_limits<float>::signaling_NaN()),
time(std::numeric_limits<float>::signaling_NaN()),
time_err(std::numeric_limits<float>::signaling_NaN()),
complete(false)
{}
} // end namespace caf
////////////////////////////////////////////////////////////////////////
27 changes: 27 additions & 0 deletions sbnanaobj/StandardRecord/SRCRTSpacePoint.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
////////////////////////////////////////////////////////////////////////
// \file SRCRTSpacePoint.h
////////////////////////////////////////////////////////////////////////
#ifndef SRCRTSPACEPOINT_H
#define SRCRTSPACEPOINT_H

#include "sbnanaobj/StandardRecord/SRVector3D.h"

namespace caf
{
class SRCRTSpacePoint
{
public:
SRCRTSpacePoint();
virtual ~SRCRTSpacePoint() {}

SRVector3D position; // position [cm]
SRVector3D position_err; // positional spread [cm]
float pe; // total PE
float time; // time [ns]
float time_err; // time_err [ns]
bool complete; // was cluster made from perpendicular & overlapping strips?
};
} // end namespace

#endif // SRCRTSPACEPOINT_H
//////////////////////////////////////////////////////////////////////////////
13 changes: 13 additions & 0 deletions sbnanaobj/StandardRecord/SRCRTSpacePointMatch.cxx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
////////////////////////////////////////////////////////////////////////
// \file SRCRTSpacePointMatch.cxx
////////////////////////////////////////////////////////////////////////

#include "sbnanaobj/StandardRecord/SRCRTSpacePointMatch.h"

namespace caf
{
SRCRTSpacePointMatch::SRCRTSpacePointMatch():
score(std::numeric_limits<float>::signaling_NaN())
{}
}
////////////////////////////////////////////////////////////////////////
23 changes: 23 additions & 0 deletions sbnanaobj/StandardRecord/SRCRTSpacePointMatch.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
////////////////////////////////////////////////////////////////////////
// \file SRCRTSpacePointMatch.h
////////////////////////////////////////////////////////////////////////
#ifndef SRCRTSPACEPOINTMATCH_H
#define SRCRTSPACEPOINTMATCH_H

#include "sbnanaobj/StandardRecord/SRCRTSpacePoint.h"

namespace caf
{
class SRCRTSpacePointMatch
{
public:
SRCRTSpacePointMatch();
virtual ~SRCRTSpacePointMatch() {}

SRCRTSpacePoint spacepoint; // the spacepoint
float score; // assessment of quality of matching (depends on alg configuration)
};
}

#endif // SRCRTSPACEPOINTMATCH_H
//////////////////////////////////////////////////////////////////////////////
14 changes: 14 additions & 0 deletions sbnanaobj/StandardRecord/SREnums.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,20 @@ namespace caf
kWallBack=6
};

enum SBNDCRTTagger_t {
kUndefinedSBNDTagger = -1,
kBottomSBNDTagger,
kSouthSBNDTagger,
kNorthSBNDTagger,
kWestSBNDTagger,
kEastSBNDTagger,
kTopLowSBNDTagger,
kTopHighSBNDTagger,

kUpstreamSBNDTagger = kSouthSBNDTagger,
kDownstreamSBNDTagger = kNorthSBNDTagger
};

/// Which type of MC?
enum MCType_t
{
Expand Down
18 changes: 18 additions & 0 deletions sbnanaobj/StandardRecord/SRSBNDCRTTrack.cxx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
////////////////////////////////////////////////////////////////////////
// \file SRSBNDCRTTrack.cxx
////////////////////////////////////////////////////////////////////////

#include "sbnanaobj/StandardRecord/SRSBNDCRTTrack.h"

#include <climits>

namespace caf
{
SRSBNDCRTTrack::SRSBNDCRTTrack():
time(std::numeric_limits<float>::signaling_NaN()),
time_err(std::numeric_limits<float>::signaling_NaN()),
pe(std::numeric_limits<float>::signaling_NaN()),
tof(std::numeric_limits<float>::signaling_NaN())
{}
} // end namespace caf
////////////////////////////////////////////////////////////////////////
32 changes: 32 additions & 0 deletions sbnanaobj/StandardRecord/SRSBNDCRTTrack.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
////////////////////////////////////////////////////////////////////////
// \file SRSBNDCRTTrack.h
////////////////////////////////////////////////////////////////////////
#ifndef SRSBNDCRTTRACK_H
#define SRSBNDCRTTRACK_H

#include "sbnanaobj/StandardRecord/SRVector3D.h"
#include "sbnanaobj/StandardRecord/SREnums.h"

#include <vector>

namespace caf
{
class SRSBNDCRTTrack
{
public:
SRSBNDCRTTrack();
virtual ~SRSBNDCRTTrack() {}

std::vector<SRVector3D> points; // fitted track points at each tagger [cm]
float time; // average time [ns]
float time_err; // error in average time [ns]
float pe; // total PE;
float tof; // time from first space point to last [ns]

// TODO: Find way of adding taggers field
// std::set<SBNDCRTTagger_t> taggers; // which taggers were used to create the track
};
} // end namespace

#endif // SRSBNDCRTTRACK_H
//////////////////////////////////////////////////////////////////////////////
13 changes: 13 additions & 0 deletions sbnanaobj/StandardRecord/SRSBNDCRTTrackMatch.cxx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
////////////////////////////////////////////////////////////////////////
// \file SRSBNDCRTTrackMatch.cxx
////////////////////////////////////////////////////////////////////////

#include "sbnanaobj/StandardRecord/SRSBNDCRTTrackMatch.h"

namespace caf
{
SRSBNDCRTTrackMatch::SRSBNDCRTTrackMatch():
score(std::numeric_limits<float>::signaling_NaN())
{}
}
////////////////////////////////////////////////////////////////////////
23 changes: 23 additions & 0 deletions sbnanaobj/StandardRecord/SRSBNDCRTTrackMatch.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
////////////////////////////////////////////////////////////////////////
// \file SRSBNDCRTTrackMatch.h
////////////////////////////////////////////////////////////////////////
#ifndef SRSBNDCRTTRACKMATCH_H
#define SRSBNDCRTTRACKMATCH_H

#include "sbnanaobj/StandardRecord/SRSBNDCRTTrack.h"

namespace caf
{
class SRSBNDCRTTrackMatch
{
public:
SRSBNDCRTTrackMatch();
virtual ~SRSBNDCRTTrackMatch() {}

SRSBNDCRTTrack track; // the track
float score; // assessment of quality of matching (depends on alg configuration)
};
}

#endif // SRSBNDCRTTRACKMATCH_H
//////////////////////////////////////////////////////////////////////////////
10 changes: 7 additions & 3 deletions sbnanaobj/StandardRecord/SRTrack.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
#include "sbnanaobj/StandardRecord/SRTrkRange.h"
#include "sbnanaobj/StandardRecord/SRCRTHitMatch.h"
#include "sbnanaobj/StandardRecord/SRCRTTrackMatch.h"
#include "sbnanaobj/StandardRecord/SRCRTSpacePointMatch.h"
#include "sbnanaobj/StandardRecord/SRSBNDCRTTrackMatch.h"
#include "sbnanaobj/StandardRecord/SRTrackCalo.h"
#include "sbnanaobj/StandardRecord/SRTrackDazzle.h"
#include "sbnanaobj/StandardRecord/SRTrackScatterClosestApproach.h"
Expand Down Expand Up @@ -49,9 +51,11 @@ namespace caf
SRTrkMCS mcsP;
SRTrkRange rangeP;

SRTrackTruth truth; ///< truth information
SRCRTHitMatch crthit; ///< CRT Hit match
SRCRTTrackMatch crttrack; ///< CRT Track match
SRTrackTruth truth; ///< truth information
SRCRTHitMatch crthit; ///< CRT Hit match (ICARUS)
SRCRTTrackMatch crttrack; ///< CRT Track match (ICARUS)
SRCRTSpacePointMatch crtspacepoint; ///< CRT SpacePoint match (SBND)
SRSBNDCRTTrackMatch crtsbndtrack; ///< CRT Track match (SBND)

SRTrackScatterClosestApproach scatterClosestApproach; ///< Scattering variables relating to spread about interpolated track
SRTrackStoppingChi2Fit stoppingChi2Fit; ///< Fit results from Pol0 and Exp to dEdx vs res. range
Expand Down
30 changes: 18 additions & 12 deletions sbnanaobj/StandardRecord/StandardRecord.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

#include "sbnanaobj/StandardRecord/SRCRTHit.h"
#include "sbnanaobj/StandardRecord/SRCRTTrack.h"
#include "sbnanaobj/StandardRecord/SRCRTSpacePoint.h"
#include "sbnanaobj/StandardRecord/SRSBNDCRTTrack.h"
#include "sbnanaobj/StandardRecord/SRHeader.h"
#include "sbnanaobj/StandardRecord/SRCRTPMTMatch.h"
#include "sbnanaobj/StandardRecord/SRSlice.h"
Expand Down Expand Up @@ -36,18 +38,22 @@ namespace caf
SRSliceRecoBranch reco; ///< Slice reco branch: tracks, showers, etc.
SRTruthBranch mc; ///< Truth branch for all interactions

int nslc; ///< Number of slices in list
std::vector<SRSlice> slc; ///< Slice branch.
int nfake_reco; ///< Number of Fake-Reco's in list
std::vector<SRFakeReco> fake_reco; ///< List of fake-reco slices
int ntrue_particles; ///< Number of true particles in list
std::vector<SRTrueParticle> true_particles; ///< True particles in spill
int ncrt_hits; ///< Number of CRT hits in event
std::vector<SRCRTHit> crt_hits; ///< CRT hits in event
int ncrt_tracks; ///< Number of CRT tracks in event
std::vector<SRCRTTrack> crt_tracks; ///< CRT tracks in event
int nopflashes; ///< Number of OpFlashes in spill
std::vector<SROpFlash> opflashes; ///< List of OpFlashes in spill
int nslc; ///< Number of slices in list
std::vector<SRSlice> slc; ///< Slice branch.
int nfake_reco; ///< Number of Fake-Reco's in list
std::vector<SRFakeReco> fake_reco; ///< List of fake-reco slices
int ntrue_particles; ///< Number of true particles in list
std::vector<SRTrueParticle> true_particles; ///< True particles in spill
int ncrt_hits; ///< Number of CRT hits in event (ICARUS)
std::vector<SRCRTHit> crt_hits; ///< CRT hits in event (ICARUS)
int ncrt_tracks; ///< Number of CRT tracks in event (ICARUS)
std::vector<SRCRTTrack> crt_tracks; ///< CRT tracks in event (ICARUS)
int ncrt_spacepoints; ///< Number of CRT spacepoints in event (SBND)
std::vector<SRCRTSpacePoint> crt_spacepoints; ///< CRT spacepoints in event (SBND)
int nsbnd_crt_tracks; ///< Number of CRT tracks in event (SBND)
std::vector<SRSBNDCRTTrack> sbnd_crt_tracks; ///< CRT tracks in event (SBND)
int nopflashes; ///< Number of OpFlashes in spill
std::vector<SROpFlash> opflashes; ///< List of OpFlashes in spill

int ncrtpmt_matches; ///<Number of CRT-PMT Matches in event
std::vector<SRCRTPMTMatch> crtpmt_matches; ///< CRT-PMT matches in event
Expand Down
26 changes: 24 additions & 2 deletions sbnanaobj/StandardRecord/classes_def.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
<!-- art::Wrappers for these products are defined in CAFMaker -->

<lcgdict>
<class name="caf::StandardRecord" ClassVersion="12">
<class name="caf::StandardRecord" ClassVersion="13">
<version ClassVersion="13" checksum="1979816256"/>
<version ClassVersion="12" checksum="3984422068"/>
<version ClassVersion="11" checksum="483883398"/>
<version ClassVersion="10" checksum="2569909752"/>
Expand Down Expand Up @@ -101,7 +102,8 @@
<version ClassVersion="10" checksum="3777054621"/>
</class>

<class name="caf::SRTrack" ClassVersion="14">
<class name="caf::SRTrack" ClassVersion="15">
<version ClassVersion="15" checksum="175611744"/>
<version ClassVersion="14" checksum="3934033130"/>
<version ClassVersion="13" checksum="522362999"/>
<version ClassVersion="12" checksum="3952974887"/>
Expand Down Expand Up @@ -355,9 +357,29 @@
</class>
<class name="std::vector<caf::SRTPCPMTBarycenterMatch>"/>

<class name="caf::SRCRTSpacePoint" ClassVersion="10">
<version ClassVersion="10" checksum="3912601582"/>
</class>

<class name="caf::SRCRTSpacePointMatch" ClassVersion="10">
<version ClassVersion="10" checksum="382456729"/>
</class>

<class name="caf::SRSBNDCRTTrack" ClassVersion="10">
<version ClassVersion="10" checksum="1967800431"/>
</class>

<class name="caf::SRSBNDCRTTrackMatch" ClassVersion="10">
<version ClassVersion="10" checksum="2486605052"/>
</class>

<class name="std::vector<caf::SRCRTSpacePoint>" />
<class name="std::vector<caf::SRSBNDCRTTrack>" />

<enum name="caf::Det_t" ClassVersion="10"/>
<enum name="caf::Plane_t" ClassVersion="10"/>
<enum name="caf::Wall_t" ClassVersion="10"/>
<enum name="caf::SBNDCRTTagger_t" ClassVersion="10"/>
<enum name="caf::MCType_t" ClassVersion="10"/>
<enum name="caf::generator_" ClassVersion="10"/>
<enum name="caf::mevprtlchannel_" ClassVersion="10"/>
Expand Down

0 comments on commit 3f7c396

Please sign in to comment.