Main function to read-in data and fill variables in this algorithm to reconstruct MC shower.
33 if(!part_v.size())
return;
36 std::vector<std::multimap<double,unsigned int> > daughter_map;
37 for(
size_t i=0; i<part_v.size(); ++i) {
39 auto const& mcp = part_v[i];
41 int candidate_mom_index=-1;
42 if( mcp._pdgcode == 22 ||
45 candidate_mom_index = i;
47 unsigned int mom_track = mcp._mother;
48 auto mom_iter = part_v._track_index.find(mom_track);
49 while(mom_iter != part_v._track_index.end()) {
51 unsigned int mom_index = (*mom_iter).second;
53 if( part_v.at(mom_index)._pdgcode == 22 || part_v.at(mom_index)._pdgcode == 11 || part_v.at(mom_index)._pdgcode == -11 )
55 candidate_mom_index = mom_index;
57 mom_iter = part_v._track_index.find(part_v.at(mom_index)._mother);
61 if(candidate_mom_index >= 0) {
63 auto candidate_mom_iter =
_shower_index.find(candidate_mom_index);
66 daughter_map.push_back(std::multimap<double,unsigned int>());
69 daughter_map.at(shower_index).insert(std::make_pair((
double)(mcp._start_vtx[3]),(
unsigned int)i));
75 <<
"Found a particle that does not belong to a shower!" <<
std::endl 76 << Form(
" PDGID: %d ... Track %d @ (%g,%g,%g,%g) with (%g,%g,%g,%g)",
101 for(
auto const &part_index : daughter_map.at(mom.second))
105 auto const& mcp = part_v.at(mom.first);
108 << Form(
"PDGID: %d ... Track %d @ (%g,%g,%g,%g) with (%g,%g,%g,%g) ... %zu daughters!",
std::vector< int > _shower_id
Track index to shower index map.
std::vector< std::vector< unsigned int > > _shower_daughters
Shower time-ordered daughters.
bool _debug_mode
lots of stdout stream
std::map< unsigned int, unsigned int > _shower_index
Shower Primary Index ID => Shower Index Map.
second_as<> second
Type of time stored in seconds, in double precision.
QTextStream & endl(QTextStream &s)