14 #include "canvas/Persistency/Common/FindManyP.h" 62 std::vector<unsigned int> g4_track_id;
63 for (
auto const& mct : *mctHandle) {
65 if (!mct.size())
continue;
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;
83 art::FindManyP<recob::Hit> hit_coll_v(trkHandle, e,
"trackkalmanhit");
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
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.
MCBTDemo & operator=(MCBTDemo const &)=delete
EDAnalyzer(fhicl::ParameterSet const &pset)
art framework interface to geometry description
bool isValid() const noexcept
void analyze(art::Event const &e) override
bool getByLabel(std::string const &label, std::string const &instance, Handle< PROD > &result) const
#define DEFINE_ART_MODULE(klass)
std::vector< double > MCQ(detinfo::DetectorClocksData const &clockData, const WireRange_t &hit) const
MCBTDemo(fhicl::ParameterSet const &p)
Class def header for mctrack data container.
Declaration of signal hit object.
std::vector< double > MCQFrac(detinfo::DetectorClocksData const &clockData, const WireRange_t &hit) const
Provides recob::Track data product.
Planes which measure W (third view for Bo, MicroBooNE, etc).
recob::tracking::Plane Plane
LArSoft geometry interface.
QTextStream & endl(QTextStream &s)