Public Member Functions | Private Member Functions | Private Attributes | List of all members
lar_content::CheatingCosmicRayTaggingTool Class Reference

CheatingCosmicRayTaggingTool class. More...

#include <CheatingCosmicRayTaggingTool.h>

Inheritance diagram for lar_content::CheatingCosmicRayTaggingTool:
lar_content::CosmicRayTaggingBaseTool

Public Member Functions

 CheatingCosmicRayTaggingTool ()
 Default constructor. More...
 
void FindAmbiguousPfos (const pandora::PfoList &parentCosmicRayPfos, pandora::PfoList &ambiguousPfos, const MasterAlgorithm *const pAlgorithm)
 Find the list of ambiguous pfos (could represent cosmic-ray muons or neutrinos) More...
 

Private Member Functions

pandora::StatusCode ReadSettings (const pandora::TiXmlHandle xmlHandle)
 

Private Attributes

float m_maxCosmicRayFraction
 The maximum cosmic ray fraction for a pfo to be declared an ambiguous cosmic ray. More...
 

Detailed Description

CheatingCosmicRayTaggingTool class.

Definition at line 19 of file CheatingCosmicRayTaggingTool.h.

Constructor & Destructor Documentation

lar_content::CheatingCosmicRayTaggingTool::CheatingCosmicRayTaggingTool ( )

Default constructor.

Definition at line 22 of file CheatingCosmicRayTaggingTool.cc.

23 {
24 }
float m_maxCosmicRayFraction
The maximum cosmic ray fraction for a pfo to be declared an ambiguous cosmic ray. ...

Member Function Documentation

void lar_content::CheatingCosmicRayTaggingTool::FindAmbiguousPfos ( const pandora::PfoList &  parentCosmicRayPfos,
pandora::PfoList &  ambiguousPfos,
const MasterAlgorithm *const  pAlgorithm 
)
virtual

Find the list of ambiguous pfos (could represent cosmic-ray muons or neutrinos)

Parameters
parentCosmicRayPfosthe list of parent cosmic-ray pfos
ambiguousPfosto receive the list of ambiguous pfos
pAlgorithmthe address of this master algorithm

Implements lar_content::CosmicRayTaggingBaseTool.

Definition at line 28 of file CheatingCosmicRayTaggingTool.cc.

29 {
30  if (this->GetPandora().GetSettings()->ShouldDisplayAlgorithmInfo())
31  std::cout << "----> Running Algorithm Tool: " << this->GetInstanceName() << ", " << this->GetType() << std::endl;
32 
33  PfoList ambiguousParentPfos;
34 
35  for (const Pfo *const pParentCosmicRayPfo : parentCosmicRayPfos)
36  {
37  PfoList downstreamPfos;
38  LArPfoHelper::GetAllDownstreamPfos(pParentCosmicRayPfo, downstreamPfos);
39 
40  float thisCosmicRayWeight(0.f), thisTotalWeight(0.f);
41  CheatingSliceIdBaseTool::GetTargetParticleWeight(&downstreamPfos, thisCosmicRayWeight, thisTotalWeight, LArMCParticleHelper::IsCosmicRay);
42 
43  if ((thisTotalWeight > 0.f) && ((thisCosmicRayWeight / thisTotalWeight) < m_maxCosmicRayFraction))
44  ambiguousParentPfos.push_back(pParentCosmicRayPfo);
45  }
46 
47  LArPfoHelper::GetAllConnectedPfos(ambiguousParentPfos, ambiguousPfos);
48 }
static bool IsCosmicRay(const pandora::MCParticle *const pMCParticle)
Return true if passed a primary cosmic ray MCParticle.
static void GetTargetParticleWeight(const pandora::PfoList *const pPfoList, float &targetParticleWeight, float &totalWeight, std::function< bool(const pandora::MCParticle *const)> fCriteria)
Get the target particle weight in a list of pfos.
float m_maxCosmicRayFraction
The maximum cosmic ray fraction for a pfo to be declared an ambiguous cosmic ray. ...
static void GetAllDownstreamPfos(const pandora::PfoList &inputPfoList, pandora::PfoList &outputPfoList)
Get a flat list of all pfos, recursively, of all daughters associated with those pfos in an input lis...
static void GetAllConnectedPfos(const pandora::PfoList &inputPfoList, pandora::PfoList &outputPfoList)
Get a flat list of all pfos, recursively including all daughters and parents associated with those pf...
QTextStream & endl(QTextStream &s)
StatusCode lar_content::CheatingCosmicRayTaggingTool::ReadSettings ( const pandora::TiXmlHandle  xmlHandle)
private

Definition at line 52 of file CheatingCosmicRayTaggingTool.cc.

53 {
54  PANDORA_RETURN_RESULT_IF_AND_IF(
55  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "MaxCosmicRayFraction", m_maxCosmicRayFraction));
56 
57  return STATUS_CODE_SUCCESS;
58 }
float m_maxCosmicRayFraction
The maximum cosmic ray fraction for a pfo to be declared an ambiguous cosmic ray. ...

Member Data Documentation

float lar_content::CheatingCosmicRayTaggingTool::m_maxCosmicRayFraction
private

The maximum cosmic ray fraction for a pfo to be declared an ambiguous cosmic ray.

Definition at line 32 of file CheatingCosmicRayTaggingTool.h.


The documentation for this class was generated from the following files: