LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
PhotonBackTrackerService.h
Go to the documentation of this file.
1 //
3 // \file: PhotonBackTrackerServiceService_service.cc
4 //
5 //jason.stock@mines.sdsmt.edu
6 //Based on the BackTracker_service by Brian Rebel
7 //
9 #ifndef CHEAT_PHOTONBACKTRACKERSERVICESERVICE_H
10 #define CHEAT_PHOTONBACKTRACKERSERVICESERVICE_H
11 
18 
19 namespace art {
20  class ActivityRegistry;
21  class Event;
22 }
23 
25 
26 #include "fhiclcpp/types/Comment.h"
27 #include "fhiclcpp/types/Name.h"
28 #include "fhiclcpp/types/Table.h"
29 
30 namespace fhicl {
31  class ParameterSet;
32 }
33 
34 #include <set>
35 #include <vector>
36 
37 namespace cheat {
39  public:
40  struct fhiclConfig {
42  fhicl::Name("PhotonBackTracker"),
44  "This if the fhicl configuration of the PhotonBackTracker service provider.")};
45  };
46 
48  const provider_type* provider() const { 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 
59  // This section contains the implimentation //
60  // of all PhotonBackTrackerService end user //
61  // functionality //
63 
64  //----------------------------------------------------------------------
65  const std::vector<art::Ptr<sim::OpDetBacktrackerRecord>>& OpDetBTRs();
66  const double GetDelay();
67  const std::vector<const sim::SDP*> TrackIdToSimSDPs_Ps(int const& id);
68  const std::vector<const sim::SDP*> TrackIdToSimSDPs_Ps(int const& id, geo::View_t const& view);
69  art::Ptr<sim::OpDetBacktrackerRecord> FindOpDetBTR(int const& opDetNum);
70  const std::vector<sim::TrackSDP> OpDetToTrackSDPs(int const& OpDetNum,
71  double const& opHit_start_time,
72  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(
82  int const& tkId,
83  std::vector<art::Ptr<recob::OpHit>> const& hitsIn);
84  const std::vector<std::vector<art::Ptr<recob::OpHit>>> TrackIdsToOpHits_Ps(
85  std::vector<int> const& tkIds,
86  std::vector<art::Ptr<recob::OpHit>> const& hitsIn);
87  const std::vector<const sim::SDP*> OpHitToSimSDPs_Ps(recob::OpHit const& opHit);
88  const std::vector<const sim::SDP*> OpHitToSimSDPs_Ps(art::Ptr<recob::OpHit> const& opHit_P);
89  // const std::vector< sim::SDP > OpHitToChannelWeightedSimSDPs(art::Ptr<recob::OpHit> const& opHit_P);
90  const std::unordered_set<const sim::SDP*> OpHitToEveSimSDPs_Ps(recob::OpHit const& opHit);
91  const std::unordered_set<const sim::SDP*> OpHitToEveSimSDPs_Ps(art::Ptr<recob::OpHit>& opHit_P);
92  const std::vector<double> SimSDPsToXYZ(std::vector<sim::SDP> const& sdps) const&;
93  const std::vector<double> SimSDPsToXYZ(std::vector<const sim::SDP*> const& sdps_Ps);
94  const std::vector<double> OpHitToXYZ(recob::OpHit const& opHit);
95  const std::vector<double> OpHitToXYZ(art::Ptr<recob::OpHit> const& opHit_P);
96  const std::set<int> GetSetOfEveIds();
97  const std::set<int> GetSetOfTrackIds();
98  const std::set<int> GetSetOfEveIds(std::vector<art::Ptr<recob::OpHit>> const& opHits_Ps);
99  const std::set<int> GetSetOfEveIds(const std::vector<recob::OpHit>& opHits);
100  const std::set<int> GetSetOfTrackIds(std::vector<art::Ptr<recob::OpHit>> const& opHits_Ps);
101  const std::set<int> GetSetOfTrackIds(std::vector<recob::OpHit> const& opHits);
102  const double OpHitCollectionPurity(std::set<int> const& tkIds,
103  std::vector<art::Ptr<recob::OpHit>> const& opHits_Ps);
104  const double OpHitLightCollectionPurity(std::set<int> const& tkIds,
105  std::vector<art::Ptr<recob::OpHit>> const& opHits_Ps);
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  geo::View_t const& view);
110  const double OpHitCollectionEfficiency(std::set<int> const& tkIds,
111  std::vector<art::Ptr<recob::OpHit>> const& opHits_Ps,
112  std::vector<art::Ptr<recob::OpHit>> const& opHitsIn_Ps);
113  const double OpHitLightCollectionEfficiency(
114  std::set<int> const& tkIds,
115  std::vector<art::Ptr<recob::OpHit>> const& opHits_Ps,
116  std::vector<art::Ptr<recob::OpHit>> const& opHitsIn_Ps,
117  geo::View_t const& view);
118  const double OpHitLightCollectionEfficiency(
119  std::set<int> const& tkIds,
120  std::vector<art::Ptr<recob::OpHit>> const& opHits_Ps,
121  std::vector<art::Ptr<recob::OpHit>> const& opHitsIn_Ps);
123  std::set<int> const& tkIds,
124  std::vector<art::Ptr<recob::OpHit>> const& opHits_Ps,
125  std::vector<art::Ptr<recob::OpHit>> const& opHitsIn_Ps)
126  {
127  return PhotonBackTracker::OpHitLightCollectionEfficiency(tkIds, opHits_Ps, opHitsIn_Ps);
128  } //Exists only temporarily. Is deprecated.
129  const std::set<int> OpFlashToTrackIds(art::Ptr<recob::OpFlash>& flash_P) const;
130  const std::vector<art::Ptr<recob::OpHit>> OpFlashToOpHits_Ps(art::Ptr<recob::OpFlash>& flash_P);
131  const std::vector<double> OpFlashToXYZ(art::Ptr<recob::OpFlash>& flash_P);
132 
133  private:
134  //The PhotonBackTrackerService has no parameters.
135 
136  void priv_PrepEvent(art::Event const& evt, art::ScheduleContext);
137  void priv_PrepFailed();
138  void priv_PrepOpDetBTRs(art::Event const& evt);
139  void priv_PrepOpFlashToOpHits(art::Event const& evt);
140 
141  bool priv_CanRun(art::Event const& evt);
142  bool priv_OpDetBTRsReady() { return PhotonBackTracker::BTRsReady(); }
143  bool priv_OpFlashToOpHitsReady() { return PhotonBackTracker::OpFlashToOpHitsReady(); }
144 
145  }; //Class PhotonBackTrackerService
146 
147  //----------------------------------------------------------------------
148 } // namespace
150 
151 #endif //CHEAT_PHOTONBACKTRACKERSERVICESERVICE_H
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
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)
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
Definition: DumpUtils.h:289
#define DECLARE_ART_SERVICE(svc, scope)
parameter set interface
back track the reconstruction to the simulation
Definition of data types for geometry description.
const provider_type * provider() const
code to link reconstructed objects back to the MC truth information
Definition: BackTracker.cc:22
Definition: MVAAlg.h:12
TCEvent evt
Definition: DataStructs.cxx:8