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

#include <JetHistoMatchedFiller.h>

Inheritance diagram for JetHistoMatchedFiller:
Collaboration diagram for JetHistoMatchedFiller:

Public Member Functions

 JetHistoMatchedFiller (const std::string &type, const std::string &name, const IInterface *parent)
virtual StatusCode initialize ()
virtual StatusCode processJetContainer (const JetMonitoringAlg &parentAlg, const xAOD::JetContainer &jets, const EventContext &ctx) 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

Static Public Member Functions

static const InterfaceID & interfaceID ()

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

Gaudi::Property< std::string > m_group {this,"Group", "undefined"}
SG::ReadDecorHandleKey< xAOD::JetContainerm_matchedKey {this, "matched", "matched", "SG key for input matched decoration"}
SG::ReadDecorHandleKey< xAOD::JetContainerm_ptdiffKey {this, "ptdiff", "ptdiff", "SG key for input matched ptdiff decoration"}
SG::ReadDecorHandleKey< xAOD::JetContainerm_energydiffKey {this, "energydiff", "energydiff", "SG key for input matched energydiff decoration"}
SG::ReadDecorHandleKey< xAOD::JetContainerm_massdiffKey {this, "massdiff", "massdiff", "SG key for input matched massdiff decoration"}
SG::ReadDecorHandleKey< xAOD::JetContainerm_ptrespKey {this, "ptresp", "ptresp", "SG key for input matched ptresp decoration"}
SG::ReadDecorHandleKey< xAOD::JetContainerm_energyrespKey {this, "energyresp", "energyresp", "SG key for input matched energyresp decoration"}
SG::ReadDecorHandleKey< xAOD::JetContainerm_massrespKey {this, "massresp", "massresp", "SG key for input matched massresp decoration"}
SG::ReadDecorHandleKey< xAOD::JetContainerm_ptrefKey {this, "ptref", "ptref", "SG key for input matched ptref decoration"}
SG::ReadDecorHandleKey< xAOD::JetContainerm_etarefKey {this, "etaref", "etaref", "SG key for input matched etaref decoration"}
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 17 of file JetHistoMatchedFiller.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

◆ JetHistoMatchedFiller()

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

Definition at line 10 of file JetHistoMatchedFiller.cxx.

10 :
11 AthAlgTool( type, name, parent )
12{
13 declareInterface<IJetHistoFiller>(this);
14 declareProperty("JetMatchedKey",m_matchedKey="NONE");
15 declareProperty("JetPtDiffKey", m_ptdiffKey="NONE");
16 declareProperty("JetEnergyDiffKey", m_energydiffKey="NONE");
17 declareProperty("JetMassDiffKey", m_massdiffKey="NONE");
18 declareProperty("JetPtRespKey", m_ptrespKey="NONE");
19 declareProperty("JetEnergyRespKey", m_energyrespKey="NONE");
20 declareProperty("JetMassRespKey", m_massrespKey="NONE");
21 declareProperty("JetPtRefKey", m_ptrefKey="NONE");
22 declareProperty("JetEtaRefKey", m_etarefKey="NONE");
23}
AthAlgTool()
Default constructor:
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
SG::ReadDecorHandleKey< xAOD::JetContainer > m_massrespKey
SG::ReadDecorHandleKey< xAOD::JetContainer > m_ptdiffKey
SG::ReadDecorHandleKey< xAOD::JetContainer > m_etarefKey
SG::ReadDecorHandleKey< xAOD::JetContainer > m_massdiffKey
SG::ReadDecorHandleKey< xAOD::JetContainer > m_energyrespKey
SG::ReadDecorHandleKey< xAOD::JetContainer > m_matchedKey
SG::ReadDecorHandleKey< xAOD::JetContainer > m_ptrefKey
SG::ReadDecorHandleKey< xAOD::JetContainer > m_energydiffKey
SG::ReadDecorHandleKey< xAOD::JetContainer > m_ptrespKey

Member Function Documentation

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

◆ 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 JetHistoMatchedFiller::initialize ( )
virtual

Definition at line 26 of file JetHistoMatchedFiller.cxx.

26 {
27 ATH_CHECK( m_matchedKey.initialize() );
28 ATH_CHECK( m_ptdiffKey.initialize() );
29 ATH_CHECK( m_energydiffKey.initialize() );
30 ATH_CHECK( m_massdiffKey.initialize() );
31 ATH_CHECK( m_ptrespKey.initialize() );
32 ATH_CHECK( m_energyrespKey.initialize() );
33 ATH_CHECK( m_massrespKey.initialize() );
34 ATH_CHECK( m_ptrefKey.initialize() );
35 ATH_CHECK( m_etarefKey.initialize() );
36 return StatusCode::SUCCESS;
37}
#define ATH_CHECK
Evaluate an expression and check for errors.

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

◆ interfaceID()

const InterfaceID & IJetHistoFiller::interfaceID ( )
inlinestaticinherited

Definition at line 28 of file IJetHistoFiller.h.

28{ return IID_IJetHistoFiller; }
static const InterfaceID IID_IJetHistoFiller("IJetHistoFiller", 1, 0)

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

◆ processJetContainer()

StatusCode JetHistoMatchedFiller::processJetContainer ( const JetMonitoringAlg & parentAlg,
const xAOD::JetContainer & jets,
const EventContext & ctx ) const
virtual

Implements IJetHistoFiller.

Definition at line 40 of file JetHistoMatchedFiller.cxx.

40 {
41 if(jets.empty()) return StatusCode::SUCCESS;
42
43 SG::ReadDecorHandle<xAOD::JetContainer, char> matchedHandle(m_matchedKey, ctx);
44 SG::ReadDecorHandle<xAOD::JetContainer, double> ptdiffHandle(m_ptdiffKey, ctx);
45 SG::ReadDecorHandle<xAOD::JetContainer, double> energydiffHandle(m_energydiffKey, ctx);
46 SG::ReadDecorHandle<xAOD::JetContainer, double> massdiffHandle(m_massdiffKey, ctx);
47 SG::ReadDecorHandle<xAOD::JetContainer, double> ptrespHandle(m_ptrespKey, ctx);
48 SG::ReadDecorHandle<xAOD::JetContainer, double> energyrespHandle(m_energyrespKey, ctx);
49 SG::ReadDecorHandle<xAOD::JetContainer, double> massrespHandle(m_massrespKey, ctx);
50 SG::ReadDecorHandle<xAOD::JetContainer, double> ptrefHandle(m_ptrefKey, ctx);
51 SG::ReadDecorHandle<xAOD::JetContainer, double> etarefHandle(m_etarefKey, ctx);
52
53 auto matched = Monitored::Collection("matched", jets, [matchedHandle](const xAOD::Jet * jet) {return matchedHandle(*jet);});
54 auto dPt = Monitored::Scalar("ptdiff",0.0);
55 auto dEnergy = Monitored::Scalar("energydiff",0.0);
56 auto dMass = Monitored::Scalar("massdiff",0.0);
57 auto rPt = Monitored::Scalar("ptresp",0.0);
58 auto rEnergy = Monitored::Scalar("energyresp",0.0);
59 auto rMass = Monitored::Scalar("massresp",0.0);
60 auto ptRef = Monitored::Scalar("ptref",0.0);
61 auto etaRef = Monitored::Scalar("etaref",0.0);
62
63 // Loop over jets and fill pt, energy, mass differences and responses between matched jets, plus reference pT and eta
64
65 for(const xAOD::Jet* jet : jets){
66 bool matched = matchedHandle(*jet);
67 if(matched){
68 dPt = ptdiffHandle(*jet);
69 dEnergy = energydiffHandle(*jet);
70 dMass = massdiffHandle(*jet);
71 rPt = ptrespHandle(*jet);
72 rEnergy = energyrespHandle(*jet);
73 rMass = massrespHandle(*jet);
74 ptRef = ptrefHandle(*jet);
75 etaRef = etarefHandle(*jet);
76 parentAlg.fill(m_group, dPt, dEnergy, dMass, rPt, rEnergy, rMass, ptRef, etaRef);
77 }
78 }
79 parentAlg.fill(m_group,matched);
80
81 return StatusCode::SUCCESS;
82}
Gaudi::Property< std::string > m_group
void fill(const ToolHandle< GenericMonitoringTool > &groupHandle, std::vector< std::reference_wrapper< Monitored::IMonitoredVariable > > &&variables) const
Fills a vector of variables to a group by reference.
ValuesCollection< T > Collection(std::string name, const T &collection)
Declare a monitored (double-convertible) collection.
Jet_v1 Jet
Definition of the current "jet version".

◆ 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_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_energydiffKey

SG::ReadDecorHandleKey<xAOD::JetContainer> JetHistoMatchedFiller::m_energydiffKey {this, "energydiff", "energydiff", "SG key for input matched energydiff decoration"}
private

Definition at line 29 of file JetHistoMatchedFiller.h.

29{this, "energydiff", "energydiff", "SG key for input matched energydiff decoration"};

◆ m_energyrespKey

SG::ReadDecorHandleKey<xAOD::JetContainer> JetHistoMatchedFiller::m_energyrespKey {this, "energyresp", "energyresp", "SG key for input matched energyresp decoration"}
private

Definition at line 32 of file JetHistoMatchedFiller.h.

32{this, "energyresp", "energyresp", "SG key for input matched energyresp decoration"};

◆ m_etarefKey

SG::ReadDecorHandleKey<xAOD::JetContainer> JetHistoMatchedFiller::m_etarefKey {this, "etaref", "etaref", "SG key for input matched etaref decoration"}
private

Definition at line 35 of file JetHistoMatchedFiller.h.

35{this, "etaref", "etaref", "SG key for input matched etaref decoration"};

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

Gaudi::Property<std::string> JetHistoMatchedFiller::m_group {this,"Group", "undefined"}
private

Definition at line 26 of file JetHistoMatchedFiller.h.

26{this,"Group", "undefined"};

◆ m_massdiffKey

SG::ReadDecorHandleKey<xAOD::JetContainer> JetHistoMatchedFiller::m_massdiffKey {this, "massdiff", "massdiff", "SG key for input matched massdiff decoration"}
private

Definition at line 30 of file JetHistoMatchedFiller.h.

30{this, "massdiff", "massdiff", "SG key for input matched massdiff decoration"};

◆ m_massrespKey

SG::ReadDecorHandleKey<xAOD::JetContainer> JetHistoMatchedFiller::m_massrespKey {this, "massresp", "massresp", "SG key for input matched massresp decoration"}
private

Definition at line 33 of file JetHistoMatchedFiller.h.

33{this, "massresp", "massresp", "SG key for input matched massresp decoration"};

◆ m_matchedKey

SG::ReadDecorHandleKey<xAOD::JetContainer> JetHistoMatchedFiller::m_matchedKey {this, "matched", "matched", "SG key for input matched decoration"}
private

Definition at line 27 of file JetHistoMatchedFiller.h.

27{this, "matched", "matched", "SG key for input matched decoration"};

◆ m_ptdiffKey

SG::ReadDecorHandleKey<xAOD::JetContainer> JetHistoMatchedFiller::m_ptdiffKey {this, "ptdiff", "ptdiff", "SG key for input matched ptdiff decoration"}
private

Definition at line 28 of file JetHistoMatchedFiller.h.

28{this, "ptdiff", "ptdiff", "SG key for input matched ptdiff decoration"};

◆ m_ptrefKey

SG::ReadDecorHandleKey<xAOD::JetContainer> JetHistoMatchedFiller::m_ptrefKey {this, "ptref", "ptref", "SG key for input matched ptref decoration"}
private

Definition at line 34 of file JetHistoMatchedFiller.h.

34{this, "ptref", "ptref", "SG key for input matched ptref decoration"};

◆ m_ptrespKey

SG::ReadDecorHandleKey<xAOD::JetContainer> JetHistoMatchedFiller::m_ptrespKey {this, "ptresp", "ptresp", "SG key for input matched ptresp decoration"}
private

Definition at line 31 of file JetHistoMatchedFiller.h.

31{this, "ptresp", "ptresp", "SG key for input matched ptresp decoration"};

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