62 std::vector<unsigned int> g4_track_id;
63 for (
auto const& mct : *mctHandle) {
65 if (!mct.size())
continue;
67 double dE = (*mct.begin()).Momentum().E() - (*mct.rbegin()).Momentum().E();
68 if (dE > 100) g4_track_id.push_back(mct.TrackID());
71 if (g4_track_id.size()) {
76 auto sum_mcq_v = alg_mct.
MCQSum(2);
77 std::cout <<
"Total charge contents on W plane:" << std::endl;
78 for (
size_t i = 0; i < sum_mcq_v.size() - 1; ++i)
79 std::cout <<
" MCTrack " << i <<
" => " << sum_mcq_v[i] << std::endl;
80 std::cout <<
" Others => " << (*sum_mcq_v.rbegin()) << std::endl;
86 for (
size_t i = 0; i < trkHandle->size(); ++i) {
88 const std::vector<art::Ptr<recob::Hit>> hit_coll = hit_coll_v.at(i);
90 std::vector<btutil::WireRange_t>
hits;
92 for (
auto const& h_ptr : hit_coll) {
96 hits.emplace_back(h_ptr->Channel(), h_ptr->StartTick(), h_ptr->EndTick());
99 auto mcq_v = alg_mct.
MCQ(clockData, hits);
100 auto mcq_frac_v = alg_mct.
MCQFrac(clockData, hits);
102 std::cout <<
"Track " << i <<
" " 103 <<
"Y plane Charge from first MCTrack: " << mcq_v[0]
104 <<
" ... Purity: " << mcq_frac_v[0]
105 <<
" ... Efficiency: " << mcq_v[0] / sum_mcq_v[0] << std::endl;
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.
Declaration of signal hit object.
Class def header for a class MCBTAlg.
MCBTDemo & operator=(MCBTDemo const &)=delete
EDAnalyzer(fhicl::ParameterSet const &pset)
bool isValid() const noexcept
void analyze(art::Event const &e) override
#define DEFINE_ART_MODULE(klass)
std::vector< double > MCQ(detinfo::DetectorClocksData const &clockData, const WireRange_t &hit) const
MCBTDemo(fhicl::ParameterSet const &p)
Provides recob::Track data product.
Class def header for mctrack data container.
bool getByLabel(std::string const &label, std::string const &instance, Handle< PROD > &result) const
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 ...
Planes which measure W (third view for Bo, MicroBooNE, etc).
recob::tracking::Plane Plane
Namespace collecting geometry-related classes utilities.
art framework interface to geometry description