#include <MCBTAlg.h>
Definition at line 54 of file MCBTAlg.h.
btutil::MCBTAlg::MCBTAlg |
( |
| ) |
|
|
inline |
MCBTAlg::MCBTAlg |
( |
const std::vector< unsigned int > & |
g4_trackid_v, |
|
|
const std::vector< sim::SimChannel > & |
simch_v |
|
) |
| |
Definition at line 17 of file MCBTAlg.cxx.
20 Reset(g4_trackid_v, simch_v);
void Reset(const std::vector< unsigned int > &g4_trackid_v, const std::vector< sim::SimChannel > &simch_v)
size_t MCBTAlg::Index |
( |
const unsigned int |
g4_track_id | ) |
const |
Definition at line 175 of file MCBTAlg.cxx.
static const size_t kINVALID_INDEX
Signifies invalid MCX index number.
std::vector< size_t > _trkid_to_index
Relate Hit => MCShower/MCTrack (called MCX). Returns a vector of double w/ length = # of relevant MCX + 1. Each entry is # drifted electrons from each relevant MCX. The last element contains a sum of drifted electrons that do not belong to any of relevant MCX.
Definition at line 106 of file MCBTAlg.cxx.
114 auto itlow = ch_info.lower_bound((
unsigned int)(clockData.TPCTick2TDC(
hit.start)));
115 auto itup = ch_info.upper_bound((
unsigned int)(clockData.TPCTick2TDC(
hit.end)) + 1);
117 while (itlow != ch_info.end() && itlow != itup) {
119 auto const& edep_info = (*itlow).second;
121 for (
size_t part_index = 0; part_index <
_num_parts; ++part_index)
123 res[part_index] += edep_info[part_index];
std::vector<::btutil::ch_info_t > _event_info
Relate Cluster => MCX. Returns a vector of double w/ length = # of relevant MCXs + 1. Each entry is # drifted electrons from each relevant MCX. The last element contains a sum of drifted electrons that do not belong to any of relevant MCX.
Definition at line 146 of file MCBTAlg.cxx.
150 for (
auto const&
h : hit_v) {
151 auto tmp_res =
MCQ(clockData,
h);
152 for (
size_t i = 0; i < res.size(); ++i)
153 res[i] += tmp_res[i];
std::vector< double > MCQ(detinfo::DetectorClocksData const &clockData, const WireRange_t &hit) const
Relate Hit => MCX. Returns a vector of double w/ length = # of relevant MCXs + 1. Each entry is a fraction of # drifted electrons within the specified time range from each relevant MCX. The last element contains a sum of drifted electrons that do not belong to any of relevant MCX.
Definition at line 131 of file MCBTAlg.cxx.
133 auto res =
MCQ(clockData,
hit);
134 if (!res.size())
return res;
137 for (
auto const& v : res)
139 for (
size_t i = 0; i < (res.size() - 1); ++i)
140 res[i] /= (sum - (*res.rbegin()));
141 (*res.rbegin()) /= sum;
std::vector< double > MCQ(detinfo::DetectorClocksData const &clockData, const WireRange_t &hit) const
Relate Cluster => MCX. Returns a vector of double w/ length = # of relevant MCXs + 1. Each entry is a fraction of # drifted electrons within the specified time range from each relevant MCX. The last element contains a sum of drifted electrons that do not belong to any of relevant MCX.
Definition at line 159 of file MCBTAlg.cxx.
162 auto res =
MCQ(clockData, hit_v);
163 if (!res.size())
return res;
166 for (
auto const& v : res)
168 for (
size_t i = 0; i < (res.size() - 1); ++i)
169 res[i] /= (sum - (*res.rbegin()));
170 (*res.rbegin()) /= sum;
std::vector< double > MCQ(detinfo::DetectorClocksData const &clockData, const WireRange_t &hit) const
const std::vector< double > & MCBTAlg::MCQSum |
( |
const size_t |
plane_id | ) |
const |
Returns MC charge sum per MCX for a specified plane
Definition at line 98 of file MCBTAlg.cxx.
101 throw MCBTException(Form(
"Invalid plane requested: %zu", plane_id));
std::vector< std::vector< double > > _sum_mcq
size_t btutil::MCBTAlg::NumParts |
( |
| ) |
const |
|
inline |
void MCBTAlg::ProcessSimChannel |
( |
const std::vector< sim::SimChannel > & |
simch_v | ) |
|
|
protected |
Definition at line 54 of file MCBTAlg.cxx.
57 art::ServiceHandle<geo::Geometry const> geo;
61 for (
auto const& sch : simch_v) {
63 auto const ch = sch.Channel();
68 size_t plane = geo->ChannelToWire(ch)[0].Plane;
71 for (
auto const& time_ide : sch.TDCIDEMap()) {
73 auto const& time = time_ide.first;
74 auto const& ide_v = time_ide.second;
76 auto& edep_info = ch_info[time];
78 if (!edep_info.size()) edep_info.resize(_num_parts, 0);
80 for (
auto const& ide : ide_v) {
84 if (_num_parts <= index) {
85 (*edep_info.rbegin()) += ide.numElectrons;
86 (*(
_sum_mcq[plane]).rbegin()) += ide.numElectrons;
89 edep_info[index] += ide.numElectrons;
90 _sum_mcq[plane][index] += ide.numElectrons;
std::vector< std::vector< double > > _sum_mcq
std::vector<::btutil::ch_info_t > _event_info
static const size_t kINVALID_INDEX
Signifies invalid MCX index number.
std::vector< size_t > _trkid_to_index
void MCBTAlg::Register |
( |
const unsigned int & |
g4_track_id | ) |
|
|
protected |
Definition at line 182 of file MCBTAlg.cxx.
static const size_t kINVALID_INDEX
Signifies invalid MCX index number.
std::vector< size_t > _trkid_to_index
void MCBTAlg::Register |
( |
const std::vector< unsigned int > & |
g4_track_id | ) |
|
|
protected |
Definition at line 194 of file MCBTAlg.cxx.
196 unsigned int max_id = 0;
197 for (
auto const&
id : track_id_v)
198 if (max_id <
id) max_id = id;
201 for (
auto const&
id : track_id_v) {
209 throw MCBTException(Form(
"Doubly used TrackID: %d",
id));
static const size_t kINVALID_INDEX
Signifies invalid MCX index number.
std::vector< size_t > _trkid_to_index
void MCBTAlg::Reset |
( |
const std::vector< unsigned int > & |
g4_trackid_v, |
|
|
const std::vector< sim::SimChannel > & |
simch_v |
|
) |
| |
Definition at line 24 of file MCBTAlg.cxx.
32 for (
auto const&
id : g4_trackid_v)
std::vector< std::vector< double > > _sum_mcq
std::vector<::btutil::ch_info_t > _event_info
void ProcessSimChannel(const std::vector< sim::SimChannel > &simch_v)
std::vector< size_t > _trkid_to_index
void Register(const unsigned int &g4_track_id)
void MCBTAlg::Reset |
( |
const std::vector< std::vector< unsigned int >> & |
g4_trackid_v, |
|
|
const std::vector< sim::SimChannel > & |
simch_v |
|
) |
| |
Definition at line 39 of file MCBTAlg.cxx.
47 for (
auto const&
id : g4_trackid_v)
std::vector< std::vector< double > > _sum_mcq
std::vector<::btutil::ch_info_t > _event_info
void ProcessSimChannel(const std::vector< sim::SimChannel > &simch_v)
std::vector< size_t > _trkid_to_index
void Register(const unsigned int &g4_track_id)
size_t btutil::MCBTAlg::_num_parts |
|
protected |
std::vector<std::vector<double> > btutil::MCBTAlg::_sum_mcq |
|
protected |
std::vector<size_t> btutil::MCBTAlg::_trkid_to_index |
|
protected |
The documentation for this class was generated from the following files: