LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
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::ParticleListParticleList () const
 
void SetEveIdCalculator (sim::EveIdCalculator *ec)
 
const simb::MCParticleTrackIDToParticle (int const &id) const
 
const simb::MCParticleTrackIDToMotherParticle (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::TrackSDPOpHitToTrackID (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::ParticleListParticleList () const
 
void SetEveIdCalculator (sim::EveIdCalculator *ec)
 
const simb::MCParticleTrackIDToParticle (int const &id) const
 
const simb::MCParticleTrackIDToMotherParticle (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::TrackSDPOpHitToTrackID (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::OpDetBacktrackerRecordFindOpDetBTR (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::OpDetBacktrackerRecordFindOpDetBacktrackerRecord (int channel) const
 
const void shouldThisFail () const
 
const art::Ptr< sim::OpDetBacktrackerRecordFindOpDetBacktrackerRecord (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 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 46 of file old.PhotonBackTracker.h.

Constructor & Destructor Documentation

cheat::PhotonBackTracker::PhotonBackTracker ( fhicl::ParameterSet const &  pset,
art::ActivityRegistry reg 
)
cheat::PhotonBackTracker::~PhotonBackTracker ( )
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  fOpHitLabel(config.OpHitLabel()),
46  fOpFlashLabel(config.OpFlashLabel()),
47  //fWavLabel(config.WavLabel()),
48  fMinOpHitEnergyFraction(config.MinOpHitEnergyFraction())
49  {}
std::string fG4ModuleLabel
label for geant4 module
const cheat::ParticleInventory * fPartInv
const geo::GeometryCore * fGeom
const art::InputTag fOpFlashLabel
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 52 of file PhotonBackTracker.cc.

56  :fPartInv (partInv),
57  fGeom (geom),
58 // fDetClocks(detClock),
59  fDelay(pSet.get<double>("Delay")),
60  fG4ModuleLabel(pSet.get<art::InputTag>("G4ModuleLabel", "largeant")),
61  fOpHitLabel(pSet.get<art::InputTag>("OpHitLabel", "ophit")),
62  fOpFlashLabel(pSet.get<art::InputTag>("OpFlashLabel", "opflash")),
63  fMinOpHitEnergyFraction(pSet.get<double>("MinimumOpHitEnergyFraction", 0.1))
64  {}
std::string fG4ModuleLabel
label for geant4 module
const cheat::ParticleInventory * fPartInv
const geo::GeometryCore * fGeom
const art::InputTag fOpFlashLabel
double fMinOpHitEnergyFraction
minimum fraction of energy a track id has to
const art::InputTag fOpHitLabel
cheat::PhotonBackTracker::PhotonBackTracker ( PhotonBackTracker const &  )
delete

Member Function Documentation

const bool cheat::PhotonBackTracker::BTRsReady ( )

Definition at line 77 of file PhotonBackTracker.cc.

References priv_OpDetBTRs.

Referenced by cheat::PhotonBackTrackerService::priv_OpDetBTRsReady().

78  {
79  return !( priv_OpDetBTRs.empty() ) ;
80  }
std::vector< art::Ptr< sim::OpDetBacktrackerRecord > > priv_OpDetBTRs
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.

References e, energy, sim::TrackSDP::energy, sim::TrackSDP::energyFrac, FindOpDetBacktrackerRecord(), geom, sim::NoParticleId, geo::GeometryCore::OpDetFromOpChannel(), shouldThisFail(), sim::TrackSDP::trackID, and sim::OpDetBacktrackerRecord::TrackIDsAndEnergies().

Referenced by GetSetOfTrackIDs(), OpDetBacktrackerRecords(), OpHitToTrackSDPs(), and TrackIDsToOpHits().

640  {
641  shouldThisFail();
642  trackSDPs.clear();
643 
644  double totalE = 0.;
645 
646  try{
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 
673  sim::TrackSDP info;
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:28
float energyFrac
fraction of OpHit energy from the particle with this trackID
double energy
Definition: plottest35.C:25
Ionization photons from a Geant4 track.
const art::Ptr< sim::OpDetBacktrackerRecord > FindOpDetBacktrackerRecord(int channel) const
geo::GeometryCore const * geom
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
std::vector< sim::SDP > TrackIDsAndEnergies(timePDclock_t startTimePDclock, timePDclock_t endTimePDclock) const
Return all the recorded energy deposition within a time interval.
float energy
energy from the particle with this trackID [MeV]
Float_t e
Definition: plot.C:34
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
void cheat::PhotonBackTracker::ClearEvent ( )

Definition at line 71 of file PhotonBackTracker.cc.

References priv_OpDetBTRs, and priv_OpFlashToOpHits.

Referenced by cheat::PhotonBackTrackerService::priv_PrepEvent().

71  {
72  priv_OpDetBTRs.clear();
73  priv_OpFlashToOpHits.clear();
74  }
std::vector< art::Ptr< sim::OpDetBacktrackerRecord > > priv_OpDetBTRs
std::map< art::Ptr< recob::OpFlash >, std::vector< art::Ptr< recob::OpHit > > > priv_OpFlashToOpHits
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.

References cOpDetBacktrackerRecords, and shouldThisFail().

Referenced by ChannelToTrackSDPs(), OpDetBacktrackerRecords(), and OpHitToSDPs().

617  {
618  shouldThisFail();
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
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
const art::Ptr< sim::OpDetBacktrackerRecord > cheat::PhotonBackTracker::FindOpDetBTR ( int const &  opDetNum) const

Definition at line 121 of file PhotonBackTracker.cc.

References priv_OpDetBTRs.

Referenced by cheat::PhotonBackTrackerService::FindOpDetBTR(), OpDetToTrackSDPs(), and OpHitToSimSDPs_Ps().

122  {
124  for(size_t sc = 0; sc < priv_OpDetBTRs.size(); ++sc){
125  //This could become a bug. What if it occurs twice (shouldn't happen in correct records, but still, no error handeling included for the situation
126  if(priv_OpDetBTRs.at(sc)->OpDetNum() == opDetNum) opDet = priv_OpDetBTRs.at(sc);
127  }
128  if(!opDet)
129  {
130  throw cet::exception("PhotonBackTracker2") << "No sim:: OpDetBacktrackerRecord corresponding "
131  << "to opDetNum: " << opDetNum << "\n";
132  }
133  return opDet;
134  }
std::vector< art::Ptr< sim::OpDetBacktrackerRecord > > priv_OpDetBTRs
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
const double cheat::PhotonBackTracker::GetDelay ( )

Definition at line 68 of file PhotonBackTracker.cc.

References fDelay.

Referenced by cheat::PhotonBackTrackerService::GetDelay().

68 { return this->fDelay;}
std::set< int > cheat::PhotonBackTracker::GetSetOfEveIDs ( )

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

References sim::ParticleList::begin(), sim::ParticleList::end(), sim::ParticleList::EveId(), fParticleList, and shouldThisFail().

Referenced by OpHitToSimSDPs().

358  {
359  shouldThisFail();
360  std::set<int> eveIDs;
361 
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  }
list_type::const_iterator const_iterator
Definition: ParticleList.h:132
int EveId(const int trackID) const
iterator begin()
Definition: ParticleList.h:305
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.

References OpHitToEveID(), and shouldThisFail().

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

Definition at line 481 of file PhotonBackTracker.cc.

References fPartInv, and cheat::ParticleInventory::GetSetOfEveIds().

Referenced by cheat::PhotonBackTrackerService::GetSetOfEveIds().

482  {
483  //std::set<int> out = fPartInv->GetSetOfEveIds();
484  return fPartInv->GetSetOfEveIds();
485  //return out;
486  }
const cheat::ParticleInventory * fPartInv
std::set< int > GetSetOfEveIds() const
const std::set< int > cheat::PhotonBackTracker::GetSetOfEveIds ( std::vector< art::Ptr< recob::OpHit > > const &  opHits) const

Definition at line 495 of file PhotonBackTracker.cc.

References OpHitToEveTrackSDPs().

496  {
497  std::set<int> eveIds;
498  for(auto const& opHit_P : opHits_Ps){
499  const std::vector<sim::TrackSDP> sdps = this->OpHitToEveTrackSDPs(opHit_P);
500  for(auto const& sdp : sdps){eveIds.insert(sdp.trackID);}//end sdps
501  }//End for hits
502  return eveIds;
503  }
const std::vector< sim::TrackSDP > OpHitToEveTrackSDPs(art::Ptr< recob::OpHit > const &opHit_P) const
const std::set< int > cheat::PhotonBackTracker::GetSetOfEveIds ( std::vector< recob::OpHit > const &  opHits) const

Definition at line 506 of file PhotonBackTracker.cc.

References OpHitToEveTrackSDPs().

507  { /*NEW*/ /*COMPLETE*/
508  std::set<int> eveIds;
509  for(auto const& opHit : opHits){
510  const std::vector<sim::TrackSDP> sdps = this->OpHitToEveTrackSDPs(opHit);
511  for(auto const& sdp : sdps){eveIds.insert(sdp.trackID);}//end sdps
512  }//End for hits
513  return eveIds;
514  }
const std::vector< sim::TrackSDP > OpHitToEveTrackSDPs(art::Ptr< recob::OpHit > const &opHit_P) const
std::set<int> cheat::PhotonBackTracker::GetSetOfTrackIDs ( )
std::set< int > cheat::PhotonBackTracker::GetSetOfTrackIDs ( )

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

References fParticleList, and shouldThisFail().

Referenced by OpHitToSimSDPs(), and Rebuild().

375  {
376  shouldThisFail();
377  // fParticleList::value_type is a pair (track, particle pointer)
378  std::set<int> trackIDs;
380  trackIDs.insert(pl.first);
381 
382  return trackIDs;
383  }
list_type::value_type value_type
Definition: ParticleList.h:130
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.

References ChannelToTrackSDPs(), evd::details::end(), fDelay, and shouldThisFail().

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)
std::vector< evd::details::RawDigitInfo_t >::const_iterator end(RawDigitCacheDataClass const &cache)
std::set<int> cheat::PhotonBackTracker::GetSetOfTrackIDs ( std::vector< art::Ptr< recob::OpHit > > const &  hits)
const std::set< int > cheat::PhotonBackTracker::GetSetOfTrackIds ( ) const

Definition at line 489 of file PhotonBackTracker.cc.

References fPartInv, and cheat::ParticleInventory::GetSetOfTrackIds().

Referenced by cheat::PhotonBackTrackerService::GetSetOfTrackIds().

490  {
491  return fPartInv->GetSetOfTrackIds();
492  }
const cheat::ParticleInventory * fPartInv
std::set< int > GetSetOfTrackIds() const
const std::set< int > cheat::PhotonBackTracker::GetSetOfTrackIds ( std::vector< art::Ptr< recob::OpHit > > const &  opHits) const

Definition at line 517 of file PhotonBackTracker.cc.

References OpHitToTrackSDPs().

518  {
519  std::set<int> tids;
520  for( auto const& opHit : opHits){
521  for(auto const& sdp : this->OpHitToTrackSDPs(opHit)) {
522  tids.insert(sdp.trackID);
523  }//End for TrackSDPs
524  }//End for hits
525  return tids;
526  }
std::vector< sim::TrackSDP > OpHitToTrackSDPs(art::Ptr< recob::OpHit > const &hit)
const std::set< int > cheat::PhotonBackTracker::GetSetOfTrackIds ( std::vector< recob::OpHit > const &  opHits) const

Definition at line 529 of file PhotonBackTracker.cc.

References OpHitToTrackSDPs().

530  { /*NEW*/ /*COMPLETE*/
531  std::set<int> tids;
532  for( auto const& opHit : opHits){
533  for(auto const& sdp : this->OpHitToTrackSDPs(opHit)) {
534  tids.insert(sdp.trackID);
535  }//End for TrackSDPs
536  }//End for hits
537  return tids;
538  }
std::vector< sim::TrackSDP > OpHitToTrackSDPs(art::Ptr< recob::OpHit > const &hit)
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.

References fParticleList, shouldThisFail(), and TrackIDToMCTruth().

Referenced by SetEveIdCalculator().

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  }
list_type::value_type value_type
Definition: ParticleList.h:130
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 82 of file old.PhotonBackTracker.h.

References fMCTruthList.

82 { 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 82 of file old.PhotonBackTrackerService.h.

References fMCTruthList.

82 { 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
const std::vector< art::Ptr< sim::OpDetBacktrackerRecord > >& cheat::PhotonBackTracker::OpDetBacktrackerRecords ( ) const
inline

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

References ChannelToTrackSDPs(), and cOpDetBacktrackerRecords.

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

Definition at line 89 of file PhotonBackTracker.cc.

References priv_OpDetBTRs.

Referenced by cheat::PhotonBackTrackerService::OpDetBTRs().

90  {
91  return priv_OpDetBTRs;
92  }
std::vector< art::Ptr< sim::OpDetBacktrackerRecord > > priv_OpDetBTRs
const std::vector< sim::TrackSDP > cheat::PhotonBackTracker::OpDetToTrackSDPs ( int const &  OpDetNum,
double const &  opHit_start_time,
double const &  opHit_end_time 
) const

Definition at line 137 of file PhotonBackTracker.cc.

References e, energy, sim::TrackSDP::energy, sim::TrackSDP::energyFrac, FindOpDetBTR(), sim::NoParticleId, sim::TrackSDP::trackID, and sim::OpDetBacktrackerRecord::TrackIDsAndEnergies().

Referenced by cheat::PhotonBackTrackerService::OpDetToTrackSDPs(), OpHitToTrackSDPs(), and TrackIdsToOpHits_Ps().

139  {
140  std::vector< sim::TrackSDP > tSDPs;
141  double totalE=0;
142  try{
144  this->FindOpDetBTR(OpDetNum);
145  // ( fGeom->OpDetFromOpChannel(channel) );
146  std::vector<sim::SDP> simSDPs =
147  opDetBTR->TrackIDsAndEnergies(opHit_start_time, opHit_end_time);
148  for(size_t e = 0; e < simSDPs.size(); ++e)
149  totalE += simSDPs[e].energy;
150  if(totalE < 1.e-5) totalE = 1.;
151  for(size_t e = 0; e < simSDPs.size(); ++e){
152  if(simSDPs[e].trackID == sim::NoParticleId) continue;
153  sim::TrackSDP info;
154  info.trackID = simSDPs[e].trackID;
155  info.energyFrac = simSDPs[e].energy/totalE;
156  info.energy = simSDPs[e].energy;
157  tSDPs.push_back(info);
158  }
159  }
160  catch(cet::exception e){//This needs to go. Make it specific if there is a really an exception we would like to catch.
161  mf::LogWarning("PhotonBackTracker")<<"Exception caught\n"
162  <<e;
163  }
164  return tSDPs;
165  }
const art::Ptr< sim::OpDetBacktrackerRecord > FindOpDetBTR(int const &opDetNum) const
int trackID
Geant4 supplied trackID.
static const int NoParticleId
Definition: sim.h:28
float energyFrac
fraction of OpHit energy from the particle with this trackID
double energy
Definition: plottest35.C:25
Ionization photons from a Geant4 track.
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
std::vector< sim::SDP > TrackIDsAndEnergies(timePDclock_t startTimePDclock, timePDclock_t endTimePDclock) const
Return all the recorded energy deposition within a time interval.
float energy
energy from the particle with this trackID [MeV]
Float_t e
Definition: plot.C:34
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
const std::vector< art::Ptr< recob::OpHit > > cheat::PhotonBackTracker::OpFlashToOpHits_Ps ( art::Ptr< recob::OpFlash > &  flash_P) const

Definition at line 704 of file PhotonBackTracker.cc.

References priv_OpFlashToOpHits.

Referenced by cheat::PhotonBackTrackerService::OpFlashToOpHits_Ps(), OpFlashToTrackIds(), and OpFlashToXYZ().

706  {//There is not "non-pointer" version of this because the art::Ptr is needed to look up the assn. One could loop the Ptrs and dereference them, but I will not encourage the behavior by building the tool to do it.
707  //
708  std::vector<art::Ptr<recob::OpHit>> const& hits_Ps = priv_OpFlashToOpHits.at(flash_P);
709  return hits_Ps;
710  }
std::map< art::Ptr< recob::OpFlash >, std::vector< art::Ptr< recob::OpHit > > > priv_OpFlashToOpHits
const bool cheat::PhotonBackTracker::OpFlashToOpHitsReady ( )

Definition at line 83 of file PhotonBackTracker.cc.

References priv_OpFlashToOpHits.

Referenced by cheat::PhotonBackTrackerService::priv_OpFlashToOpHitsReady().

84  {
85  return !( priv_OpFlashToOpHits.empty() ) ;
86  }
std::map< art::Ptr< recob::OpFlash >, std::vector< art::Ptr< recob::OpHit > > > priv_OpFlashToOpHits
const std::set< int > cheat::PhotonBackTracker::OpFlashToTrackIds ( art::Ptr< recob::OpFlash > &  flash_P) const

Definition at line 722 of file PhotonBackTracker.cc.

References OpFlashToOpHits_Ps(), and OpHitToTrackIds().

Referenced by cheat::PhotonBackTrackerService::OpFlashToTrackIds().

723  {
724  std::vector<art::Ptr<recob::OpHit> > opHits_Ps = this->OpFlashToOpHits_Ps(flash_P);
725  std::set<int> ids;
726  for( auto& opHit_P : opHits_Ps){
727  for( const int& id : this->OpHitToTrackIds(opHit_P) ){
728  ids.insert( id) ;
729  } // end for ids
730  }// end for opHits
731  // std::set<int> ids;
732  return ids;
733  }// end OpFlashToTrackIds
const std::vector< int > OpHitToTrackIds(recob::OpHit const &opHit) const
const std::vector< art::Ptr< recob::OpHit > > OpFlashToOpHits_Ps(art::Ptr< recob::OpFlash > &flash_P) const
const std::vector< double > cheat::PhotonBackTracker::OpFlashToXYZ ( art::Ptr< recob::OpFlash > &  flash_P) const

Definition at line 713 of file PhotonBackTracker.cc.

References OpFlashToOpHits_Ps(), and OpHitsToXYZ().

Referenced by cheat::PhotonBackTrackerService::OpFlashToXYZ().

714  {
715  const std::vector< art::Ptr< recob::OpHit > > opHits_Ps = this->OpFlashToOpHits_Ps(flash_P);
716  const std::vector<double> retVec = this->OpHitsToXYZ(opHits_Ps);
717  //const std::vector<double> retVec(0.0,3);
718  return retVec;
719  }
const std::vector< double > OpHitsToXYZ(std::vector< art::Ptr< recob::OpHit > > const &opHits_Ps) const
const std::vector< art::Ptr< recob::OpHit > > OpFlashToOpHits_Ps(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.

References recob::OpHit::Area(), e, fMinOpHitEnergyFraction, OpHitToTrackSDPs(), and shouldThisFail().

Referenced by OpHitToSimSDPs().

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  }
std::vector< sim::TrackSDP > OpHitToTrackSDPs(art::Ptr< recob::OpHit > const &hit)
double fMinOpHitEnergyFraction
minimum fraction of energy a track id has to
double Area() const
Definition: OpHit.h:67
Float_t e
Definition: plot.C:34
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  }
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
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.

References recob::OpHit::Area(), e, OpHitToTrackSDPs(), and shouldThisFail().

Referenced by OpHitToSimSDPs().

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  }
std::vector< sim::TrackSDP > OpHitToTrackSDPs(art::Ptr< recob::OpHit > const &hit)
double Area() const
Definition: OpHit.h:67
Float_t e
Definition: plot.C:34
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.

References e, fMinOpHitEnergyFraction, OpHitToTrackSDPs(), and shouldThisFail().

Referenced by cheat::PhotonBackTrackerService::OpHitCollectionEfficiency(), and OpHitToSimSDPs().

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  }
std::vector< sim::TrackSDP > OpHitToTrackSDPs(art::Ptr< recob::OpHit > const &hit)
double fMinOpHitEnergyFraction
minimum fraction of energy a track id has to
Float_t e
Definition: plot.C:34
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  }
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
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 
)

Definition at line 604 of file PhotonBackTracker.cc.

References e, fMinOpHitEnergyFraction, and OpHitToTrackSDPs().

607  {
608  float desired = 0.;
609  float total = 0.;
610  for(size_t h = 0; h < opHits.size(); ++h){
611  art::Ptr<recob::OpHit> opHit = opHits[h];
612  std::vector<sim::TrackSDP> opHitTrackSDPs = this->OpHitToTrackSDPs(opHit);
613  // also don't double count if this opHit has more than one of the
614  // desired track IDs associated with it
615  for(size_t e = 0; e < opHitTrackSDPs.size(); ++e){
616  if(tkIds.find(opHitTrackSDPs[e].trackID) != tkIds.end() &&
617  opHitTrackSDPs[e].energyFrac >= fMinOpHitEnergyFraction){
618  desired += 1.;
619  break;
620  }
621  }
622  }// end loop over opHits
623  // now figure out how many opHits in the whole collection are associated with this id
624  for(size_t h = 0; h < opHitsIn.size(); ++h){
625  art::Ptr<recob::OpHit> opHit = opHitsIn[h];
626  std::vector<sim::TrackSDP> opHitTrackSDPs = this->OpHitToTrackSDPs(opHit);
627  for(size_t e = 0; e < opHitTrackSDPs.size(); ++e){
628  // don't worry about opHits where the energy fraction for the chosen
629  // trackID is < 0.1
630  // also don't double count if this opHit has more than one of the
631  // desired track IDs associated with it
632  if(tkIds.find(opHitTrackSDPs[e].trackID) != tkIds.end() &&
633  opHitTrackSDPs[e].energyFrac >= fMinOpHitEnergyFraction){
634  total += 1.;
635  break;
636  }
637  }
638  }// end loop over all opHits
639  double efficiency = 0.;
640  if(total > 0.) efficiency = desired/total;
641  return efficiency;
642  }
std::vector< sim::TrackSDP > OpHitToTrackSDPs(art::Ptr< recob::OpHit > const &hit)
double fMinOpHitEnergyFraction
minimum fraction of energy a track id has to
Float_t e
Definition: plot.C:34
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 
)

Definition at line 595 of file PhotonBackTracker.cc.

599  {
600  throw cet::exception("PhotonBackTracker")<<"This function is not supported. OpHits do not have type View.\n";
601  }
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
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.

References e, OpHitToTrackSDPs(), and shouldThisFail().

Referenced by cheat::PhotonBackTrackerService::OpHitCollectionPurity(), and OpHitToSimSDPs().

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  }
std::vector< sim::TrackSDP > OpHitToTrackSDPs(art::Ptr< recob::OpHit > const &hit)
Float_t e
Definition: plot.C:34
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 
)

Definition at line 541 of file PhotonBackTracker.cc.

References e, and OpHitToTrackSDPs().

543  {
544  // get the list of EveIDs that correspond to the opHits in this collection
545  // if the EveID shows up in the input list of tkIds, then it counts
546  float total = 1.*opHits.size();;
547  float desired = 0.;
548  for(size_t h = 0; h < opHits.size(); ++h){
549  art::Ptr<recob::OpHit> opHit = opHits[h];
550  std::vector<sim::TrackSDP> opHitTrackSDPs = this->OpHitToTrackSDPs(opHit);
551  // don't double count if this opHit has more than one of the
552  // desired track IDs associated with it
553  for(size_t e = 0; e < opHitTrackSDPs.size(); ++e){
554  if(tkIds.find(opHitTrackSDPs[e].trackID) != tkIds.end()){
555  desired += 1.;
556  break;
557  }
558  }
559  }// end loop over opHits
560  double purity = 0.;
561  if(total > 0) purity = desired/total;
562  return purity;
563  }
std::vector< sim::TrackSDP > OpHitToTrackSDPs(art::Ptr< recob::OpHit > const &hit)
Float_t e
Definition: plot.C:34
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 
)

Definition at line 654 of file PhotonBackTracker.cc.

References recob::OpHit::Area(), e, fMinOpHitEnergyFraction, and OpHitToTrackSDPs().

Referenced by cheat::PhotonBackTrackerService::OpHitChargeCollectionEfficiency(), and cheat::PhotonBackTrackerService::OpHitLightCollectionEfficiency().

657  {
658  float desired = 0.;
659  float total = 0.;
660 
661  // don't have to check the view in the opHits collection because
662  // those are assumed to be from the object we are testing and will
663  // the correct view by definition then.
664  for(size_t h = 0; h < opHits.size(); ++h){
665 
666  art::Ptr<recob::OpHit> opHit = opHits[h];
667  std::vector<sim::TrackSDP> opHitTrackIDs = this->OpHitToTrackSDPs(opHit);
668 
669  // don't worry about opHits where the energy fraction for the chosen
670  // trackID is < 0.1
671  // also don't double count if this opHit has more than one of the
672  // desired track IDs associated with it
673  for(size_t e = 0; e < opHitTrackIDs.size(); ++e){
674  if(tkIds.find(opHitTrackIDs[e].trackID) != tkIds.end() &&
675  opHitTrackIDs[e].energyFrac >= fMinOpHitEnergyFraction){
676  desired += opHit->Area();
677  break;
678  }
679  }
680  }// end loop over opHits
681  for(size_t h = 0; h < opHitsIn.size(); ++h){
682  art::Ptr<recob::OpHit> opHit = opHitsIn[h];
683  // check that we are looking at the appropriate view here
684  // in the case of 3D objects we take all opHits
685  //if(opHit->View() != view && view != geo::k3D ) continue;
686  std::vector<sim::TrackSDP> opHitTrackIDs = this->OpHitToTrackSDPs(opHit);
687  for(size_t e = 0; e < opHitTrackIDs.size(); ++e){
688  // don't worry about opHits where the energy fraction for the chosen
689  // trackID is < 0.1
690  // also don't double count if this opHit has more than one of the
691  // desired track IDs associated with it
692  if(tkIds.find(opHitTrackIDs[e].trackID) != tkIds.end() &&
693  opHitTrackIDs[e].energyFrac >= fMinOpHitEnergyFraction){
694  total += opHit->Area();
695  break;
696  }
697  }
698  }// end loop over all opHits
699  double efficiency = 0.;
700  if(total > 0.) efficiency = desired/total;
701  return efficiency;
702  }
std::vector< sim::TrackSDP > OpHitToTrackSDPs(art::Ptr< recob::OpHit > const &hit)
double fMinOpHitEnergyFraction
minimum fraction of energy a track id has to
double Area() const
Definition: OpHit.h:67
Float_t e
Definition: plot.C:34
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 
)

Definition at line 645 of file PhotonBackTracker.cc.

649  {
650  throw cet::exception("PhotonBackTracker")<<"This function is not supported. OpHits do not have type View.\n";
651  }
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
const double cheat::PhotonBackTracker::OpHitLightCollectionPurity ( std::set< int > const &  tkIds,
std::vector< art::Ptr< recob::OpHit > > const &  opHits 
)

Definition at line 566 of file PhotonBackTracker.cc.

References recob::OpHit::Area(), e, and OpHitToTrackSDPs().

Referenced by cheat::PhotonBackTrackerService::OpHitLightCollectionPurity().

568  {
569  // get the list of EveIDs that correspond to the opHits in this collection
570  // if the EveID shows up in the input list of tkIds, then it counts
571  float total = 0;
572  float desired = 0.;
573  // don't have to check the view in the opHits collection because
574  // those are assumed to be from the object we are testing and will
575  // the correct view by definition then.
576  for(size_t h = 0; h < opHits.size(); ++h){
577  art::Ptr<recob::OpHit> opHit = opHits[h];
578  std::vector<sim::TrackSDP> opHitTrackIDs = this->OpHitToTrackSDPs(opHit);
579  total+=opHit->Area(); // sum up the charge in the cluster
580  // don't double count if this opHit has more than one of the
581  // desired track IDs associated with it
582  for(size_t e = 0; e < opHitTrackIDs.size(); ++e){
583  if(tkIds.find(opHitTrackIDs[e].trackID) != tkIds.end()){
584  desired += opHit->Area();
585  break;
586  }
587  }
588  }// end loop over opHits
589  double purity = 0.;
590  if(total > 0) purity = desired/total;
591  return purity;
592  }
std::vector< sim::TrackSDP > OpHitToTrackSDPs(art::Ptr< recob::OpHit > const &hit)
double Area() const
Definition: OpHit.h:67
Float_t e
Definition: plot.C:34
const std::vector< const sim::SDP * > cheat::PhotonBackTracker::OpHitsToSimSDPs_Ps ( std::vector< art::Ptr< recob::OpHit > > const &  opHits_Ps) const

Definition at line 435 of file PhotonBackTracker.cc.

References OpHitToSimSDPs_Ps().

Referenced by OpHitsToXYZ().

436  {
437  std::vector < const sim::SDP* > sdps_Ps;
438  for ( auto opHit_P : opHits_Ps ){
439  std::vector < const sim::SDP* > to_add_sdps_Ps = this->OpHitToSimSDPs_Ps(opHit_P);
440  sdps_Ps.insert( sdps_Ps.end(), to_add_sdps_Ps.begin(), to_add_sdps_Ps.end() );
441  }
442  return sdps_Ps;
443  }
const std::vector< const sim::SDP * > OpHitToSimSDPs_Ps(recob::OpHit const &opHit) const
const std::vector< double > cheat::PhotonBackTracker::OpHitsToXYZ ( std::vector< art::Ptr< recob::OpHit > > const &  opHits_Ps) const

Definition at line 446 of file PhotonBackTracker.cc.

References OpHitsToSimSDPs_Ps(), and SimSDPsToXYZ().

Referenced by OpFlashToXYZ().

447  {
448  const std::vector<const sim::SDP*> SDPs_Ps = OpHitsToSimSDPs_Ps(opHits_Ps);
449  return this->SimSDPsToXYZ(SDPs_Ps);
450  }
std::vector< double > SimSDPsToXYZ(std::vector< sim::SDP > const &sdps)
const std::vector< const sim::SDP * > OpHitsToSimSDPs_Ps(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.

References OpHitToEveSDPs().

Referenced by GetSetOfEveIDs(), and OpHitToTrackID().

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)
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
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.

References sim::TrackSDP::energy, sim::TrackSDP::energyFrac, sim::ParticleList::EveId(), fParticleList, OpHitToTrackSDPs(), shouldThisFail(), and sim::TrackSDP::trackID.

Referenced by OpHitToEveID(), and OpHitToTrackID().

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 EveId(const int trackID) const
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)

Definition at line 453 of file PhotonBackTracker.cc.

References OpHitToEveTrackIds(), and TrackIdToSimSDPs_Ps().

Referenced by cheat::PhotonBackTrackerService::OpHitToEveSimSDPs_Ps().

454  { /*NEW*/ /*COMPLETE*/
455  const std::vector < int > ids = this->OpHitToEveTrackIds(opHit_P);
456  std::unordered_set <const sim::SDP* > sdps;
457  for( auto const& id : ids ){
458  std::vector<const sim::SDP* > tmp_sdps = TrackIdToSimSDPs_Ps(id);
459  for( const sim::SDP* tmp_sdp : tmp_sdps ){
460  sdps.insert(tmp_sdp); //emplace not needed here.
461  }
462  }
463  return sdps;
464  }
const std::vector< const sim::SDP * > TrackIdToSimSDPs_Ps(int const &id)
const std::vector< int > OpHitToEveTrackIds(recob::OpHit const &opHit)
const std::unordered_set< const sim::SDP * > cheat::PhotonBackTracker::OpHitToEveSimSDPs_Ps ( art::Ptr< recob::OpHit > &  opHit_P)

Definition at line 467 of file PhotonBackTracker.cc.

References OpHitToEveTrackIds(), and TrackIdToSimSDPs_Ps().

468  { /*NEW*/ /*COMPLETE*/
469  const std::vector < int > ids = this->OpHitToEveTrackIds(opHit);
470  std::unordered_set <const sim::SDP* > sdps;
471  for( auto const& id : ids ){
472  std::vector<const sim::SDP* > tmp_sdps = TrackIdToSimSDPs_Ps(id);
473  for( const sim::SDP* tmp_sdp : tmp_sdps ){
474  sdps.insert(tmp_sdp); //emplace not needed here.
475  }
476  }
477  return sdps;
478  }
const std::vector< const sim::SDP * > TrackIdToSimSDPs_Ps(int const &id)
const std::vector< int > OpHitToEveTrackIds(recob::OpHit const &opHit)
const std::vector< int > cheat::PhotonBackTracker::OpHitToEveTrackIds ( recob::OpHit const &  opHit)

Definition at line 219 of file PhotonBackTracker.cc.

References OpHitToEveTrackSDPs().

Referenced by OpHitToEveSimSDPs_Ps(), cheat::PhotonBackTrackerService::OpHitToEveTrackIds(), and OpHitToEveTrackIds().

220  {/*NEW*/ /*COMPLETE*/
221  std::vector< int > retVec;
222  for( auto const trackSDP : this->OpHitToEveTrackSDPs(opHit) ){
223  retVec.push_back( trackSDP.trackID);
224  }
225  return retVec;
226  }
const std::vector< sim::TrackSDP > OpHitToEveTrackSDPs(art::Ptr< recob::OpHit > const &opHit_P) const
const std::vector< int > cheat::PhotonBackTracker::OpHitToEveTrackIds ( art::Ptr< recob::OpHit > const &  opHit_P)

Definition at line 229 of file PhotonBackTracker.cc.

References OpHitToEveTrackIds().

230  {/*NEW*/ /*COMPLETE*/
231  return this->OpHitToEveTrackIds(*opHit_P);
232  }
const std::vector< int > OpHitToEveTrackIds(recob::OpHit const &opHit)
const std::vector< sim::TrackSDP > cheat::PhotonBackTracker::OpHitToEveTrackSDPs ( art::Ptr< recob::OpHit > const &  opHit_P) const

Definition at line 235 of file PhotonBackTracker.cc.

Referenced by GetSetOfEveIds(), OpHitToEveTrackIds(), and cheat::PhotonBackTrackerService::OpHitToEveTrackSDPs().

236  {
237  return this->OpHitToEveTrackSDPs(*opHit_P);
238  }
const std::vector< sim::TrackSDP > OpHitToEveTrackSDPs(art::Ptr< recob::OpHit > const &opHit_P) const
const std::vector< sim::TrackSDP > cheat::PhotonBackTracker::OpHitToEveTrackSDPs ( recob::OpHit const &  opHit) const

Definition at line 241 of file PhotonBackTracker.cc.

References sim::TrackSDP::energy, sim::TrackSDP::energyFrac, fPartInv, OpHitToTrackSDPs(), cheat::ParticleInventory::ParticleList(), and sim::TrackSDP::trackID.

242  {
243  std::vector<sim::TrackSDP> trackSDPs = this->OpHitToTrackSDPs(opHit);
244 
245  // make a map of evd ID values and fraction of energy represented by
246  // // that eve id in this opHit
247  std::map<int, float> eveIDtoEfrac;
248 
249  double totalE = 0.;
250  for(size_t t = 0; t < trackSDPs.size(); ++t){
251  eveIDtoEfrac[(fPartInv->ParticleList()).EveId( trackSDPs[t].trackID )] += trackSDPs[t].energy;
252  totalE += trackSDPs[t].energy;
253  }
254 
255  // now fill the eveSDPs vector from the map
256  std::vector<sim::TrackSDP> eveSDPs;
257  eveSDPs.reserve(eveIDtoEfrac.size());
258  for(auto itr = eveIDtoEfrac.begin(); itr != eveIDtoEfrac.end(); itr++){
259  sim::TrackSDP temp;
260  temp.trackID = (*itr).first;
261  temp.energyFrac = (*itr).second/totalE;
262  temp.energy = (*itr).second;
263  eveSDPs.push_back(std::move(temp));
264  }
265  return eveSDPs;
266  }
int trackID
Geant4 supplied trackID.
const cheat::ParticleInventory * fPartInv
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]
const sim::ParticleList & ParticleList() 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.

References fDelay, FindOpDetBacktrackerRecord(), geom, recob::OpHit::OpChannel(), geo::GeometryCore::OpDetFromOpChannel(), recob::OpHit::PeakTime(), shouldThisFail(), sim::OpDetBacktrackerRecord::TrackIDsAndEnergies(), and recob::OpHit::Width().

Referenced by OpHitToSDPs(), OpHitToSimSDPs(), OpHitToTrackID(), and OpHitToXYZ().

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.
double timePDclock_t
Type for iTimePDclock tick used in the interface.
const art::Ptr< sim::OpDetBacktrackerRecord > FindOpDetBacktrackerRecord(int channel) const
geo::GeometryCore const * geom
std::vector< sim::SDP > TrackIDsAndEnergies(timePDclock_t startTimePDclock, timePDclock_t endTimePDclock) const
Return all the recorded energy deposition within a time interval.
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 106 of file old.PhotonBackTrackerService.h.

References OpHitToSDPs().

108  { OpHitToSDPs(*hit, sdps); }
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 106 of file old.PhotonBackTracker.h.

References OpHitToSDPs().

108  { OpHitToSDPs(*hit, sdps); }
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 103 of file old.PhotonBackTracker.h.

References OpHitToSDPs().

105  { OpHitToSDPs( hit, sdps); }
void OpHitToSDPs(recob::OpHit const &hit, std::vector< sim::SDP > &sdps) const
Detector simulation of raw signals on wires.
DEPRECATED void cheat::PhotonBackTracker::OpHitToSimSDPs ( recob::OpHit const &  hit,
std::vector< sim::SDP > &  sdps 
) const
inline

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

References OpHitToSDPs().

105  { OpHitToSDPs( hit, sdps); }
void OpHitToSDPs(recob::OpHit const &hit, std::vector< sim::SDP > &sdps) const
Detector simulation of raw signals on wires.
DEPRECATED void cheat::PhotonBackTracker::OpHitToSimSDPs ( art::Ptr< recob::OpHit > const &  hit,
std::vector< sim::SDP > &  sdps 
) const
inline
DEPRECATED void cheat::PhotonBackTracker::OpHitToSimSDPs ( art::Ptr< recob::OpHit > const &  hit,
std::vector< sim::SDP > &  sdps 
) const
inline
const std::vector< const sim::SDP * > cheat::PhotonBackTracker::OpHitToSimSDPs_Ps ( recob::OpHit const &  opHit) const

Definition at line 315 of file PhotonBackTracker.cc.

References fDelay, fGeom, FindOpDetBTR(), recob::OpHit::OpChannel(), geo::GeometryCore::OpDetFromOpChannel(), recob::OpHit::PeakTime(), and recob::OpHit::Width().

Referenced by OpHitsToSimSDPs_Ps(), cheat::PhotonBackTrackerService::OpHitToSimSDPs_Ps(), OpHitToSimSDPs_Ps(), and OpHitToXYZ().

316  {
317  std::vector<const sim::SDP*> retVec;
318  double fPeakTime = opHit.PeakTime();
319  double fWidth = opHit.Width();
320  sim::OpDetBacktrackerRecord::timePDclock_t start_time = ((fPeakTime- fWidth)*1000.0)-fDelay;
321  sim::OpDetBacktrackerRecord::timePDclock_t end_time = ((fPeakTime+ fWidth)*1000.0)-fDelay;
322  if(start_time > end_time){throw;}
323 
324  //BUG!!!fGeom->OpDetFromOpChannel(channel)
325  const std::vector<std::pair<double, std::vector<sim::SDP>> >& timeSDPMap
326  = (this->FindOpDetBTR(fGeom->OpDetFromOpChannel(opHit.OpChannel()) ))->timePDclockSDPsMap(); //Not guranteed to be sorted.
327  //const std::vector<std::pair<double, std::vector<sim::SDP>> >& timeSDPMap = (this->FindOpDetBTR(opHit.OpChannel()))->timePDclockSDPsMap(); //Not guranteed to be sorted.
328 
329  std::vector<const std::pair<double, std::vector<sim::SDP>>*> timePDclockSDPMap_SortedPointers;
330  for ( auto& pair : timeSDPMap ){ timePDclockSDPMap_SortedPointers.push_back(&pair); }
331  auto pairSort = [](auto& a, auto& b) { return a->first < b->first ; } ;
332  if( !std::is_sorted( timePDclockSDPMap_SortedPointers.begin(), timePDclockSDPMap_SortedPointers.end(), pairSort)){
333  std::sort(timePDclockSDPMap_SortedPointers.begin(), timePDclockSDPMap_SortedPointers.end(), pairSort);
334  }
335 
336  //This section is a hack to make comparisons work right.
337  std::vector<sim::SDP> dummyVec;
338  std::pair<double, std::vector<sim::SDP>> start_timePair = std::make_pair(start_time, dummyVec);
339  std::pair<double, std::vector<sim::SDP>> end_timePair = std::make_pair(end_time, dummyVec);
340  auto start_timePair_P = &start_timePair;
341  auto end_timePair_P = &end_timePair;
342  //First interesting iterator.
343  auto mapFirst = std::lower_bound(timePDclockSDPMap_SortedPointers.begin(), timePDclockSDPMap_SortedPointers.end(), start_timePair_P, pairSort);
344  //Last interesting iterator.
345  auto mapLast = std::upper_bound(mapFirst, timePDclockSDPMap_SortedPointers.end(), end_timePair_P, pairSort);
346 
347  for( auto& mapitr = mapFirst; mapitr != mapLast; ++mapitr )
348  for( auto& sdp : (*mapitr)->second)
349  retVec.push_back(&sdp);
350 
351  return retVec;
352 
353  //sdps = FindOpDetBTR( geom->OpDetFromOpChannel(opHit. OpChannel()) )->TrackIDsAndEnergies(start_time, end_time);
354  // return (this->FindOpDetBTR( fGeom->OpDetFromOpChannel(opHit.OpChannel()) ))->TrackIDsAndEnergies(start_time, end_time);
355 
356  }
const art::Ptr< sim::OpDetBacktrackerRecord > FindOpDetBTR(int const &opDetNum) const
unsigned int OpDetFromOpChannel(int opChannel) const
Convert unique channel to detector number.
const geo::GeometryCore * fGeom
double timePDclock_t
Type for iTimePDclock tick used in the interface.
const std::vector< const sim::SDP * > cheat::PhotonBackTracker::OpHitToSimSDPs_Ps ( art::Ptr< recob::OpHit > const &  opHit_P) const

Definition at line 360 of file PhotonBackTracker.cc.

References OpHitToSimSDPs_Ps().

361  {
362  return this->OpHitToSimSDPs_Ps(*opHit_P);
363  }
const std::vector< const sim::SDP * > OpHitToSimSDPs_Ps(recob::OpHit const &opHit) const
DEPRECATED std::vector<sim::TrackSDP> cheat::PhotonBackTracker::OpHitToTrackID ( art::Ptr< recob::OpHit > const &  hit)
inline

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

References OpHitToEveID(), OpHitToEveSDPs(), OpHitToSDPs(), OpHitToTrackSDPs(), TrackIDsToOpHits(), and lar::dump::vector().

87  {return OpHitToTrackSDPs(hit);}
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 86 of file old.PhotonBackTrackerService.h.

References OpHitToEveID(), OpHitToEveSDPs(), OpHitToSDPs(), OpHitToTrackSDPs(), TrackIDsToOpHits(), and lar::dump::vector().

87  {return OpHitToTrackSDPs(hit);}
std::vector< sim::TrackSDP > OpHitToTrackSDPs(art::Ptr< recob::OpHit > const &hit)
const std::vector< int > cheat::PhotonBackTracker::OpHitToTrackIds ( recob::OpHit const &  opHit) const

Definition at line 203 of file PhotonBackTracker.cc.

References OpHitToTrackSDPs().

Referenced by OpFlashToTrackIds(), cheat::PhotonBackTrackerService::OpHitToTrackIds(), and OpHitToTrackIds().

204  {
205  std::vector< int > retVec;
206  for( auto const trackSDP : this->OpHitToTrackSDPs(opHit) ){
207  retVec.push_back( trackSDP.trackID);
208  }
209  return retVec;
210  }
std::vector< sim::TrackSDP > OpHitToTrackSDPs(art::Ptr< recob::OpHit > const &hit)
const std::vector< int > cheat::PhotonBackTracker::OpHitToTrackIds ( art::Ptr< recob::OpHit > const &  opHit) const

Definition at line 213 of file PhotonBackTracker.cc.

References OpHitToTrackIds().

214  {
215  return this->OpHitToTrackIds(*opHit);
216  }
const std::vector< int > OpHitToTrackIds(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.

References ChannelToTrackSDPs(), evd::details::end(), fDelay, recob::OpHit::OpChannel(), recob::OpHit::PeakTime(), shouldThisFail(), and recob::OpHit::Width().

Referenced by GetSetOfTrackIds(), OpHitChargeCollectionEfficiency(), OpHitChargeCollectionPurity(), OpHitCollectionEfficiency(), OpHitCollectionPurity(), OpHitLightCollectionEfficiency(), OpHitLightCollectionPurity(), OpHitToEveSDPs(), OpHitToEveTrackSDPs(), OpHitToTrackID(), OpHitToTrackIds(), and cheat::PhotonBackTrackerService::OpHitToTrackSDPs().

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)
std::vector< evd::details::RawDigitInfo_t >::const_iterator end(RawDigitCacheDataClass const &cache)
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

Definition at line 168 of file PhotonBackTracker.cc.

References evd::details::end(), fDelay, fGeom, recob::OpHit::OpChannel(), geo::GeometryCore::OpDetFromOpChannel(), OpDetToTrackSDPs(), recob::OpHit::PeakTime(), and recob::OpHit::Width().

169  {
170  //auto opHit = *opHit_P;
171  auto OpDetNum = fGeom->OpDetFromOpChannel(opHit_P->OpChannel()) ;
172  std::vector<sim::TrackSDP> trackSDPs;
173  const double pTime = opHit_P->PeakTime();
174  const double pWidth= opHit_P->Width();
175  const double start = (pTime-pWidth)*1000-fDelay;
176  const double end = (pTime+pWidth)*1000-fDelay;
177 
178  //this->OpDetToTrackSDPs(trackSDPs, opHit_P->OpChannel(), start, end);
179 
180 
181  //return trackSDPs;
182  //return this->OpDetToTrackSDPs( opHit_P->OpChannel(), start, end);
183  return this->OpDetToTrackSDPs( OpDetNum, start, end);
184 
185  }
double PeakTime() const
Definition: OpHit.h:64
unsigned int OpDetFromOpChannel(int opChannel) const
Convert unique channel to detector number.
double Width() const
Definition: OpHit.h:66
const geo::GeometryCore * fGeom
std::vector< evd::details::RawDigitInfo_t >::const_iterator end(RawDigitCacheDataClass const &cache)
int OpChannel() const
Definition: OpHit.h:62
const std::vector< sim::TrackSDP > OpDetToTrackSDPs(int const &OpDetNum, double const &opHit_start_time, double const &opHit_end_time) const
const std::vector< sim::TrackSDP > cheat::PhotonBackTracker::OpHitToTrackSDPs ( recob::OpHit const &  opHit) const

Definition at line 188 of file PhotonBackTracker.cc.

References evd::details::end(), fDelay, fGeom, recob::OpHit::OpChannel(), geo::GeometryCore::OpDetFromOpChannel(), OpDetToTrackSDPs(), recob::OpHit::PeakTime(), and recob::OpHit::Width().

189  {
190  auto OpDetNum = fGeom->OpDetFromOpChannel(opHit.OpChannel()) ;
191  std::vector<sim::TrackSDP> trackSDPs;
192  const double pTime = opHit.PeakTime();
193  const double pWidth= opHit.Width();
194  const double start = (pTime-pWidth)*1000-fDelay;
195  const double end = (pTime+pWidth)*1000-fDelay;
196 
197 
198  return this->OpDetToTrackSDPs( OpDetNum, start, end);
199 
200  }
unsigned int OpDetFromOpChannel(int opChannel) const
Convert unique channel to detector number.
const geo::GeometryCore * fGeom
std::vector< evd::details::RawDigitInfo_t >::const_iterator end(RawDigitCacheDataClass const &cache)
const std::vector< sim::TrackSDP > OpDetToTrackSDPs(int const &OpDetNum, double const &opHit_start_time, double const &opHit_end_time) const
std::vector<double> cheat::PhotonBackTracker::OpHitToXYZ ( art::Ptr< recob::OpHit > const &  hit)
const std::vector< double > cheat::PhotonBackTracker::OpHitToXYZ ( art::Ptr< recob::OpHit > const &  hit)

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

References DEFINE_ART_SERVICE, OpHitToSDPs(), shouldThisFail(), and SimSDPsToXYZ().

Referenced by OpHitToSimSDPs(), cheat::PhotonBackTrackerService::OpHitToXYZ(), and OpHitToXYZ().

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)

Definition at line 421 of file PhotonBackTracker.cc.

References OpHitToSimSDPs_Ps(), OpHitToXYZ(), and SimSDPsToXYZ().

422  {
423  return SimSDPsToXYZ(this->OpHitToSimSDPs_Ps(opHit));
424  }
std::vector< double > SimSDPsToXYZ(std::vector< sim::SDP > const &sdps)
const std::vector< const sim::SDP * > OpHitToSimSDPs_Ps(recob::OpHit const &opHit) const
const sim::ParticleList& cheat::PhotonBackTracker::ParticleList ( ) const
inline

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

References fParticleList.

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

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

References fParticleList.

66 { 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.

References shouldThisFail(), simb::MCParticle::TrackId(), and TrackIDToMCTruth().

Referenced by SetEveIdCalculator().

241  {
242  shouldThisFail();
243  return this->TrackIDToMCTruth(p->TrackId());
244  }
int TrackId() const
Definition: MCParticle.h:214
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.

References sim::ParticleList::Add(), sim::ParticleList::AdoptEveIdCalculator(), sim::ParticleList::clear(), cOpDetBacktrackerRecords, art::Handle< T >::failedToGet(), fG4ModuleLabel, art::fill_ptr_vector(), fMCTruthList, fParticleList, fTrackIDToMCTruthIndex, art::DataViewImpl::getByLabel(), GetSetOfTrackIDs(), have_complained, art::Event::isRealData(), LOG_DEBUG, part, art::errors::ProductNotFound, and art::Handle< T >::whyFailed().

57  {
58  // do nothing if this is data
59  if(evt.isRealData()) return;
60 
61  // get the particles from the event
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
77  fMCTruthList .clear();
78  cOpDetBacktrackerRecords .clear();
79  //fVoxelList .clear();
80 
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 
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.
143  }
144 
145 
146  // grab the voxel list for this event
147  //fVoxelList = sim::SimListUtils::GetLArVoxelList(evt, fG4ModuleLabel);
148 
150 
151  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  LOG_DEBUG("PhotonBackTracker") << *(fMCTruthList.at(mc).get());
158 
159  return;
160  }
std::map< int, int > fTrackIDToMCTruthIndex
map of track ids to MCTruthList entry
void Add(simb::MCParticle *value)
Definition: ParticleList.h:315
bool isRealData() const
Definition: Event.h:83
std::string fG4ModuleLabel
label for geant4 module
TString part[npart]
Definition: Style.C:32
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
Definition: DataViewImpl.h:344
MaybeLogger_< ELseverityLevel::ELsev_success, false > LogDebug
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
#define LOG_DEBUG(id)
std::shared_ptr< art::Exception const > whyFailed() const
Definition: Handle.h:220
void fill_ptr_vector(std::vector< Ptr< T >> &ptrs, H const &h)
Definition: Ptr.h:464
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
static void AdoptEveIdCalculator(EveIdCalculator *)
sim::ParticleList fParticleList
ParticleList to map track ID to sim::Particle.
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
bool failedToGet() const
Definition: Handle.h:197
void cheat::PhotonBackTracker::Rebuild ( const art::Event evt)
void cheat::PhotonBackTracker::reconfigure ( fhicl::ParameterSet const &  pset)

Referenced by ~PhotonBackTracker().

void cheat::PhotonBackTracker::reconfigure ( fhicl::ParameterSet const &  pset)
void cheat::PhotonBackTracker::SetEveIdCalculator ( sim::EveIdCalculator ec)
inline
void cheat::PhotonBackTracker::SetEveIdCalculator ( sim::EveIdCalculator ec)
inline
const void cheat::PhotonBackTracker::shouldThisFail ( ) const
private

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

References have_complained.

Referenced by ChannelToTrackSDPs(), FindOpDetBacktrackerRecord(), GetSetOfEveIDs(), GetSetOfTrackIDs(), MCTruthToParticles(), OpDetBacktrackerRecords(), OpHitChargeCollectionEfficiency(), OpHitChargeCollectionPurity(), OpHitCollectionEfficiency(), OpHitCollectionPurity(), OpHitToEveSDPs(), OpHitToSDPs(), OpHitToTrackSDPs(), OpHitToXYZ(), ParticleToMCTruth(), SimSDPsToXYZ(), TrackIDsToOpHits(), TrackIDToMCTruth(), TrackIDToMotherParticle(), TrackIDToParticle(), and TrackIDToSimSDP().

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  }
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
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.

References e, shouldThisFail(), w, weight, x, y, and z.

Referenced by OpHitsToXYZ(), OpHitToSimSDPs(), OpHitToXYZ(), and cheat::PhotonBackTrackerService::SimSDPsToXYZ().

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  }
Float_t x
Definition: compare.C:6
Float_t y
Definition: compare.C:6
Double_t z
Definition: plot.C:279
double weight
Definition: plottest35.C:25
Float_t e
Definition: plot.C:34
Float_t w
Definition: plot.C:23
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
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

Definition at line 366 of file PhotonBackTracker.cc.

References e, w, weight, x, y, and z.

367  {
368  std::vector<double> xyz(3, -999.);
369  double x = 0.;
370  double y = 0.;
371  double z = 0.;
372  double w = 0.;
373  // loop over photons.
374  for(auto const& sdp : sdps) {
375  double weight = sdp.numPhotons;
376  w += weight;
377  x += weight * sdp.x;
378  y += weight * sdp.y;
379  z += weight * sdp.z;
380  }// end loop over sim::SDPs
381  //If the sum of the weights is still zero, then fail to return a value.
382  //A hit with no contributing photons does't make sense.
383  if(w < 1.e-5)
384  throw cet::exception("PhotonBackTracker") << "No sim::SDPs providing non-zero number of photons"
385  << " can't determine originating location from truth\n";
386  xyz[0] = x/w;
387  xyz[1] = y/w;
388  xyz[2] = z/w;
389  return xyz;
390  }
Float_t x
Definition: compare.C:6
Float_t y
Definition: compare.C:6
Double_t z
Definition: plot.C:279
double weight
Definition: plottest35.C:25
Float_t e
Definition: plot.C:34
Float_t w
Definition: plot.C:23
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
const std::vector< double > cheat::PhotonBackTracker::SimSDPsToXYZ ( std::vector< const sim::SDP * > const &  sdps_Ps) const

Definition at line 393 of file PhotonBackTracker.cc.

References e, w, weight, x, y, and z.

394  {
395  std::vector<double> xyz(3, -999.);
396  double x = 0.;
397  double y = 0.;
398  double z = 0.;
399  double w = 0.;
400  // loop over photons.
401  for(const sim::SDP* sdp_P : sdps_Ps) {
402  auto& sdp = *sdp_P;
403  double weight = sdp.numPhotons;
404  w += weight;
405  x += weight * sdp.x;
406  y += weight * sdp.y;
407  z += weight * sdp.z;
408  }// end loop over sim::SDPs
409  //If the sum of the weights is still zero, then fail to return a value.
410  //A hit with no contributing photons does't make sense.
411  if(w < 1.e-5)
412  throw cet::exception("PhotonBackTracker") << "No sim::SDPs providing non-zero number of photons"
413  << " can't determine originating location from truth\n";
414  xyz[0] = x/w;
415  xyz[1] = y/w;
416  xyz[2] = z/w;
417  return xyz;
418  }
Float_t x
Definition: compare.C:6
Float_t y
Definition: compare.C:6
Double_t z
Definition: plot.C:279
double weight
Definition: plottest35.C:25
Float_t e
Definition: plot.C:34
Float_t w
Definition: plot.C:23
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
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.

References ChannelToTrackSDPs(), evd::details::end(), fDelay, fMinOpHitEnergyFraction, recob::OpHit::OpChannel(), recob::OpHit::PeakTime(), shouldThisFail(), and recob::OpHit::Width().

Referenced by OpHitToTrackID().

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  }
double PeakTime() const
Definition: OpHit.h:64
double Width() const
Definition: OpHit.h:66
void ChannelToTrackSDPs(std::vector< sim::TrackSDP > &trackSDPs, int channel, const double hit_start_time, const double hit_end_time)
double fMinOpHitEnergyFraction
minimum fraction of energy a track id has to
std::vector< evd::details::RawDigitInfo_t >::const_iterator end(RawDigitCacheDataClass const &cache)
int OpChannel() const
Definition: OpHit.h:62
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 
)

Definition at line 281 of file PhotonBackTracker.cc.

References evd::details::end(), fDelay, fGeom, fMinOpHitEnergyFraction, recob::OpHit::OpChannel(), geo::GeometryCore::OpDetFromOpChannel(), OpDetToTrackSDPs(), recob::OpHit::PeakTime(), and recob::OpHit::Width().

Referenced by cheat::PhotonBackTrackerService::TrackIdsToOpHits_Ps(), and TrackIdToOpHits_Ps().

282  {
283  std::vector<std::pair<int, art::Ptr<recob::OpHit>>> opHitList;
284  for(auto itr = hitsIn.begin(); itr != hitsIn.end(); ++itr) {
285  art::Ptr<recob::OpHit> const& opHit = *itr;
286  auto OpDetNum = fGeom->OpDetFromOpChannel(opHit->OpChannel());
287  const double pTime = opHit->PeakTime(), pWidth= opHit->Width();
288  const double start = (pTime-pWidth)*1000.0-fDelay, end = (pTime+ pWidth)*1000.0-fDelay;
289  std::vector<sim::TrackSDP> tids = this->OpDetToTrackSDPs( OpDetNum, start, end);
290  //std::vector<sim::TrackSDP> tids = this->OpDetToTrackSDPs( opHit->OpChannel(), start, end);
291  for(auto itid = tids.begin(); itid != tids.end(); ++itid) {
292  for(auto itkid = tkIds.begin(); itkid != tkIds.end(); ++itkid) {
293  if(itid->trackID == *itkid) {
294  if(itid->energyFrac > fMinOpHitEnergyFraction)
295  opHitList.push_back(std::make_pair(*itkid, opHit));
296  }
297  } // itkid
298  } // itid
299  } // itr
300  // now build the truOpHits vector that will be returned to the caller
301  std::vector<std::vector<art::Ptr<recob::OpHit>>> truOpHits;
302  // temporary vector containing opHits assigned to one MC particle
303  std::vector<art::Ptr<recob::OpHit>> tmpOpHits;
304  for(auto itkid = tkIds.begin(); itkid != tkIds.end(); ++itkid) {
305  tmpOpHits.clear();
306  for(auto itr = opHitList.begin(); itr != opHitList.end(); ++itr) {
307  if(*itkid == (*itr).first) tmpOpHits.push_back((*itr).second);
308  }
309  truOpHits.push_back(tmpOpHits);
310  }
311  return truOpHits;
312  }
double PeakTime() const
Definition: OpHit.h:64
unsigned int OpDetFromOpChannel(int opChannel) const
Convert unique channel to detector number.
double Width() const
Definition: OpHit.h:66
const geo::GeometryCore * fGeom
double fMinOpHitEnergyFraction
minimum fraction of energy a track id has to
std::vector< evd::details::RawDigitInfo_t >::const_iterator end(RawDigitCacheDataClass const &cache)
int OpChannel() const
Definition: OpHit.h:62
const std::vector< sim::TrackSDP > OpDetToTrackSDPs(int const &OpDetNum, double const &opHit_start_time, double const &opHit_end_time) const
const art::Ptr< simb::MCTruth > & cheat::PhotonBackTracker::TrackIDToMCTruth ( int const &  id) const

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

References fMCTruthList, fTrackIDToMCTruthIndex, and shouldThisFail().

Referenced by MCTruthToParticles(), ParticleToMCTruth(), and SetEveIdCalculator().

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
std::vector< art::Ptr< simb::MCTruth > > fMCTruthList
all the MCTruths for the event
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
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.

References sim::ParticleList::EveId(), fParticleList, shouldThisFail(), and TrackIDToParticle().

Referenced by SetEveIdCalculator().

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
int EveId(const int trackID) const
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 
)

Definition at line 270 of file PhotonBackTracker.cc.

References TrackIdsToOpHits_Ps().

Referenced by cheat::PhotonBackTrackerService::TrackIdToOpHits_Ps().

271  {
272  //One would think we would want to have this function defined, and call this function in the std::vector<tkids> to opHits, but that would require more loops (and a higher overhead.) Instead, to provide this, we will just call the existing std::vector<tkids>ToOpHits with an input of 1.
273  std::vector<int> tkidFake(1, tkId);
274  //std::vector<art::Ptr<recob::OpHit>> retVec = (this->TrackIdsToOpHits_Ps(tkidFake, hitsIn)).at(0);
275  // return (this->TrackIdsToOpHits_Ps(tkidFake, hitsIn));
276  const std::vector<art::Ptr<recob::OpHit>> out = (this->TrackIdsToOpHits_Ps(tkidFake, hitsIn)).at(0);
277  return out;
278  }
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 simb::MCParticle * cheat::PhotonBackTracker::TrackIDToParticle ( int const &  id) const

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

References sim::ParticleList::end(), sim::ParticleList::find(), fParticleList, and shouldThisFail().

Referenced by SetEveIdCalculator(), and TrackIDToMotherParticle().

174  {
175  shouldThisFail();
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  }
list_type::const_iterator const_iterator
Definition: ParticleList.h:132
iterator find(const key_type &key)
Definition: ParticleList.h:318
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
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.

References cOpDetBacktrackerRecords, and shouldThisFail().

Referenced by SetEveIdCalculator().

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  }
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)

Definition at line 95 of file PhotonBackTracker.cc.

References evd::details::end(), and priv_OpDetBTRs.

Referenced by OpHitToEveSimSDPs_Ps(), and cheat::PhotonBackTrackerService::TrackIdToSimSDPs_Ps().

96  {
97  std::vector< const sim::SDP* > sdp_Ps;
98  for(size_t odet=0; odet<priv_OpDetBTRs.size(); ++odet){
99  const auto & pdTimeSDPmap = priv_OpDetBTRs[odet]->timePDclockSDPsMap();
100  for(auto mapitr = pdTimeSDPmap.begin(); mapitr != pdTimeSDPmap. end(); mapitr++){
101  std::vector<sim::SDP> const& sdpvec = (*mapitr).second;
102  for(size_t iv = 0; iv < sdpvec.size(); ++iv){
103  // const sim::SDP* const sdp_P = &sdpvec[iv];
104  if( abs(sdpvec[iv].trackID) == id) sdp_Ps.push_back(&(sdpvec[iv]));
105  }
106  } // end loop over map from sim::OpDetBacktrackerRecord
107 
108 
109  }// end loop over sim::OpDetBacktrackerRecords
110  return sdp_Ps;
111  }
std::vector< art::Ptr< sim::OpDetBacktrackerRecord > > priv_OpDetBTRs
std::vector< evd::details::RawDigitInfo_t >::const_iterator end(RawDigitCacheDataClass const &cache)
const std::vector< const sim::SDP * > cheat::PhotonBackTracker::TrackIdToSimSDPs_Ps ( int const &  id,
geo::View_t const &  view 
)

Definition at line 114 of file PhotonBackTracker.cc.

115  {
116  throw cet::exception("PhotonBackTracker")
117  <<"PhotonBackTracker is not equiped to handle geo::Views.";
118  }
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33

Member Data Documentation

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

all the OpDetBacktrackerRecords for the event

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

Referenced by FindOpDetBacktrackerRecord(), OpDetBacktrackerRecords(), Rebuild(), and TrackIDToSimSDP().

const double cheat::PhotonBackTracker::fDelay
private

Definition at line 246 of file PhotonBackTracker.h.

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

label for geant4 module

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

Referenced by OpDetBacktrackerRecords(), Rebuild(), and ~PhotonBackTracker().

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

Definition at line 247 of file PhotonBackTracker.h.

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

Definition at line 244 of file PhotonBackTracker.h.

Referenced by OpHitToSimSDPs_Ps(), OpHitToTrackSDPs(), and TrackIdsToOpHits_Ps().

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

all the MCTruths for the event

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

Referenced by MCTruthVector(), OpDetBacktrackerRecords(), Rebuild(), and TrackIDToMCTruth().

double cheat::PhotonBackTracker::fMinOpHitEnergyFraction
private
const double cheat::PhotonBackTracker::fMinOpHitEnergyFraction
private

Definition at line 250 of file PhotonBackTracker.h.

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

Definition at line 249 of file PhotonBackTracker.h.

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

Definition at line 248 of file PhotonBackTracker.h.

sim::ParticleList cheat::PhotonBackTracker::fParticleList
private
const cheat::ParticleInventory* cheat::PhotonBackTracker::fPartInv
private

Definition at line 243 of file PhotonBackTracker.h.

Referenced by GetSetOfEveIds(), GetSetOfTrackIds(), and OpHitToEveTrackSDPs().

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

map of track ids to MCTruthList entry

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

Referenced by OpDetBacktrackerRecords(), Rebuild(), and TrackIDToMCTruth().

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 186 of file old.PhotonBackTracker.h.

Referenced by OpDetBacktrackerRecords().

geo::GeometryCore const * cheat::PhotonBackTracker::geom = lar::providerFrom<geo::Geometry>()
private
bool cheat::PhotonBackTracker::have_complained
private
std::vector<art::Ptr<sim::OpDetBacktrackerRecord> > cheat::PhotonBackTracker::priv_OpDetBTRs
mutableprivate
std::map< art::Ptr < recob::OpFlash >, std::vector < art::Ptr < recob::OpHit > > > cheat::PhotonBackTracker::priv_OpFlashToOpHits
private

Definition at line 252 of file PhotonBackTracker.h.

Referenced by ClearEvent(), OpFlashToOpHits_Ps(), and OpFlashToOpHitsReady().


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