PhotonBackTrackerService.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 //
3 // \file: PhotonBackTrackerServiceService_service.cc
4 //
5 //jason.stock@mines.sdsmt.edu
6 //Based on the BackTracker_service by Brian Rebel
7 //
8 ////////////////////////////////////////////////////////////////////////
9 #ifndef CHEAT_PHOTONBACKTRACKERSERVICESERVICE_H
10 #define CHEAT_PHOTONBACKTRACKERSERVICESERVICE_H
11 
12 //INCLUDES
13 #include <map>
14 
15 // Framework includes
16 #include "fhiclcpp/ParameterSet.h"
23 
24 // LArSoft includes
29 
30 //Larsoft Services
34 
35 namespace cheat{
37  {
38  public:
39  struct fhiclConfig{
41  fhicl::Name("PhotonBackTracker"),
42  fhicl::Comment("This if the fhicl configuration of the PhotonBackTracker service provider.")
43  };
44  };
45 
47  const provider_type* provider() const
48  {return static_cast<provider_type const*>(this);}
49 
52 
53  //Temporarily include a rebuild function until the lazy rebuild works.
54 
55  void Rebuild( art::Event const& evt);
56 
57  ///////////////////////////////////////////////
58  /////BackTracking Functions Implimentation/////
59  // This section contains the implimentation //
60  // of all PhotonBackTrackerService end user //
61  // functionality //
62  ///////////////////////////////////////////////
63 
64 
65  //----------------------------------------------------------------------
66  const std::vector< art::Ptr< sim::OpDetBacktrackerRecord >>& OpDetBTRs() ;
67  const double GetDelay();
68  const std::vector< const sim::SDP* > TrackIdToSimSDPs_Ps(int const& id);
69  const std::vector< const sim::SDP* > TrackIdToSimSDPs_Ps(int const& id, geo::View_t const& view);
71  const std::vector < sim::TrackSDP > OpDetToTrackSDPs( int const& OpDetNum,
72  double const& opHit_start_time, double const& opHit_end_time);
73  std::vector<sim::TrackSDP> OpHitToTrackSDPs(art::Ptr<recob::OpHit> const& opHit_P );
74  std::vector<sim::TrackSDP> OpHitToTrackSDPs(recob::OpHit const& opHit);
75  const std::vector < int > OpHitToTrackIds(recob::OpHit const& opHit);
76  const std::vector < int > OpHitToTrackIds(art::Ptr<recob::OpHit> const& opHit_P);
77  const std::vector < int > OpHitToEveTrackIds(recob::OpHit const& opHit);
78  const std::vector < int > OpHitToEveTrackIds(art::Ptr<recob::OpHit> const& opHit_P);
79  std::vector<sim::TrackSDP> OpHitToEveTrackSDPs(art::Ptr<recob::OpHit> const& opHit_P );
80  std::vector<sim::TrackSDP> OpHitToEveTrackSDPs(recob::OpHit const& opHit);
81  const std::vector<art::Ptr<recob::OpHit>> TrackIdToOpHits_Ps(int const& tkId, std::vector<art::Ptr<recob::OpHit>> const& hitsIn);
82  const std::vector<std::vector<art::Ptr<recob::OpHit>>> TrackIdsToOpHits_Ps(std::vector<int> const& tkIds, std::vector<art::Ptr<recob::OpHit>> const& hitsIn);
83  const std::vector< const sim::SDP* > OpHitToSimSDPs_Ps(recob::OpHit const& opHit) ;
84  const std::vector< const sim::SDP* > OpHitToSimSDPs_Ps(art::Ptr<recob::OpHit> const& opHit_P) ;
85 // const std::vector< sim::SDP > OpHitToChannelWeightedSimSDPs(art::Ptr<recob::OpHit> const& opHit_P);
86  const std::unordered_set< const sim::SDP* > OpHitToEveSimSDPs_Ps(recob::OpHit const& opHit) ;
87  const std::unordered_set< const sim::SDP* > OpHitToEveSimSDPs_Ps(art::Ptr<recob::OpHit>& opHit_P) ;
88  const std::vector< double> SimSDPsToXYZ(std::vector<sim::SDP> const& sdps ) const& ;
89  const std::vector< double> SimSDPsToXYZ(std::vector<const sim::SDP*> const& sdps_Ps);
90  const std::vector< double> OpHitToXYZ(recob::OpHit const& opHit);
91  const std::vector< double> OpHitToXYZ(art::Ptr<recob::OpHit> const& opHit_P);
92  const std::set< int> GetSetOfEveIds();
93  const std::set< int> GetSetOfTrackIds();
94  const std::set< int> GetSetOfEveIds(std::vector< art::Ptr<recob::OpHit> > const& opHits_Ps);
95  const std::set< int> GetSetOfEveIds(const std::vector< recob::OpHit >& opHits);
96  const std::set< int> GetSetOfTrackIds(std::vector< art::Ptr<recob::OpHit> > const& opHits_Ps);
97  const std::set< int> GetSetOfTrackIds(std::vector< recob::OpHit > const& opHits);
98  const double OpHitCollectionPurity(std::set<int> const& tkIds,
99  std::vector< art::Ptr<recob::OpHit> > const& opHits_Ps);
100  const double OpHitLightCollectionPurity(std::set<int> const& tkIds,
101  std::vector< art::Ptr<recob::OpHit> > const& opHits_Ps);
102  const double OpHitCollectionEfficiency(std::set<int> const& tkIds,
103  std::vector< art::Ptr<recob::OpHit> > const& opHits_Ps,
104  std::vector< art::Ptr<recob::OpHit> > const& opHitsIn_Ps,
105  geo::View_t const& view);
106  const double OpHitCollectionEfficiency(std::set<int> const& tkIds,
107  std::vector< art::Ptr<recob::OpHit> > const& opHits_Ps,
108  std::vector< art::Ptr<recob::OpHit> > const& opHitsIn_Ps);
109  const double OpHitLightCollectionEfficiency(std::set<int> const& tkIds,
110  std::vector< art::Ptr<recob::OpHit> > const& opHits_Ps,
111  std::vector< art::Ptr<recob::OpHit> > const& opHitsIn_Ps,
112  geo::View_t const& view);
113  const double OpHitLightCollectionEfficiency(std::set<int> const& tkIds,
114  std::vector< art::Ptr<recob::OpHit> > const& opHits_Ps,
115  std::vector< art::Ptr<recob::OpHit> > const& opHitsIn_Ps);
116  const double OpHitChargeCollectionEfficiency(std::set<int> const& tkIds,
117  std::vector< art::Ptr<recob::OpHit> > const& opHits_Ps,
118  std::vector< art::Ptr<recob::OpHit> > const& opHitsIn_Ps) { return PhotonBackTracker::OpHitLightCollectionEfficiency(tkIds, opHits_Ps, opHitsIn_Ps); }//Exists only temporarily. Is deprecated.
119  const std::set<int> OpFlashToTrackIds(art::Ptr<recob::OpFlash>& flash_P) const;
120  const std::vector < art::Ptr< recob::OpHit> > OpFlashToOpHits_Ps ( art::Ptr < recob::OpFlash > & flash_P );
121  const std::vector < double > OpFlashToXYZ ( art::Ptr < recob::OpFlash > & flash_P );
122 
123 
124 
125  private:
126  //The PhotonBackTrackerService has no parameters.
127 
129  void priv_PrepFailed();
130  void priv_PrepOpDetBTRs(art::Event const& evt);
131  void priv_PrepOpFlashToOpHits(art::Event const& evt);
132 
133  bool priv_CanRun(art::Event const& evt);
136 
137  }; //Class PhotonBackTrackerService
138 
139 
140 
141  //----------------------------------------------------------------------
142 } // namespace
144 
145 #endif //CHEAT_PHOTONBACKTRACKERSERVICESERVICE_H
art::Ptr< sim::OpDetBacktrackerRecord > FindOpDetBTR(int const &opDetNum)
const std::vector< art::Ptr< recob::OpHit > > OpFlashToOpHits_Ps(art::Ptr< recob::OpFlash > &flash_P)
const double OpHitLightCollectionPurity(std::set< int > const &tkIds, std::vector< art::Ptr< recob::OpHit > > const &opHits_Ps)
const std::vector< const sim::SDP * > OpHitToSimSDPs_Ps(recob::OpHit const &opHit)
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
const std::unordered_set< const sim::SDP * > OpHitToEveSimSDPs_Ps(recob::OpHit const &opHit)
const std::vector< double > SimSDPsToXYZ(std::vector< sim::SDP > const &sdps) const &
const std::vector< art::Ptr< recob::OpHit > > TrackIdToOpHits_Ps(int const &tkId, std::vector< art::Ptr< recob::OpHit >> const &hitsIn)
struct vector vector
ChannelGroupService::Name Name
const std::vector< int > OpHitToEveTrackIds(recob::OpHit const &opHit)
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 double OpHitCollectionPurity(std::set< int > const &tkIds, std::vector< art::Ptr< recob::OpHit > > const &opHits_Ps)
const std::vector< double > OpHitToXYZ(recob::OpHit const &opHit)
art framework interface to geometry description
const std::vector< art::Ptr< sim::OpDetBacktrackerRecord > > & OpDetBTRs()
const double OpHitChargeCollectionEfficiency(std::set< int > const &tkIds, std::vector< art::Ptr< recob::OpHit > > const &opHits_Ps, std::vector< art::Ptr< recob::OpHit > > const &opHitsIn_Ps)
#define DECLARE_ART_SERVICE(svc, scope)
static Config * config
Definition: config.cpp:1054
const double OpHitLightCollectionEfficiency(std::set< int > const &tkIds, std::vector< art::Ptr< recob::OpHit > > const &opHits, std::vector< art::Ptr< recob::OpHit > > const &opHitsIn)
std::vector< sim::TrackSDP > OpHitToTrackSDPs(art::Ptr< recob::OpHit > const &opHit_P)
back track the reconstruction to the simulation
const std::vector< const sim::SDP * > TrackIdToSimSDPs_Ps(int const &id)
const provider_type * provider() const
fhicl::Table< PhotonBackTracker::fhiclConfig > PhotonBackTrackerTable
const std::vector< sim::TrackSDP > OpDetToTrackSDPs(int const &OpDetNum, double const &opHit_start_time, double const &opHit_end_time)
const double OpHitLightCollectionEfficiency(std::set< int > const &tkIds, std::vector< art::Ptr< recob::OpHit > > const &opHits_Ps, std::vector< art::Ptr< recob::OpHit > > const &opHitsIn_Ps, geo::View_t const &view)
const std::vector< double > OpFlashToXYZ(art::Ptr< recob::OpFlash > &flash_P)
const double OpHitCollectionEfficiency(std::set< int > const &tkIds, std::vector< art::Ptr< recob::OpHit > > const &opHits_Ps, std::vector< art::Ptr< recob::OpHit > > const &opHitsIn_Ps, geo::View_t const &view)
PhotonBackTracker(fhicl::ParameterSet const &pset, art::ActivityRegistry &reg)
code to link reconstructed objects back to the MC truth information
Definition: BackTracker.cc:22
#define Comment
PhotonBackTrackerService(fhicl::ParameterSet const &pSet, art::ActivityRegistry &reg)
Access the description of detector geometry.
void priv_PrepEvent(art::Event const &evt, art::ScheduleContext)
const std::vector< int > OpHitToTrackIds(recob::OpHit const &opHit)
TCEvent evt
Definition: DataStructs.cxx:7
const std::set< int > OpFlashToTrackIds(art::Ptr< recob::OpFlash > &flash_P) const
std::vector< sim::TrackSDP > OpHitToEveTrackSDPs(art::Ptr< recob::OpHit > const &opHit_P)
void priv_PrepOpFlashToOpHits(art::Event const &evt)