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

#include <TrigVSIHypoTool.h>

Inheritance diagram for TrigVSIHypoTool:
Collaboration diagram for TrigVSIHypoTool:

Classes

struct  eventVtxInfo

Public Member Functions

 TrigVSIHypoTool (const std::string &type, const std::string &name, const IInterface *parent)
virtual ~TrigVSIHypoTool ()=default
virtual StatusCode initialize () override
StatusCode decide (eventVtxInfo &decisions) 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
Gaudi::Property< float > m_minNTrks {this, "minNTrks", 3, "Accept vertices with minimum of this number of tracks"}
Gaudi::Property< float > m_maxNTrks {this, "maxNTrks", -1, "Accept vertices with maximum of this number of tracks"}
Gaudi::Property< float > m_minR {this, "minR" , 20., "Accept vertices with decay position R greater than this limit"}
Gaudi::Property< float > m_maxR {this, "maxR" , 520., "Accept vertices with decay position R smaller than this limit"}
Gaudi::Property< float > m_minPt {this, "minPt", 1000., "Accept vertices with momentum higher than this limit"}
Gaudi::Property< float > m_maxPt {this, "maxPt", 1.4e7, "Accept vertices with momentum smaller than this limit"}
Gaudi::Property< float > m_maxChi2 {this, "maxChi2", 10., "Accept vertices with chi2 less than this limit"}
Gaudi::Property< float > m_minMass {this, "minMass", 1000., "Accept events with a vertex with the mass larger than this limit"}
Gaudi::Property< float > m_maxMass {this, "maxMass", 1.4e7, "Accept events with a vertex with the mass larger than this limit"}
Gaudi::Property< bool > m_logicAnd {this, "TriggerTypeAnd", true, "And/Or Logic for nTrkCut, RCut, pTCut, chi2Cut, massCut"}
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 15 of file TrigVSIHypoTool.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

◆ TrigVSIHypoTool()

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

Definition at line 15 of file TrigVSIHypoTool.cxx.

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

◆ ~TrigVSIHypoTool()

virtual TrigVSIHypoTool::~TrigVSIHypoTool ( )
virtualdefault

Member Function Documentation

◆ decide()

StatusCode TrigVSIHypoTool::decide ( eventVtxInfo & decisions) const

Definition at line 23 of file TrigVSIHypoTool.cxx.

23 {
24 if ( vtxinfo.previousDecisionIDs.count( m_decisionId.numeric() ) == 0 ) {
25 ATH_MSG_DEBUG("Already rejected");
26 return StatusCode::SUCCESS;
27 }
28
29 bool passNTrkCut = false;
30 bool passRCut = false;
31 bool passPtCut = false;
32 bool passChi2Cut = false;
33 bool passMassCut = false;
34
35 bool passSelection = false;
36
37 static const SG::ConstAccessor<float> vsi_massAcc ("vsi_mass");
38 static const SG::ConstAccessor<float> vsi_pTAcc ("vsi_pT");
39
40 for (auto vertex : vtxinfo.vertices) {
41 passNTrkCut = false;
42 passRCut = false;
43 passPtCut = false;
44 passChi2Cut = false;
45 passMassCut = false;
46
47 if ( vertex == nullptr ) continue;
48 const size_t ntrk = vertex->nTrackParticles();
49 const float pT = vsi_pTAcc.withDefault(*vertex, 0);
50 const float chi2 = vertex->chiSquared();
51 const float mass = vsi_massAcc.withDefault(*vertex, 0);
52
53 const float x_ = vertex->position().x();
54 const float y_ = vertex->position().y();
55 const float r = std::sqrt(x_*x_+y_*y_);
56
57 if ( ntrk >= m_minNTrks
58 && (ntrk <= m_maxNTrks || m_maxNTrks <= m_minNTrks)
59 ) passNTrkCut = true;
60
61 if ( r >= m_minR
62 && r <= m_maxR
63 ) passRCut = true;
64
65 if ( pT > m_minPt
66 && pT < m_maxPt
67 ) passPtCut = true;
68
69 if ( chi2 < m_maxChi2
70 ) passChi2Cut = true;
71
72 if ( mass > m_minMass
73 && mass < m_maxMass
74 ) passMassCut = true;
75
76 std::array<bool,5> decisions{ passNTrkCut, passRCut, passPtCut, passChi2Cut, passMassCut };
77
78 if ( m_logicAnd ) {
79 passSelection = std::all_of( decisions.begin(), decisions.end(), [](bool k ){return k;} );
80 } else {
81 passSelection = std::any_of( decisions.begin(), decisions.end(), [](bool k ){return k;} );
82 }
83
84 if (passSelection) break;
85 }
86
87 if ( !passSelection ) {
88 return StatusCode::SUCCESS;
89 } else {
90 addDecisionID( m_decisionId.numeric(), vtxinfo.decision );
91 ATH_MSG_DEBUG ("REGTEST event accepted");
92 }
93
94 return StatusCode::SUCCESS;
95}
#define ATH_MSG_DEBUG(x)
Gaudi::Property< float > m_maxPt
Gaudi::Property< float > m_minNTrks
Gaudi::Property< float > m_minMass
Gaudi::Property< bool > m_logicAnd
Gaudi::Property< float > m_minPt
Gaudi::Property< float > m_maxNTrks
Gaudi::Property< float > m_maxMass
Gaudi::Property< float > m_maxR
Gaudi::Property< float > m_minR
Gaudi::Property< float > m_maxChi2
double chi2(TH1 *h0, TH1 *h1)
int r
Definition globals.cxx:22
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 TrigVSIHypoTool::initialize ( )
overridevirtual

Definition at line 19 of file TrigVSIHypoTool.cxx.

19 {
20 return StatusCode::SUCCESS;
21}

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

HLT::Identifier TrigVSIHypoTool::m_decisionId
private

Definition at line 36 of file TrigVSIHypoTool.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> TrigVSIHypoTool::m_logicAnd {this, "TriggerTypeAnd", true, "And/Or Logic for nTrkCut, RCut, pTCut, chi2Cut, massCut"}
private

Definition at line 46 of file TrigVSIHypoTool.h.

46{this, "TriggerTypeAnd", true, "And/Or Logic for nTrkCut, RCut, pTCut, chi2Cut, massCut"};

◆ m_maxChi2

Gaudi::Property<float> TrigVSIHypoTool::m_maxChi2 {this, "maxChi2", 10., "Accept vertices with chi2 less than this limit"}
private

Definition at line 43 of file TrigVSIHypoTool.h.

43{this, "maxChi2", 10., "Accept vertices with chi2 less than this limit"};

◆ m_maxMass

Gaudi::Property<float> TrigVSIHypoTool::m_maxMass {this, "maxMass", 1.4e7, "Accept events with a vertex with the mass larger than this limit"}
private

Definition at line 45 of file TrigVSIHypoTool.h.

45{this, "maxMass", 1.4e7, "Accept events with a vertex with the mass larger than this limit"};

◆ m_maxNTrks

Gaudi::Property<float> TrigVSIHypoTool::m_maxNTrks {this, "maxNTrks", -1, "Accept vertices with maximum of this number of tracks"}
private

Definition at line 38 of file TrigVSIHypoTool.h.

38{this, "maxNTrks", -1, "Accept vertices with maximum of this number of tracks"};

◆ m_maxPt

Gaudi::Property<float> TrigVSIHypoTool::m_maxPt {this, "maxPt", 1.4e7, "Accept vertices with momentum smaller than this limit"}
private

Definition at line 42 of file TrigVSIHypoTool.h.

42{this, "maxPt", 1.4e7, "Accept vertices with momentum smaller than this limit"};

◆ m_maxR

Gaudi::Property<float> TrigVSIHypoTool::m_maxR {this, "maxR" , 520., "Accept vertices with decay position R smaller than this limit"}
private

Definition at line 40 of file TrigVSIHypoTool.h.

40{this, "maxR" , 520., "Accept vertices with decay position R smaller than this limit"};

◆ m_minMass

Gaudi::Property<float> TrigVSIHypoTool::m_minMass {this, "minMass", 1000., "Accept events with a vertex with the mass larger than this limit"}
private

Definition at line 44 of file TrigVSIHypoTool.h.

44{this, "minMass", 1000., "Accept events with a vertex with the mass larger than this limit"};

◆ m_minNTrks

Gaudi::Property<float> TrigVSIHypoTool::m_minNTrks {this, "minNTrks", 3, "Accept vertices with minimum of this number of tracks"}
private

Definition at line 37 of file TrigVSIHypoTool.h.

37{this, "minNTrks", 3, "Accept vertices with minimum of this number of tracks"};

◆ m_minPt

Gaudi::Property<float> TrigVSIHypoTool::m_minPt {this, "minPt", 1000., "Accept vertices with momentum higher than this limit"}
private

Definition at line 41 of file TrigVSIHypoTool.h.

41{this, "minPt", 1000., "Accept vertices with momentum higher than this limit"};

◆ m_minR

Gaudi::Property<float> TrigVSIHypoTool::m_minR {this, "minR" , 20., "Accept vertices with decay position R greater than this limit"}
private

Definition at line 39 of file TrigVSIHypoTool.h.

39{this, "minR" , 20., "Accept vertices with decay position R greater than this limit"};

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