14 #ifndef CHEAT_PHOTONBACKTRACKER_H
15 #define CHEAT_PHOTONBACKTRACKER_H
19 #include <unordered_set>
23 #include "canvas/Persistency/Common/Ptr.h"
24 #include "canvas/Utilities/InputTag.h"
25 #include "fhiclcpp/types/Atom.h"
26 #include "fhiclcpp/types/Sequence.h"
34 namespace cheat {
class ParticleInventory; }
35 namespace fhicl {
class ParameterSet; }
36 namespace geo {
class GeometryCore; }
43 class PhotonBackTracker
48 fhicl::Atom<double>
Delay{
fhicl::Name(
"Delay"), fhicl::Comment(
"The delay time needed to correctly account for the optical simulation and optical systems simulation. (The time between when a g4partcile was made, and when the simulation write out says a signal was recorded)."), 0};
49 fhicl::Atom<art::InputTag>
G4ModuleLabel{
fhicl::Name(
"G4ModuleLabel"), fhicl::Comment(
"The label of the LArG4 module used to produce the art file we will be using."),
"largeant"};
50 fhicl::Sequence<art::InputTag>
G4ModuleLabels{
fhicl::Name(
"G4ModuleLabels"), fhicl::Comment(
"The labels of the LArG4 modules used to produce the art file we will be using."), fhicl::Sequence<art::InputTag>::default_type{}};
51 fhicl::Atom<art::InputTag>
OpHitLabel{
fhicl::Name(
"OpHitLabel"), fhicl::Comment(
"The default label for the module to use when grabbing OpHits"),
"ophit"};
52 fhicl::Atom<art::InputTag>
OpFlashLabel{
fhicl::Name(
"OpFlashLabel"), fhicl::Comment(
"The default label for the module to use when grabbing OpFlash"),
"opflash"};
53 fhicl::Atom<double>
MinOpHitEnergyFraction{
fhicl::Name(
"MinOpHitEnergyFraction"), fhicl::Comment(
"The minimum contribution an energy deposit must make to a Hit to be considered part of that hit."),0.010};
72 template<
typename Evt>
76 template<
typename Evt>
80 template<
typename Evt>
84 template<
typename Evt>
88 const std::vector< art::Ptr<recob::OpHit> >
OpFlashToOpHits_Ps(art::Ptr< recob::OpFlash >& flash_P)
const;
91 const std::vector<double>
OpFlashToXYZ(art::Ptr<recob::OpFlash>& flash_P)
const ;
109 std::vector<art::Ptr<sim::OpDetBacktrackerRecord>>
const&
OpDetBTRs() ;
118 const art::Ptr< sim::OpDetBacktrackerRecord >
FindOpDetBTR(
int const& opDetNum)
const;
123 const std::vector < sim::TrackSDP >
OpDetToTrackSDPs(
int const& OpDetNum,
double const& opHit_start_time,
double const& opHit_end_time)
const;
126 const std::vector< sim::TrackSDP>
OpHitToTrackSDPs(art::Ptr<recob::OpHit>
const& opHit_P)
const ;
135 const std::vector < int >
OpHitToTrackIds(art::Ptr<recob::OpHit>
const& opHit)
const;
144 const std::vector< sim::TrackSDP>
OpHitToEveTrackSDPs(art::Ptr<recob::OpHit>
const& opHit_P)
const;
153 const std::vector<std::vector<art::Ptr<recob::OpHit>>>
TrackIdsToOpHits_Ps( std::vector< int>
const& tkIds,
std::vector<art::Ptr<recob::OpHit>>
const& hitsIn) ;
159 const std::vector< const sim::SDP* >
OpHitToSimSDPs_Ps( art::Ptr<recob::OpHit>
const& opHit_P)
const;
167 const std::vector< double >
SimSDPsToXYZ(std::vector<sim::SDP>
const& sdps)
const&;
170 const std::vector< double >
SimSDPsToXYZ(std::vector<const sim::SDP*>
const& sdps_Ps )
const&;
173 const std::vector< double >
OpHitToXYZ(art::Ptr<recob::OpHit>
const& opHit) ;
179 const std::vector< double >
OpHitsToXYZ(
std::vector < art::Ptr < recob::OpHit > >
const& opHits_Ps)
const;
185 const std::unordered_set<const sim::SDP*>
OpHitToEveSimSDPs_Ps(art::Ptr<recob::OpHit>& opHit_P);
197 const std::set< int>
GetSetOfEveIds(std::vector< recob::OpHit >
const& opHits)
const ;
203 const std::set< int>
GetSetOfTrackIds(std::vector< recob::OpHit >
const& opHits)
const;
213 std::vector< art::Ptr< recob::OpHit > >
const& opHits,
214 std::vector< art::Ptr< recob::OpHit > >
const& opHitsIn) ;
218 std::vector< art::Ptr< recob::OpHit > >
const& opHits,
219 std::vector< art::Ptr< recob::OpHit > >
const& opHitsIn,
224 std::vector< art::Ptr< recob::OpHit > >
const& opHits,
225 std::vector< art::Ptr< recob::OpHit > >
const& opHitsIn) ;
229 std::vector< art::Ptr< recob::OpHit > >
const& opHits,
230 std::vector< art::Ptr< recob::OpHit > >
const& opHitsIn,
260 #include "PhotonBackTracker.tcc"
fhicl::Atom< art::InputTag > G4ModuleLabel
const std::unordered_set< const sim::SDP * > OpHitToEveSimSDPs_Ps(recob::OpHit const &opHit)
const art::Ptr< sim::OpDetBacktrackerRecord > FindOpDetBTR(int const &opDetNum) const
fhicl::Atom< art::InputTag > OpHitLabel
const std::vector< const sim::SDP * > OpHitsToSimSDPs_Ps(std::vector< art::Ptr< recob::OpHit > > const &opHits_Ps) const
const double fMinOpHitEnergyFraction
std::vector< double > OpHitToXYZ(art::Ptr< recob::OpHit > const &hit)
fhicl::Atom< double > Delay
const bool CanRun(Evt const &evt)
const art::InputTag fG4ModuleLabel
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
std::vector< double > SimSDPsToXYZ(std::vector< sim::SDP > const &sdps)
void PrepOpFlashToOpHits(Evt const &evt)
const std::vector< art::Ptr< recob::OpHit > > OpFlashToOpHits_Ps(art::Ptr< recob::OpFlash > &flash_P) const
double OpHitCollectionPurity(std::set< int > trackIDs, std::vector< art::Ptr< recob::OpHit > > const &hits)
const std::set< int > OpFlashToTrackIds(art::Ptr< recob::OpFlash > &flash_P) const
const std::vector< const sim::SDP * > TrackIdToSimSDPs_Ps(int const &id)
fhicl::Atom< art::InputTag > OpFlashLabel
const std::vector< const sim::SDP * > OpHitToSimSDPs_Ps(recob::OpHit const &opHit) const
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
void PrepOpDetBTRs(Evt const &evt)
const cheat::ParticleInventory * fPartInv
std::vector< art::Ptr< sim::OpDetBacktrackerRecord > > priv_OpDetBTRs
const geo::GeometryCore * fGeom
const std::set< int > GetSetOfEveIds() const
const double OpHitLightCollectionEfficiency(std::set< int > const &tkIds, std::vector< art::Ptr< recob::OpHit > > const &opHits, std::vector< art::Ptr< recob::OpHit > > const &opHitsIn)
fhicl::Sequence< art::InputTag > G4ModuleLabels
double OpHitCollectionEfficiency(std::set< int > trackIDs, std::vector< art::Ptr< recob::OpHit > > const &hits, std::vector< art::Ptr< recob::OpHit > > const &allhits)
const std::set< int > GetSetOfTrackIds() const
BEGIN_PROLOG vertical distance to the surface Name
const std::vector< sim::TrackSDP > OpHitToEveTrackSDPs(art::Ptr< recob::OpHit > const &opHit_P) const
const double OpHitLightCollectionPurity(std::set< int > const &tkIds, std::vector< art::Ptr< recob::OpHit > > const &opHits)
Description of geometry of one entire detector.
Definition of data types for geometry description.
const std::vector< double > OpFlashToXYZ(art::Ptr< recob::OpFlash > &flash_P) const
const std::vector< int > OpHitToEveTrackIds(recob::OpHit const &opHit)
const art::InputTag fOpFlashLabel
std::vector< sim::TrackSDP > OpHitToTrackSDPs(art::Ptr< recob::OpHit > const &hit)
fhicl::Atom< double > MinOpHitEnergyFraction
PhotonBackTracker(fhicl::ParameterSet const &pset, art::ActivityRegistry ®)
const std::vector< art::InputTag > fG4ModuleLabels
std::vector< art::Ptr< sim::OpDetBacktrackerRecord > > const & OpDetBTRs()
geo::GeometryCore const * geom
const std::vector< int > OpHitToTrackIds(recob::OpHit const &opHit) const
const std::vector< double > OpHitsToXYZ(std::vector< art::Ptr< recob::OpHit > > const &opHits_Ps) const
const art::InputTag fOpHitLabel
const std::vector< art::Ptr< recob::OpHit > > TrackIdToOpHits_Ps(int const &tkId, std::vector< art::Ptr< recob::OpHit >> const &hitsIn)
void PrepEvent(Evt const &evt)
const bool OpFlashToOpHitsReady()
std::map< art::Ptr< recob::OpFlash >, std::vector< art::Ptr< recob::OpHit > > > priv_OpFlashToOpHits
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< sim::TrackSDP > OpDetToTrackSDPs(int const &OpDetNum, double const &opHit_start_time, double const &opHit_end_time) const