MCBTAlg.h
Go to the documentation of this file.
1 /**
2  * \file MCBTAlg.h
3  *
4  * \ingroup MCComp
5  *
6  * \brief Class def header for a class MCBTAlg
7  *
8  * @author littlejohn, kaleko, terao
9  */
10 
11 /** \addtogroup MCComp
12 
13  @{*/
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 
26 /**
27  \class MCBTAlg
28  MCBTAlg is meant to back-track reco-ed hits/clusters to MCShower/MCTrack
29  */
30 
31 namespace btutil {
32 
33  struct WireRange_t {
34  unsigned int ch;
35  double start, end;
37  {
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 
68  /**
69  Returns MC charge sum per MCX for a specified plane
70  */
71  const std::vector<double>& MCQSum(const size_t plane_id) const;
72 
73  /**
74  Relate Hit => MCShower/MCTrack (called MCX).
75  Returns a vector of double w/ length = # of relevant MCX + 1.
76  Each entry is # drifted electrons from each relevant MCX.
77  The last element contains a sum of drifted electrons that do not belong
78  to any of relevant MCX.
79  */
80  std::vector<double> MCQ(detinfo::DetectorClocksData const& clockData,
81  const WireRange_t& hit) const;
82 
83  /**
84  Relate Hit => MCX.
85  Returns a vector of double w/ length = # of relevant MCXs + 1.
86  Each entry is a fraction of # drifted electrons within the specified time
87  range from each relevant MCX. The last element contains a sum of drifted
88  electrons that do not belong to any of relevant MCX.
89  */
90  std::vector<double> MCQFrac(detinfo::DetectorClocksData const& clockData,
91  const WireRange_t& hit) const;
92 
93  /**
94  Relate Cluster => MCX.
95  Returns a vector of double w/ length = # of relevant MCXs + 1.
96  Each entry is # drifted electrons from each relevant MCX.
97  The last element contains a sum of drifted electrons that do not belong
98  to any of relevant MCX.
99  */
100  std::vector<double> MCQ(detinfo::DetectorClocksData const& clockData,
101  const std::vector<btutil::WireRange_t>& hit_v) const;
102 
103  /**
104  Relate Cluster => MCX.
105  Returns a vector of double w/ length = # of relevant MCXs + 1.
106  Each entry is a fraction of # drifted electrons within the specified time
107  range from each relevant MCX. The last element contains a sum of drifted
108  electrons that do not belong to any of relevant MCX.
109  */
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
116  NumParts() const
117  {
118  return _num_parts - 1;
119  }
120 
121  protected:
122  void Register(const unsigned int& g4_track_id);
123 
124  void Register(const std::vector<unsigned int>& g4_track_id);
125 
126  void ProcessSimChannel(const std::vector<sim::SimChannel>& simch_v);
127 
128  std::vector<::btutil::ch_info_t> _event_info;
129  std::vector<size_t> _trkid_to_index;
130  std::vector<std::vector<double>> _sum_mcq;
131  size_t _num_parts;
132  };
133 }
134 #endif
135 /** @} */ // end of doxygen group
end
while True: pbar.update(maxval-len(onlies[E][S])) #print iS, "/", len(onlies[E][S]) found = False for...
unsigned int ch
Definition: MCBTAlg.h:34
std::vector< std::vector< double > > _sum_mcq
Definition: MCBTAlg.h:130
struct vector vector
std::vector<::btutil::ch_info_t > _event_info
Definition: MCBTAlg.h:128
unsigned int Index
const double e
WireRange_t(unsigned int c, double s, double e)
Definition: MCBTAlg.h:41
std::vector< double > edep_info_t
Definition: MCBTAlg.h:49
std::vector< size_t > _trkid_to_index
Definition: MCBTAlg.h:129
size_t NumParts() const
Definition: MCBTAlg.h:116
General LArSoft Utilities.
static int max(int a, int b)
Detector simulation of raw signals on wires.
Contains all timing reference information for the detector.
std::map< unsigned int,::btutil::edep_info_t > ch_info_t
Definition: MCBTAlg.h:52
size_t _num_parts
Definition: MCBTAlg.h:131
static QCString * s
Definition: config.cpp:1042