ATLAS Offline Software
Loading...
Searching...
No Matches
ISF::KeepChildrenTruthStrategy Class Referencefinal

A modifier for the purposes of truth strategies defining cases in which we should keep all the children of an interaction. More...

#include <KeepChildrenTruthStrategy.h>

Inheritance diagram for ISF::KeepChildrenTruthStrategy:
Collaboration diagram for ISF::KeepChildrenTruthStrategy:

Public Member Functions

 KeepChildrenTruthStrategy (const std::string &t, const std::string &n, const IInterface *p)
 Constructor with parameters.
 ~KeepChildrenTruthStrategy ()=default
 Destructor.
virtual StatusCode initialize () override final
virtual bool pass (ITruthIncident &incident) const override final
 true if the ITruthStrategy implementation applies to the given ITruthIncident
virtual bool appliesToRegion (unsigned short) const override final
 true if the strategy applies to this region

Private Attributes

Gaudi::Property< VertexTypesVectorm_vertexTypesVector {this, "VertexTypes", 0}
 vertex type (physics code) checks
VertexTypesSet m_vertexTypes {}
 optimized for search
bool m_doVertexRangeCheck {false}
Gaudi::Property< int > m_vertexTypeRangeLow {this, "VertexTypeRangeLow", 0}
Gaudi::Property< int > m_vertexTypeRangeHigh {this, "VertexTypeRangeHigh", 0}
unsigned m_vertexTypeRangeLength {0}
Gaudi::Property< int > m_passProcessCategory {this, "PassProcessCategory", 9}
Gaudi::Property< bool > m_bsmParent {this, "BSMParent", false}
 Apply to BSM parents.
Gaudi::Property< PDGCodesVectorm_parentPdgCodesVector {this, "ParentPDGCodes", 0}
 PDG code checks.
PDGCodesSet m_parentPdgCodes {}
 optimized for search

Detailed Description

A modifier for the purposes of truth strategies defining cases in which we should keep all the children of an interaction.

Author
Zach.Marshall -at- cern.ch

Definition at line 31 of file KeepChildrenTruthStrategy.h.

Constructor & Destructor Documentation

◆ KeepChildrenTruthStrategy()

ISF::KeepChildrenTruthStrategy::KeepChildrenTruthStrategy ( const std::string & t,
const std::string & n,
const IInterface * p )

Constructor with parameters.

Constructor.

Definition at line 17 of file KeepChildrenTruthStrategy.cxx.

18 : base_class(t,n,p)
19{
20}

◆ ~KeepChildrenTruthStrategy()

ISF::KeepChildrenTruthStrategy::~KeepChildrenTruthStrategy ( )
default

Destructor.

Member Function Documentation

◆ appliesToRegion()

bool ISF::KeepChildrenTruthStrategy::appliesToRegion ( unsigned short ) const
finaloverridevirtual

true if the strategy applies to this region

Definition at line 85 of file KeepChildrenTruthStrategy.cxx.

86{
87 // This applies to all regions, since it is only a modifier
88 return true;
89}

◆ initialize()

StatusCode ISF::KeepChildrenTruthStrategy::initialize ( )
finaloverridevirtual

Definition at line 23 of file KeepChildrenTruthStrategy.cxx.

24{
25 ATH_MSG_VERBOSE("Initializing ...");
26
27 // VertexTypeRanges:
28 //
29 // check whether user input makes sense:
31 ATH_MSG_ERROR("The given parameter VertexTypeRangeLow is bigger than VertexTypeRangeHigh. ABORT");
32 return StatusCode::FAILURE;
33 }
34 // the length of the given vertex type range
36 // if neither lower now upper range limit given, disable range check
38
39 // fill PDG code std::set used for optimized search
41
42 // fill vertex type std::set used for optimized search
44
45 return StatusCode::SUCCESS;
46}
#define ATH_MSG_ERROR(x)
#define ATH_MSG_VERBOSE(x)
VertexTypesSet m_vertexTypes
optimized for search
Gaudi::Property< PDGCodesVector > m_parentPdgCodesVector
PDG code checks.
Gaudi::Property< VertexTypesVector > m_vertexTypesVector
vertex type (physics code) checks
PDGCodesSet m_parentPdgCodes
optimized for search

◆ pass()

bool ISF::KeepChildrenTruthStrategy::pass ( ITruthIncident & incident) const
finaloverridevirtual

true if the ITruthStrategy implementation applies to the given ITruthIncident

Definition at line 48 of file KeepChildrenTruthStrategy.cxx.

48 {
49
50 // check whether parent PDG code matches with any of the given ones
51 // Could require BSM parents and hit BSM, or give a list and be on the list
52 // Or require neither and apply to everything
53 if ( !( (m_bsmParent && MC::isBSM(abs(ti.parentPdgCode()))) || // BSM parent and parent is BSM
54 (m_parentPdgCodes.size() && m_parentPdgCodes.find(ti.parentPdgCode())==m_parentPdgCodes.end()) || // Explicit list and parent in the list
55 (!m_bsmParent && !m_parentPdgCodes.size()) ) ){ // Neither BSM parent nor explicit list -- allow all
56 return false;
57 }
58
59 // vertex type check
60 // ----
61 int vxtype = ti.physicsProcessCode();
62 int processCategory = ti.physicsProcessCategory(); // == G4ProcessType
63 if ((processCategory!=m_passProcessCategory && m_passProcessCategory!=0) && // Not in the category we were after
64 (m_doVertexRangeCheck || m_vertexTypes.size()) ){ // Should do the category check
65 // (part 1) vxtype in given range?: this is a small performance trick (only one comparison operator to check if within range)
66 // -> exactly equivalent to: m_doVertexRangeCheck && (m_vertexTypeLow<=vxtype) && (vxtype<=m_vertexTypeRangeHigh)
67 bool vtxTypeRangePassed = m_doVertexRangeCheck && ( unsigned(vxtype-m_vertexTypeRangeLow) < m_vertexTypeRangeLength );
68 // (part 2) if not in range or range check disabled, check whether vxtype
69 // std::set contains the given vertex type
70 if ( (!vtxTypeRangePassed) && (m_vertexTypes.find(vxtype)==m_vertexTypes.end()) ) {
71 // vxtype not registered -> not passed
72 return false;
73 }
74 }
75
76 // all cuts passed. Save all children.
77 for (unsigned short i=0;i<ti.numberOfChildren();++i){
78 ti.setChildPassedFilters(i);
79 }
80
81 // This strategy does not cause the *saving* of a vertex -- it only changes the strategy for the children
82 return false;
83}
Gaudi::Property< bool > m_bsmParent
Apply to BSM parents.
bool isBSM(const T &p)
APID: graviton and all Higgs extensions are BSM.

Member Data Documentation

◆ m_bsmParent

Gaudi::Property<bool> ISF::KeepChildrenTruthStrategy::m_bsmParent {this, "BSMParent", false}
private

Apply to BSM parents.

Definition at line 59 of file KeepChildrenTruthStrategy.h.

59{this, "BSMParent", false};

◆ m_doVertexRangeCheck

bool ISF::KeepChildrenTruthStrategy::m_doVertexRangeCheck {false}
private

Definition at line 54 of file KeepChildrenTruthStrategy.h.

54{false};

◆ m_parentPdgCodes

PDGCodesSet ISF::KeepChildrenTruthStrategy::m_parentPdgCodes {}
private

optimized for search

Definition at line 62 of file KeepChildrenTruthStrategy.h.

62{};

◆ m_parentPdgCodesVector

Gaudi::Property<PDGCodesVector> ISF::KeepChildrenTruthStrategy::m_parentPdgCodesVector {this, "ParentPDGCodes", 0}
private

PDG code checks.

Python property

Definition at line 61 of file KeepChildrenTruthStrategy.h.

61{this, "ParentPDGCodes", 0};

◆ m_passProcessCategory

Gaudi::Property<int> ISF::KeepChildrenTruthStrategy::m_passProcessCategory {this, "PassProcessCategory", 9}
private

Definition at line 58 of file KeepChildrenTruthStrategy.h.

58{this, "PassProcessCategory", 9};

◆ m_vertexTypeRangeHigh

Gaudi::Property<int> ISF::KeepChildrenTruthStrategy::m_vertexTypeRangeHigh {this, "VertexTypeRangeHigh", 0}
private

Definition at line 56 of file KeepChildrenTruthStrategy.h.

56{this, "VertexTypeRangeHigh", 0};

◆ m_vertexTypeRangeLength

unsigned ISF::KeepChildrenTruthStrategy::m_vertexTypeRangeLength {0}
private

Definition at line 57 of file KeepChildrenTruthStrategy.h.

57{0};

◆ m_vertexTypeRangeLow

Gaudi::Property<int> ISF::KeepChildrenTruthStrategy::m_vertexTypeRangeLow {this, "VertexTypeRangeLow", 0}
private

Definition at line 55 of file KeepChildrenTruthStrategy.h.

55{this, "VertexTypeRangeLow", 0};

◆ m_vertexTypes

VertexTypesSet ISF::KeepChildrenTruthStrategy::m_vertexTypes {}
private

optimized for search

Definition at line 53 of file KeepChildrenTruthStrategy.h.

53{};

◆ m_vertexTypesVector

Gaudi::Property<VertexTypesVector> ISF::KeepChildrenTruthStrategy::m_vertexTypesVector {this, "VertexTypes", 0}
private

vertex type (physics code) checks

Python property

Definition at line 52 of file KeepChildrenTruthStrategy.h.

52{this, "VertexTypes", 0};

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