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

#include <SPCountHypoTool.h>

Inheritance diagram for SPCountHypoTool:
Collaboration diagram for SPCountHypoTool:

Classes

struct  SPCountsInfo

Public Member Functions

 SPCountHypoTool (const std::string &type, const std::string &name, const IInterface *parent)
virtual StatusCode initialize () override
StatusCode decide (SPCountsInfo &decisions) const
virtual StatusCode sysInitialize () override
 Perform system initialization for the component.
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 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

template<typename DetailType>
bool applyCut (const Gaudi::Property< DetailType > &threshold, const xAOD::TrigComposite *composit, const std::string_view name="") const
template<typename DetailType>
bool applyInverseCut (const Gaudi::Property< DetailType > &threshold, const xAOD::TrigComposite *composit, const std::string_view name="") const
StatusCode isConfigured ()
 Check if component is configured in JobOptionsSvc.
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
Gaudi::Property< int > m_pixCL {this, "pixCL", -1, "Require Clusters (of any size) Count > threshold (-1 disabled) in whole pixel"}
Gaudi::Property< int > m_pixCLMax {this, "pixCLMax", -1, "Require Clusters (of any size) Count < threshold (-1 disabled) in whole pixel"}
Gaudi::Property< int > m_pixCLnoToT {this, "pixCLnoToT", -1, "Require Clusters (of any size, without ToT cut) Count > threshold (-1 disabled) in whole pixel"}
Gaudi::Property< int > m_pixCL_1 {this, "pixCL_1", -1, "Require Clusters Count made of clusters of size 1 > threshold (-1 disabled) in whole pixel"}
Gaudi::Property< int > m_pixCL_2 {this, "pixCL_2", -1, "Require Clusters Count made of clusters of size 2 > threshold (-1 disabled) in whole pixel"}
Gaudi::Property< int > m_pixCLmin3 {this, "pixCLmin3", -1, "Accept eventss with minimum 3 SP Count > threshold (-1 disabled) in pixel"}
Gaudi::Property< int > m_pixCLBarrel {this, "pixCLBarrel", -1, "Require Clusters Count > threshold (-1 disabled) in pixel Barrel"}
Gaudi::Property< int > m_pixCLEndcapA {this, "pixCLEndcapA", -1, "Require Clusters Count > threshold (-1 disabled) in pixel Endcap A side"}
Gaudi::Property< int > m_pixCLEndcapC {this, "pixCLEndcapC", -1, "Require Clusters > threshold (-1 disabled) in pixel Endcap C side"}
Gaudi::Property< int > m_sctSP {this, "sctSP", -1, "Require SP Count > threshold (-1 disabled) in whole SCT"}
Gaudi::Property< int > m_sctSPMax {this, "sctSPMax", -1, "Require SP Count < threshold (-1 disabled) in whole SCT"}
Gaudi::Property< int > m_sctSPBarrel {this, "sctSPBarrel", -1, "Require SP Count > threshold (-1 disabled) in SCT Barrel"}
Gaudi::Property< int > m_sctSPEndcapA {this, "sctSPEndcapA", -1, "Require SP Count > threshold (-1 disabled) in SCT Endcap A side"}
Gaudi::Property< int > m_sctSPEndcapC {this, "sctSPEndcapC", -1, "Require SP Count > threshold (-1 disabled) in SCT Endcap C side"}
Gaudi::Property< bool > m_logicAnd {this, "TriggerTypeAnd", true, "And/Or Logic"}
Gaudi::Property< float > m_pixQ2mod {this, "pixQ2mod", -1, "Cut on the value of QT magnitude"}
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 13 of file SPCountHypoTool.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

◆ SPCountHypoTool()

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

Definition at line 11 of file SPCountHypoTool.cxx.

12 : AthCheckedComponent<AthAlgTool>(type, name, parent), m_decisionId(HLT::Identifier::fromToolName(name)) {}
static HLT::Identifier fromToolName(const std::string &tname)
HLT::Identifier m_decisionId

Member Function Documentation

◆ applyCut()

template<typename DetailType>
bool SPCountHypoTool::applyCut ( const Gaudi::Property< DetailType > & threshold,
const xAOD::TrigComposite * composit,
const std::string_view name = "" ) const
private

Definition at line 19 of file SPCountHypoTool.cxx.

19 {
20 if (threshold == -1) {
21 return m_logicAnd; // If the logic is And, it should return true and otherwise it should return false.
22 }
23 const std::string detailName = (name != "" ? std::string(name) : threshold.name());
24
25 ATH_MSG_DEBUG("count for = " << threshold.name() << "=" << (composit->getDetail<DetailType>(detailName) > threshold));
26 return (composit->getDetail<DetailType>(detailName) > threshold);
27}
#define ATH_MSG_DEBUG(x)
Gaudi::Property< bool > m_logicAnd
bool getDetail(const std::string &name, TYPE &value) const
Get an TYPE detail from the object.

◆ applyInverseCut()

template<typename DetailType>
bool SPCountHypoTool::applyInverseCut ( const Gaudi::Property< DetailType > & threshold,
const xAOD::TrigComposite * composit,
const std::string_view name = "" ) const
private

Definition at line 30 of file SPCountHypoTool.cxx.

30 {
31 if (threshold == -1) {
32 return m_logicAnd; // If the logic is And, it should return true and otherwise it should return false.
33 }
34 const std::string detailName = (name != "" ? std::string(name) : threshold.name());
35
36 ATH_MSG_DEBUG("count for = " << threshold.name() << "=" << (composit->getDetail<DetailType>(detailName) < threshold));
37 return (composit->getDetail<DetailType>(detailName) < threshold); // here is the difference
38}

◆ decide()

StatusCode SPCountHypoTool::decide ( SPCountsInfo & decisions) const

Definition at line 40 of file SPCountHypoTool.cxx.

40 {
41 if (spinfo.previousDecisionIDs.count(m_decisionId.numeric()) == 0) {
42 ATH_MSG_DEBUG("Already rejected");
43 return StatusCode::SUCCESS;
44 }
45
46 // clang-format off
47 std::vector<bool> decisionCuts({
48 applyCut(m_pixCL, spinfo.counts),
49 applyInverseCut(m_pixCLMax, spinfo.counts, "pixCL"),
50 applyCut(m_pixCLnoToT, spinfo.counts),
51 applyCut(m_pixCL_1, spinfo.counts),
52 applyCut(m_pixCL_2, spinfo.counts),
53 applyCut(m_pixCLmin3, spinfo.counts),
54 applyCut(m_pixCLBarrel, spinfo.counts),
55 applyCut(m_pixCLEndcapA, spinfo.counts),
56 applyCut(m_pixCLEndcapC, spinfo.counts),
57 applyCut(m_sctSP, spinfo.counts),
58 applyInverseCut(m_sctSPMax, spinfo.counts, "sctSP"),
59 applyCut(m_sctSPBarrel, spinfo.counts),
60 applyCut(m_sctSPEndcapA, spinfo.counts),
61 applyCut(m_sctSPEndcapC, spinfo.counts),
62 applyCut(m_pixQ2mod, spinfo.counts)}
63 );
64 // clang-format on
65
66 if (m_logicAnd && !std::all_of(decisionCuts.begin(), decisionCuts.end(), [](bool k) { return k; })) {
67 ATH_MSG_DEBUG("REGTEST " << name() << " rejected");
68 return StatusCode::SUCCESS;
69 } else if (m_logicAnd == false && !std::any_of(decisionCuts.begin(), decisionCuts.end(), [](bool k) { return k; })) {
70 ATH_MSG_DEBUG("REGTEST " << name() << " rejected");
71 return StatusCode::SUCCESS;
72 } else {
73 addDecisionID(m_decisionId.numeric(), spinfo.decision);
74 ATH_MSG_DEBUG("REGTEST " << name() << " accepted");
75 }
76
77 return StatusCode::SUCCESS;
78}
Gaudi::Property< int > m_sctSPBarrel
Gaudi::Property< int > m_pixCL_1
Gaudi::Property< int > m_pixCLEndcapC
Gaudi::Property< int > m_sctSPMax
Gaudi::Property< int > m_sctSPEndcapC
Gaudi::Property< float > m_pixQ2mod
Gaudi::Property< int > m_pixCLMax
Gaudi::Property< int > m_pixCL_2
Gaudi::Property< int > m_pixCL
bool applyCut(const Gaudi::Property< DetailType > &threshold, const xAOD::TrigComposite *composit, const std::string_view name="") const
Gaudi::Property< int > m_pixCLmin3
Gaudi::Property< int > m_pixCLBarrel
bool applyInverseCut(const Gaudi::Property< DetailType > &threshold, const xAOD::TrigComposite *composit, const std::string_view name="") const
Gaudi::Property< int > m_sctSP
Gaudi::Property< int > m_sctSPEndcapA
Gaudi::Property< int > m_pixCLEndcapA
Gaudi::Property< int > m_pixCLnoToT
void addDecisionID(DecisionID id, Decision *d)
Appends the decision (given as ID) to the decision object.

◆ 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 SPCountHypoTool::initialize ( )
overridevirtual

Definition at line 14 of file SPCountHypoTool.cxx.

14 {
15 return StatusCode::SUCCESS;
16}

◆ 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.

◆ isConfigured()

StatusCode AthCheckedComponent< ::AthAlgTool >::isConfigured ( )
privateinherited

Check if component is configured in JobOptionsSvc.

Checks if at least one property of the component is configured in the JobOptionsSvc. Can be used to detect if a component is missing its python configuration.

◆ 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 AthCheckedComponent< ::AthAlgTool >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for the component.

We overwrite this to call the additional checkers below.

Reimplemented from AthCommonDataStore< AthCommonMsg< AlgTool > >.

◆ 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_decisionId

HLT::Identifier SPCountHypoTool::m_decisionId
private

Definition at line 33 of file SPCountHypoTool.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_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_logicAnd

Gaudi::Property<bool> SPCountHypoTool::m_logicAnd {this, "TriggerTypeAnd", true, "And/Or Logic"}
private

Definition at line 49 of file SPCountHypoTool.h.

49{this, "TriggerTypeAnd", true, "And/Or Logic"};

◆ m_pixCL

Gaudi::Property<int> SPCountHypoTool::m_pixCL {this, "pixCL", -1, "Require Clusters (of any size) Count > threshold (-1 disabled) in whole pixel"}
private

Definition at line 35 of file SPCountHypoTool.h.

35{this, "pixCL", -1, "Require Clusters (of any size) Count > threshold (-1 disabled) in whole pixel"};

◆ m_pixCL_1

Gaudi::Property<int> SPCountHypoTool::m_pixCL_1 {this, "pixCL_1", -1, "Require Clusters Count made of clusters of size 1 > threshold (-1 disabled) in whole pixel"}
private

Definition at line 38 of file SPCountHypoTool.h.

38{this, "pixCL_1", -1, "Require Clusters Count made of clusters of size 1 > threshold (-1 disabled) in whole pixel"};

◆ m_pixCL_2

Gaudi::Property<int> SPCountHypoTool::m_pixCL_2 {this, "pixCL_2", -1, "Require Clusters Count made of clusters of size 2 > threshold (-1 disabled) in whole pixel"}
private

Definition at line 39 of file SPCountHypoTool.h.

39{this, "pixCL_2", -1, "Require Clusters Count made of clusters of size 2 > threshold (-1 disabled) in whole pixel"};

◆ m_pixCLBarrel

Gaudi::Property<int> SPCountHypoTool::m_pixCLBarrel {this, "pixCLBarrel", -1, "Require Clusters Count > threshold (-1 disabled) in pixel Barrel"}
private

Definition at line 41 of file SPCountHypoTool.h.

41{this, "pixCLBarrel", -1, "Require Clusters Count > threshold (-1 disabled) in pixel Barrel"};

◆ m_pixCLEndcapA

Gaudi::Property<int> SPCountHypoTool::m_pixCLEndcapA {this, "pixCLEndcapA", -1, "Require Clusters Count > threshold (-1 disabled) in pixel Endcap A side"}
private

Definition at line 42 of file SPCountHypoTool.h.

42{this, "pixCLEndcapA", -1, "Require Clusters Count > threshold (-1 disabled) in pixel Endcap A side"};

◆ m_pixCLEndcapC

Gaudi::Property<int> SPCountHypoTool::m_pixCLEndcapC {this, "pixCLEndcapC", -1, "Require Clusters > threshold (-1 disabled) in pixel Endcap C side"}
private

Definition at line 43 of file SPCountHypoTool.h.

43{this, "pixCLEndcapC", -1, "Require Clusters > threshold (-1 disabled) in pixel Endcap C side"};

◆ m_pixCLMax

Gaudi::Property<int> SPCountHypoTool::m_pixCLMax {this, "pixCLMax", -1, "Require Clusters (of any size) Count < threshold (-1 disabled) in whole pixel"}
private

Definition at line 36 of file SPCountHypoTool.h.

36{this, "pixCLMax", -1, "Require Clusters (of any size) Count < threshold (-1 disabled) in whole pixel"};

◆ m_pixCLmin3

Gaudi::Property<int> SPCountHypoTool::m_pixCLmin3 {this, "pixCLmin3", -1, "Accept eventss with minimum 3 SP Count > threshold (-1 disabled) in pixel"}
private

Definition at line 40 of file SPCountHypoTool.h.

40{this, "pixCLmin3", -1, "Accept eventss with minimum 3 SP Count > threshold (-1 disabled) in pixel"};

◆ m_pixCLnoToT

Gaudi::Property<int> SPCountHypoTool::m_pixCLnoToT {this, "pixCLnoToT", -1, "Require Clusters (of any size, without ToT cut) Count > threshold (-1 disabled) in whole pixel"}
private

Definition at line 37 of file SPCountHypoTool.h.

37{this, "pixCLnoToT", -1, "Require Clusters (of any size, without ToT cut) Count > threshold (-1 disabled) in whole pixel"};

◆ m_pixQ2mod

Gaudi::Property<float> SPCountHypoTool::m_pixQ2mod {this, "pixQ2mod", -1, "Cut on the value of QT magnitude"}
private

Definition at line 50 of file SPCountHypoTool.h.

50{this, "pixQ2mod", -1, "Cut on the value of QT magnitude"};

◆ m_sctSP

Gaudi::Property<int> SPCountHypoTool::m_sctSP {this, "sctSP", -1, "Require SP Count > threshold (-1 disabled) in whole SCT"}
private

Definition at line 44 of file SPCountHypoTool.h.

44{this, "sctSP", -1, "Require SP Count > threshold (-1 disabled) in whole SCT"};

◆ m_sctSPBarrel

Gaudi::Property<int> SPCountHypoTool::m_sctSPBarrel {this, "sctSPBarrel", -1, "Require SP Count > threshold (-1 disabled) in SCT Barrel"}
private

Definition at line 46 of file SPCountHypoTool.h.

46{this, "sctSPBarrel", -1, "Require SP Count > threshold (-1 disabled) in SCT Barrel"};

◆ m_sctSPEndcapA

Gaudi::Property<int> SPCountHypoTool::m_sctSPEndcapA {this, "sctSPEndcapA", -1, "Require SP Count > threshold (-1 disabled) in SCT Endcap A side"}
private

Definition at line 47 of file SPCountHypoTool.h.

47{this, "sctSPEndcapA", -1, "Require SP Count > threshold (-1 disabled) in SCT Endcap A side"};

◆ m_sctSPEndcapC

Gaudi::Property<int> SPCountHypoTool::m_sctSPEndcapC {this, "sctSPEndcapC", -1, "Require SP Count > threshold (-1 disabled) in SCT Endcap C side"}
private

Definition at line 48 of file SPCountHypoTool.h.

48{this, "sctSPEndcapC", -1, "Require SP Count > threshold (-1 disabled) in SCT Endcap C side"};

◆ m_sctSPMax

Gaudi::Property<int> SPCountHypoTool::m_sctSPMax {this, "sctSPMax", -1, "Require SP Count < threshold (-1 disabled) in whole SCT"}
private

Definition at line 45 of file SPCountHypoTool.h.

45{this, "sctSPMax", -1, "Require SP Count < threshold (-1 disabled) in whole SCT"};

◆ 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: