LArSoft  v06_85_00
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
 
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 > > > fOpFlashToOpHits
 

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 35 of file PhotonBackTracker.cc.

39  :fPartInv (partInv),
40  fGeom (geom),
41 // fDetClocks (detClock),
42  fDelay (config.Delay()),
43  fG4ModuleLabel(config.G4ModuleLabel()),
44  fOpHitLabel(config.OpHitLabel()),
45  fOpFlashLabel(config.OpFlashLabel()),
46  fMinOpHitEnergyFraction(config.MinOpHitEnergyFraction())
47  {}
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 50 of file PhotonBackTracker.cc.

54  :fPartInv (partInv),
55  fGeom (geom),
56 // fDetClocks(detClock),
57  fDelay(pSet.get<double>("Delay")),
58  fG4ModuleLabel(pSet.get<art::InputTag>("G4ModuleLabel", "largeant")),
59  fOpHitLabel(pSet.get<art::InputTag>("OpHitLabel", "ophit")),
60  fOpFlashLabel(pSet.get<art::InputTag>("OpFlashLabel", "opflash")),
61  fMinOpHitEnergyFraction(pSet.get<double>("MinimumOpHitEnergyFraction", 0.1))
62  {}
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 70 of file PhotonBackTracker.cc.

References priv_OpDetBTRs.

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

71  {
72  return !( priv_OpDetBTRs.empty() ) ;
73  }
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 65 of file PhotonBackTracker.cc.

References priv_OpDetBTRs.

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

65  {
66  priv_OpDetBTRs.clear();
67  }
std::vector< art::Ptr< sim::OpDetBacktrackerRecord > > priv_OpDetBTRs
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 114 of file PhotonBackTracker.cc.

References priv_OpDetBTRs.

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

115  {
117  for(size_t sc = 0; sc < priv_OpDetBTRs.size(); ++sc){
118  //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
119  if(priv_OpDetBTRs.at(sc)->OpDetNum() == opDetNum) opDet = priv_OpDetBTRs.at(sc);
120  }
121  if(!opDet)
122  {
123  throw cet::exception("PhotonBackTracker2") << "No sim:: OpDetBacktrackerRecord corresponding "
124  << "to opDetNum: " << opDetNum << "\n";
125  }
126  return opDet;
127  }
std::vector< art::Ptr< sim::OpDetBacktrackerRecord > > priv_OpDetBTRs
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
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 473 of file PhotonBackTracker.cc.

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

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

474  {
475  //std::set<int> out = fPartInv->GetSetOfEveIds();
476  return fPartInv->GetSetOfEveIds();
477  //return out;
478  }
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 487 of file PhotonBackTracker.cc.

References OpHitToEveTrackSDPs().

488  {
489  std::set<int> eveIds;
490  for(auto const& opHit_P : opHits_Ps){
491  const std::vector<sim::TrackSDP> sdps = this->OpHitToEveTrackSDPs(opHit_P);
492  for(auto const& sdp : sdps){eveIds.insert(sdp.trackID);}//end sdps
493  }//End for hits
494  return eveIds;
495  }
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 498 of file PhotonBackTracker.cc.

References OpHitToEveTrackSDPs().

499  { /*NEW*/ /*COMPLETE*/
500  std::set<int> eveIds;
501  for(auto const& opHit : opHits){
502  const std::vector<sim::TrackSDP> sdps = this->OpHitToEveTrackSDPs(opHit);
503  for(auto const& sdp : sdps){eveIds.insert(sdp.trackID);}//end sdps
504  }//End for hits
505  return eveIds;
506  }
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 481 of file PhotonBackTracker.cc.

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

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

482  {
483  return fPartInv->GetSetOfTrackIds();
484  }
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 509 of file PhotonBackTracker.cc.

References OpHitToTrackSDPs().

510  {
511  std::set<int> tids;
512  for( auto const& opHit : opHits){
513  for(auto const& sdp : this->OpHitToTrackSDPs(opHit)) {
514  tids.insert(sdp.trackID);
515  }//End for TrackSDPs
516  }//End for hits
517  return tids;
518  }
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 521 of file PhotonBackTracker.cc.

References OpHitToTrackSDPs().

522  { /*NEW*/ /*COMPLETE*/
523  std::set<int> tids;
524  for( auto const& opHit : opHits){
525  for(auto const& sdp : this->OpHitToTrackSDPs(opHit)) {
526  tids.insert(sdp.trackID);
527  }//End for TrackSDPs
528  }//End for hits
529  return tids;
530  }
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 82 of file PhotonBackTracker.cc.

References priv_OpDetBTRs.

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

83  {
84  return priv_OpDetBTRs;
85  }
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 130 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().

132  {
133  std::vector< sim::TrackSDP > tSDPs;
134  double totalE=0;
135  try{
137  this->FindOpDetBTR(OpDetNum);
138  // ( fGeom->OpDetFromOpChannel(channel) );
139  std::vector<sim::SDP> simSDPs =
140  opDetBTR->TrackIDsAndEnergies(opHit_start_time, opHit_end_time);
141  for(size_t e = 0; e < simSDPs.size(); ++e)
142  totalE += simSDPs[e].energy;
143  if(totalE < 1.e-5) totalE = 1.;
144  for(size_t e = 0; e < simSDPs.size(); ++e){
145  if(simSDPs[e].trackID == sim::NoParticleId) continue;
146  sim::TrackSDP info;
147  info.trackID = simSDPs[e].trackID;
148  info.energyFrac = simSDPs[e].energy/totalE;
149  info.energy = simSDPs[e].energy;
150  tSDPs.push_back(info);
151  }
152  }
153  catch(cet::exception e){
154  mf::LogWarning("PhotonBackTracker")<<"Exception caught\n"
155  <<e;
156  }
157  return tSDPs;
158  }
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 696 of file PhotonBackTracker.cc.

References fOpFlashToOpHits.

Referenced by OpFlashToTrackIds(), and OpFlashToXYZ().

698  {//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.
699 
700  // art::FindManyP< recob::OpHit > fmoh(std::vector<art::Ptr<recob::OpFlash>>({flash_P}), evt, fOpHitLabel.label());
701  // std::vector<art::Ptr<recob::OpHit>> const& hits_Ps = fmoh.at(0);
702  std::vector<art::Ptr<recob::OpHit>> const& hits_Ps = fOpFlashToOpHits.at(flash_P);
703  return hits_Ps;
704 
705  }
std::map< art::Ptr< recob::OpFlash >, std::vector< art::Ptr< recob::OpHit > > > fOpFlashToOpHits
const bool cheat::PhotonBackTracker::OpFlashToOpHitsReady ( )

Definition at line 76 of file PhotonBackTracker.cc.

References fOpFlashToOpHits.

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

77  {
78  return !( fOpFlashToOpHits.empty() ) ;
79  }
std::map< art::Ptr< recob::OpFlash >, std::vector< art::Ptr< recob::OpHit > > > fOpFlashToOpHits
const std::set< int > cheat::PhotonBackTracker::OpFlashToTrackIds ( art::Ptr< recob::OpFlash > &  flash_P) const

Definition at line 716 of file PhotonBackTracker.cc.

References OpFlashToOpHits_Ps(), and OpHitToTrackIds().

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

716  {
717  std::vector<art::Ptr<recob::OpHit> > opHits_Ps = this->OpFlashToOpHits_Ps(flash_P);
718  std::set<int> ids;
719  for( auto& opHit_P : opHits_Ps){
720  for( const int& id : this->OpHitToTrackIds(opHit_P) ){
721  ids.insert( id) ;
722  } // end for ids
723  }// end for opHits
724  return ids;
725  }// 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 708 of file PhotonBackTracker.cc.

References OpFlashToOpHits_Ps(), and OpHitsToXYZ().

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

709  {
710  const std::vector< art::Ptr<recob::OpHit>> opHits_Ps = this->OpFlashToOpHits_Ps(flash_P);
711  const std::vector<double> retVec = this->OpHitsToXYZ(opHits_Ps);
712  return retVec;
713  }
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 596 of file PhotonBackTracker.cc.

References e, fMinOpHitEnergyFraction, and OpHitToTrackSDPs().

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

591  {
592  throw cet::exception("PhotonBackTracker")<<"This function is not supported. OpHits do not have type View.\n";
593  }
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 
)
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
const double cheat::PhotonBackTracker::OpHitCollectionPurity ( std::set< int > const &  tkIds,
std::vector< art::Ptr< recob::OpHit > > const &  opHits 
)

Definition at line 533 of file PhotonBackTracker.cc.

References e, and OpHitToTrackSDPs().

535  {
536  // get the list of EveIDs that correspond to the opHits in this collection
537  // if the EveID shows up in the input list of tkIds, then it counts
538  float total = 1.*opHits.size();;
539  float desired = 0.;
540  for(size_t h = 0; h < opHits.size(); ++h){
541  art::Ptr<recob::OpHit> opHit = opHits[h];
542  std::vector<sim::TrackSDP> opHitTrackSDPs = this->OpHitToTrackSDPs(opHit);
543  // don't double count if this opHit has more than one of the
544  // desired track IDs associated with it
545  for(size_t e = 0; e < opHitTrackSDPs.size(); ++e){
546  if(tkIds.find(opHitTrackSDPs[e].trackID) != tkIds.end()){
547  desired += 1.;
548  break;
549  }
550  }
551  }// end loop over opHits
552  double purity = 0.;
553  if(total > 0) purity = desired/total;
554  return purity;
555  }
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 646 of file PhotonBackTracker.cc.

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

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

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

641  {
642  throw cet::exception("PhotonBackTracker")<<"This function is not supported. OpHits do not have type View.\n";
643  }
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 558 of file PhotonBackTracker.cc.

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

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

560  {
561  // get the list of EveIDs that correspond to the opHits in this collection
562  // if the EveID shows up in the input list of tkIds, then it counts
563  float total = 0;
564  float desired = 0.;
565  // don't have to check the view in the opHits collection because
566  // those are assumed to be from the object we are testing and will
567  // the correct view by definition then.
568  for(size_t h = 0; h < opHits.size(); ++h){
569  art::Ptr<recob::OpHit> opHit = opHits[h];
570  std::vector<sim::TrackSDP> opHitTrackIDs = this->OpHitToTrackSDPs(opHit);
571  total+=opHit->Area(); // sum up the charge in the cluster
572  // don't double count if this opHit has more than one of the
573  // desired track IDs associated with it
574  for(size_t e = 0; e < opHitTrackIDs.size(); ++e){
575  if(tkIds.find(opHitTrackIDs[e].trackID) != tkIds.end()){
576  desired += opHit->Area();
577  break;
578  }
579  }
580  }// end loop over opHits
581  double purity = 0.;
582  if(total > 0) purity = desired/total;
583  return purity;
584  }
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 427 of file PhotonBackTracker.cc.

References OpHitToSimSDPs_Ps().

Referenced by OpHitsToXYZ().

428  {
429  std::vector < const sim::SDP* > sdps_Ps;
430  for ( auto opHit_P : opHits_Ps ){
431  std::vector < const sim::SDP* > to_add_sdps_Ps = this->OpHitToSimSDPs_Ps(opHit_P);
432  sdps_Ps.insert( sdps_Ps.end(), to_add_sdps_Ps.begin(), to_add_sdps_Ps.end() );
433  }
434  return sdps_Ps;
435  }
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 438 of file PhotonBackTracker.cc.

References OpHitsToSimSDPs_Ps(), and SimSDPsToXYZ().

Referenced by OpFlashToXYZ().

439  {
440  const std::vector<const sim::SDP*> SDPs_Ps = OpHitsToSimSDPs_Ps(opHits_Ps);
441  return this->SimSDPsToXYZ(SDPs_Ps);
442  }
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 445 of file PhotonBackTracker.cc.

References OpHitToEveTrackIds(), and TrackIdToSimSDPs_Ps().

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

446  { /*NEW*/ /*COMPLETE*/
447  const std::vector < int > ids = this->OpHitToEveTrackIds(opHit_P);
448  std::unordered_set <const sim::SDP* > sdps;
449  for( auto const& id : ids ){
450  std::vector<const sim::SDP* > tmp_sdps = TrackIdToSimSDPs_Ps(id);
451  for( const sim::SDP* tmp_sdp : tmp_sdps ){
452  sdps.insert(tmp_sdp); //emplace not needed here.
453  }
454  }
455  return sdps;
456  }
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 459 of file PhotonBackTracker.cc.

References OpHitToEveTrackIds(), and TrackIdToSimSDPs_Ps().

460  { /*NEW*/ /*COMPLETE*/
461  const std::vector < int > ids = this->OpHitToEveTrackIds(opHit);
462  std::unordered_set <const sim::SDP* > sdps;
463  for( auto const& id : ids ){
464  std::vector<const sim::SDP* > tmp_sdps = TrackIdToSimSDPs_Ps(id);
465  for( const sim::SDP* tmp_sdp : tmp_sdps ){
466  sdps.insert(tmp_sdp); //emplace not needed here.
467  }
468  }
469  return sdps;
470  }
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 212 of file PhotonBackTracker.cc.

References OpHitToEveTrackSDPs().

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

213  {/*NEW*/ /*COMPLETE*/
214  std::vector< int > retVec;
215  for( auto const trackSDP : this->OpHitToEveTrackSDPs(opHit) ){
216  retVec.push_back( trackSDP.trackID);
217  }
218  return retVec;
219  }
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 222 of file PhotonBackTracker.cc.

References OpHitToEveTrackIds().

223  {/*NEW*/ /*COMPLETE*/
224  return this->OpHitToEveTrackIds(*opHit_P);
225  }
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 228 of file PhotonBackTracker.cc.

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

229  {
230  return this->OpHitToEveTrackSDPs(*opHit_P);
231  }
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 234 of file PhotonBackTracker.cc.

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

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

309  {
310  std::vector<const sim::SDP*> retVec;
311  double fPeakTime = opHit.PeakTime();
312  double fWidth = opHit.Width();
313  sim::OpDetBacktrackerRecord::timePDclock_t start_time = ((fPeakTime- fWidth)*1000.0)-fDelay;
314  sim::OpDetBacktrackerRecord::timePDclock_t end_time = ((fPeakTime+ fWidth)*1000.0)-fDelay;
315  if(start_time > end_time){throw;}
316 
317  //BUG!!!fGeom->OpDetFromOpChannel(channel)
318  const std::vector<std::pair<double, std::vector<sim::SDP>> >& timeSDPMap
319  = (this->FindOpDetBTR(fGeom->OpDetFromOpChannel(opHit.OpChannel()) ))->timePDclockSDPsMap(); //Not guranteed to be sorted.
320  //const std::vector<std::pair<double, std::vector<sim::SDP>> >& timeSDPMap = (this->FindOpDetBTR(opHit.OpChannel()))->timePDclockSDPsMap(); //Not guranteed to be sorted.
321 
322  std::vector<const std::pair<double, std::vector<sim::SDP>>*> timePDclockSDPMap_SortedPointers;
323  for ( auto& pair : timeSDPMap ){ timePDclockSDPMap_SortedPointers.push_back(&pair); }
324  auto pairSort = [](auto& a, auto& b) { return a->first < b->first ; } ;
325  if( !std::is_sorted( timePDclockSDPMap_SortedPointers.begin(), timePDclockSDPMap_SortedPointers.end(), pairSort)){
326  std::sort(timePDclockSDPMap_SortedPointers.begin(), timePDclockSDPMap_SortedPointers.end(), pairSort);
327  }
328 
329  //This section is a hack to make comparisons work right.
330  std::vector<sim::SDP> dummyVec;
331  std::pair<double, std::vector<sim::SDP>> start_timePair = std::make_pair(start_time, dummyVec);
332  std::pair<double, std::vector<sim::SDP>> end_timePair = std::make_pair(end_time, dummyVec);
333  auto start_timePair_P = &start_timePair;
334  auto end_timePair_P = &end_timePair;
335  //First interesting iterator.
336  auto mapFirst = std::lower_bound(timePDclockSDPMap_SortedPointers.begin(), timePDclockSDPMap_SortedPointers.end(), start_timePair_P, pairSort);
337  //Last interesting iterator.
338  auto mapLast = std::upper_bound(mapFirst, timePDclockSDPMap_SortedPointers.end(), end_timePair_P, pairSort);
339 
340  for( auto& mapitr = mapFirst; mapitr != mapLast; ++mapitr )
341  for( auto& sdp : (*mapitr)->second)
342  retVec.push_back(&sdp);
343 
344  return retVec;
345 
346  //sdps = FindOpDetBTR( geom->OpDetFromOpChannel(opHit. OpChannel()) )->TrackIDsAndEnergies(start_time, end_time);
347  // return (this->FindOpDetBTR( fGeom->OpDetFromOpChannel(opHit.OpChannel()) ))->TrackIDsAndEnergies(start_time, end_time);
348 
349  }
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 352 of file PhotonBackTracker.cc.

References OpHitToSimSDPs_Ps().

353  {
354  return this->OpHitToSimSDPs_Ps(*opHit_P);
355  }
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 196 of file PhotonBackTracker.cc.

References OpHitToTrackSDPs().

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

197  {
198  std::vector< int > retVec;
199  for( auto const trackSDP : this->OpHitToTrackSDPs(opHit) ){
200  retVec.push_back( trackSDP.trackID);
201  }
202  return retVec;
203  }
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 206 of file PhotonBackTracker.cc.

References OpHitToTrackIds().

207  {
208  return this->OpHitToTrackIds(*opHit);
209  }
const std::vector< int > OpHitToTrackIds(recob::OpHit const &opHit) const
std::vector<sim::TrackSDP> cheat::PhotonBackTracker::OpHitToTrackSDPs ( art::Ptr< recob::OpHit > const &  hit)
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)
const std::vector< sim::TrackSDP > cheat::PhotonBackTracker::OpHitToTrackSDPs ( art::Ptr< recob::OpHit > const &  opHit_P) const

Definition at line 161 of file PhotonBackTracker.cc.

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

162  {
163  //auto opHit = *opHit_P;
164  auto OpDetNum = fGeom->OpDetFromOpChannel(opHit_P->OpChannel()) ;
165  std::vector<sim::TrackSDP> trackSDPs;
166  const double pTime = opHit_P->PeakTime();
167  const double pWidth= opHit_P->Width();
168  const double start = (pTime-pWidth)*1000-fDelay;
169  const double end = (pTime+pWidth)*1000-fDelay;
170 
171  //this->OpDetToTrackSDPs(trackSDPs, opHit_P->OpChannel(), start, end);
172 
173 
174  //return trackSDPs;
175  //return this->OpDetToTrackSDPs( opHit_P->OpChannel(), start, end);
176  return this->OpDetToTrackSDPs( OpDetNum, start, end);
177 
178  }
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 181 of file PhotonBackTracker.cc.

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

182  {
183  auto OpDetNum = fGeom->OpDetFromOpChannel(opHit.OpChannel()) ;
184  std::vector<sim::TrackSDP> trackSDPs;
185  const double pTime = opHit.PeakTime();
186  const double pWidth= opHit.Width();
187  const double start = (pTime-pWidth)*1000-fDelay;
188  const double end = (pTime+pWidth)*1000-fDelay;
189 
190 
191  return this->OpDetToTrackSDPs( OpDetNum, start, end);
192 
193  }
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
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
std::vector<double> cheat::PhotonBackTracker::OpHitToXYZ ( art::Ptr< recob::OpHit > const &  hit)
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 413 of file PhotonBackTracker.cc.

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

414  {
415  return SimSDPsToXYZ(this->OpHitToSimSDPs_Ps(opHit));
416  }
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)
void cheat::PhotonBackTracker::reconfigure ( fhicl::ParameterSet const &  pset)

Referenced by ~PhotonBackTracker().

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 358 of file PhotonBackTracker.cc.

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

359  {
360  std::vector<double> xyz(3, -999.);
361  double x = 0.;
362  double y = 0.;
363  double z = 0.;
364  double w = 0.;
365  // loop over photons.
366  for(auto const& sdp : sdps) {
367  double weight = sdp.numPhotons;
368  w += weight;
369  x += weight * sdp.x;
370  y += weight * sdp.y;
371  z += weight * sdp.z;
372  }// end loop over sim::SDPs
373  //If the sum of the weights is still zero, then fail to return a value.
374  //A hit with no contributing photons does't make sense.
375  if(w < 1.e-5)
376  throw cet::exception("PhotonBackTracker") << "No sim::SDPs providing non-zero number of photons"
377  << " can't determine originating location from truth\n";
378  xyz[0] = x/w;
379  xyz[1] = y/w;
380  xyz[2] = z/w;
381  return xyz;
382  }
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 385 of file PhotonBackTracker.cc.

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

386  {
387  std::vector<double> xyz(3, -999.);
388  double x = 0.;
389  double y = 0.;
390  double z = 0.;
391  double w = 0.;
392  // loop over photons.
393  for(const sim::SDP* sdp_P : sdps_Ps) {
394  auto& sdp = *sdp_P;
395  double weight = sdp.numPhotons;
396  w += weight;
397  x += weight * sdp.x;
398  y += weight * sdp.y;
399  z += weight * sdp.z;
400  }// end loop over sim::SDPs
401  //If the sum of the weights is still zero, then fail to return a value.
402  //A hit with no contributing photons does't make sense.
403  if(w < 1.e-5)
404  throw cet::exception("PhotonBackTracker") << "No sim::SDPs providing non-zero number of photons"
405  << " can't determine originating location from truth\n";
406  xyz[0] = x/w;
407  xyz[1] = y/w;
408  xyz[2] = z/w;
409  return xyz;
410  }
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 274 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().

275  {
276  std::vector<std::pair<int, art::Ptr<recob::OpHit>>> opHitList;
277  for(auto itr = hitsIn.begin(); itr != hitsIn.end(); ++itr) {
278  art::Ptr<recob::OpHit> const& opHit = *itr;
279  auto OpDetNum = fGeom->OpDetFromOpChannel(opHit->OpChannel());
280  const double pTime = opHit->PeakTime(), pWidth= opHit->Width();
281  const double start = (pTime-pWidth)*1000.0-fDelay, end = (pTime+ pWidth)*1000.0-fDelay;
282  std::vector<sim::TrackSDP> tids = this->OpDetToTrackSDPs( OpDetNum, start, end);
283  //std::vector<sim::TrackSDP> tids = this->OpDetToTrackSDPs( opHit->OpChannel(), start, end);
284  for(auto itid = tids.begin(); itid != tids.end(); ++itid) {
285  for(auto itkid = tkIds.begin(); itkid != tkIds.end(); ++itkid) {
286  if(itid->trackID == *itkid) {
287  if(itid->energyFrac > fMinOpHitEnergyFraction)
288  opHitList.push_back(std::make_pair(*itkid, opHit));
289  }
290  } // itkid
291  } // itid
292  } // itr
293  // now build the truOpHits vector that will be returned to the caller
294  std::vector<std::vector<art::Ptr<recob::OpHit>>> truOpHits;
295  // temporary vector containing opHits assigned to one MC particle
296  std::vector<art::Ptr<recob::OpHit>> tmpOpHits;
297  for(auto itkid = tkIds.begin(); itkid != tkIds.end(); ++itkid) {
298  tmpOpHits.clear();
299  for(auto itr = opHitList.begin(); itr != opHitList.end(); ++itr) {
300  if(*itkid == (*itr).first) tmpOpHits.push_back((*itr).second);
301  }
302  truOpHits.push_back(tmpOpHits);
303  }
304  return truOpHits;
305  }
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
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 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 263 of file PhotonBackTracker.cc.

References TrackIdsToOpHits_Ps().

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

264  {
265  //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.
266  std::vector<int> tkidFake(1, tkId);
267  //std::vector<art::Ptr<recob::OpHit>> retVec = (this->TrackIdsToOpHits_Ps(tkidFake, hitsIn)).at(0);
268  // return (this->TrackIdsToOpHits_Ps(tkidFake, hitsIn));
269  const std::vector<art::Ptr<recob::OpHit>> out = (this->TrackIdsToOpHits_Ps(tkidFake, hitsIn)).at(0);
270  return out;
271  }
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 88 of file PhotonBackTracker.cc.

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

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

89  {
90  std::vector< const sim::SDP* > sdp_Ps;
91  for(size_t odet=0; odet<priv_OpDetBTRs.size(); ++odet){
92  const auto & pdTimeSDPmap = priv_OpDetBTRs[odet]->timePDclockSDPsMap();
93  for(auto mapitr = pdTimeSDPmap.begin(); mapitr != pdTimeSDPmap. end(); mapitr++){
94  std::vector<sim::SDP> const& sdpvec = (*mapitr).second;
95  for(size_t iv = 0; iv < sdpvec.size(); ++iv){
96  // const sim::SDP* const sdp_P = &sdpvec[iv];
97  if( abs(sdpvec[iv].trackID) == id) sdp_Ps.push_back(&(sdpvec[iv]));
98  }
99  } // end loop over map from sim::OpDetBacktrackerRecord
100 
101 
102  }// end loop over sim::OpDetBacktrackerRecords
103  return sdp_Ps;
104  }
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 107 of file PhotonBackTracker.cc.

108  {
109  throw cet::exception("PhotonBackTracker")
110  <<"PhotonBackTracker is not equiped to handle geo::Views.";
111  }
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 235 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 236 of file PhotonBackTracker.h.

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

Definition at line 233 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 239 of file PhotonBackTracker.h.

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

Definition at line 238 of file PhotonBackTracker.h.

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

Definition at line 241 of file PhotonBackTracker.h.

Referenced by OpFlashToOpHits_Ps(), and OpFlashToOpHitsReady().

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

Definition at line 237 of file PhotonBackTracker.h.

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

Definition at line 232 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

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