7 #ifndef MCSHOWERRECOPART_CXX 8 #define MCSHOWERRECOPART_CXX 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;
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>());
68 unsigned int shower_index = (*
_shower_index.find(candidate_mom_index)).second;
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)",
87 << std::endl << std::endl;
95 << Form(
"Found %zu MCShowers....",
_shower_index.size()) << std::endl;
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!",
124 std::cout<<std::endl;
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.
T get(std::string const &key) const
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
void ConstructShower(const MCRecoPart &part_v)
Main function to read-in data and fill variables in this algorithm to reconstruct MC shower...