Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion sbnobj/Common/CRT/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@ cet_make_library(
CRTPMTMatching.cxx
CRTTrack.cc
CRTTzero.cc
LIBRARIES
CRTHitT0TaggingInfo.cc
CRTHitT0TaggingTruthInfo.cc
LIBRARIES
cetlib_except::cetlib_except
lardataobj::Simulation
larcorealg::Geometry
)

art_dictionary(DICTIONARY_LIBRARIES sbnobj::Common_CRT)
Expand Down
1 change: 1 addition & 0 deletions sbnobj/Common/CRT/CRTHitT0TaggingInfo.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#include "sbnobj/Common/CRT/CRTHitT0TaggingInfo.hh"
103 changes: 103 additions & 0 deletions sbnobj/Common/CRT/CRTHitT0TaggingInfo.hh
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
/**
* @file sbnobj/Common/CRT/CRTHitT0TaggingInfo.hh
* @author Francesco Poppi (poppi@bo.infn.it)
* @date January 2025
*/

#ifndef SBNOBJ_COMMON_CRTHitT0TaggingInfo_hh_
#define SBNOBJ_COMMON_CRTHitT0TaggingInfo_hh_

// C/C++ standard libraries
#include <limits>
#include "larcorealg/Geometry/GeometryCore.h"
#include "larcoreobj/SimpleTypesAndConstants/geo_types.h"
#include "larcoreobj/SimpleTypesAndConstants/geo_vectors.h"
// -----------------------------------------------------------------------------
namespace sbn::crt {
/// @brief How was the track fitted when matched with a CRT hit.

enum class CRTTaggingMethod {
crtHits = 0, ///< matching performed using single CRT Hits
crtTracks = 1 ///< matching performed using CRTTracks
};

enum class CRTTaggingTrackFit {
pca = 0, ///< Track fitted with PCA method
startEnd = 1, ///< Track fitted from Start-End vector
kalman = 2, ///< Track fitted using Kalman Filter
others = 9 ///< Track direction evaluated in other mehods
};

struct CRTHitT0TaggingInfo;
}
/**
* @brief Additional information on the matching between CRT and TPC tracks.
*
*/
struct sbn::crt::CRTHitT0TaggingInfo {

/// Magic value denoting the absence of DCA information.
static constexpr double NoDistance = std::numeric_limits<double>::lowest();
static constexpr double NoTime = std::numeric_limits<double>::lowest();

/// Magic value denoting the absence of CRTs.
static constexpr int NoCRT = std::numeric_limits<int>::lowest();

/// Magic value denoting the absence of CRT Plane.
static constexpr int NoPlane = std::numeric_limits<int>::lowest();

// --- BEGIN -- Data members -------------------------------------------------

// Francesco: following a discussion with Henry Lay, we decided that is good
// to have a common object to store additional information, but at the moment
// the matching approach is different, ICARUS uses single CRT Hits to track
// matching, while SBND uses CRTTracks. Due to this difference, we decided
// to add a notation "Hit" in the member which matches tracks with single hits.
// We might at some point do more discussion and see if this can work for both.

/// Distance of closest approach between track extension and CRT hit [cm]
double Distance = NoDistance;

/// Matched CRT Hit sub detector
// e.g. ICARUS case: 0 Top, 1 Side, 2 Bottom
int Sys = NoCRT;

/// Matched CRT Hit region
// e.g. ICARUS case: 30-34 Top CRT, 40-48 Side CRT, 50 Bottom CRT
int Region = NoCRT;

/// Matched CRT Hit time w.r.t. trigger [ns]
double Time = NoTime;

/// Distance distinguished into its components DX, DY, DZ [cm]
double DeltaX = NoDistance;
double DeltaY = NoDistance;
double DeltaZ = NoDistance;

/// Extrapolated Track Projection Crossing Point onto the CRT Plane
double CrossX = NoDistance;
double CrossY = NoDistance;
double CrossZ = NoDistance;

/// Fix Coordinate for the CRT Plane
// e.g. ICARUS case:
// For Top CRT region 30 Y coordinate is constant: plane=0
// For Top CRT region 31/32 and Side CRT 40/41/42/43/44/45 X coordinate is constant: plane=1
// For Top CRT region 33/34 and Side CRT 46/47 Z coordinate is constant: plane=2
int Plane = NoPlane;

// PCA Fit Fir Eigenvector
geo::Vector_t PCAEigenVector = {-1., -1., -1.};

CRTTaggingTrackFit fitType;
CRTTaggingMethod taggingMethod;
Comment thread
henrylay97 marked this conversation as resolved.

// --- END ---- Data members -------------------------------------------------

}; // sbn::crt::CRTHitT0TaggingInfo


// -----------------------------------------------------------------------------


#endif // SBNOBJ_COMMON_CRTHitT0TaggingInfo_hh_
1 change: 1 addition & 0 deletions sbnobj/Common/CRT/CRTHitT0TaggingTruthInfo.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#include "sbnobj/Common/CRT/CRTHitT0TaggingTruthInfo.hh"
51 changes: 51 additions & 0 deletions sbnobj/Common/CRT/CRTHitT0TaggingTruthInfo.hh
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/**
* @file sbnobj/Common/CRT/CRTHitT0TaggingTruthInfo.hh
* @author Francesco Poppi (poppi@bo.infn.it)
* @date January 2025
*/

#ifndef SBNOBJ_COMMON_CRTHitT0TaggingTruthInfo_hh_
#define SBNOBJ_COMMON_CRTHitT0TaggingTruthInfo_hh_

// C/C++ standard libraries
#include <limits>

// -----------------------------------------------------------------------------
namespace sbn::crt {
struct CRTHitT0TaggingTruthInfo;
}
/**
* @brief Truth information on the matching between CRT and TPC tracks.
*
*/
struct sbn::crt::CRTHitT0TaggingTruthInfo {
static constexpr double NoCoordinate = std::numeric_limits<double>::lowest();
static constexpr int NoId = std::numeric_limits<int>::lowest();
static constexpr int NoPdg = std::numeric_limits<int>::lowest();

/// Verify that the truth level information of the track were correctly retrieved.
/// Default is false.
bool truthFound = false;

/// Turth level information of the match.
/// Default is false. For MC this information is filled if MC truth is available.
bool truthMatch = false;

/// Truth information of the particle Geant4Id.
int truthG4TrackId = NoId;

/// Truth information of the particle Pdg code.
int truthTrackPdgCode = NoPdg;

/// Truth information if the particle is associated with the neutrino interaction
/// or not (information from generator). Default is false.
bool truthIsNu = false;

// --- END ---- Data members -------------------------------------------------

}; // sbn::crt::CRTHitT0TaggingTruthInfo

// -----------------------------------------------------------------------------


#endif // SBNOBJ_COMMON_CRTHitT0TaggingTruthInfo_hh_
6 changes: 6 additions & 0 deletions sbnobj/Common/CRT/classes.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
#include "canvas/Persistency/Common/Wrapper.h"
#include "canvas/Persistency/Common/Assns.h"
#include "lardataobj/RecoBase/Track.h"
#include "lardataobj/RecoBase/PFParticle.h"
#include "lardataobj/AnalysisBase/T0.h"
#include "lardataobj/Simulation/AuxDetSimChannel.h"
#include "lardataobj/RecoBase/Track.h"
#include "lardataobj/RecoBase/PFParticle.h"
#include "sbnobj/Common/CRT/CRTHit.hh"
#include "sbnobj/Common/CRT/CRTTrack.hh"
#include "lardataobj/AnalysisBase/T0.h"
Expand All @@ -11,6 +15,8 @@
#include "sbnobj/Common/CRT/CRTHit_Legacy.hh"
#include "sbnobj/Common/CRT/CRTTrack_Legacy.hh"
#include "sbnobj/Common/CRT/CRTTzero_Legacy.hh"
#include "sbnobj/Common/CRT/CRTHitT0TaggingInfo.hh"
#include "sbnobj/Common/CRT/CRTHitT0TaggingTruthInfo.hh"
#include <vector>
#include <map>
#include <utility>
Expand Down
31 changes: 31 additions & 0 deletions sbnobj/Common/CRT/classes_def.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
</class>
<class name="std::vector<sbn::crt::CRTTzero>"/>
<class name="art::Wrapper< std::vector<sbn::crt::CRTTzero> >"/>


<class name="sbn::crt::CRTTrack" ClassVersion="12">
<version ClassVersion="12" checksum="197963098"/>
Expand Down Expand Up @@ -159,4 +160,34 @@
<!--<class name="art::Assns<recob::OpFlash,sbn::crt::CRTHit,sbn::crt::CRTPMTMatchingInfo>"/>
<class name="art::Wrapper<art::Assns<recob::OpFlash,sbn::crt::CRTHit,sbn::crt::CRTPMTMatchingInfo> >"/>
<class name="art::Wrapper<art::Assns<sbn::crt::CRTHit,recob::OpFlash,sbn::crt::CRTPMTMatchingInfo> >"/>-->
<!-- CRTT0Tagging Information -->
<enum name="sbn::crt::CRTTaggingMethod"/>
<enum name="sbn::crt::CRTTaggingTrackFit"/>
<class name="sbn::crt::CRTHitT0TaggingInfo" ClassVersion="10">
<version ClassVersion="10" checksum="836791263"/>
</class>
<class name="std::vector<sbn::crt::CRTHitT0TaggingInfo>"/>
<class name="art::Wrapper<std::vector<sbn::crt::CRTHitT0TaggingInfo>>"/>

<class name="sbn::crt::CRTHitT0TaggingTruthInfo" ClassVersion="10">
<version ClassVersion="10" checksum="443868831"/>
</class>
<class name="std::vector<sbn::crt::CRTHitT0TaggingTruthInfo>"/>
<class name="art::Wrapper<std::vector<sbn::crt::CRTHitT0TaggingTruthInfo>>"/>

<class name="art::Assns<sbn::crt::CRTHitT0TaggingInfo , sbn::crt::CRTHitT0TaggingTruthInfo , void>"/>
<class name="art::Assns<sbn::crt::CRTHitT0TaggingTruthInfo , sbn::crt::CRTHitT0TaggingInfo , void>"/>
<class name="art::Wrapper<art::Assns<sbn::crt::CRTHitT0TaggingInfo , sbn::crt::CRTHitT0TaggingTruthInfo> >"/>
<class name="art::Wrapper<art::Assns<sbn::crt::CRTHitT0TaggingTruthInfo , sbn::crt::CRTHitT0TaggingInfo> >"/>

<class name="art::Assns<recob::Track , sbn::crt::CRTHitT0TaggingInfo , void>"/>
<class name="art::Wrapper<art::Assns<recob::Track , sbn::crt::CRTHitT0TaggingInfo>>"/>
<class name="art::Assns<sbn::crt::CRTHitT0TaggingInfo , recob::Track, void>"/>
<class name="art::Wrapper<art::Assns<sbn::crt::CRTHitT0TaggingInfo, recob::Track>>"/>

<class name="art::Assns<recob::PFParticle , sbn::crt::CRTHitT0TaggingInfo , void>"/>
<class name="art::Wrapper<art::Assns<recob::PFParticle , sbn::crt::CRTHitT0TaggingInfo>>"/>
<class name="art::Assns<sbn::crt::CRTHitT0TaggingInfo , recob::PFParticle, void>"/>
<class name="art::Wrapper<art::Assns<sbn::crt::CRTHitT0TaggingInfo, recob::PFParticle>>"/>

</lcgdict>
13 changes: 8 additions & 5 deletions sbnobj/Common/Calibration/TrackCaloSkimmerObj.h
Original file line number Diff line number Diff line change
Expand Up @@ -261,15 +261,17 @@ namespace sbn {
std::vector<WireInfo> wires1; //!< List of wire information on plane 1
std::vector<WireInfo> wires2; //!< List of wire information on plane 2

float t0; //!< T0 of track [ns]
float t0CRT; //!< T0 of track from CRT-TPC matching [ns]
int whicht0; //!< Which T0 producer was used to tag
float t0PFP; //!< Particle-Flow-Particle (Pandora) T0. Derived from cathode crossing
float t0CRTTrack; //!< t0 from CRT Track
float t0CRTHit; //!< t0 from CRT Hit
int whicht0; //!< Which T0 producer was used to tag. 0 is Pandora, 1 is CRTTrack 2 is CRTHit
int id; //!< ID of track
int cryostat; //!< Cryostat number of track
bool clear_cosmic_muon; //!< Whether Pandora thinks the track is "clearly" a cosmic
Vector3D start; //!< Start position of track [cm]
Vector3D end; //!< End position of track [cm]
Vector3D dir; //!< Direction of track
Vector3D PCAdir; //!< Track Direction as fitted from PCA
float length; //!< Length of track [cm]

float hit_min_time_p0_tpcE; //!< Min hit time of track on plane 0 TPC E
Expand Down Expand Up @@ -312,8 +314,9 @@ namespace sbn {
TrackTruth truth; //!< Truth-matching information

TrackInfo():
t0(-1),
t0CRT(-1),
Comment thread
henrylay97 marked this conversation as resolved.
t0PFP(std::numeric_limits<float>::lowest()),
t0CRTTrack(std::numeric_limits<float>::lowest()),
t0CRTHit(std::numeric_limits<float>::lowest()),
id(-1),
cryostat(-1),
clear_cosmic_muon(false),
Expand Down
4 changes: 3 additions & 1 deletion sbnobj/Common/Calibration/classes_def.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
<version ClassVersion="11" checksum="903476586"/>
<version ClassVersion="10" checksum="118230262"/>
</class>
<class name="sbn::TrackInfo" ClassVersion="14">
<class name="sbn::TrackInfo" ClassVersion="16">
<version ClassVersion="16" checksum="2134249071"/>
<version ClassVersion="15" checksum="1667792945"/>
<version ClassVersion="14" checksum="3729960902"/>
<version ClassVersion="13" checksum="1962204283"/>
<version ClassVersion="12" checksum="2151440214"/>
Expand Down