LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
OpticalRecoAna.h
Go to the documentation of this file.
1 //Analyzer for flash <----> track matching
2 #ifndef OpticalRecoAna_H
3 #define OpticalRecoAna_H
4 
5 #include <string>
6 #include <vector>
7 
8 // ART includes
10 #include "fhiclcpp/ParameterSet.h"
14 
15 //LArSoft includes
16 //#include "larsim/MCCheater/BackTrackerService.h" //Not used
22 
23 #include "TH1.h"
24 #include "TTree.h"
25 
26 namespace opreco {
27 
28  //bookkeeping on all the matches
29  struct flash_match{
30  std::vector<size_t> particle_indices;
31  std::vector<size_t> track_indices;
32  };
33  struct track_match{
34  std::vector<size_t> particle_indices;
35  std::vector<size_t> flash_indices;
36  };
38  std::vector<size_t> flash_indices;
39  std::vector<size_t> track_indices;
40  };
41 
43  public:
44 
46  virtual ~OpticalRecoAna();
47 
48  void beginJob();
49  void analyze (const art::Event&);
50 
51  private:
52 
53  //fcl parameters here
54  std::string fFlashModuleLabel;
55  std::string fTrackModuleLabel;
57  float fPEMin;
59 
60  std::vector<flash_match> fFlash_match_vector;
61  std::vector<track_match> fTrack_match_vector;
62  std::vector<particle_match> fParticle_match_vector;
63 
64  void get_MC_particle_list(sim::ParticleList const& ,std::vector<simb::MCParticle> & );
65  simb::Origin_t get_MC_particle_origin(simb::MCParticle const& );
66  float update_MC_particle_time(simb::MCParticle const&, bool& ,geo::Geometry const&);
67 
68  //matching functions
69  void match_flashes_to_tracks(std::vector<recob::OpFlash> const& ,
70  std::vector<recob::Track> const&);
71  void compare_track_and_flash(recob::Track const&,
72  recob::OpFlash const&,
73  bool &);
74 
75  void match_flashes_to_particles(std::vector<recob::OpFlash> const&,
76  std::vector<simb::MCParticle> const&,
77  float const&,
78  geo::Geometry const&);
79  void compare_particle_and_flash(simb::MCParticle const&,
80  recob::OpFlash const&,
81  bool &,
82  float const&,
83  geo::Geometry const&);
84 
85  void match_flashes_to_particles(std::vector<recob::Track> const&,
86  std::vector<simb::MCParticle> const&,
87  geo::Geometry const&);
88  void compare_particle_and_track(simb::MCParticle const&,
89  recob::Track const&,
90  bool &,
91  geo::Geometry const&);
92 
93  void FillMatchTree_PF(std::vector<recob::OpFlash> const&,
94  std::vector<simb::MCParticle> const&,
95  float const&,
96  geo::Geometry const&);
97 
98 
99  TH1F *fTimeDiff;
102 
105  int fRun;
106  int fEvent;
111  float fParticleVx;
112  float fParticleVy;
113  float fParticleVz;
114  int fFlashID;
115  float fFlashTime;
117  float fFlashY;
118  float fFlashZ;
121  float fFlashPE;
125 
126  };
127 
128 }
129 
130 
131 
132 
133 #endif
std::string fFlashModuleLabel
enum simb::_ev_origin Origin_t
event origin types
std::vector< flash_match > fFlash_match_vector
std::vector< size_t > track_indices
Particle class.
std::vector< size_t > flash_indices
std::string fTrackModuleLabel
void beginJob()
Definition: Breakpoints.cc:14
std::vector< size_t > flash_indices
The geometry of one entire detector, as served by art.
Definition: Geometry.h:110
Provides recob::Track data product.
std::vector< particle_match > fParticle_match_vector
std::vector< size_t > particle_indices
std::vector< size_t > particle_indices
std::vector< size_t > track_indices
std::vector< track_match > fTrack_match_vector
art framework interface to geometry description
Track from a non-cascading particle.A recob::Track consists of a recob::TrackTrajectory, plus additional members relevant for a "fitted" track:
Definition: Track.h:51