All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
cheat::PhotonBackTracker Class Reference

#include <old.PhotonBackTracker.h>

Inheritance diagram for cheat::PhotonBackTracker:
cheat::PhotonBackTrackerService

Classes

struct  fhiclConfig
 

Public Member Functions

 PhotonBackTracker (fhicl::ParameterSet const &pset, art::ActivityRegistry &reg)
 
 ~PhotonBackTracker ()
 
void reconfigure (fhicl::ParameterSet const &pset)
 
void Rebuild (const art::Event &evt)
 
const sim::ParticleList & ParticleList () const
 
void SetEveIdCalculator (sim::EveIdCalculator *ec)
 
const simb::MCParticle * TrackIDToParticle (int const &id) const
 
const simb::MCParticle * TrackIDToMotherParticle (int const &id) const
 
std::vector< sim::SDPTrackIDToSimSDP (int const &id) const
 
const art::Ptr< simb::MCTruth > & TrackIDToMCTruth (int const &id) const
 
const art::Ptr< simb::MCTruth > & ParticleToMCTruth (const simb::MCParticle *p) const
 
std::vector< const
simb::MCParticle * > 
MCTruthToParticles (art::Ptr< simb::MCTruth > const &mct) const
 
const std::vector< art::Ptr
< simb::MCTruth > > & 
MCTruthVector () const
 
DEPRECATED std::vector
< sim::TrackSDP
OpHitToTrackID (art::Ptr< recob::OpHit > const &hit)
 
std::vector< sim::TrackSDPOpHitToTrackSDPs (art::Ptr< recob::OpHit > const &hit)
 
const std::vector< std::vector
< art::Ptr< recob::OpHit > > > 
TrackIDsToOpHits (std::vector< art::Ptr< recob::OpHit >> const &allhits, std::vector< int > const &tkIDs)
 
std::vector< sim::TrackSDPOpHitToEveSDPs (art::Ptr< recob::OpHit > const &hit)
 
std::vector< sim::TrackSDPOpHitToEveID (art::Ptr< recob::OpHit > const &hit)
 
std::vector< double > SimSDPsToXYZ (std::vector< sim::SDP > const &sdps)
 
std::vector< double > OpHitToXYZ (art::Ptr< recob::OpHit > const &hit)
 
double OpHitCollectionPurity (std::set< int > trackIDs, std::vector< art::Ptr< recob::OpHit > > const &hits)
 
double OpHitCollectionEfficiency (std::set< int > trackIDs, std::vector< art::Ptr< recob::OpHit > > const &hits, std::vector< art::Ptr< recob::OpHit > > const &allhits)
 
double OpHitCollectionEfficiency (std::set< int > trackIDs, std::vector< art::Ptr< recob::OpHit > > const &hits, std::vector< art::Ptr< recob::OpHit > > const &allhits, geo::View_t const &view)
 
double OpHitChargeCollectionPurity (std::set< int > trackIDs, std::vector< art::Ptr< recob::OpHit > > const &hits)
 
double OpHitChargeCollectionEfficiency (std::set< int > trackIDs, std::vector< art::Ptr< recob::OpHit > > const &hits, std::vector< art::Ptr< recob::OpHit > > const &allhits)
 
double OpHitChargeCollectionEfficiency (std::set< int > trackIDs, std::vector< art::Ptr< recob::OpHit > > const &hits, std::vector< art::Ptr< recob::OpHit > > const &allhits, geo::View_t const &view)
 
std::set< int > GetSetOfEveIDs ()
 
std::set< int > GetSetOfTrackIDs ()
 
std::set< int > GetSetOfEveIDs (std::vector< art::Ptr< recob::OpHit > > const &hits)
 
std::set< int > GetSetOfTrackIDs (std::vector< art::Ptr< recob::OpHit > > const &hits)
 
const std::vector< art::Ptr
< sim::OpDetBacktrackerRecord > > & 
OpDetBacktrackerRecords () const
 
void ChannelToTrackSDPs (std::vector< sim::TrackSDP > &trackSDPs, int channel, const double hit_start_time, const double hit_end_time)
 
 PhotonBackTracker (fhicl::ParameterSet const &pset, art::ActivityRegistry &reg)
 
 ~PhotonBackTracker ()
 
void reconfigure (fhicl::ParameterSet const &pset)
 
void Rebuild (const art::Event &evt)
 
const sim::ParticleList & ParticleList () const
 
void SetEveIdCalculator (sim::EveIdCalculator *ec)
 
const simb::MCParticle * TrackIDToParticle (int const &id) const
 
const simb::MCParticle * TrackIDToMotherParticle (int const &id) const
 
std::vector< sim::SDPTrackIDToSimSDP (int const &id) const
 
const art::Ptr< simb::MCTruth > & TrackIDToMCTruth (int const &id) const
 
const art::Ptr< simb::MCTruth > & ParticleToMCTruth (const simb::MCParticle *p) const
 
std::vector< const
simb::MCParticle * > 
MCTruthToParticles (art::Ptr< simb::MCTruth > const &mct) const
 
const std::vector< art::Ptr
< simb::MCTruth > > & 
MCTruthVector () const
 
DEPRECATED std::vector
< sim::TrackSDP
OpHitToTrackID (art::Ptr< recob::OpHit > const &hit)
 
std::vector< sim::TrackSDPOpHitToTrackSDPs (art::Ptr< recob::OpHit > const &hit)
 
const std::vector< std::vector
< art::Ptr< recob::OpHit > > > 
TrackIDsToOpHits (std::vector< art::Ptr< recob::OpHit >> const &allhits, std::vector< int > const &tkIDs)
 
std::vector< sim::TrackSDPOpHitToEveSDPs (art::Ptr< recob::OpHit > const &hit)
 
std::vector< sim::TrackSDPOpHitToEveID (art::Ptr< recob::OpHit > const &hit)
 
std::vector< double > SimSDPsToXYZ (std::vector< sim::SDP > const &sdps)
 
std::vector< double > OpHitToXYZ (art::Ptr< recob::OpHit > const &hit)
 
double OpHitCollectionPurity (std::set< int > trackIDs, std::vector< art::Ptr< recob::OpHit > > const &hits)
 
double OpHitCollectionEfficiency (std::set< int > trackIDs, std::vector< art::Ptr< recob::OpHit > > const &hits, std::vector< art::Ptr< recob::OpHit > > const &allhits)
 
double OpHitCollectionEfficiency (std::set< int > trackIDs, std::vector< art::Ptr< recob::OpHit > > const &hits, std::vector< art::Ptr< recob::OpHit > > const &allhits, geo::View_t const &view)
 
double OpHitChargeCollectionPurity (std::set< int > trackIDs, std::vector< art::Ptr< recob::OpHit > > const &hits)
 
double OpHitChargeCollectionEfficiency (std::set< int > trackIDs, std::vector< art::Ptr< recob::OpHit > > const &hits, std::vector< art::Ptr< recob::OpHit > > const &allhits)
 
double OpHitChargeCollectionEfficiency (std::set< int > trackIDs, std::vector< art::Ptr< recob::OpHit > > const &hits, std::vector< art::Ptr< recob::OpHit > > const &allhits, geo::View_t const &view)
 
std::set< int > GetSetOfEveIDs ()
 
std::set< int > GetSetOfTrackIDs ()
 
std::set< int > GetSetOfEveIDs (std::vector< art::Ptr< recob::OpHit > > const &hits)
 
std::set< int > GetSetOfTrackIDs (std::vector< art::Ptr< recob::OpHit > > const &hits)
 
const std::vector< art::Ptr
< sim::OpDetBacktrackerRecord > > & 
OpDetBacktrackerRecords () const
 
void ChannelToTrackSDPs (std::vector< sim::TrackSDP > &trackSDPs, int channel, const double hit_start_time, const double hit_end_time)
 
 PhotonBackTracker (fhiclConfig const &config, const cheat::ParticleInventory *partInv, const geo::GeometryCore *geom)
 
 PhotonBackTracker (fhicl::ParameterSet const &pSet, const cheat::ParticleInventory *partInv, const geo::GeometryCore *geom)
 
 PhotonBackTracker (PhotonBackTracker const &)=delete
 
template<typename Evt >
void PrepEvent (Evt const &evt)
 
template<typename Evt >
const bool CanRun (Evt const &evt)
 
template<typename Evt >
void PrepOpDetBTRs (Evt const &evt)
 
template<typename Evt >
void PrepOpFlashToOpHits (Evt const &evt)
 
const std::vector< art::Ptr
< recob::OpHit > > 
OpFlashToOpHits_Ps (art::Ptr< recob::OpFlash > &flash_P) const
 
const std::vector< double > OpFlashToXYZ (art::Ptr< recob::OpFlash > &flash_P) const
 
const std::set< int > OpFlashToTrackIds (art::Ptr< recob::OpFlash > &flash_P) const
 
const double GetDelay ()
 
void ClearEvent ()
 
const bool BTRsReady ()
 
const bool OpFlashToOpHitsReady ()
 
std::vector< art::Ptr
< sim::OpDetBacktrackerRecord >
> const & 
OpDetBTRs ()
 
const std::vector< const
sim::SDP * > 
TrackIdToSimSDPs_Ps (int const &id)
 
const std::vector< const
sim::SDP * > 
TrackIdToSimSDPs_Ps (int const &id, geo::View_t const &view)
 
const art::Ptr
< sim::OpDetBacktrackerRecord
FindOpDetBTR (int const &opDetNum) const
 
const std::vector< sim::TrackSDPOpDetToTrackSDPs (int const &OpDetNum, double const &opHit_start_time, double const &opHit_end_time) const
 
const std::vector< sim::TrackSDPOpHitToTrackSDPs (art::Ptr< recob::OpHit > const &opHit_P) const
 
const std::vector< sim::TrackSDPOpHitToTrackSDPs (recob::OpHit const &opHit) const
 
const std::vector< int > OpHitToTrackIds (recob::OpHit const &opHit) const
 
const std::vector< int > OpHitToTrackIds (art::Ptr< recob::OpHit > const &opHit) const
 
const std::vector< int > OpHitToEveTrackIds (recob::OpHit const &opHit)
 
const std::vector< int > OpHitToEveTrackIds (art::Ptr< recob::OpHit > const &opHit_P)
 
const std::vector< sim::TrackSDPOpHitToEveTrackSDPs (art::Ptr< recob::OpHit > const &opHit_P) const
 
const std::vector< sim::TrackSDPOpHitToEveTrackSDPs (recob::OpHit const &opHit) const
 
const std::vector< art::Ptr
< recob::OpHit > > 
TrackIdToOpHits_Ps (int const &tkId, std::vector< art::Ptr< recob::OpHit >> const &hitsIn)
 
const std::vector< std::vector
< art::Ptr< recob::OpHit > > > 
TrackIdsToOpHits_Ps (std::vector< int > const &tkIds, std::vector< art::Ptr< recob::OpHit >> const &hitsIn)
 
const std::vector< const
sim::SDP * > 
OpHitToSimSDPs_Ps (recob::OpHit const &opHit) const
 
const std::vector< const
sim::SDP * > 
OpHitToSimSDPs_Ps (art::Ptr< recob::OpHit > const &opHit_P) const
 
const std::vector< const
sim::SDP * > 
OpHitsToSimSDPs_Ps (std::vector< art::Ptr< recob::OpHit > > const &opHits_Ps) const
 
const std::vector< double > SimSDPsToXYZ (std::vector< sim::SDP > const &sdps) const &
 
const std::vector< double > SimSDPsToXYZ (std::vector< const sim::SDP * > const &sdps_Ps) const &
 
const std::vector< double > OpHitToXYZ (art::Ptr< recob::OpHit > const &opHit)
 
const std::vector< double > OpHitToXYZ (recob::OpHit const &opHit)
 
const std::vector< double > OpHitsToXYZ (std::vector< art::Ptr< recob::OpHit > > const &opHits_Ps) const
 
const std::unordered_set
< const sim::SDP * > 
OpHitToEveSimSDPs_Ps (recob::OpHit const &opHit)
 
const std::unordered_set
< const sim::SDP * > 
OpHitToEveSimSDPs_Ps (art::Ptr< recob::OpHit > &opHit_P)
 
const std::set< int > GetSetOfEveIds () const
 
const std::set< int > GetSetOfTrackIds () const
 
const std::set< int > GetSetOfEveIds (std::vector< art::Ptr< recob::OpHit > > const &opHits) const
 
const std::set< int > GetSetOfEveIds (std::vector< recob::OpHit > const &opHits) const
 
const std::set< int > GetSetOfTrackIds (std::vector< art::Ptr< recob::OpHit > > const &opHits) const
 
const std::set< int > GetSetOfTrackIds (std::vector< recob::OpHit > const &opHits) const
 
const double OpHitCollectionPurity (std::set< int > const &tkIds, std::vector< art::Ptr< recob::OpHit > > const &opHits)
 
const double OpHitLightCollectionPurity (std::set< int > const &tkIds, std::vector< art::Ptr< recob::OpHit > > const &opHits)
 
const double OpHitCollectionEfficiency (std::set< int > const &tkIds, std::vector< art::Ptr< recob::OpHit > > const &opHits, std::vector< art::Ptr< recob::OpHit > > const &opHitsIn)
 
const double OpHitCollectionEfficiency (std::set< int > const &tkIds, std::vector< art::Ptr< recob::OpHit > > const &opHits, std::vector< art::Ptr< recob::OpHit > > const &opHitsIn, geo::View_t const &view)
 
const double OpHitLightCollectionEfficiency (std::set< int > const &tkIds, std::vector< art::Ptr< recob::OpHit > > const &opHits, std::vector< art::Ptr< recob::OpHit > > const &opHitsIn)
 
const double OpHitLightCollectionEfficiency (std::set< int > const &tkIds, std::vector< art::Ptr< recob::OpHit > > const &opHits, std::vector< art::Ptr< recob::OpHit > > const &opHitsIn, geo::View_t const &view)
 
void OpHitToSDPs (recob::OpHit const &hit, std::vector< sim::SDP > &sdps) const
 
DEPRECATED void OpHitToSimSDPs (recob::OpHit const &hit, std::vector< sim::SDP > &sdps) const
 
void OpHitToSDPs (art::Ptr< recob::OpHit > const &hit, std::vector< sim::SDP > &sdps) const
 
DEPRECATED void OpHitToSimSDPs (art::Ptr< recob::OpHit > const &hit, std::vector< sim::SDP > &sdps) const
 
void OpHitToSDPs (recob::OpHit const &hit, std::vector< sim::SDP > &sdps) const
 
DEPRECATED void OpHitToSimSDPs (recob::OpHit const &hit, std::vector< sim::SDP > &sdps) const
 
void OpHitToSDPs (art::Ptr< recob::OpHit > const &hit, std::vector< sim::SDP > &sdps) const
 
DEPRECATED void OpHitToSimSDPs (art::Ptr< recob::OpHit > const &hit, std::vector< sim::SDP > &sdps) const
 

Private Member Functions

const art::Ptr
< sim::OpDetBacktrackerRecord
FindOpDetBacktrackerRecord (int channel) const
 
const void shouldThisFail () const
 
const art::Ptr
< sim::OpDetBacktrackerRecord
FindOpDetBacktrackerRecord (int channel) const
 
const void shouldThisFail () const
 

Private Attributes

geo::GeometryCore const * geom = lar::providerFrom<geo::Geometry>()
 
bool have_complained
 
sim::ParticleList fParticleList
 ParticleList to map track ID to sim::Particle. More...
 
sim::LArVoxelList fVoxelList
 
std::vector< art::Ptr
< simb::MCTruth > > 
fMCTruthList
 all the MCTruths for the event More...
 
std::vector< art::Ptr
< sim::OpDetBacktrackerRecord > > 
cOpDetBacktrackerRecords
 all the OpDetBacktrackerRecords for the event More...
 
std::map< int, int > fTrackIDToMCTruthIndex
 map of track ids to MCTruthList entry More...
 
std::string fG4ModuleLabel
 label for geant4 module More...
 
double fMinOpHitEnergyFraction
 minimum fraction of energy a track id has to More...
 
double fDelay
 
const cheat::ParticleInventoryfPartInv
 
const geo::GeometryCorefGeom
 
const double fDelay
 
const art::InputTag fG4ModuleLabel
 
const std::vector< art::InputTag > fG4ModuleLabels
 
const art::InputTag fOpHitLabel
 
const art::InputTag fOpFlashLabel
 
const double fMinOpHitEnergyFraction
 
std::vector< art::Ptr
< sim::OpDetBacktrackerRecord > > 
priv_OpDetBTRs
 
std::map< art::Ptr
< recob::OpFlash >
, std::vector< art::Ptr
< recob::OpHit > > > 
priv_OpFlashToOpHits
 

Detailed Description

Definition at line 45 of file old.PhotonBackTracker.h.

Constructor & Destructor Documentation

cheat::PhotonBackTracker::PhotonBackTracker ( fhicl::ParameterSet const &  pset,
art::ActivityRegistry &  reg 
)

Definition at line 33 of file old.PhotonBackTracker_service.cc.

35  {
36  reconfigure(pset);
37 
38  reg.sPreProcessEvent.watch(this, &PhotonBackTracker::Rebuild);
39  }
void reconfigure(fhicl::ParameterSet const &pset)
void Rebuild(const art::Event &evt)
cheat::PhotonBackTracker::~PhotonBackTracker ( )

Definition at line 42 of file old.PhotonBackTracker_service.cc.

43  {
44  }
cheat::PhotonBackTracker::PhotonBackTracker ( fhicl::ParameterSet const &  pset,
art::ActivityRegistry &  reg 
)
cheat::PhotonBackTracker::~PhotonBackTracker ( )
cheat::PhotonBackTracker::PhotonBackTracker ( fhiclConfig const &  config,
const cheat::ParticleInventory partInv,
const geo::GeometryCore geom 
)

Definition at line 36 of file PhotonBackTracker.cc.

40  :fPartInv (partInv),
41  fGeom (geom),
42 // fDetClocks (detClock),
43  fDelay (config.Delay()),
44  fG4ModuleLabel(config.G4ModuleLabel()),
45  fG4ModuleLabels(config.G4ModuleLabels()),
46  fOpHitLabel(config.OpHitLabel()),
47  fOpFlashLabel(config.OpFlashLabel()),
48  //fWavLabel(config.WavLabel()),
49  fMinOpHitEnergyFraction(config.MinOpHitEnergyFraction())
50  {}
std::string fG4ModuleLabel
label for geant4 module
const cheat::ParticleInventory * fPartInv
const geo::GeometryCore * fGeom
const art::InputTag fOpFlashLabel
const std::vector< art::InputTag > fG4ModuleLabels
double fMinOpHitEnergyFraction
minimum fraction of energy a track id has to
const art::InputTag fOpHitLabel
cheat::PhotonBackTracker::PhotonBackTracker ( fhicl::ParameterSet const &  pSet,
const cheat::ParticleInventory partInv,
const geo::GeometryCore geom 
)

Definition at line 53 of file PhotonBackTracker.cc.

57  :fPartInv (partInv),
58  fGeom (geom),
59 // fDetClocks(detClock),
60  fDelay(pSet.get<double>("Delay")),
61  fG4ModuleLabel(pSet.get<art::InputTag>("G4ModuleLabel", "largeant")),
62  fG4ModuleLabels(pSet.get<std::vector<art::InputTag>>("G4ModuleLabels", {})),
std::string fG4ModuleLabel
label for geant4 module
const cheat::ParticleInventory * fPartInv
const geo::GeometryCore * fGeom
const std::vector< art::InputTag > fG4ModuleLabels
cheat::PhotonBackTracker::PhotonBackTracker ( PhotonBackTracker const &  )
delete

Member Function Documentation

const bool cheat::PhotonBackTracker::BTRsReady ( )
template<typename Evt >
const bool cheat::PhotonBackTracker::CanRun ( Evt const &  evt)
void cheat::PhotonBackTracker::ChannelToTrackSDPs ( std::vector< sim::TrackSDP > &  trackSDPs,
int  channel,
const double  hit_start_time,
const double  hit_end_time 
)
void cheat::PhotonBackTracker::ChannelToTrackSDPs ( std::vector< sim::TrackSDP > &  trackSDPs,
int  channel,
const double  hit_start_time,
const double  hit_end_time 
)

Definition at line 636 of file old.PhotonBackTracker_service.cc.

640  {
641  shouldThisFail();
642  trackSDPs.clear();
643 
644  double totalE = 0.;
645 
646  try{
647  const art::Ptr< sim::OpDetBacktrackerRecord > schannel = this->FindOpDetBacktrackerRecord( geom->OpDetFromOpChannel(channel) );
648 
649  // loop over the photons in the channel and grab those that are in time
650  // with the identified opHit start and stop times
651  //const detinfo::DetectorClocks* ts = lar::providerFrom<detinfo::DetectorClocksService>();
652  //int start_tdc = ts->OpticalG4Time2TDC( opHit_start_time );
653  //int end_tdc = ts->OpticalG4Time2TDC( opHit_end_time );
654  // if(start_tdc<0) start_tdc = 0;
655  // if(end_tdc<0) end_tdc = 0;
656  std::vector<sim::SDP> simSDPs = schannel->TrackIDsAndEnergies(opHit_start_time, opHit_end_time);
657 
658  // first get the total energy represented by all track ids for
659  // this channel and range of tdc values
660  for(size_t e = 0; e < simSDPs.size(); ++e)
661  totalE += simSDPs[e].energy;
662 
663 
664  // protect against a divide by zero below
665  if(totalE < 1.e-5) totalE = 1.;
666 
667  // loop over the entries in the map and fill the input vectors
668 
669  for(size_t e = 0; e < simSDPs.size(); ++e){
670 
671  if(simSDPs[e].trackID == sim::NoParticleId) continue;
672 
674  info.trackID = simSDPs[e].trackID;
675  info.energyFrac = simSDPs[e].energy/totalE;
676  info.energy = simSDPs[e].energy;
677 
678  trackSDPs.push_back(info);
679 
680  }
681  }// end try
682  catch(cet::exception e){
683  mf::LogWarning("PhotonBackTracker") << "caught exception \n"
684  << e;
685  }
686 
687  return;
688  }
unsigned int OpDetFromOpChannel(int opChannel) const
Convert unique channel to detector number.
int trackID
Geant4 supplied trackID.
static const int NoParticleId
Definition: sim.h:21
float energyFrac
fraction of OpHit energy from the particle with this trackID
Ionization photons from a Geant4 track.
const art::Ptr< sim::OpDetBacktrackerRecord > FindOpDetBacktrackerRecord(int channel) const
geo::GeometryCore const * geom
do i e
float energy
energy from the particle with this trackID [MeV]
void cheat::PhotonBackTracker::ClearEvent ( )
const art::Ptr< sim::OpDetBacktrackerRecord > cheat::PhotonBackTracker::FindOpDetBacktrackerRecord ( int  channel) const
private
const art::Ptr< sim::OpDetBacktrackerRecord > cheat::PhotonBackTracker::FindOpDetBacktrackerRecord ( int  channel) const
private

Definition at line 616 of file old.PhotonBackTracker_service.cc.

617  {
618  shouldThisFail();
619  art::Ptr< sim::OpDetBacktrackerRecord > opDet;
620 
621  for(size_t sc = 0; sc < cOpDetBacktrackerRecords.size(); ++sc){
622  //This could become a bug. What if it occurs twice (shouldn't happen in correct recorts, but still, no error handeling included for the situation
623  if(cOpDetBacktrackerRecords[sc]->OpDetNum() == opDetNum) opDet = cOpDetBacktrackerRecords[sc];
624  }
625 
626  if(!opDet)
627  {
628  throw cet::exception("PhotonBackTracker2") << "No sim::OpDetBacktrackerRecord corresponding "
629  << "to opDetNum: " << opDetNum << "\n";
630  }
631 
632  return opDet;
633  }
std::vector< art::Ptr< sim::OpDetBacktrackerRecord > > cOpDetBacktrackerRecords
all the OpDetBacktrackerRecords for the event
const art::Ptr< sim::OpDetBacktrackerRecord > cheat::PhotonBackTracker::FindOpDetBTR ( int const &  opDetNum) const
const double cheat::PhotonBackTracker::GetDelay ( )
std::set< int > cheat::PhotonBackTracker::GetSetOfEveIDs ( )

Definition at line 357 of file old.PhotonBackTracker_service.cc.

358  {
359  shouldThisFail();
360  std::set<int> eveIDs;
361 
362  sim::ParticleList::const_iterator plitr = fParticleList.begin();
363  while(plitr != fParticleList.end() ){
364  int eveID = fParticleList.EveId((*plitr).first);
365  // look to see if this eveID is already in the set
366  if( eveIDs.find(eveID) == eveIDs.end() ) eveIDs.insert(eveID);
367  plitr++;
368  }
369 
370  return eveIDs;
371  }
sim::ParticleList fParticleList
ParticleList to map track ID to sim::Particle.
std::set<int> cheat::PhotonBackTracker::GetSetOfEveIDs ( )
std::set<int> cheat::PhotonBackTracker::GetSetOfEveIDs ( std::vector< art::Ptr< recob::OpHit > > const &  hits)
std::set< int > cheat::PhotonBackTracker::GetSetOfEveIDs ( std::vector< art::Ptr< recob::OpHit > > const &  hits)

Definition at line 386 of file old.PhotonBackTracker_service.cc.

387  {
388  shouldThisFail();
389  std::set<int> eveIDs;
390 
391  std::vector< art::Ptr<recob::OpHit> >::const_iterator itr = opHits.begin();
392  while(itr != opHits.end() ){
393 
394  // get the eve ids corresponding to this opHit
395  const std::vector<sim::TrackSDP> sdps = OpHitToEveID(*itr);
396 
397  // loop over the sdps and extract the track ids
398  for(size_t i = 0; i < sdps.size(); ++i) eveIDs.insert(sdps[i].trackID);
399 
400  itr++;
401  }
402 
403  return eveIDs;
404  }
std::vector< sim::TrackSDP > OpHitToEveID(art::Ptr< recob::OpHit > const &hit)
const std::set< int> cheat::PhotonBackTracker::GetSetOfEveIds ( ) const
const std::set< int> cheat::PhotonBackTracker::GetSetOfEveIds ( std::vector< art::Ptr< recob::OpHit > > const &  opHits) const
const std::set< int> cheat::PhotonBackTracker::GetSetOfEveIds ( std::vector< recob::OpHit > const &  opHits) const
std::set<int> cheat::PhotonBackTracker::GetSetOfTrackIDs ( )
std::set< int > cheat::PhotonBackTracker::GetSetOfTrackIDs ( )

Definition at line 374 of file old.PhotonBackTracker_service.cc.

375  {
376  shouldThisFail();
377  // fParticleList::value_type is a pair (track, particle pointer)
378  std::set<int> trackIDs;
379  for (const sim::ParticleList::value_type& pl: fParticleList)
380  trackIDs.insert(pl.first);
381 
382  return trackIDs;
383  }
sim::ParticleList fParticleList
ParticleList to map track ID to sim::Particle.
std::set< int > cheat::PhotonBackTracker::GetSetOfTrackIDs ( std::vector< art::Ptr< recob::OpHit > > const &  hits)

Definition at line 407 of file old.PhotonBackTracker_service.cc.

408  {
409  shouldThisFail();
410  std::set<int> trackIDs;
411 
412  std::vector< art::Ptr<recob::OpHit> >::const_iterator itr = opHits.begin();
413  while(itr != opHits.end() ){
414 
415  std::vector<sim::TrackSDP> trackSDPs;
416 
417  // get the track ids corresponding to this opHit
418  const double pTime = (*itr)->PeakTime();
419  const double pWidth= (*itr)->Width();
420  const double start = (pTime-pWidth)*1000.0-fDelay;
421  const double end = (pTime+pWidth)*1000.0-fDelay;
422  // const double start = (*itr)->PeakTimeMinusRMS();
423  // const double end = (*itr)->PeakTimePlusRMS();
424 
425  this->ChannelToTrackSDPs(trackSDPs, (*itr)->OpChannel(), start, end);
426 
427  // loop over the sdps and extract the track ids
428  for(size_t i = 0; i < trackSDPs.size(); ++i) {
429  trackIDs.insert(trackSDPs[i].trackID);
430  }
431 
432  itr++;
433  }
434 
435  return trackIDs;
436  }
void ChannelToTrackSDPs(std::vector< sim::TrackSDP > &trackSDPs, int channel, const double hit_start_time, const double hit_end_time)
auto end(FixedBins< T, C > const &) noexcept
Definition: FixedBins.h:585
std::set<int> cheat::PhotonBackTracker::GetSetOfTrackIDs ( std::vector< art::Ptr< recob::OpHit > > const &  hits)
const std::set< int> cheat::PhotonBackTracker::GetSetOfTrackIds ( ) const
const std::set< int> cheat::PhotonBackTracker::GetSetOfTrackIds ( std::vector< art::Ptr< recob::OpHit > > const &  opHits) const
const std::set< int> cheat::PhotonBackTracker::GetSetOfTrackIds ( std::vector< recob::OpHit > const &  opHits) const
std::vector<const simb::MCParticle*> cheat::PhotonBackTracker::MCTruthToParticles ( art::Ptr< simb::MCTruth > const &  mct) const
std::vector< const simb::MCParticle * > cheat::PhotonBackTracker::MCTruthToParticles ( art::Ptr< simb::MCTruth > const &  mct) const

Definition at line 247 of file old.PhotonBackTracker_service.cc.

248  {
249  shouldThisFail();
250  std::vector<const simb::MCParticle*> ret;
251 
252  // sim::ParticleList::value_type is a pair (track ID, particle pointer)
253  for (const sim::ParticleList::value_type& TrackIDpair: fParticleList) {
254  if( TrackIDToMCTruth(TrackIDpair.first) == mct )
255  ret.push_back(TrackIDpair.second);
256  }
257 
258  return ret;
259  }
sim::ParticleList fParticleList
ParticleList to map track ID to sim::Particle.
const art::Ptr< simb::MCTruth > & TrackIDToMCTruth(int const &id) const
const std::vector< art::Ptr<simb::MCTruth> >& cheat::PhotonBackTracker::MCTruthVector ( ) const
inline

Definition at line 81 of file old.PhotonBackTracker.h.

81 { return fMCTruthList; }
std::vector< art::Ptr< simb::MCTruth > > fMCTruthList
all the MCTruths for the event
const std::vector< art::Ptr<simb::MCTruth> >& cheat::PhotonBackTracker::MCTruthVector ( ) const
inline

Definition at line 81 of file old.PhotonBackTrackerService.h.

81 { return fMCTruthList; }
std::vector< art::Ptr< simb::MCTruth > > fMCTruthList
all the MCTruths for the event
const std::vector< art::Ptr< sim::OpDetBacktrackerRecord > >& cheat::PhotonBackTracker::OpDetBacktrackerRecords ( ) const
inline

Definition at line 167 of file old.PhotonBackTrackerService.h.

167 { return cOpDetBacktrackerRecords; }
std::vector< art::Ptr< sim::OpDetBacktrackerRecord > > cOpDetBacktrackerRecords
all the OpDetBacktrackerRecords for the event
const std::vector< art::Ptr< sim::OpDetBacktrackerRecord > >& cheat::PhotonBackTracker::OpDetBacktrackerRecords ( ) const
inline

Definition at line 167 of file old.PhotonBackTracker.h.

167 { return cOpDetBacktrackerRecords; }
std::vector< art::Ptr< sim::OpDetBacktrackerRecord > > cOpDetBacktrackerRecords
all the OpDetBacktrackerRecords for the event
std::vector<art::Ptr<sim::OpDetBacktrackerRecord> > const& cheat::PhotonBackTracker::OpDetBTRs ( )
const std::vector< sim::TrackSDP > cheat::PhotonBackTracker::OpDetToTrackSDPs ( int const &  OpDetNum,
double const &  opHit_start_time,
double const &  opHit_end_time 
) const
const std::vector< art::Ptr<recob::OpHit> > cheat::PhotonBackTracker::OpFlashToOpHits_Ps ( art::Ptr< recob::OpFlash > &  flash_P) const
const bool cheat::PhotonBackTracker::OpFlashToOpHitsReady ( )
const std::set<int> cheat::PhotonBackTracker::OpFlashToTrackIds ( art::Ptr< recob::OpFlash > &  flash_P) const
const std::vector<double> cheat::PhotonBackTracker::OpFlashToXYZ ( art::Ptr< recob::OpFlash > &  flash_P) const
double cheat::PhotonBackTracker::OpHitChargeCollectionEfficiency ( std::set< int >  trackIDs,
std::vector< art::Ptr< recob::OpHit > > const &  hits,
std::vector< art::Ptr< recob::OpHit > > const &  allhits 
)

Definition at line 551 of file old.PhotonBackTracker_service.cc.

554  {
555  shouldThisFail();
556  // get the list of EveIDs that correspond to the opHits in this collection
557  // and the energy associated with the desired trackID
558  float desired = 0.;
559  float total = 0.;
560 
561  // don't have to check the view in the opHits collection because
562  // those are assumed to be from the object we are testing and will
563  // the correct view by definition then.
564  for(size_t h = 0; h < opHits.size(); ++h){
565 
566  art::Ptr<recob::OpHit> opHit = opHits[h];
567  std::vector<sim::TrackSDP> opHitTrackIDs = this->OpHitToTrackSDPs(opHit);
568 
569  // don't worry about opHits where the energy fraction for the chosen
570  // trackID is < 0.1
571  // also don't double count if this opHit has more than one of the
572  // desired track IDs associated with it
573  for(size_t e = 0; e < opHitTrackIDs.size(); ++e){
574  if(trackIDs.find(opHitTrackIDs[e].trackID) != trackIDs.end() &&
575  opHitTrackIDs[e].energyFrac >= fMinOpHitEnergyFraction){
576  desired += opHit->Area();
577  break;
578  }
579  }
580  }// end loop over opHits
581 
582  // now figure out how many opHits in the whole collection are associated with this id
583  for(size_t h = 0; h < allOpHits.size(); ++h){
584 
585  art::Ptr<recob::OpHit> opHit = allOpHits[h];
586 
587  // check that we are looking at the appropriate view here
588  // in the case of 3D objects we take all opHits
589  //if(opHit->View() != view && view != geo::k3D ) continue;
590 
591  std::vector<sim::TrackSDP> opHitTrackIDs = this->OpHitToTrackSDPs(opHit);
592 
593  for(size_t e = 0; e < opHitTrackIDs.size(); ++e){
594  // don't worry about opHits where the energy fraction for the chosen
595  // trackID is < 0.1
596  // also don't double count if this opHit has more than one of the
597  // desired track IDs associated with it
598  if(trackIDs.find(opHitTrackIDs[e].trackID) != trackIDs.end() &&
599  opHitTrackIDs[e].energyFrac >= fMinOpHitEnergyFraction){
600  total += opHit->Area();
601  break;
602  }
603  }
604 
605  }// end loop over all opHits
606 
607  double efficiency = 0.;
608  if(total > 0.) efficiency = desired/total;
609 
610  return efficiency;
611  }
while getopts h
std::vector< sim::TrackSDP > OpHitToTrackSDPs(art::Ptr< recob::OpHit > const &hit)
do i e
double fMinOpHitEnergyFraction
minimum fraction of energy a track id has to
double cheat::PhotonBackTracker::OpHitChargeCollectionEfficiency ( std::set< int >  trackIDs,
std::vector< art::Ptr< recob::OpHit > > const &  hits,
std::vector< art::Ptr< recob::OpHit > > const &  allhits 
)
double cheat::PhotonBackTracker::OpHitChargeCollectionEfficiency ( std::set< int >  trackIDs,
std::vector< art::Ptr< recob::OpHit > > const &  hits,
std::vector< art::Ptr< recob::OpHit > > const &  allhits,
geo::View_t const &  view 
)
double cheat::PhotonBackTracker::OpHitChargeCollectionEfficiency ( std::set< int >  trackIDs,
std::vector< art::Ptr< recob::OpHit > > const &  hits,
std::vector< art::Ptr< recob::OpHit > > const &  allhits,
geo::View_t const &  view 
)

Definition at line 544 of file old.PhotonBackTracker_service.cc.

548  {
549  throw cet::exception("PhotonBackTracker")<<"This function is not supported. OpHits do not have type View.\n";
550  }
double cheat::PhotonBackTracker::OpHitChargeCollectionPurity ( std::set< int >  trackIDs,
std::vector< art::Ptr< recob::OpHit > > const &  hits 
)

Definition at line 465 of file old.PhotonBackTracker_service.cc.

467  {
468  shouldThisFail();
469  // get the list of EveIDs that correspond to the opHits in this collection
470  // if the EveID shows up in the input list of trackIDs, then it counts
471  float total = 0;
472  float desired = 0.;
473  // don't have to check the view in the opHits collection because
474  // those are assumed to be from the object we are testing and will
475  // the correct view by definition then.
476  for(size_t h = 0; h < opHits.size(); ++h){
477  art::Ptr<recob::OpHit> opHit = opHits[h];
478  std::vector<sim::TrackSDP> opHitTrackIDs = this->OpHitToTrackSDPs(opHit);
479  total+=opHit->Area(); // sum up the charge in the cluster
480  // don't double count if this opHit has more than one of the
481  // desired track IDs associated with it
482  for(size_t e = 0; e < opHitTrackIDs.size(); ++e){
483  if(trackIDs.find(opHitTrackIDs[e].trackID) != trackIDs.end()){
484  desired += opHit->Area();
485  break;
486  }
487  }
488  }// end loop over opHits
489  double purity = 0.;
490  if(total > 0) purity = desired/total;
491  return purity;
492  }
while getopts h
std::vector< sim::TrackSDP > OpHitToTrackSDPs(art::Ptr< recob::OpHit > const &hit)
do i e
double cheat::PhotonBackTracker::OpHitChargeCollectionPurity ( std::set< int >  trackIDs,
std::vector< art::Ptr< recob::OpHit > > const &  hits 
)
double cheat::PhotonBackTracker::OpHitCollectionEfficiency ( std::set< int >  trackIDs,
std::vector< art::Ptr< recob::OpHit > > const &  hits,
std::vector< art::Ptr< recob::OpHit > > const &  allhits 
)

Definition at line 504 of file old.PhotonBackTracker_service.cc.

505  {
506  shouldThisFail();
507  float desired = 0.;
508  float total = 0.;
509  for(size_t h = 0; h < opHits.size(); ++h){
510  art::Ptr<recob::OpHit> opHit = opHits[h];
511  std::vector<sim::TrackSDP> opHitTrackSDPs = this->OpHitToTrackSDPs(opHit);
512  // also don't double count if this opHit has more than one of the
513  // desired track IDs associated with it
514  for(size_t e = 0; e < opHitTrackSDP.size(); ++e){
515  if(trackIDs.find(opHitTrackSDPs[e].trackID) != trackIDs.end() &&
516  opHitTrackSDPs[e].energyFrac >= fMinOpHitEnergyFraction){
517  desired += 1.;
518  break;
519  }
520  }
521  }// end loop over opHits
522  // now figure out how many opHits in the whole collection are associated with this id
523  for(size_t h = 0; h < allOpHits.size(); ++h){
524  art::Ptr<recob::OpHit> opHit = allOpHits[h];
525  std::vector<sim::TrackSDP> opHitTrackSDPs = this->OpHitToTrackSDPs(opHit);
526  for(size_t e = 0; e < opHitTrackSDPs.size(); ++e){
527  // don't worry about opHits where the energy fraction for the chosen
528  // trackID is < 0.1
529  // also don't double count if this opHit has more than one of the
530  // desired track IDs associated with it
531  if(trackIDs.find(opHitTrackSDPs[e].trackID) != trackIDs.end() &&
532  opHitTrackIDs[e].energyFrac >= fMinOpHitEnergyFraction){
533  total += 1.;
534  break;
535  }
536  }
537  }// end loop over all opHits
538  double efficiency = 0.;
539  if(total > 0.) efficiency = desired/total;
540  return efficiency;
541  }
while getopts h
std::vector< sim::TrackSDP > OpHitToTrackSDPs(art::Ptr< recob::OpHit > const &hit)
do i e
double fMinOpHitEnergyFraction
minimum fraction of energy a track id has to
double cheat::PhotonBackTracker::OpHitCollectionEfficiency ( std::set< int >  trackIDs,
std::vector< art::Ptr< recob::OpHit > > const &  hits,
std::vector< art::Ptr< recob::OpHit > > const &  allhits 
)
double cheat::PhotonBackTracker::OpHitCollectionEfficiency ( std::set< int >  trackIDs,
std::vector< art::Ptr< recob::OpHit > > const &  hits,
std::vector< art::Ptr< recob::OpHit > > const &  allhits,
geo::View_t const &  view 
)

Definition at line 496 of file old.PhotonBackTracker_service.cc.

500  {
501  throw cet::exception("PhotonBackTracker")<<"This function is not supported. OpHits do not have type View.\n";
502  }
double cheat::PhotonBackTracker::OpHitCollectionEfficiency ( std::set< int >  trackIDs,
std::vector< art::Ptr< recob::OpHit > > const &  hits,
std::vector< art::Ptr< recob::OpHit > > const &  allhits,
geo::View_t const &  view 
)
const double cheat::PhotonBackTracker::OpHitCollectionEfficiency ( std::set< int > const &  tkIds,
std::vector< art::Ptr< recob::OpHit > > const &  opHits,
std::vector< art::Ptr< recob::OpHit > > const &  opHitsIn 
)
const double cheat::PhotonBackTracker::OpHitCollectionEfficiency ( std::set< int > const &  tkIds,
std::vector< art::Ptr< recob::OpHit > > const &  opHits,
std::vector< art::Ptr< recob::OpHit > > const &  opHitsIn,
geo::View_t const &  view 
)
double cheat::PhotonBackTracker::OpHitCollectionPurity ( std::set< int >  trackIDs,
std::vector< art::Ptr< recob::OpHit > > const &  hits 
)

Definition at line 439 of file old.PhotonBackTracker_service.cc.

441  {
442  shouldThisFail();
443  // get the list of EveIDs that correspond to the opHits in this collection
444  // if the EveID shows up in the input list of trackIDs, then it counts
445  float total = 1.*opHits.size();;
446  float desired = 0.;
447  for(size_t h = 0; h < opHits.size(); ++h){
448  art::Ptr<recob::OpHit> opHit = opHits[h];
449  std::vector<sim::TrackSDP> opHitTrackSDPs = this->OpHitToTrackSDPs(opHit);
450  // don't double count if this opHit has more than one of the
451  // desired track IDs associated with it
452  for(size_t e = 0; e < opHitTrackSDPs.size(); ++e){
453  if(trackIds.find(opHitTrackSDPs[e].trackID) != trackIds.end()){
454  desired += 1.;
455  break;
456  }
457  }
458  }// end loop over opHits
459  double purity = 0.;
460  if(total > 0) purity = desired/total;
461  return purity;
462  }
while getopts h
std::vector< sim::TrackSDP > OpHitToTrackSDPs(art::Ptr< recob::OpHit > const &hit)
do i e
double cheat::PhotonBackTracker::OpHitCollectionPurity ( std::set< int >  trackIDs,
std::vector< art::Ptr< recob::OpHit > > const &  hits 
)
const double cheat::PhotonBackTracker::OpHitCollectionPurity ( std::set< int > const &  tkIds,
std::vector< art::Ptr< recob::OpHit > > const &  opHits 
)
const double cheat::PhotonBackTracker::OpHitLightCollectionEfficiency ( std::set< int > const &  tkIds,
std::vector< art::Ptr< recob::OpHit > > const &  opHits,
std::vector< art::Ptr< recob::OpHit > > const &  opHitsIn 
)
const double cheat::PhotonBackTracker::OpHitLightCollectionEfficiency ( std::set< int > const &  tkIds,
std::vector< art::Ptr< recob::OpHit > > const &  opHits,
std::vector< art::Ptr< recob::OpHit > > const &  opHitsIn,
geo::View_t const &  view 
)
const double cheat::PhotonBackTracker::OpHitLightCollectionPurity ( std::set< int > const &  tkIds,
std::vector< art::Ptr< recob::OpHit > > const &  opHits 
)
const std::vector< const sim::SDP* > cheat::PhotonBackTracker::OpHitsToSimSDPs_Ps ( std::vector< art::Ptr< recob::OpHit > > const &  opHits_Ps) const
const std::vector< double > cheat::PhotonBackTracker::OpHitsToXYZ ( std::vector< art::Ptr< recob::OpHit > > const &  opHits_Ps) const
std::vector< sim::TrackSDP > cheat::PhotonBackTracker::OpHitToEveID ( art::Ptr< recob::OpHit > const &  hit)

Definition at line 349 of file old.PhotonBackTracker_service.cc.

350  {
351  mf::LogWarning("PhotonBackTracker") << "PhotonBackTracker::OpHitToEveID is being replaced with PhotonBackTracker::OpHitToEveSDPs. Please \n update your code accordingly.\n ";
352  std::vector<sim::TrackSDP> eveSDPs = OpHitToEveSDPs(opHit);
353  return eveSDPs;
354  }
std::vector< sim::TrackSDP > OpHitToEveSDPs(art::Ptr< recob::OpHit > const &hit)
std::vector<sim::TrackSDP> cheat::PhotonBackTracker::OpHitToEveID ( art::Ptr< recob::OpHit > const &  hit)
std::vector< sim::TrackSDP > cheat::PhotonBackTracker::OpHitToEveSDPs ( art::Ptr< recob::OpHit > const &  hit)

Definition at line 321 of file old.PhotonBackTracker_service.cc.

322  {
323  shouldThisFail();
324  std::vector<sim::TrackSDP> trackSDPs = this->OpHitToTrackSDPs(opHit);
325 
326  // make a map of evd ID values and fraction of energy represented by
327  // that eve id in this opHit
328  std::map<int, float> eveIDtoEfrac;
329 
330  double totalE = 0.;
331  for(size_t t = 0; t < trackSDPs.size(); ++t){
332  eveIDtoEfrac[fParticleList.EveId( trackSDPs[t].trackID )] += trackSDPs[t].energy;
333  totalE += trackSDPs[t].energy;
334  }
335 
336  // now fill the eveSDPs vector from the map
337  std::vector<sim::TrackSDP> eveSDPs;
338  eveSDPs.reserve(eveIDtoEfrac.size());
339  for(auto itr = eveIDtoEfrac.begin(); itr != eveIDtoEfrac.end(); itr++){
340  sim::TrackSDP temp;
341  temp.trackID = (*itr).first;
342  temp.energyFrac = (*itr).second/totalE;
343  temp.energy = (*itr).second;
344  eveSDPs.push_back(std::move(temp));
345  }
346 
347  return eveSDPs;
348  }
int trackID
Geant4 supplied trackID.
float energyFrac
fraction of OpHit energy from the particle with this trackID
Ionization photons from a Geant4 track.
std::vector< sim::TrackSDP > OpHitToTrackSDPs(art::Ptr< recob::OpHit > const &hit)
float energy
energy from the particle with this trackID [MeV]
sim::ParticleList fParticleList
ParticleList to map track ID to sim::Particle.
std::vector<sim::TrackSDP> cheat::PhotonBackTracker::OpHitToEveSDPs ( art::Ptr< recob::OpHit > const &  hit)
const std::unordered_set<const sim::SDP*> cheat::PhotonBackTracker::OpHitToEveSimSDPs_Ps ( recob::OpHit const &  opHit)
const std::unordered_set<const sim::SDP*> cheat::PhotonBackTracker::OpHitToEveSimSDPs_Ps ( art::Ptr< recob::OpHit > &  opHit_P)
const std::vector< int > cheat::PhotonBackTracker::OpHitToEveTrackIds ( recob::OpHit const &  opHit)
const std::vector< int > cheat::PhotonBackTracker::OpHitToEveTrackIds ( art::Ptr< recob::OpHit > const &  opHit_P)
const std::vector< sim::TrackSDP> cheat::PhotonBackTracker::OpHitToEveTrackSDPs ( art::Ptr< recob::OpHit > const &  opHit_P) const
const std::vector< sim::TrackSDP> cheat::PhotonBackTracker::OpHitToEveTrackSDPs ( recob::OpHit const &  opHit) const
void cheat::PhotonBackTracker::OpHitToSDPs ( recob::OpHit const &  hit,
std::vector< sim::SDP > &  sdps 
) const

Definition at line 691 of file old.PhotonBackTracker_service.cc.

693  {
694  shouldThisFail();
695  // Get services.
696  //const detinfo::DetectorClocks* ts = lar::providerFrom<detinfo::DetectorClocksService>();
697 
698  double fPeakTime = opHit.PeakTime();
699  double fWidth = opHit.Width();
700  sim::OpDetBacktrackerRecord::timePDclock_t start_time = ((fPeakTime-fWidth)*1000.0)-fDelay;
701  sim::OpDetBacktrackerRecord::timePDclock_t end_time = ((fPeakTime+fWidth)*1000.0)-fDelay;
702 
703  sdps = FindOpDetBacktrackerRecord( geom->OpDetFromOpChannel(opHit.OpChannel()) )->TrackIDsAndEnergies(start_time, end_time);
704 
705  }
unsigned int OpDetFromOpChannel(int opChannel) const
Convert unique channel to detector number.
then echo fcl sbnd_project sbnd_project sbnd_project sbnd_project production production end_time
double timePDclock_t
Type for iTimePDclock tick used in the interface.
then echo fcl sbnd_project sbnd_project sbnd_project sbnd_project production production start_time
const art::Ptr< sim::OpDetBacktrackerRecord > FindOpDetBacktrackerRecord(int channel) const
geo::GeometryCore const * geom
void cheat::PhotonBackTracker::OpHitToSDPs ( recob::OpHit const &  hit,
std::vector< sim::SDP > &  sdps 
) const
void cheat::PhotonBackTracker::OpHitToSDPs ( art::Ptr< recob::OpHit > const &  hit,
std::vector< sim::SDP > &  sdps 
) const
inline

Definition at line 105 of file old.PhotonBackTrackerService.h.

107  { OpHitToSDPs(*hit, sdps); }
process_name hit
Definition: cheaterreco.fcl:51
void OpHitToSDPs(recob::OpHit const &hit, std::vector< sim::SDP > &sdps) const
void cheat::PhotonBackTracker::OpHitToSDPs ( art::Ptr< recob::OpHit > const &  hit,
std::vector< sim::SDP > &  sdps 
) const
inline

Definition at line 105 of file old.PhotonBackTracker.h.

107  { OpHitToSDPs(*hit, sdps); }
process_name hit
Definition: cheaterreco.fcl:51
void OpHitToSDPs(recob::OpHit const &hit, std::vector< sim::SDP > &sdps) const
DEPRECATED void cheat::PhotonBackTracker::OpHitToSimSDPs ( recob::OpHit const &  hit,
std::vector< sim::SDP > &  sdps 
) const
inline

Definition at line 102 of file old.PhotonBackTracker.h.

104  { OpHitToSDPs( hit, sdps); }
process_name hit
Definition: cheaterreco.fcl:51
void OpHitToSDPs(recob::OpHit const &hit, std::vector< sim::SDP > &sdps) const
DEPRECATED void cheat::PhotonBackTracker::OpHitToSimSDPs ( recob::OpHit const &  hit,
std::vector< sim::SDP > &  sdps 
) const
inline

Definition at line 102 of file old.PhotonBackTrackerService.h.

104  { OpHitToSDPs( hit, sdps); }
process_name hit
Definition: cheaterreco.fcl:51
void OpHitToSDPs(recob::OpHit const &hit, std::vector< sim::SDP > &sdps) const
DEPRECATED void cheat::PhotonBackTracker::OpHitToSimSDPs ( art::Ptr< recob::OpHit > const &  hit,
std::vector< sim::SDP > &  sdps 
) const
inline

Definition at line 108 of file old.PhotonBackTrackerService.h.

110  { OpHitToSDPs(*hit, sdps); }
process_name hit
Definition: cheaterreco.fcl:51
void OpHitToSDPs(recob::OpHit const &hit, std::vector< sim::SDP > &sdps) const
DEPRECATED void cheat::PhotonBackTracker::OpHitToSimSDPs ( art::Ptr< recob::OpHit > const &  hit,
std::vector< sim::SDP > &  sdps 
) const
inline

Definition at line 108 of file old.PhotonBackTracker.h.

110  { OpHitToSDPs(*hit, sdps); }
process_name hit
Definition: cheaterreco.fcl:51
void OpHitToSDPs(recob::OpHit const &hit, std::vector< sim::SDP > &sdps) const
const std::vector< const sim::SDP* > cheat::PhotonBackTracker::OpHitToSimSDPs_Ps ( recob::OpHit const &  opHit) const
const std::vector< const sim::SDP* > cheat::PhotonBackTracker::OpHitToSimSDPs_Ps ( art::Ptr< recob::OpHit > const &  opHit_P) const
DEPRECATED std::vector<sim::TrackSDP> cheat::PhotonBackTracker::OpHitToTrackID ( art::Ptr< recob::OpHit > const &  hit)
inline

Definition at line 85 of file old.PhotonBackTracker.h.

86  {return OpHitToTrackSDPs(hit);}
process_name hit
Definition: cheaterreco.fcl:51
std::vector< sim::TrackSDP > OpHitToTrackSDPs(art::Ptr< recob::OpHit > const &hit)
DEPRECATED std::vector<sim::TrackSDP> cheat::PhotonBackTracker::OpHitToTrackID ( art::Ptr< recob::OpHit > const &  hit)
inline

Definition at line 85 of file old.PhotonBackTrackerService.h.

86  {return OpHitToTrackSDPs(hit);}
process_name hit
Definition: cheaterreco.fcl:51
std::vector< sim::TrackSDP > OpHitToTrackSDPs(art::Ptr< recob::OpHit > const &hit)
const std::vector< int > cheat::PhotonBackTracker::OpHitToTrackIds ( recob::OpHit const &  opHit) const
const std::vector< int > cheat::PhotonBackTracker::OpHitToTrackIds ( art::Ptr< recob::OpHit > const &  opHit) const
std::vector< sim::TrackSDP > cheat::PhotonBackTracker::OpHitToTrackSDPs ( art::Ptr< recob::OpHit > const &  hit)

Definition at line 262 of file old.PhotonBackTracker_service.cc.

263  {
264  shouldThisFail();
265  std::vector<sim::TrackSDP> trackSDPs;
266  const double pTime = opHit->PeakTime();
267  const double pWidth= opHit->Width();
268  const double start = (pTime-pWidth)*1000-fDelay;
269  const double end = (pTime+pWidth)*1000-fDelay;
270 
271  this->ChannelToTrackSDPs(trackSDPs, opHit->OpChannel(), start, end);
272 
273  return trackSDPs;
274  }
void ChannelToTrackSDPs(std::vector< sim::TrackSDP > &trackSDPs, int channel, const double hit_start_time, const double hit_end_time)
auto end(FixedBins< T, C > const &) noexcept
Definition: FixedBins.h:585
std::vector<sim::TrackSDP> cheat::PhotonBackTracker::OpHitToTrackSDPs ( art::Ptr< recob::OpHit > const &  hit)
const std::vector< sim::TrackSDP> cheat::PhotonBackTracker::OpHitToTrackSDPs ( art::Ptr< recob::OpHit > const &  opHit_P) const
const std::vector< sim::TrackSDP> cheat::PhotonBackTracker::OpHitToTrackSDPs ( recob::OpHit const &  opHit) const
std::vector<double> cheat::PhotonBackTracker::OpHitToXYZ ( art::Ptr< recob::OpHit > const &  hit)
std::vector< double > cheat::PhotonBackTracker::OpHitToXYZ ( art::Ptr< recob::OpHit > const &  hit)

Definition at line 745 of file old.PhotonBackTracker_service.cc.

746  {
747  shouldThisFail();
748  std::vector<sim::SDP> sdps;
749  OpHitToSDPs(opHit, sdps);
750  return SimSDPsToXYZ(sdps);
751  }
std::vector< double > SimSDPsToXYZ(std::vector< sim::SDP > const &sdps)
void OpHitToSDPs(recob::OpHit const &hit, std::vector< sim::SDP > &sdps) const
const std::vector< double > cheat::PhotonBackTracker::OpHitToXYZ ( art::Ptr< recob::OpHit > const &  opHit)
const std::vector< double > cheat::PhotonBackTracker::OpHitToXYZ ( recob::OpHit const &  opHit)
const sim::ParticleList& cheat::PhotonBackTracker::ParticleList ( ) const
inline

Definition at line 65 of file old.PhotonBackTracker.h.

65 { return fParticleList; }
sim::ParticleList fParticleList
ParticleList to map track ID to sim::Particle.
const sim::ParticleList& cheat::PhotonBackTracker::ParticleList ( ) const
inline

Definition at line 65 of file old.PhotonBackTrackerService.h.

65 { return fParticleList; }
sim::ParticleList fParticleList
ParticleList to map track ID to sim::Particle.
const art::Ptr< simb::MCTruth > & cheat::PhotonBackTracker::ParticleToMCTruth ( const simb::MCParticle *  p) const

Definition at line 240 of file old.PhotonBackTracker_service.cc.

241  {
242  shouldThisFail();
243  return this->TrackIDToMCTruth(p->TrackId());
244  }
pdgs p
Definition: selectors.fcl:22
const art::Ptr< simb::MCTruth > & TrackIDToMCTruth(int const &id) const
const art::Ptr<simb::MCTruth>& cheat::PhotonBackTracker::ParticleToMCTruth ( const simb::MCParticle *  p) const
template<typename Evt >
void cheat::PhotonBackTracker::PrepEvent ( Evt const &  evt)
template<typename Evt >
void cheat::PhotonBackTracker::PrepOpDetBTRs ( Evt const &  evt)
template<typename Evt >
void cheat::PhotonBackTracker::PrepOpFlashToOpHits ( Evt const &  evt)
void cheat::PhotonBackTracker::Rebuild ( const art::Event &  evt)

Definition at line 56 of file old.PhotonBackTracker_service.cc.

57  {
58  // do nothing if this is data
59  if(evt.isRealData()) return;
60 
61  // get the particles from the event
62  art::Handle<std::vector<simb::MCParticle>> pHandle;
63  evt.getByLabel(fG4ModuleLabel, pHandle);
64 
65  // first check to see if we got called to early, that is the particles are
66  // and sim channels are not made yet in a MC production job
67  // if that is the case, we'll take care of it later
68  if(pHandle.failedToGet()){
69  mf::LogWarning("PhotonBackTracker") << "failed to get handle to simb::MCParticle from "
71  << ", return";
72  return;
73  }
74 
75  // Clear out anything remaining from previous calls to Rebuild
76  fParticleList.clear();
77  fMCTruthList .clear();
78  cOpDetBacktrackerRecords .clear();
79  //fVoxelList .clear();
80 
81  art::FindOneP<simb::MCTruth> fo(pHandle, evt, fG4ModuleLabel);
82 
83  if( fo.isValid() ){
84  for(size_t p = 0; p < pHandle->size(); ++p){
85 
86  simb::MCParticle *part = new simb::MCParticle(pHandle->at(p));
87  fParticleList.Add(part);
88 
89  // get the simb::MCTruth associated to this sim::ParticleList
90  try{
91  art::Ptr<simb::MCTruth> mct = fo.at(p);
92  if(fMCTruthList.size() < 1) fMCTruthList.push_back(mct);
93  else{
94  // check that we are not adding a simb::MCTruth twice to the collection
95  // we know that all the particles for a given simb::MCTruth are put into the
96  // collection of particles at the same time, so we can just check that the
97  // current art::Ptr has a different id than the last one put
98  if(!(mct == fMCTruthList.back())) fMCTruthList.push_back(mct);
99  }
100  // fill the track id to mctruth index map
101  fTrackIDToMCTruthIndex[pHandle->at(p).TrackId()] = fMCTruthList.size() - 1;
102  }
103  catch(cet::exception &ex){
104  mf::LogWarning("PhotonBackTracker") << "unable to find MCTruth from ParticleList "
105  << "created in " << fG4ModuleLabel << " "
106  << "any attempt to get the MCTruth objects from "
107  << "the photon backtracker will fail\n"
108  << "message from caught exception:\n" << ex;
109  }
110  }// end loop over particles to get MCTruthList
111  }// end if fo.isValid()
112 
113  // grab the sim::OpDetBacktrackerRecords for this event
114 
115  /*
116  try{evt.getView(fG4ModuleLabel, cOpDetBacktrackerRecords);}
117  catch(art::Exception const& e){
118  if(e.categoryCode() != art::errors::ProductNotFound) throw;
119  if(have_complained==false){
120  }
121  }
122  */
123 
124  art::Handle< std::vector< sim::OpDetBacktrackerRecord> > cPBTRHandle;
125  // std::vector< art::Ptr< sim::OpDetBacktrackerRecords > > cOpDetBacktrackerRecords;
126  evt.getByLabel(fG4ModuleLabel, cPBTRHandle);
127  if(cPBTRHandle.failedToGet()){//Failed to get products. Prepare for controlled freak out. Assuming this is because there is no OpDetBacktrackerRecords, we will not cause things to fail, but will prepare to fail if a user tries to call backtracker functionality.
128  auto failMode = cPBTRHandle.whyFailed();
129  if(failMode->categoryCode() != art::errors::ProductNotFound) throw;
130  else if(have_complained==false){
131  std::cout<<"FAILED BECAUSE "<<(*failMode)<<"\n";
132  have_complained=true;
133  mf::LogWarning("PhotonBackTracker")<<"Failed to get BackTrackerRecords from this event. All calls to the PhotonBackTracker will fail.\n"
134  <<"This message will be generated only once per lar invokation. If this is event one, be aware the PhotonBackTracker may not work on any events from this file.\n"
135  <<"Please change the log level to debug if you need more information for each event.\n"
136  <<"Failed with :"<<(*failMode)<<"\n";
137  mf::LogDebug("PhotonBackTracker")<<"Failed to get BackTrackerRecords from this event.\n";
138  }else{
139  mf::LogDebug("PhotonBackTracker")<<"Failed to get BackTrackerRecords from this event.\n";
140  }
141  }else{//Did not fail to get products. All is well. Run as expected.
142  art::fill_ptr_vector(cOpDetBacktrackerRecords, cPBTRHandle);
143  }
144 
145 
146  // grab the voxel list for this event
147  //fVoxelList = sim::SimListUtils::GetLArVoxelList(evt, fG4ModuleLabel);
148 
149  fParticleList.AdoptEveIdCalculator(new sim::EmEveIdCalculator);
150 
151  MF_LOG_DEBUG("PhotonBackTracker") << "PhotonBackTracker has " << cOpDetBacktrackerRecords.size()
152  << " sim::OpDetBacktrackerRecords and " << GetSetOfTrackIDs().size()
153  << " tracks. The particles are:\n"
154  << fParticleList
155  << "\n the MCTruth information is\n";
156  for(size_t mc = 0; mc < fMCTruthList.size(); ++mc)
157  MF_LOG_DEBUG("PhotonBackTracker") << *(fMCTruthList.at(mc).get());
158 
159  return;
160  }
std::map< int, int > fTrackIDToMCTruthIndex
map of track ids to MCTruthList entry
pdgs p
Definition: selectors.fcl:22
std::string fG4ModuleLabel
label for geant4 module
TCEvent evt
Definition: DataStructs.cxx:8
std::vector< art::Ptr< sim::OpDetBacktrackerRecord > > cOpDetBacktrackerRecords
all the OpDetBacktrackerRecords for the event
std::vector< art::Ptr< simb::MCTruth > > fMCTruthList
all the MCTruths for the event
sim::ParticleList fParticleList
ParticleList to map track ID to sim::Particle.
BEGIN_PROLOG could also be cout
void cheat::PhotonBackTracker::Rebuild ( const art::Event &  evt)
void cheat::PhotonBackTracker::reconfigure ( fhicl::ParameterSet const &  pset)

Definition at line 47 of file old.PhotonBackTracker_service.cc.

48  {
49  fG4ModuleLabel = pset.get<std::string>("G4ModuleLabel", "largeant");
50  fMinOpHitEnergyFraction = pset.get<double >("MinimumOpHitEnergyFraction", 0.1);
51  fDelay = pset.get< double > ("Delay");
52  have_complained = false;
53  }
std::string fG4ModuleLabel
label for geant4 module
double fMinOpHitEnergyFraction
minimum fraction of energy a track id has to
void cheat::PhotonBackTracker::reconfigure ( fhicl::ParameterSet const &  pset)
void cheat::PhotonBackTracker::SetEveIdCalculator ( sim::EveIdCalculator *  ec)
inline

Definition at line 68 of file old.PhotonBackTracker.h.

68 { fParticleList.AdoptEveIdCalculator(ec); }
sim::ParticleList fParticleList
ParticleList to map track ID to sim::Particle.
void cheat::PhotonBackTracker::SetEveIdCalculator ( sim::EveIdCalculator *  ec)
inline

Definition at line 68 of file old.PhotonBackTrackerService.h.

68 { fParticleList.AdoptEveIdCalculator(ec); }
sim::ParticleList fParticleList
ParticleList to map track ID to sim::Particle.
const void cheat::PhotonBackTracker::shouldThisFail ( ) const
private

Definition at line 163 of file old.PhotonBackTracker_service.cc.

163  {
164  //I need to revisit this and see if this check is too aggressive, as it only takes one failed event to set have_complained to true for the rest of the file.
165  //I currently do believe this is okay, as have_complained only flips on ProductNotFound errors, and if that happens in one event of a file,
166  // it should happen in all events of the file.
167  if( have_complained==true ){
168  throw cet::exception("PhotonBackTracker1") << "PhotonBackTracker methods called on a file without OpDetPhotonBacktrackerRecords. Backtracked information is not available.";
169  }
170  }
const void cheat::PhotonBackTracker::shouldThisFail ( ) const
private
std::vector< double > cheat::PhotonBackTracker::SimSDPsToXYZ ( std::vector< sim::SDP > const &  sdps)

Definition at line 708 of file old.PhotonBackTracker_service.cc.

709  {
710  shouldThisFail();
711  std::vector<double> xyz(3, -999.);
712 
713  double x = 0.;
714  double y = 0.;
715  double z = 0.;
716  double w = 0.;
717 
718  // loop over photons.
719 
720  for(auto const& sdp : sdps) {
721 
722  double weight = sdp.numPhotons;
723 
724  w += weight;
725  x += weight * sdp.x;
726  y += weight * sdp.y;
727  z += weight * sdp.z;
728 
729  }// end loop over sim::SDPs
730 
731  //If the sum of the weights is still zero, then fail to return a value.
732  //A hit with no contributing photons does't make sense.
733  if(w < 1.e-5)
734  throw cet::exception("PhotonBackTracker") << "No sim::SDPs providing non-zero number of photons"
735  << " can't determine originating location from truth\n";
736 
737  xyz[0] = x/w;
738  xyz[1] = y/w;
739  xyz[2] = z/w;
740 
741  return xyz;
742  }
process_name opflash particleana ie ie ie z
process_name opflash particleana ie x
process_name opflash particleana ie ie y
do i e
std::vector<double> cheat::PhotonBackTracker::SimSDPsToXYZ ( std::vector< sim::SDP > const &  sdps)
const std::vector< double > cheat::PhotonBackTracker::SimSDPsToXYZ ( std::vector< sim::SDP > const &  sdps) const
const std::vector< double > cheat::PhotonBackTracker::SimSDPsToXYZ ( std::vector< const sim::SDP * > const &  sdps_Ps) const
const std::vector< std::vector< art::Ptr< recob::OpHit > > > cheat::PhotonBackTracker::TrackIDsToOpHits ( std::vector< art::Ptr< recob::OpHit >> const &  allhits,
std::vector< int > const &  tkIDs 
)

Definition at line 277 of file old.PhotonBackTracker_service.cc.

279  {
280  shouldThisFail();
281  // returns a subset of the opHits in the allOpHits collection that are matched
282  // to MC particles listed in tkIDs
283 
284  // temporary vector of TrackIDs and Ptrs to opHits so only one
285  // loop through the (possibly large) allOpHits collection is needed
286  std::vector<std::pair<int, art::Ptr<recob::OpHit>>> opHitList;
287  std::vector<sim::TrackSDP> tids;
288  for(auto itr = allOpHits.begin(); itr != allOpHits.end(); ++itr) {
289  tids.clear();
290  art::Ptr<recob::OpHit> const& opHit = *itr;
291  const double pTime = opHit->PeakTime(), pWidth= opHit->Width();
292  const double start = (pTime-pWidth)*1000.0-fDelay, end = (pTime+pWidth)*1000.0-fDelay;
293  this->ChannelToTrackSDPs(tids, opHit->OpChannel(), start, end);
294  for(auto itid = tids.begin(); itid != tids.end(); ++itid) {
295  for(auto itkid = tkIDs.begin(); itkid != tkIDs.end(); ++itkid) {
296  if(itid->trackID == *itkid) {
297  if(itid->energyFrac > fMinOpHitEnergyFraction)
298  opHitList.push_back(std::make_pair(*itkid, opHit));
299  }
300  } // itkid
301  } // itid
302  } // itr
303 
304  // now build the truOpHits vector that will be returned to the caller
305  std::vector<std::vector<art::Ptr<recob::OpHit>>> truOpHits;
306  // temporary vector containing opHits assigned to one MC particle
307  std::vector<art::Ptr<recob::OpHit>> tmpOpHits;
308  for(auto itkid = tkIDs.begin(); itkid != tkIDs.end(); ++itkid) {
309  tmpOpHits.clear();
310  for(auto itr = opHitList.begin(); itr != opHitList.end(); ++itr) {
311  if(*itkid == (*itr).first) tmpOpHits.push_back((*itr).second);
312  }
313  truOpHits.push_back(tmpOpHits);
314  }
315 
316  return truOpHits;
317  }
void ChannelToTrackSDPs(std::vector< sim::TrackSDP > &trackSDPs, int channel, const double hit_start_time, const double hit_end_time)
auto end(FixedBins< T, C > const &) noexcept
Definition: FixedBins.h:585
double fMinOpHitEnergyFraction
minimum fraction of energy a track id has to
const std::vector<std::vector<art::Ptr<recob::OpHit> > > cheat::PhotonBackTracker::TrackIDsToOpHits ( std::vector< art::Ptr< recob::OpHit >> const &  allhits,
std::vector< int > const &  tkIDs 
)
const std::vector<std::vector<art::Ptr<recob::OpHit> > > cheat::PhotonBackTracker::TrackIdsToOpHits_Ps ( std::vector< int > const &  tkIds,
std::vector< art::Ptr< recob::OpHit >> const &  hitsIn 
)
const art::Ptr< simb::MCTruth > & cheat::PhotonBackTracker::TrackIDToMCTruth ( int const &  id) const

Definition at line 199 of file old.PhotonBackTracker_service.cc.

200  {
201  shouldThisFail();
202  // find the entry in the MCTruth collection for this track id
203  size_t mct = fTrackIDToMCTruthIndex.find(abs(id))->second;
204 
205  if(/* mct < 0 || */ mct > fMCTruthList.size() )
206  throw cet::exception("PhotonBackTracker") << "attempting to find MCTruth index for "
207  << "out of range value: " << mct
208  << "/" << fMCTruthList.size() << "\n";
209 
210  return fMCTruthList[mct];
211  }
std::map< int, int > fTrackIDToMCTruthIndex
map of track ids to MCTruthList entry
T abs(T value)
std::vector< art::Ptr< simb::MCTruth > > fMCTruthList
all the MCTruths for the event
const art::Ptr<simb::MCTruth>& cheat::PhotonBackTracker::TrackIDToMCTruth ( int const &  id) const
const simb::MCParticle * cheat::PhotonBackTracker::TrackIDToMotherParticle ( int const &  id) const

Definition at line 189 of file old.PhotonBackTracker_service.cc.

190  {
191  shouldThisFail();
192  // get the mother id from the particle navigator
193  // the EveId was adopted in the Rebuild method
194 
195  return this->TrackIDToParticle(fParticleList.EveId(abs(id)));
196  }
const simb::MCParticle * TrackIDToParticle(int const &id) const
T abs(T value)
sim::ParticleList fParticleList
ParticleList to map track ID to sim::Particle.
const simb::MCParticle* cheat::PhotonBackTracker::TrackIDToMotherParticle ( int const &  id) const
const std::vector<art::Ptr<recob::OpHit> > cheat::PhotonBackTracker::TrackIdToOpHits_Ps ( int const &  tkId,
std::vector< art::Ptr< recob::OpHit >> const &  hitsIn 
)
const simb::MCParticle * cheat::PhotonBackTracker::TrackIDToParticle ( int const &  id) const

Definition at line 173 of file old.PhotonBackTracker_service.cc.

174  {
175  shouldThisFail();
176  sim::ParticleList::const_iterator part_it = fParticleList.find(id);
177 
178  if(part_it == fParticleList.end()){
179  mf::LogWarning("PhotonBackTracker") << "can't find particle with track id "
180  << id << " in sim::ParticleList"
181  << " returning null pointer";
182  return 0;
183  }
184 
185  return part_it->second;
186  }
sim::ParticleList fParticleList
ParticleList to map track ID to sim::Particle.
const simb::MCParticle* cheat::PhotonBackTracker::TrackIDToParticle ( int const &  id) const
std::vector< sim::SDP > cheat::PhotonBackTracker::TrackIDToSimSDP ( int const &  id) const

Definition at line 214 of file old.PhotonBackTracker_service.cc.

215  {
216  shouldThisFail();
217  std::vector<sim::SDP> sdps;
218 
219  // loop over all sim::OpDetBacktrackerRecords and fill a vector
220  // of sim::SDP objects for the given track id
221  for(size_t sc = 0; sc < cOpDetBacktrackerRecords.size(); ++sc){
222  const auto & pdTimeSDPmap = cOpDetBacktrackerRecords[sc]->timePDclockSDPsMap();
223 
224  // loop over the SDPMAP
225  for(auto mapitr = pdTimeSDPmap.begin(); mapitr != pdTimeSDPmap.end(); mapitr++){
226 
227  // loop over the vector of SDP objects.
228  const std::vector<sim::SDP>& sdpvec = (*mapitr).second;
229  for(size_t iv = 0; iv < sdpvec.size(); ++iv){
230  if( abs(sdpvec[iv].trackID) == id) sdps.push_back(sdpvec[iv]);
231  }
232 
233  } // end loop over map from sim::OpDetBacktrackerRecord
234  } // end loop over sim::OpDetBacktrackerRecords
235 
236  return sdps;
237  }
T abs(T value)
std::vector< art::Ptr< sim::OpDetBacktrackerRecord > > cOpDetBacktrackerRecords
all the OpDetBacktrackerRecords for the event
std::vector<sim::SDP> cheat::PhotonBackTracker::TrackIDToSimSDP ( int const &  id) const
const std::vector< const sim::SDP* > cheat::PhotonBackTracker::TrackIdToSimSDPs_Ps ( int const &  id)
const std::vector< const sim::SDP* > cheat::PhotonBackTracker::TrackIdToSimSDPs_Ps ( int const &  id,
geo::View_t const &  view 
)

Member Data Documentation

std::vector< art::Ptr< sim::OpDetBacktrackerRecord > > cheat::PhotonBackTracker::cOpDetBacktrackerRecords
private

all the OpDetBacktrackerRecords for the event

Definition at line 189 of file old.PhotonBackTracker.h.

double cheat::PhotonBackTracker::fDelay
private

Definition at line 193 of file old.PhotonBackTracker.h.

const double cheat::PhotonBackTracker::fDelay
private

Definition at line 247 of file PhotonBackTracker.h.

std::string cheat::PhotonBackTracker::fG4ModuleLabel
private

label for geant4 module

Definition at line 191 of file old.PhotonBackTracker.h.

const art::InputTag cheat::PhotonBackTracker::fG4ModuleLabel
private

Definition at line 248 of file PhotonBackTracker.h.

const std::vector<art::InputTag> cheat::PhotonBackTracker::fG4ModuleLabels
private

Definition at line 249 of file PhotonBackTracker.h.

const geo::GeometryCore* cheat::PhotonBackTracker::fGeom
private

Definition at line 245 of file PhotonBackTracker.h.

std::vector< art::Ptr< simb::MCTruth > > cheat::PhotonBackTracker::fMCTruthList
private

all the MCTruths for the event

Definition at line 188 of file old.PhotonBackTracker.h.

double cheat::PhotonBackTracker::fMinOpHitEnergyFraction
private

minimum fraction of energy a track id has to

Definition at line 192 of file old.PhotonBackTracker.h.

const double cheat::PhotonBackTracker::fMinOpHitEnergyFraction
private

Definition at line 252 of file PhotonBackTracker.h.

const art::InputTag cheat::PhotonBackTracker::fOpFlashLabel
private

Definition at line 251 of file PhotonBackTracker.h.

const art::InputTag cheat::PhotonBackTracker::fOpHitLabel
private

Definition at line 250 of file PhotonBackTracker.h.

sim::ParticleList cheat::PhotonBackTracker::fParticleList
private

ParticleList to map track ID to sim::Particle.

Definition at line 184 of file old.PhotonBackTracker.h.

const cheat::ParticleInventory* cheat::PhotonBackTracker::fPartInv
private

Definition at line 244 of file PhotonBackTracker.h.

std::map< int, int > cheat::PhotonBackTracker::fTrackIDToMCTruthIndex
private

map of track ids to MCTruthList entry

Definition at line 190 of file old.PhotonBackTracker.h.

sim::LArVoxelList cheat::PhotonBackTracker::fVoxelList
private

List to map the position of energy depostions in voxels to the particles depositing the energy

Definition at line 185 of file old.PhotonBackTracker.h.

geo::GeometryCore const * cheat::PhotonBackTracker::geom = lar::providerFrom<geo::Geometry>()
private

Definition at line 176 of file old.PhotonBackTracker.h.

bool cheat::PhotonBackTracker::have_complained
private

Definition at line 182 of file old.PhotonBackTracker.h.

std::vector<art::Ptr<sim::OpDetBacktrackerRecord> > cheat::PhotonBackTracker::priv_OpDetBTRs
mutableprivate

Definition at line 253 of file PhotonBackTracker.h.

std::map< art::Ptr < recob::OpFlash >, std::vector < art::Ptr < recob::OpHit > > > cheat::PhotonBackTracker::priv_OpFlashToOpHits
private

Definition at line 254 of file PhotonBackTracker.h.


The documentation for this class was generated from the following files: