31 std::set<const MCParticle *> mcSet;
32 std::map<const MCParticle *, CaloHitList> mcHitMap;
33 for (
const CaloHit *pCaloHit : *pCaloHitList)
39 while (!pParent->GetParentList().empty())
43 mcSet.insert(pParent);
44 mcHitMap[pParent].emplace_back(pCaloHit);
48 std::cout <<
"Num hits: " << pCaloHitList->size() <<
" Num MC: " << mcSet.size() << std::endl;
49 for (
auto &[pParent, caloHits] : mcHitMap)
50 std::cout <<
"MC: " << pParent <<
" (" << pParent->GetParticleId() <<
") " << caloHits.size() << std::endl;
59 CaloHitList caloHitListU, caloHitListV, caloHitListW, caloHitList2D;
60 for (
auto &[pParent, caloHits] : mcHitMap)
64 selectedNeutrinos.emplace_back(pParent);
65 for (
const CaloHit *pCaloHit : caloHits)
67 switch (pCaloHit->GetHitType())
70 caloHitListU.emplace_back(pCaloHit);
71 caloHitList2D.emplace_back(pCaloHit);
74 caloHitListV.emplace_back(pCaloHit);
75 caloHitList2D.emplace_back(pCaloHit);
78 caloHitListW.emplace_back(pCaloHit);
79 caloHitList2D.emplace_back(pCaloHit);
86 std::cout <<
"MC: " << pParent <<
" (" << pParent->GetParticleId() <<
") " << caloHits.size() << std::endl;
96 return STATUS_CODE_SUCCESS;
Header file for the lar monte carlo particle helper helper class.
static pandora::StatusCode SaveList(const pandora::Algorithm &algorithm, const T &t, const std::string &newListName)
Save a provided input object list under a new name.
static pandora::StatusCode ReplaceCurrentList(const pandora::Algorithm &algorithm, const std::string &newListName)
Replace the current list with a pre-saved list; use this new list as a permanent replacement for the ...
static pandora::StatusCode GetList(const pandora::Algorithm &algorithm, const std::string &listName, const T *&pT)
Get a named list.
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
Read the algorithm settings.
pandora::IntVector m_interactionIds
InteractionSelectionAlgorithm()
Default constructor.
pandora::StatusCode Run()
Run the algorithm.
static bool IsNeutrino(const pandora::MCParticle *const pMCParticle)
Whether a mc particle is a neutrino or antineutrino.
static const MCParticle * GetMainMCParticle(const T *const pT)
Find the mc particle making the largest contribution to a specified calo hit, track or cluster.
const MCParticleList & GetParentList() const
Get list of parents of mc particle.
static StatusCode ReadVectorOfValues(const TiXmlHandle &xmlHandle, const std::string &xmlElementName, std::vector< T > &vector)
Read a vector of values from a (space separated) list in an xml element.