LArSoft  v07_13_02
Liquid Argon Software toolkit - http://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 
12 //INCLUDES
13 #include <map>
14 
15 // Framework includes
16 #include "fhiclcpp/ParameterSet.h"
21 
22 // LArSoft includes
26 //Larsoft Services
30 
31 
32 //#include "lardata/Utilities/AssociationUtil.h"
34 //#include "lardataobj/Simulation/sim.h"
35 
36 namespace cheat{
38  {
39  public:
40  struct fhiclConfig{
42  fhicl::Name("PhotonBackTracker"),
43  fhicl::Comment("This if the fhicl configuration of the PhotonBackTracker service provider.")
44  };
45  };
46 
48  const provider_type* provider() const
49  {return static_cast<provider_type const*>(this);}
50 
53 
54  //Temporarily include a rebuild function until the lazy rebuild works.
55 
56  void Rebuild( art::Event const& evt);
57 
60  // This section contains the implimentation //
61  // of all PhotonBackTrackerService end user //
62  // functionality //
64 
65 
66  //----------------------------------------------------------------------
67  const std::vector< art::Ptr< sim::OpDetBacktrackerRecord >>& OpDetBTRs() ;
68  const double GetDelay();
69  const std::vector< const sim::SDP* > TrackIdToSimSDPs_Ps(int const& id);
70  const std::vector< const sim::SDP* > TrackIdToSimSDPs_Ps(int const& id, geo::View_t const& view);
72  const std::vector < sim::TrackSDP > OpDetToTrackSDPs( int const& OpDetNum,
73  double const& opHit_start_time, double const& opHit_end_time);
74  std::vector<sim::TrackSDP> OpHitToTrackSDPs(art::Ptr<recob::OpHit> const& opHit_P );
75  std::vector<sim::TrackSDP> OpHitToTrackSDPs(recob::OpHit const& opHit);
76  const std::vector < int > OpHitToTrackIds(recob::OpHit const& opHit);
77  const std::vector < int > OpHitToTrackIds(art::Ptr<recob::OpHit> const& opHit_P);
78  const std::vector < int > OpHitToEveTrackIds(recob::OpHit const& opHit);
79  const std::vector < int > OpHitToEveTrackIds(art::Ptr<recob::OpHit> const& opHit_P);
80  std::vector<sim::TrackSDP> OpHitToEveTrackSDPs(art::Ptr<recob::OpHit> const& opHit_P );
81  std::vector<sim::TrackSDP> OpHitToEveTrackSDPs(recob::OpHit const& opHit);
82  const std::vector<art::Ptr<recob::OpHit>> TrackIdToOpHits_Ps(int const& tkId, std::vector<art::Ptr<recob::OpHit>> const& hitsIn);
83  const std::vector<std::vector<art::Ptr<recob::OpHit>>> TrackIdsToOpHits_Ps(std::vector<int> const& tkIds, std::vector<art::Ptr<recob::OpHit>> const& hitsIn);
84  const std::vector< const sim::SDP* > OpHitToSimSDPs_Ps(recob::OpHit const& opHit) ;
85  const std::vector< const sim::SDP* > OpHitToSimSDPs_Ps(art::Ptr<recob::OpHit> const& opHit_P) ;
86 // const std::vector< sim::SDP > OpHitToChannelWeightedSimSDPs(art::Ptr<recob::OpHit> const& opHit_P);
87  const std::unordered_set< const sim::SDP* > OpHitToEveSimSDPs_Ps(recob::OpHit const& opHit) ;
88  const std::unordered_set< const sim::SDP* > OpHitToEveSimSDPs_Ps(art::Ptr<recob::OpHit>& opHit_P) ;
89  const std::vector< double> SimSDPsToXYZ(std::vector<sim::SDP> const& sdps ) const& ;
90  const std::vector< double> SimSDPsToXYZ(std::vector<const sim::SDP*> const& sdps_Ps);
91  const std::vector< double> OpHitToXYZ(recob::OpHit const& opHit);
92  const std::vector< double> OpHitToXYZ(art::Ptr<recob::OpHit> const& opHit_P);
93  const std::set< int> GetSetOfEveIds();
94  const std::set< int> GetSetOfTrackIds();
95  const std::set< int> GetSetOfEveIds(std::vector< art::Ptr<recob::OpHit> > const& opHits_Ps);
96  const std::set< int> GetSetOfEveIds(const std::vector< recob::OpHit >& opHits);
97  const std::set< int> GetSetOfTrackIds(std::vector< art::Ptr<recob::OpHit> > const& opHits_Ps);
98  const std::set< int> GetSetOfTrackIds(std::vector< recob::OpHit > const& opHits);
99  const double OpHitCollectionPurity(std::set<int> const& tkIds,
100  std::vector< art::Ptr<recob::OpHit> > const& opHits_Ps);
101  const double OpHitLightCollectionPurity(std::set<int> const& tkIds,
102  std::vector< art::Ptr<recob::OpHit> > const& opHits_Ps);
103  const double OpHitCollectionEfficiency(std::set<int> const& tkIds,
104  std::vector< art::Ptr<recob::OpHit> > const& opHits_Ps,
105  std::vector< art::Ptr<recob::OpHit> > const& opHitsIn_Ps,
106  geo::View_t const& view);
107  const double OpHitCollectionEfficiency(std::set<int> const& tkIds,
108  std::vector< art::Ptr<recob::OpHit> > const& opHits_Ps,
109  std::vector< art::Ptr<recob::OpHit> > const& opHitsIn_Ps);
110  const double OpHitLightCollectionEfficiency(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  geo::View_t const& view);
114  const double OpHitLightCollectionEfficiency(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  const double OpHitChargeCollectionEfficiency(std::set<int> const& tkIds,
118  std::vector< art::Ptr<recob::OpHit> > const& opHits_Ps,
119  std::vector< art::Ptr<recob::OpHit> > const& opHitsIn_Ps) { return PhotonBackTracker::OpHitLightCollectionEfficiency(tkIds, opHits_Ps, opHitsIn_Ps); }//Exists only temporarily. Is deprecated.
120  const std::set<int> OpFlashToTrackIds(art::Ptr<recob::OpFlash>& flash_P) const;
121  const std::vector < art::Ptr< recob::OpHit> > OpFlashToOpHits_Ps ( art::Ptr < recob::OpFlash > & flash_P );
122  const std::vector < double > OpFlashToXYZ ( art::Ptr < recob::OpFlash > & flash_P );
123 
124 
125 
126  private:
127  //The PhotonBackTrackerService has no parameters.
128 
129  void priv_PrepEvent( art::Event const& evt) ;
130  void priv_PrepFailed();
131  void priv_PrepOpDetBTRs(art::Event const& evt);
132  void priv_PrepOpFlashToOpHits(art::Event const& evt);
133 
134  bool priv_CanRun(art::Event const& evt);
137 
138  }; //Class PhotonBackTrackerService
139 
140 
141 
142  //----------------------------------------------------------------------
143 } // namespace
145 
146 #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)
const std::vector< int > OpHitToEveTrackIds(recob::OpHit const &opHit)
#define DECLARE_ART_SERVICE(svc, scope)
Definition: ServiceMacros.h:91
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)
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
Definition: DumpUtils.h:265
Access the description of detector geometry.
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)
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:26
PhotonBackTrackerService(fhicl::ParameterSet const &pSet, art::ActivityRegistry &reg)
const std::vector< int > OpHitToTrackIds(recob::OpHit const &opHit)
TCEvent evt
Definition: DataStructs.cxx:5
const std::set< int > OpFlashToTrackIds(art::Ptr< recob::OpFlash > &flash_P) const
std::vector< sim::TrackSDP > OpHitToEveTrackSDPs(art::Ptr< recob::OpHit > const &opHit_P)
art framework interface to geometry description
void priv_PrepOpFlashToOpHits(art::Event const &evt)