ATLAS Offline Software
Loading...
Searching...
No Matches
xAODMaker::TrigEMClusterCnvTool Class Reference

Implementation for the ITrigEMClusterCnvTool interface. More...

#include <TrigEMClusterCnvTool.h>

Inheritance diagram for xAODMaker::TrigEMClusterCnvTool:
Collaboration diagram for xAODMaker::TrigEMClusterCnvTool:

Public Member Functions

 TrigEMClusterCnvTool (const std::string &type, const std::string &name, const IInterface *parent)
 Regular AlgTool constructor.
virtual StatusCode convert (const TrigEMClusterContainer *aod, xAOD::TrigEMClusterContainer *xaod) const override
 Function that fills an existing xAOD::TrigEMCluster.
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 ()
 Gaudi interface definition.

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

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

Implementation for the ITrigEMClusterCnvTool interface.

   This is a simple tool that implements the converter function
   defined in ITrigEMClusterCnvTool.
Author
Arantxa Ruiz Martinez aranz.nosp@m.azu..nosp@m.ruiz..nosp@m.mart.nosp@m.inez@.nosp@m.cern.nosp@m..ch
Revision
785764
Date
2016-11-22 16:40:18 +0100 (Tue, 22 Nov 2016)

Definition at line 29 of file TrigEMClusterCnvTool.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

◆ TrigEMClusterCnvTool()

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

Regular AlgTool constructor.

Definition at line 17 of file TrigEMClusterCnvTool.cxx.

20 : AthAlgTool( type, name, parent ) {
21
22 // Declare the interface(s) provided by the tool:
23 declareInterface< ITrigEMClusterCnvTool >( this );
24 }
AthAlgTool()
Default constructor:

Member Function Documentation

◆ convert()

StatusCode xAODMaker::TrigEMClusterCnvTool::convert ( const TrigEMClusterContainer * aod,
xAOD::TrigEMClusterContainer * xaod ) const
overridevirtual

Function that fills an existing xAOD::TrigEMCluster.

This is the important function of the tool.

It takes the TrigEMCluster object from a TrigEMCluster container, and fills an xAOD::TrigEMCluster with it.

Parameters
aodThe AOD object to take the TrigEMCluster from
xaodThe xAOD object to fill with information
Returns
StatusCode::SUCCESS if all went fine, something else if not

Implements xAODMaker::ITrigEMClusterCnvTool.

Definition at line 36 of file TrigEMClusterCnvTool.cxx.

37 {
38
39 ATH_MSG_DEBUG( "Size of the xAOD container before loop: "
40 << xaod->size() );
41
42 // Number of available samplings:
43 const unsigned int samplings = 25; // Is this really right?...
44
45 // Loop over the AOD objects:
48
49 for( ; aod_itr != aod_end; ++aod_itr ) {
50
51 // Create the xAOD object:
53 xaod->push_back( cluster );
54
55 cluster->setRawEnergy ( ( *aod_itr )->rawEnergy() );
56 cluster->setRawEt ( ( *aod_itr )->rawEt() );
57 cluster->setRawEta ( ( *aod_itr )->rawEta() );
58 cluster->setRawPhi ( ( *aod_itr )->rawPhi() );
59 cluster->setRoIword ( ( *aod_itr )->RoIword() );
60 cluster->setNCells ( ( *aod_itr )->nCells() );
61 cluster->setClusterQuality( ( *aod_itr )->quality() );
62
63 cluster->setEnergy ( ( *aod_itr )->energy() );
64 cluster->setEt ( ( *aod_itr )->et() );
65 cluster->setEta ( ( *aod_itr )->eta() );
66 cluster->setPhi ( ( *aod_itr )->phi() );
67 cluster->setE237 ( ( *aod_itr )->e237() );
68 cluster->setE277 ( ( *aod_itr )->e277() );
69 cluster->setFracs1 ( ( *aod_itr )->fracs1() );
70 cluster->setWeta2 ( ( *aod_itr )->weta2() );
71 cluster->setEhad1 ( ( *aod_itr )->ehad1() );
72 cluster->setEta1 ( ( *aod_itr )->Eta1() );
73 cluster->setEmaxs1 ( ( *aod_itr )->emaxs1() );
74 cluster->setE2tsts1( ( *aod_itr )->e2tsts1() );
75 cluster->setE233 ( ( *aod_itr )->e233() );
76 cluster->setWstot ( ( *aod_itr )->wstot() );
77
78 for( unsigned int i = 0; i < samplings; ++i ) {
80 static_cast< CaloSampling::CaloSample >( i );
81 const float rawValue = ( *aod_itr )->rawEnergy( sample );
82 if( ! cluster->setRawEnergy( sample, rawValue ) ) {
83 ATH_MSG_WARNING( "Unable to set raw energy for sampling "
84 << sample );
85 }
86 const float value = ( *aod_itr )->energy( sample );
87 if( ! cluster->setEnergy( sample, value ) ) {
88 ATH_MSG_WARNING( "Unable to set energy for sampling "
89 << sample );
90 }
91 }
92
93 ATH_MSG_DEBUG( "rawEnergy: "
94 << ( *aod_itr )->rawEnergy() << "; "
95 << "rawEt: "
96 << ( *aod_itr )->rawEt() << "; "
97 << "rawEta: "
98 << ( *aod_itr )->rawEta() << "; "
99 << "rawPhi: "
100 << ( *aod_itr )->rawPhi() << "; "
101 << std::hex << "m_roiWord: 0x"
102 << ( *aod_itr )->RoIword() << "; " << std::dec
103 << "numberUsedCells: "
104 << ( *aod_itr )->nCells() << "; "
105 << "quality: "
106 << ( *aod_itr )->quality() << ";" );
107
108 if( msg().level() <= MSG::DEBUG ) {
109 for( unsigned int i = 0; i < samplings; ++i ) {
111 static_cast< CaloSampling::CaloSample >( i );
112 ATH_MSG_DEBUG( "rawEnergySample : "
114 << " = "
115 << ( *aod_itr )->rawEnergy( sample ) << ";" );
116 }
117 }
118
119 ATH_MSG_DEBUG( "energy: "
120 << ( *aod_itr )->energy() << "; "
121 << "et: "
122 << ( *aod_itr )->et() << "; "
123 << "eta: "
124 << ( *aod_itr )->eta() << "; "
125 << "phi: "
126 << ( *aod_itr )->phi() << "; "
127 << "e237: "
128 << ( *aod_itr )->e237() << "; "
129 << "e277: "
130 << ( *aod_itr )->e277() << "; "
131 << "fracs1: "
132 << ( *aod_itr )->fracs1() << "; "
133 << "weta2: "
134 << ( *aod_itr )->weta2() << "; "
135 << "ehad1: "
136 << ( *aod_itr )->ehad1() << "; "
137 << "Eta1: "
138 << ( *aod_itr )->Eta1() << "; "
139 << "emaxs1: "
140 << ( *aod_itr )->emaxs1() << "; "
141 << "e2tsts1: "
142 << ( *aod_itr )->e2tsts1() << "; "
143 << "e233: "
144 << ( *aod_itr )->e233() << "; "
145 << "wstot: "
146 << ( *aod_itr )->wstot() );
147
148 if( msg().level() <= MSG::DEBUG ) {
149 for( unsigned int i = 0; i < samplings; ++i ) {
151 static_cast< CaloSampling::CaloSample >( i );
152 ATH_MSG_DEBUG( "energySample : "
154 << " = "
155 << ( *aod_itr )->energy( sample ) << ";" );
156 }
157 }
158
159 }
160
161 ATH_MSG_DEBUG( "Size of the xAOD container after loop: "
162 << xaod->size() );
163
164 // Return gracefully:
165 return StatusCode::SUCCESS;
166 }
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
MsgStream & msg() const
static std::string getSamplingName(CaloSample theSample)
Returns a string (name) for each CaloSampling.
DataModel_detail::const_iterator< DataVector > const_iterator
Definition DataVector.h:838
value_type push_back(value_type pElem)
Add an element to the end of the collection.
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
size_type size() const noexcept
Returns the number of elements in the collection.
void setClusterQuality(unsigned int)
set quality of cluster built (to be defined)
void setNCells(int)
set number of cells used from RoI
void setRoIword(long)
set RoI Word
void setRawPhi(float)
set Raw Phi (no calibration)
void setRawEnergy(float)
set Raw Energy (no calibration)
void setRawEta(float)
set Raw Eta (no calibration)
void setRawEt(float)
set Raw Et (no calibration)
void setPhi(float)
set Phi (calibrated)
void setEta(float)
set Eta (calibrated)
void setEt(float)
set Et (calibrated)
void setEhad1(float)
set hadronic Energy (first hadronic layer)
void setWeta2(float)
set cluster width (based on a 3x5 cluster - 2nd layer)
void setEnergy(float energy)
set Energy (calibrated)
void setE2tsts1(float)
set second maximum energy in sampling 1 (strip layer)
void setE237(float)
set Energy in a 3x7 cluster (no calibration) around hottest cell
void setE277(float)
set Energy in a 7x7 cluster (no calibration) around hottest cell
void setEmaxs1(float)
set maximum energy in sampling 1 (strip layer)
void setFracs1(float)
set Energy in a 7 strips (around hottest strip) minus energy in 3 strips divided by energy in 3 strip...
void setWstot(float)
set width in first layer
void setE233(float)
set Energy in a 3x3 cluster (no calibration) around hottest cell
void setEta1(float)
set Eta sampling 1 (strip layer)
TrigEMCluster_v1 TrigEMCluster
Define the latest version of the trigger EM cluster 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

◆ 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 & xAODMaker::ITrigEMClusterCnvTool::interfaceID ( )
inlinestaticinherited

Gaudi interface definition.

Definition at line 46 of file ITrigEMClusterCnvTool.h.

46 {
48 }
static const InterfaceID IID_ITrigEMClusterCnvTool("xAODMaker::ITrigEMClusterCnvTool", 1, 0)
The interface provided by ITrigEMClusterCnvTool.

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