ATLAS Offline Software
Loading...
Searching...
No Matches
MuonClusterHypoTool Class Reference

#include <MuonClusterHypoTool.h>

Inheritance diagram for MuonClusterHypoTool:
Collaboration diagram for MuonClusterHypoTool:

Classes

struct  DecisionInfo

Public Member Functions

 MuonClusterHypoTool (const std::string &type, const std::string &name, const IInterface *parent)
 ~MuonClusterHypoTool ()
StatusCode initialize ()
StatusCode decide (DecisionInfo &input) const
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

HLT::Identifier m_decisionId
ToolHandle< GenericMonitoringToolm_monTool { this, "MonTool", "", "Monitoring tool" }
Gaudi::Property< bool > m_acceptAll {this, "acceptAll", false, "Whether we are to accept all MuonRoIClusters or only those that pass selection"}
Gaudi::Property< int > m_nRoIEndCap {this, "nRoIEndCap", 4, "Number of RoI required to reconstruct a cluster in the Endcap"}
Gaudi::Property< int > m_nRoIBarrel {this, "nRoIBarrel", 3, "Number of RoI required to reconstruct a cluster in the Barrel"}
Gaudi::Property< float > m_etaMax {this, "maxEta", 2.5, "Maximum eta value below which muonRoIClusters can reliably be reconstructed"}
Gaudi::Property< float > m_etaMid {this, "midEta", 1.0, "Eta value used to define the boundary between the Barrel and Endcap"}
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default)
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

Definition at line 31 of file MuonClusterHypoTool.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ MuonClusterHypoTool()

MuonClusterHypoTool::MuonClusterHypoTool ( const std::string & type,
const std::string & name,
const IInterface * parent )

Definition at line 33 of file MuonClusterHypoTool.cxx.

36 : AthAlgTool( type, name, parent ),
AthAlgTool()
Default constructor:
static HLT::Identifier fromToolName(const std::string &tname)
HLT::Identifier m_decisionId

◆ ~MuonClusterHypoTool()

MuonClusterHypoTool::~MuonClusterHypoTool ( )

Definition at line 49 of file MuonClusterHypoTool.cxx.

49{}

Member Function Documentation

◆ decide()

StatusCode MuonClusterHypoTool::decide ( DecisionInfo & input) const

Definition at line 51 of file MuonClusterHypoTool.cxx.

52{
53 auto monNumberRoI = Monitored::Scalar<int>( "numberRoI", -99 );
54
55 auto monEtaClust = Monitored::Scalar<float>( "etaClust", -99 );
56 auto monPhiClust = Monitored::Scalar<float>( "phiClust", -99 );
57 auto monEtaClustPass = Monitored::Scalar<float>( "etaClustPass", -99 );
58 auto monPhiClustPass = Monitored::Scalar<float>( "phiClustPass", -99 );
59
60 auto monNumRoIB = Monitored::Scalar<int>( "nRoIBarrel", -99 );
61 auto monNumRoIE = Monitored::Scalar<int>( "nRoIEndcap", -99 );
62 auto monNumRoIBPass = Monitored::Scalar<int>( "nRoIBarrelPass", -99 );
63 auto monNumRoIEPass = Monitored::Scalar<int>( "nRoIEndcapPass", -99 );
64
65 auto result = Monitored::Scalar<Bool_t>( "result", false );
66 auto chainActive = Monitored::Scalar<Bool_t>( "chainActive", false );
67
68 auto t1 = Monitored::Timer("TIME_HypoTool"); // microseconds
69 auto t2 = Monitored::Timer("TIME_HypoTool_GetCluster");
70 auto t3 = Monitored::Timer("TIME_HypoTool_Selection");
71
72 auto monitorIt = Monitored::Group( m_monTool, monNumberRoI, monEtaClust, monPhiClust,
73 monNumRoIB, monNumRoIE, monEtaClustPass, monPhiClustPass,
74 result, monNumRoIBPass, monNumRoIEPass, chainActive,
75 t1, t2, t3 );
76
77 const xAOD::TrigCompositeContainer *compCont = input.Composites;
79
80 // Exctracting MuonClusterRoI info
81 ATH_MSG_DEBUG("Found " << compCont->size() << " TrigComposite objects");
82
83 int numberRoI = 0;
84 float etaClust = -99;
85 float phiClust = -99;
86
87 bool foundMuonRoICluster = false;
88
89 t2.start();
90 for(const xAOD::TrigComposite *compObj : *compCont) {
91 ATH_MSG_DEBUG("TrigComposite ptr = " << compObj);
92 ATH_MSG_DEBUG("Found object named Cluster : " << (compObj->name()== "Cluster" ? "yes":"no"));
93 if(compObj->name() == "Cluster" ) {
94 foundMuonRoICluster = true;
95 //if we can't access all the variables necessary for the trigger hypothesis,
96 //return FAILURE, because it means the variables are missing
97 if(!compObj->getDetail("nRoIs", numberRoI)) { return StatusCode::FAILURE; }
98 if(!compObj->getDetail("ClusterEta", etaClust)) { return StatusCode::FAILURE; }
99 if(!compObj->getDetail("ClusterPhi", phiClust)) { return StatusCode::FAILURE; }
100 }
101 }
102 t2.stop();
103 if( !foundMuonRoICluster ) { return StatusCode::FAILURE;}
104
105 // Updating Monitoring values
106 monNumberRoI = numberRoI;
107 monEtaClust = etaClust;
108 monPhiClust = phiClust;
109
110 // Monitor ALL muonRoICluster multiplicities
111 if(fabs(etaClust)< m_etaMid){
112 monNumRoIB = numberRoI;
113 } else if((fabs(etaClust)>= m_etaMid && fabs(etaClust)<= m_etaMax)){
114 monNumRoIE = numberRoI;
115 }
116
117 // Bool as to whether we passed.
118 result = false;
119
120 // acceptAll can be enabled for testing
121 if(m_acceptAll) {
122 t3.start();
123 result = true;
124 ATH_MSG_DEBUG("Accept property is set: taking all the events");
125 t3.stop();
126
127 } else {
128
129 t3.start();
130 result = true; //set result to true in case of errors for safety
131
132 ATH_MSG_DEBUG("Cluster has " << numberRoI << " muon RoIs, at (eta, phi) = (" << etaClust << ", " << phiClust << ")");
133
134 // Cut on number of RoIs in the cluster
135 if(fabs(etaClust)<=m_etaMax) {
136
137 if(fabs(etaClust)< m_etaMid && numberRoI >= m_nRoIBarrel) {
138
139 ATH_MSG_DEBUG("Cluster passes barrel selection > " << m_nRoIBarrel << " RoIs");
140
141 // monitored variables
142 monNumRoIBPass = numberRoI;
143 monEtaClustPass = etaClust;
144 monPhiClustPass = phiClust;
145 result = true;
146
147 } else if((fabs(etaClust)>= m_etaMid && fabs(etaClust)<= m_etaMax) && numberRoI >= m_nRoIEndCap) {
148
149 ATH_MSG_DEBUG("Cluster passes endcap selection > " << m_nRoIEndCap << " RoIs");
150
151 // monitored variables
152 monNumRoIEPass = numberRoI;
153 monEtaClustPass = etaClust;
154 monPhiClustPass = phiClust;
155 result = true;
156
157 } else {
158 ATH_MSG_DEBUG("Cluster does not satisfy all the conditions... event not accepted");
159 result = false;
160 }
161
162 } else {
163 ATH_MSG_DEBUG("Cluster location past maximum permitted eta... event not accepted");
164 result = false;
165 }
166
167 t3.stop();
168
169 }
170
171 ATH_MSG_DEBUG( "Writing out active chains:" );
172 for (DecisionID activeChain : prev)
173 {
174 ATH_MSG_DEBUG( HLT::Identifier( activeChain ) );
175 }
176
177 // Checking if this HypoTool's chain is active in this event...
178 chainActive = prev.count(m_decisionId.numeric()) > 0;
179 if( (prev.count(m_decisionId.numeric()) > 0 ) )
180 {
181 // If it's active, then check selection. ie nothing should pass if its not active.
182 if( result ) {
183 addDecisionID( m_decisionId.numeric(), input.decision );
184 ATH_MSG_DEBUG("event accepted");
185
186 return StatusCode::SUCCESS;
187 }
188 else {
189 return StatusCode::SUCCESS;
190 }
191 } else {
192 return StatusCode::SUCCESS;
193 }
194}
#define ATH_MSG_DEBUG(x)
size_type size() const noexcept
Returns the number of elements in the collection.
Gaudi::Property< int > m_nRoIEndCap
ToolHandle< GenericMonitoringTool > m_monTool
Gaudi::Property< float > m_etaMax
Gaudi::Property< float > m_etaMid
Gaudi::Property< bool > m_acceptAll
Gaudi::Property< int > m_nRoIBarrel
std::vector< ALFA_RawDataContainer_p1 > t2
std::vector< ALFA_RawDataCollection_p1 > t1
std::vector< LUCID_RawData_p1 > t3
unsigned int DecisionID
std::set< DecisionID > DecisionIDContainer
void addDecisionID(DecisionID id, Decision *d)
Appends the decision (given as ID) to the decision object.
TrigCompositeContainer_v1 TrigCompositeContainer
Declare the latest version of the container.
TrigComposite_v1 TrigComposite
Declare the latest version of the class.

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ initialize()

StatusCode MuonClusterHypoTool::initialize ( )

Definition at line 39 of file MuonClusterHypoTool.cxx.

40{
41 if ( !m_monTool.empty() ) ATH_CHECK( m_monTool.retrieve() );
42
43 ATH_MSG_INFO("Initialization completed successfully:");
44 ATH_MSG_INFO("Tool configured for chain/id: " << m_decisionId);
45
46 return StatusCode::SUCCESS;
47}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_INFO(x)

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ msg()

MsgStream & AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ msgLvl()

bool AthCommonMsg< AlgTool >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ renounce()

std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > AthCommonDataStore< AthCommonMsg< AlgTool > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in asg::AsgMetadataTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and DerivationFramework::CfAthAlgTool.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308 {
309 // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310 // << " size: " << m_vhka.size() << endmsg;
311 for (auto &a : m_vhka) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }
std::vector< SG::VarHandleKeyArray * > m_vhka

Member Data Documentation

◆ m_acceptAll

Gaudi::Property<bool> MuonClusterHypoTool::m_acceptAll {this, "acceptAll", false, "Whether we are to accept all MuonRoIClusters or only those that pass selection"}
private

Definition at line 52 of file MuonClusterHypoTool.h.

52{this, "acceptAll", false, "Whether we are to accept all MuonRoIClusters or only those that pass selection"};

◆ m_decisionId

HLT::Identifier MuonClusterHypoTool::m_decisionId
private

Definition at line 50 of file MuonClusterHypoTool.h.

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_etaMax

Gaudi::Property<float> MuonClusterHypoTool::m_etaMax {this, "maxEta", 2.5, "Maximum eta value below which muonRoIClusters can reliably be reconstructed"}
private

Definition at line 55 of file MuonClusterHypoTool.h.

55{this, "maxEta", 2.5, "Maximum eta value below which muonRoIClusters can reliably be reconstructed"};

◆ m_etaMid

Gaudi::Property<float> MuonClusterHypoTool::m_etaMid {this, "midEta", 1.0, "Eta value used to define the boundary between the Barrel and Endcap"}
private

Definition at line 56 of file MuonClusterHypoTool.h.

56{this, "midEta", 1.0, "Eta value used to define the boundary between the Barrel and Endcap"};

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_monTool

ToolHandle<GenericMonitoringTool> MuonClusterHypoTool::m_monTool { this, "MonTool", "", "Monitoring tool" }
private

Definition at line 51 of file MuonClusterHypoTool.h.

51{ this, "MonTool", "", "Monitoring tool" };

◆ m_nRoIBarrel

Gaudi::Property<int> MuonClusterHypoTool::m_nRoIBarrel {this, "nRoIBarrel", 3, "Number of RoI required to reconstruct a cluster in the Barrel"}
private

Definition at line 54 of file MuonClusterHypoTool.h.

54{this, "nRoIBarrel", 3, "Number of RoI required to reconstruct a cluster in the Barrel"};

◆ m_nRoIEndCap

Gaudi::Property<int> MuonClusterHypoTool::m_nRoIEndCap {this, "nRoIEndCap", 4, "Number of RoI required to reconstruct a cluster in the Endcap"}
private

Definition at line 53 of file MuonClusterHypoTool.h.

53{this, "nRoIEndCap", 4, "Number of RoI required to reconstruct a cluster in the Endcap"};

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.


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