LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
MCBTAlg.h
Go to the documentation of this file.
1 
14 #ifndef RECOTOOL_MCBTALG_H
15 #define RECOTOOL_MCBTALG_H
16 
18 
19 #include <map>
20 #include <vector>
21 
22 namespace detinfo {
23  class DetectorClocksData;
24 }
25 
31 namespace btutil {
32 
33  struct WireRange_t {
34  unsigned int ch;
35  double start, end;
37  {
38  ch = std::numeric_limits<unsigned int>::max();
39  start = end = std::numeric_limits<double>::max();
40  }
41  WireRange_t(unsigned int c, double s, double e)
42  {
43  ch = c;
44  start = s;
45  end = e;
46  }
47  };
48 
49  typedef std::vector<double> edep_info_t; // vector of energy deposition
50 
51  typedef std::map<unsigned int, ::btutil::edep_info_t>
52  ch_info_t; // vector of time (index) for each edep (value)
53 
54  class MCBTAlg {
55 
56  public:
57  MCBTAlg() {}
58 
59  MCBTAlg(const std::vector<unsigned int>& g4_trackid_v,
60  const std::vector<sim::SimChannel>& simch_v);
61 
62  void Reset(const std::vector<unsigned int>& g4_trackid_v,
63  const std::vector<sim::SimChannel>& simch_v);
64 
65  void Reset(const std::vector<std::vector<unsigned int>>& g4_trackid_v,
66  const std::vector<sim::SimChannel>& simch_v);
67 
71  const std::vector<double>& MCQSum(const size_t plane_id) const;
72 
80  std::vector<double> MCQ(detinfo::DetectorClocksData const& clockData,
81  const WireRange_t& hit) const;
82 
90  std::vector<double> MCQFrac(detinfo::DetectorClocksData const& clockData,
91  const WireRange_t& hit) const;
92 
100  std::vector<double> MCQ(detinfo::DetectorClocksData const& clockData,
101  const std::vector<btutil::WireRange_t>& hit_v) const;
102 
110  std::vector<double> MCQFrac(detinfo::DetectorClocksData const& clockData,
111  const std::vector<btutil::WireRange_t>& hit_v) const;
112 
113  size_t Index(const unsigned int g4_track_id) const;
114 
115  size_t NumParts() const { return _num_parts - 1; }
116 
117  protected:
118  void Register(const unsigned int& g4_track_id);
119 
120  void Register(const std::vector<unsigned int>& g4_track_id);
121 
122  void ProcessSimChannel(const std::vector<sim::SimChannel>& simch_v);
123 
124  std::vector<::btutil::ch_info_t> _event_info;
125  std::vector<size_t> _trkid_to_index;
126  std::vector<std::vector<double>> _sum_mcq;
127  size_t _num_parts;
128  };
129 }
130 #endif
131  // end of doxygen group
unsigned int ch
Definition: MCBTAlg.h:34
std::vector< std::vector< double > > _sum_mcq
Definition: MCBTAlg.h:126
std::vector<::btutil::ch_info_t > _event_info
Definition: MCBTAlg.h:124
decltype(auto) constexpr end(T &&obj)
ADL-aware version of std::end.
Definition: StdUtils.h:77
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
Definition: DumpUtils.h:289
WireRange_t(unsigned int c, double s, double e)
Definition: MCBTAlg.h:41
ntupleExperimental Reset()
std::vector< double > edep_info_t
Definition: MCBTAlg.h:49
std::vector< size_t > _trkid_to_index
Definition: MCBTAlg.h:125
size_t NumParts() const
Definition: MCBTAlg.h:115
General LArSoft Utilities.
Detector simulation of raw signals on wires.
Contains all timing reference information for the detector.
object containing MC truth information necessary for making RawDigits and doing back tracking ...
std::map< unsigned int,::btutil::edep_info_t > ch_info_t
Definition: MCBTAlg.h:52
size_t _num_parts
Definition: MCBTAlg.h:127
Float_t e
Definition: plot.C:35