18 const std::vector<sim::SimChannel>& simch_v)
20 Reset(g4_trackid_v, simch_v);
24 const std::vector<sim::SimChannel>& simch_v)
31 for (
auto const&
id : g4_trackid_v)
38 const std::vector<sim::SimChannel>& simch_v)
45 for (
auto const&
id : g4_trackid_v)
58 for (
auto const& sch : simch_v) {
60 auto const ch = sch.Channel();
68 for (
auto const& time_ide : sch.TDCIDEMap()) {
70 auto const& time = time_ide.first;
71 auto const& ide_v = time_ide.second;
73 auto& edep_info = ch_info[time];
75 if (!edep_info.size()) edep_info.resize(_num_parts, 0);
77 for (
auto const& ide : ide_v) {
81 if (_num_parts <= index) {
82 (*edep_info.rbegin()) += ide.numElectrons;
83 (*(
_sum_mcq[plane]).rbegin()) += ide.numElectrons;
86 edep_info[index] += ide.numElectrons;
87 _sum_mcq[plane][index] += ide.numElectrons;
97 throw MCBTException(Form(
"Invalid plane requested: %zu", plane_id));
110 auto itlow = ch_info.lower_bound((
unsigned int)(clockData.
TPCTick2TDC(hit.
start)));
111 auto itup = ch_info.upper_bound((
unsigned int)(clockData.
TPCTick2TDC(hit.
end)) + 1);
113 while (itlow != ch_info.end() && itlow != itup) {
115 auto const& edep_info = (*itlow).second;
117 for (
size_t part_index = 0; part_index <
_num_parts; ++part_index)
119 res[part_index] += edep_info[part_index];
129 auto res =
MCQ(clockData, hit);
130 if (!res.size())
return res;
133 for (
auto const& v : res)
135 for (
size_t i = 0; i < (res.size() - 1); ++i)
136 res[i] /= (sum - (*res.rbegin()));
137 (*res.rbegin()) /= sum;
142 const std::vector<WireRange_t>& hit_v)
const 145 for (
auto const& h : hit_v) {
146 auto tmp_res =
MCQ(clockData, h);
147 for (
size_t i = 0; i < res.size(); ++i)
148 res[i] += tmp_res[i];
154 const std::vector<WireRange_t>& hit_v)
const 156 auto res =
MCQ(clockData, hit_v);
157 if (!res.size())
return res;
160 for (
auto const& v : res)
162 for (
size_t i = 0; i < (res.size() - 1); ++i)
163 res[i] /= (sum - (*res.rbegin()));
164 (*res.rbegin()) /= sum;
187 unsigned int max_id = 0;
188 for (
auto const&
id : track_id_v)
189 if (max_id <
id) max_id = id;
192 for (
auto const&
id : track_id_v) {
Utilities related to art service access.
const std::vector< double > & MCQSum(const size_t plane_id) const
std::vector< WireID > ChannelToWire(raw::ChannelID_t const channel) const
Returns a list of wires connected to the specified TPC channel.
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<::btutil::ch_info_t > _event_info
pure virtual base interface for detector clocks
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
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
object containing MC truth information necessary for making RawDigits and doing back tracking ...
unsigned int Nplanes(TPCID const &tpcid=tpc_zero) const
Returns the total number of planes in the specified TPC.
Namespace collecting geometry-related classes utilities.
void Register(const unsigned int &g4_track_id)
double TPCTick2TDC(double const tick) const
art framework interface to geometry description
Class def header for exception classes in MCComp package.