LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
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

Constructor & Destructor Documentation

lar_content::CheatingCosmicRayTaggingTool::CheatingCosmicRayTaggingTool ( )

Default constructor.

Definition at line 22 of file CheatingCosmicRayTaggingTool.cc.

22  :
24 {
25 }
TFile f
Definition: plotHisto.C:6
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 29 of file CheatingCosmicRayTaggingTool.cc.

References f, lar_content::LArPfoHelper::GetAllConnectedPfos(), lar_content::LArPfoHelper::GetAllDownstreamPfos(), lar_content::CheatingSliceIdBaseTool::GetTargetParticleWeight(), lar_content::LArMCParticleHelper::IsCosmicRay(), and m_maxCosmicRayFraction.

30 {
31  if (this->GetPandora().GetSettings()->ShouldDisplayAlgorithmInfo())
32  std::cout << "----> Running Algorithm Tool: " << this->GetInstanceName() << ", " << this->GetType() << std::endl;
33 
34  PfoList ambiguousParentPfos;
35 
36  for (const Pfo *const pParentCosmicRayPfo : parentCosmicRayPfos)
37  {
38  PfoList downstreamPfos;
39  LArPfoHelper::GetAllDownstreamPfos(pParentCosmicRayPfo, downstreamPfos);
40 
41  float thisCosmicRayWeight(0.f), thisTotalWeight(0.f);
42  CheatingSliceIdBaseTool::GetTargetParticleWeight(&downstreamPfos, thisCosmicRayWeight, thisTotalWeight, LArMCParticleHelper::IsCosmicRay);
43 
44  if ((thisTotalWeight > 0.f) && ((thisCosmicRayWeight / thisTotalWeight) < m_maxCosmicRayFraction))
45  ambiguousParentPfos.push_back(pParentCosmicRayPfo);
46  }
47 
48  LArPfoHelper::GetAllConnectedPfos(ambiguousParentPfos, ambiguousPfos);
49 }
TFile f
Definition: plotHisto.C:6
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...
StatusCode lar_content::CheatingCosmicRayTaggingTool::ReadSettings ( const pandora::TiXmlHandle  xmlHandle)
private

Definition at line 53 of file CheatingCosmicRayTaggingTool.cc.

References m_maxCosmicRayFraction.

54 {
55  PANDORA_RETURN_RESULT_IF_AND_IF(
56  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "MaxCosmicRayFraction", m_maxCosmicRayFraction));
57 
58  return STATUS_CODE_SUCCESS;
59 }
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 33 of file CheatingCosmicRayTaggingTool.h.

Referenced by FindAmbiguousPfos(), and ReadSettings().


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