18 const std::vector<sim::SimChannel>& simch_v)
20 Reset(g4_trackid_v, simch_v);
25 const std::vector<sim::SimChannel>& simch_v)
32 for (
auto const&
id : g4_trackid_v)
40 const std::vector<sim::SimChannel>& simch_v)
47 for (
auto const&
id : g4_trackid_v)
61 for (
auto const& sch : simch_v) {
63 auto const ch = sch.Channel();
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;
97 const std::vector<double>&
101 throw MCBTException(Form(
"Invalid plane requested: %zu", plane_id));
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];
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;
147 const std::vector<WireRange_t>& hit_v)
const 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];
160 const std::vector<WireRange_t>& hit_v)
const 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;
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) {
const std::vector< double > & MCQSum(const size_t plane_id) const
std::vector< std::vector< double > > _sum_mcq
void Reset(const std::vector< unsigned int > &g4_trackid_v, const std::vector< sim::SimChannel > &simch_v)
Class def header for a class MCBTAlg.
std::vector< geo::WireID > ChannelToWire(raw::ChannelID_t const channel) const
Returns a list of wires connected to the specified TPC channel.
std::vector<::btutil::ch_info_t > _event_info
art framework interface to geometry description
unsigned int Nplanes(unsigned int tpc=0, unsigned int cstat=0) const
Returns the total number of wire planes in the specified TPC.
size_t Index(const unsigned int g4_track_id) const
std::vector< double > MCQ(detinfo::DetectorClocksData const &clockData, const WireRange_t &hit) const
static const size_t kINVALID_INDEX
Signifies invalid MCX index number.
void ProcessSimChannel(const std::vector< sim::SimChannel > &simch_v)
std::vector< size_t > _trkid_to_index
Definition of data types for geometry description.
Detector simulation of raw signals on wires.
Contains all timing reference information for the detector.
std::vector< double > MCQFrac(detinfo::DetectorClocksData const &clockData, const WireRange_t &hit) const
LArSoft geometry interface.
void Register(const unsigned int &g4_track_id)
double TPCTick2TDC(double const tick) const
Class def header for exception classes in MCComp package.
pure virtual base interface for detector clocks