12 #ifndef GAR_CHEAT_BackTrackerCore_h 13 #define GAR_CHEAT_BackTrackerCore_h 20 #include "nug4/ParticleNavigation/ParticleList.h" 21 #include "nug4/ParticleNavigation/EveIdCalculator.h" 36 #include <unordered_map> 42 class EveIdCalculator;
62 HitIDE(
int id,
float ef,
float e,
const TLorentzVector&
pos,
const TLorentzVector& mom)
63 : trackID(id), energyFrac(ef), energyTot(e), position(pos), momentum(mom) {}
66 if(this->trackID != hitr.
trackID)
return false;
67 if(this->energyTot != hitr.
energyTot)
return false;
68 if(this->energyFrac != hitr.
energyFrac)
return false;
69 if(this->position != hitr.
position)
return false;
70 if(this->momentum != hitr.
momentum)
return false;
77 if(*
this == hitr)
return false;
78 if(this->trackID < hitr.
trackID)
return true;
79 if(this->trackID > hitr.
trackID)
return false;
80 if(this->energyTot < hitr.
energyTot)
return true;
81 if(this->energyTot > hitr.
energyTot)
return false;
82 if(this->energyFrac < hitr.
energyFrac)
return true;
83 if(this->energyFrac > hitr.
energyFrac)
return false;
84 if(this->position.Rho() < hitr.
position.Rho())
return true;
85 if(this->position.Rho() > hitr.
position.Rho())
return false;
86 if(this->position.Phi() < hitr.
position.Phi())
return true;
87 if(this->position.Phi() > hitr.
position.Phi())
return false;
88 if(this->position.Z() < hitr.
position.Z())
return true;
89 if(this->position.Z() > hitr.
position.Z())
return false;
90 if(this->momentum.P() < hitr.
position.P())
return true;
91 if(this->momentum.P() > hitr.
position.P())
return false;
92 if(this->momentum.E() < hitr.
position.E())
return true;
93 if(this->momentum.E() > hitr.
position.E())
return false;
106 : trackID(id), energyFrac(ef), energyTot(e) {}
119 fParticleList.AdoptEveIdCalculator(ec);
138 return &fParticleList;
148 return TrackIDToParticle(p->
Mother());
170 std::vector<HitIDE> HitToHitIDEs(
rec::Hit const& hit)
const;
172 std::vector<art::Ptr<rec::Hit>>
175 bool checkNeutrals=
false)
const;
180 std::pair<double,double>
183 bool weightByCharge=
false)
const;
187 std::pair<double,double>
191 bool weightByCharge=
false)
const;
203 std::vector<CalIDE> CaloHitToCalIDEs(
rec::CaloHit const& hit)
const;
205 std::vector<art::Ptr<rec::CaloHit>>
212 std::pair<double,double>
215 bool weightByCharge=
false)
const;
219 std::pair<double,double>
223 bool weightByCharge=
false)
const;
231 std::vector<art::Ptr<rec::Hit>>
const TrackToHits(
rec::Track*
const t);
233 std::vector<art::Ptr<rec::Hit>>
const TPCClusterToHits(
rec::TPCCluster*
const clust);
236 std::vector<const rec::TPCCluster*>
const TrackToClusters(
rec::Track*
const t);
238 std::vector<std::pair<simb::MCParticle*,float>> TrackToMCParticles(
rec::Track*
const t);
242 double TrackToTotalEnergy(
rec::Track*
const t);
244 std::vector<art::Ptr<rec::Track>>
254 std::vector<art::Ptr<rec::CaloHit>>
const ClusterToCaloHits(
rec::Cluster*
const c);
256 std::vector<std::pair<simb::MCParticle*,float>> ClusterToMCParticles(
rec::Cluster*
const c);
258 std::vector<art::Ptr<rec::Cluster>>
272 double const start,
double const stop)
const;
277 std::vector<simb::MCParticle*>
280 TLorentzVector EnergyDepositToMomentum(
const int& trackID,
const TLorentzVector&
position,
size_t& startTrajIndex)
const;
284 bool fHasMC, fHasHits, fHasCalHits,
fHasTracks, fHasClusters;
319 std::unordered_map<raw::CellID_t,std::vector<const sdp::CaloDeposit*>>
323 std::unordered_map< rec::IDNumber, std::vector<art::Ptr<rec::Hit>> >
327 std::unordered_map< rec::IDNumber, std::vector<const rec::TPCCluster*> >
332 std::unordered_map< rec::IDNumber, std::vector<art::Ptr<rec::Hit>> >
335 std::unordered_map< rec::IDNumber, std::vector<art::Ptr<rec::CaloHit>> >
float energyFrac
fraction of gar::rec::Hit energy from the particle with this trackID
TLorentzVector position
deposited energy-weighted mean true 4-position [cm,ns]
double fClusterFracMCP
min frac of ionization in a cluster for matching to an MCParticle
double fLongDiffConst
longitudinal diffusion constant
std::vector< std::vector< std::pair< const sdp::EnergyDeposit *, float const > > > fChannelToEDepCol
convenience collections of EnergyDeposits for each channel
HitIDE(int id, float ef, float e, const TLorentzVector &pos, const TLorentzVector &mom)
std::unordered_map< rec::IDNumber, std::vector< const rec::TPCCluster * > > fTrackIDToClusters
Reco track ID to track's clusters.
const detinfo::DetectorClocks * fClocks
Detector clock information.
TLorentzVector momentum
deposited energy-weighted mean true 4-momentum [GeV/c,GeV]
double fMinHitEnergyFraction
min frac of ionization a track has to count in a TPC hit
std::string fRawCaloDataECALInstance
instance name for the ECAL raw hits
Description of geometry of one entire detector.
std::string fClusterLabel
label for ECAL cluster producing module
std::unordered_map< raw::CellID_t, std::vector< const sdp::CaloDeposit * > > fCellIDToEDepCol
convenience collections of EnergyDeposit for each cell
const geo::GeometryCore * fGeo
pointer to the geometry
void AdoptEveIdCalculator(sim::EveIdCalculator *ec)
std::unordered_map< int, int > fTrackIDToMCTruthIndex
double fTrackFracMCP
min frac of ionization in a track for matching to an MCParticle
std::unordered_map< rec::IDNumber, std::vector< art::Ptr< rec::Hit > > > fTrackIDToHits
Reco track ID to track's hits.
float energyFrac
fraction of gar::rec::CaloHit energy from particle with this trackID
std::string fClusterECALInstance
instance name for the ECAL clusters
std::string fRawTPCDataLabel
label for TPC readout module
float energyTot
total energy for this trackID. In units of probably-GeV.
sim::ParticleList fParticleList
Maps MCParticle::TrackId() to same MCParticle.
std::string fTPCClusterLabel
label for TPCCluster producing module
simb::MCParticle * FindMother(simb::MCParticle *const p) const
std::string fTrackLabel
label for final track producing module
std::unordered_map< rec::IDNumber, std::vector< art::Ptr< rec::Hit > > > fTPCClusterIDToHits
Reco TPC cluster ID to cluster's hits.
std::unordered_map< rec::IDNumber, std::vector< art::Ptr< rec::CaloHit > > > fClusterIDToCaloHits
Reco ECAL cluster ID to CaloHits.
Definition of basic calo raw digits.
sim::ParticleList * GetParticleList()
std::unordered_map< int, int > * fECALTrackToTPCTrack
results of previous FindTPCEve calls
CalIDE(int id, float ef, float e)
Code to link reconstructed objects back to the MC truth information.
Detector simulation of raw signals on wires.
std::string fG4ModuleLabel
label for geant4 module
General GArSoft Utilities.
int trackID
Geant4 trackID, as modified by ParticleListAction::PreTrackingAction.
int trackID
Geant4 trackID, as modified by ParticleListAction::PreTrackingAction.
code to link reconstructed objects back to the MC truth information
bool fSplitEDeps
use weights from PRFs to break true energy deposits into channel specific contributions ...
std::string fRawCaloDataLabel
label for ECAL readout module
float energyTot
total energy for this trackID. In units of probably-GeV.
std::vector< art::Ptr< simb::MCTruth > > fMCTruthList
all the MCTruths for the event
double fECALtimeResolution
time resolution for hits in ECAL, nsec.
art framework interface to geometry description
double fInverseVelocity
inverse drift velocity
bool fDisableRebuild
for switching off backtracker's rebuild of the MCParticle tables
double fMinCaloHitEnergyFrac
min frac of ionization a track has to count in a CaloHit
bool operator<(const BeamGateInfo &lhs, const BeamGateInfo &rhs)
bool operator==(ModuleKeyAndType const &a, ModuleKeyAndType const &b) noexcept