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

function. More...

#include <JetHistoAttributeFiller.h>

Inheritance diagram for JetHistoAttributeFiller:
Collaboration diagram for JetHistoAttributeFiller:

Public Member Functions

 JetHistoAttributeFiller (const std::string &type, const std::string &name, const IInterface *parent)
virtual ~JetHistoAttributeFiller ()
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"}
ToolHandle< IJetHistoVarToolm_varX
ToolHandle< IJetHistoVarToolm_varY
ToolHandle< IJetHistoVarToolm_varZ
int m_nVar =1
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

function.

A IJetHistoFiller implementation in charge of filling 1 1D or 2D histogram.

The tool does not directly fill histograms but uses Monitored::Scalar and Monitored::Group as is requested by the monitoring framewok.

The variables are specified by means of IJetHistoVarTool which are just configurable version of the JetVariable class. The IJetHistoVarTool are set via the properterties VarX, VarY and VarZ The Monitoring Group is specified by the Group property

The tool support plotting variables of type float,int ,vector<float> and vector<int>.

The histogram is filled according to 1 (or 2 if 2D histo, or 3 if TProfile2D)

Definition at line 32 of file JetHistoAttributeFiller.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

◆ JetHistoAttributeFiller()

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

Definition at line 126 of file JetHistoAttributeFiller.cxx.

126 :
127 AthAlgTool( type, name, parent )
128 , m_varX(this)
129 , m_varY(this)
130 , m_varZ(this)
131
132{
133 declareInterface<IJetHistoFiller>(this);
134
135 declareProperty("VarX",m_varX);
136 declareProperty("VarY",m_varY);
137 declareProperty("VarZ",m_varZ);
138
139}
AthAlgTool()
Default constructor:
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
ToolHandle< IJetHistoVarTool > m_varY
ToolHandle< IJetHistoVarTool > m_varZ
ToolHandle< IJetHistoVarTool > m_varX

◆ ~JetHistoAttributeFiller()

virtual JetHistoAttributeFiller::~JetHistoAttributeFiller ( )
inlinevirtual

Definition at line 35 of file JetHistoAttributeFiller.h.

35{}

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

Definition at line 142 of file JetHistoAttributeFiller.cxx.

142 {
143 ATH_CHECK(m_varX.retrieve() );
144 m_nVar = 1;
145 if( ! m_varY.isEnabled() ){
146 ATH_MSG_DEBUG( "Filling 1 var X=("<< m_varX->describe() << ")");
147 }else { // has Y variable
148 ATH_CHECK(m_varY.retrieve() );
149 m_nVar = 2;
150 if ( ! m_varZ.isEnabled()) {
151 ATH_MSG_DEBUG( "Filling 2 vars X=("<< m_varX->describe() << ") Y=("<<m_varY->describe() << ")");
152 }else{
153 ATH_CHECK(m_varZ.retrieve() );
154 m_nVar = 3;
155 ATH_MSG_DEBUG( "Filling 3 vars X=("<< m_varX->describe() << ") Y=("<<m_varY->describe() << ") Z=("<<m_varZ->describe() << ")");
156 }
157
158 }
159
160 return StatusCode::SUCCESS;
161}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(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.

◆ 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 JetHistoAttributeFiller::processJetContainer ( const JetMonitoringAlg & parentAlg,
const xAOD::JetContainer & jets,
const EventContext & ctx ) const
virtual

Implements IJetHistoFiller.

Definition at line 164 of file JetHistoAttributeFiller.cxx.

164 {
165 if(jets.empty()) return StatusCode::SUCCESS;
166 const JetVar::Variable * vX = m_varX->variable();
167 ToolHandle<GenericMonitoringTool> grpT = parentAlg.getGroup(m_group);
168
169 if(m_nVar==1){
170 if( vX->isVector() ) processXVec(grpT, vX, jets) ;
171 else processX(grpT, vX, jets) ;
172
173 }else if(m_nVar==2) { //
174
175 const JetVar::Variable * vY = m_varY->variable();
176
177 int c = int(vX->isVector() | vY->isVector()<<1) ; // encode what to do so we can use a switch()
178 switch( c ){
179 case 0: processXY(grpT, vX,vY, jets) ; break ;
180 case 1: processXVecY(grpT, vX,vY, jets) ; break ;
181 case 2: processXYVec(grpT, vX,vY, jets) ; break ;
182 case 3: processXVecYVec(grpT, vX,vY, jets) ; break ;
183
184 }
185 } else { // then m_nVar == 3
186 const JetVar::Variable * vY = m_varY->variable();
187 const JetVar::Variable * vZ = m_varZ->variable();
188 processXYZ(grpT, vX,vY, vZ, jets) ;
189 }
190
191
192 return StatusCode::SUCCESS;
193}
const ToolHandle< GenericMonitoringTool > & getGroup(const std::string &name) const
Get a specific monitoring tool from the tool handle array.
Gaudi::Property< std::string > m_group
virtual bool isVector() const
return true if the underlying variable is of type vector<X>
Definition JetVariable.h:59

◆ 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_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> JetHistoAttributeFiller::m_group {this,"Group", "undefined"}
private

Definition at line 44 of file JetHistoAttributeFiller.h.

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

◆ m_nVar

int JetHistoAttributeFiller::m_nVar =1
private

Definition at line 50 of file JetHistoAttributeFiller.h.

◆ m_varHandleArraysDeclared

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

Definition at line 399 of file AthCommonDataStore.h.

◆ m_varX

ToolHandle<IJetHistoVarTool> JetHistoAttributeFiller::m_varX
private

Definition at line 45 of file JetHistoAttributeFiller.h.

◆ m_varY

ToolHandle<IJetHistoVarTool> JetHistoAttributeFiller::m_varY
private

Definition at line 46 of file JetHistoAttributeFiller.h.

◆ m_varZ

ToolHandle<IJetHistoVarTool> JetHistoAttributeFiller::m_varZ
private

Definition at line 48 of file JetHistoAttributeFiller.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: