7 #include "fhiclcpp/ParameterSet.h"
36 if(!part_v.size())
return;
39 std::vector<std::multimap<double,unsigned int> > daughter_map;
40 for(
size_t i=0; i<part_v.size(); ++i) {
42 auto const& mcp = part_v[i];
44 int candidate_mom_index=-1;
45 if( mcp._pdgcode == 22 ||
48 candidate_mom_index = i;
50 unsigned int mom_track = mcp._mother;
54 unsigned int mom_index = (*mom_iter).second;
56 if( part_v.at(mom_index)._pdgcode == 22 || part_v.at(mom_index)._pdgcode == 11 || part_v.at(mom_index)._pdgcode == -11 )
58 candidate_mom_index = mom_index;
60 mom_iter = part_v.
_track_index.find(part_v.at(mom_index)._mother);
64 if(candidate_mom_index >= 0) {
66 auto candidate_mom_iter =
_shower_index.find(candidate_mom_index);
69 daughter_map.push_back(std::multimap<double,unsigned int>());
72 daughter_map.at(shower_index).insert(std::make_pair((
double)(mcp._start_vtx[3]),(
unsigned int)i));
78 <<
"Found a particle that does not belong to a shower!" << std::endl
79 << Form(
" PDGID: %d ... Track %d @ (%g,%g,%g,%g) with (%g,%g,%g,%g)",
90 << std::endl << std::endl;
98 << Form(
"Found %zu MCShowers....",
_shower_index.size()) << std::endl;
104 for(
auto const &part_index : daughter_map.at(mom.second))
108 auto const& mcp = part_v.at(mom.first);
111 << 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::map< unsigned int, unsigned int > _track_index
Track ID => Index Map.
std::vector< std::vector< unsigned int > > _shower_daughters
Shower time-ordered daughters.
MCShowerRecoPart(fhicl::ParameterSet const &pset)
Default constructor with fhicl parameters.
static const int kINVALID_INT
bool _debug_mode
lots of stdout stream
std::map< unsigned int, unsigned int > _shower_index
Shower Primary Index ID => Shower Index Map.
static const unsigned int kINVALID_UINT
BEGIN_PROLOG could also be cout
void ConstructShower(const MCRecoPart &part_v)
Main function to read-in data and fill variables in this algorithm to reconstruct MC shower...