74 std::vector<unsigned int> g4_track_id;
75 for(
auto const& mct : *mctHandle) {
77 if(!mct.size())
continue;
79 double dE = (*mct.begin()).Momentum().E() - (*mct.rbegin()).Momentum().E();
80 if(dE > 100) g4_track_id.push_back(mct.TrackID());
84 if(g4_track_id.size()) {
89 auto sum_mcq_v = alg_mct.
MCQSum(2);
90 std::cout<<
"Total charge contents on W plane:"<<std::endl;
91 for(
size_t i=0; i<sum_mcq_v.size()-1; ++i)
92 std::cout<<
" MCTrack " << i <<
" => " << sum_mcq_v[i] <<std::endl;
93 std::cout<<
" Others => "<<(*sum_mcq_v.rbegin())<<std::endl;
98 for(
size_t i=0; i<trkHandle->size(); ++i) {
100 const std::vector<art::Ptr<recob::Hit> > hit_coll = hit_coll_v.at(i);
102 std::vector<btutil::WireRange_t>
hits;
104 for(
auto const& h_ptr : hit_coll) {
108 hits.emplace_back(h_ptr->Channel(),h_ptr->StartTick(), h_ptr->EndTick());
112 auto mcq_v = alg_mct.
MCQ(hits);
114 auto mcq_frac_v = alg_mct.
MCQFrac(hits);
116 std::cout <<
"Track " << i <<
" " 117 <<
"Y plane Charge from first MCTrack: " << mcq_v[0]
118 <<
" ... Purity: " << mcq_frac_v[0]
119 <<
" ... Efficiency: " << mcq_v[0] / sum_mcq_v[0] << std::endl;
const std::vector< double > & MCQSum(const size_t plane_id) const
Declaration of signal hit object.
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
std::vector< double > MCQFrac(const WireRange_t &hit) const
void analyze(art::Event const &e) override
#define DEFINE_ART_MODULE(klass)
MCBTDemo(fhicl::ParameterSet const &p)
EDAnalyzer(Table< Config > const &config)
Class def header for mctrack data container.
Provides recob::Track data product.
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
std::vector< double > MCQ(const WireRange_t &hit) const
object containing MC truth information necessary for making RawDigits and doing back tracking ...
Class def header for MCShower data container.
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