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

#include <HIEventShapeFillerTool.h>

Inheritance diagram for HIEventShapeFillerTool:
Collaboration diagram for HIEventShapeFillerTool:

Public Member Functions

 HIEventShapeFillerTool (const std::string &myname)
virtual StatusCode initialize () override
 Dummy implementation of the initialisation function.
virtual StatusCode initializeIndex () override
virtual StatusCode initializeEventShapeContainer (std::unique_ptr< xAOD::HIEventShapeContainer > &evtShape) const override
virtual StatusCode fillCollectionFromTowers (std::unique_ptr< xAOD::HIEventShapeContainer > &evtShape, const SG::ReadHandleKey< xAOD::CaloClusterContainer > &tower_container_key, const SG::ReadHandleKey< INavigable4MomentumCollection > &navi_container_key, const EventContext &ctx) const override
virtual StatusCode fillCollectionFromCells (std::unique_ptr< xAOD::HIEventShapeContainer > &evtShape, const SG::ReadHandleKey< CaloCellContainer > &cell_container_key, const EventContext &ctx) const override
virtual StatusCode fillCollectionFromTowerContainer (std::unique_ptr< xAOD::HIEventShapeContainer > &evtShape, const INavigable4MomentumCollection *navInColl) const
virtual StatusCode fillCollectionFromCellContainer (std::unique_ptr< xAOD::HIEventShapeContainer > &evtShape, const CaloCellContainer *CellContainer) const
virtual StatusCode fillCollectionFromClusterContainer (std::unique_ptr< xAOD::HIEventShapeContainer > &evtShape, const xAOD::CaloClusterContainer *theClusters, const EventContext &ctx) const
virtual void print () const
 Print the state of the tool.
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
const std::string & getContainerName () const
void setContainerName (const std::string &cname)
Additional helper functions, not directly mimicking Athena
template<class T>
const T * getProperty (const std::string &name) const
 Get one of the tool's properties.
const std::string & msg_level_name () const __attribute__((deprecated))
 A deprecated function for getting the message level's name.
const std::string & getName (const void *ptr) const
 Get the name of an object that is / should be in the event store.
SG::sgkey_t getKey (const void *ptr) const
 Get the (hashed) key of an object that is in the event store.

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

void updateShape (std::unique_ptr< xAOD::HIEventShapeContainer > &shape, const HIEventShapeIndex *index, const CaloCell *theCell, float geoWeight, float eta0, float phi0, bool isNeg=false) const
std::unique_ptr< const CaloCellgetMirroredCell (const CaloCell *pCell, const CaloCellContainer *ccc) const
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

const HIEventShapeIndexm_index
const CaloCell_IDm_calo_id {nullptr}
ToolHandle< IHITowerWeightToolm_towerWeightTool { this, "TowerWeightTool", "", "Handle to Tower Weight Tool" }
ToolHandle< IHIEventShapeMapToolm_eventShapeMapTool { this, "EventShapeMapTool", "HIEventShapeMapTool", "Handle to Event Shape Map Tool" }
SG::ReadHandleKey< CaloCellContainerm_caloCellKey {this, "CaloCellContainerKey","","cell container for mirror"}
Gaudi::Property< bool > m_useClusters { this, "UseClusters", false, "use Clusters boolean switch" }
Gaudi::Property< int > m_numOrders { this, "OrderOfFlowHarmonics", 7, "The number of Orders of harmonic flow to store in the EventShape" }
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
std::string m_outputContainerName

Detailed Description

Definition at line 26 of file HIEventShapeFillerTool.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

◆ HIEventShapeFillerTool()

HIEventShapeFillerTool::HIEventShapeFillerTool ( const std::string & myname)

Definition at line 19 of file HIEventShapeFillerTool.cxx.

19 : asg::AsgTool(myname),
20m_index(nullptr)
21{
22}
const HIEventShapeIndex * m_index

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

◆ fillCollectionFromCellContainer()

StatusCode HIEventShapeFillerTool::fillCollectionFromCellContainer ( std::unique_ptr< xAOD::HIEventShapeContainer > & evtShape,
const CaloCellContainer * CellContainer ) const
virtual

Definition at line 224 of file HIEventShapeFillerTool.cxx.

225{
226 //loop on Cells
227 for (const auto cellItr : *CellContainer) {
228 const CaloCell* cell=cellItr;
229 std::unique_ptr<const CaloCell> mirroredCell{};
230 bool isDeadFEB = (!cell->caloDDE()->is_tile() && LArProv::test(cell->provenance(),LArProv::DEADFEB));
231 if (isDeadFEB) {
232 mirroredCell=getMirroredCell(cell,CellContainer);
233 if (mirroredCell)
234 cell=mirroredCell.get();
235 else {
236 ATH_MSG_WARNING("Failed to obtain mirrored cell for deadFEB cell with id" << std::hex << cell->ID().get_compact());
237 }
238 }
239
240
241 updateShape(evtShape, m_index, cell, 1., cellItr->eta(), cellItr->phi());
242 }
243
244 return StatusCode::SUCCESS;
245}
#define ATH_MSG_WARNING(x)
std::unique_ptr< const CaloCell > getMirroredCell(const CaloCell *pCell, const CaloCellContainer *ccc) const
void updateShape(std::unique_ptr< xAOD::HIEventShapeContainer > &shape, const HIEventShapeIndex *index, const CaloCell *theCell, float geoWeight, float eta0, float phi0, bool isNeg=false) const
bool test(const uint16_t prov, const LArProvenance check)

◆ fillCollectionFromCells()

StatusCode HIEventShapeFillerTool::fillCollectionFromCells ( std::unique_ptr< xAOD::HIEventShapeContainer > & evtShape,
const SG::ReadHandleKey< CaloCellContainer > & cell_container_key,
const EventContext & ctx ) const
overridevirtual

Implements IHIEventShapeFiller.

Definition at line 215 of file HIEventShapeFillerTool.cxx.

216{
217 //retrieve the cell container from store
218 SG::ReadHandle<CaloCellContainer> read_handle_caloCell(cell_container_key, ctx);
219 const CaloCellContainer* CellContainer = read_handle_caloCell.get();
220 return fillCollectionFromCellContainer(evtShape, CellContainer);
221}
virtual StatusCode fillCollectionFromCellContainer(std::unique_ptr< xAOD::HIEventShapeContainer > &evtShape, const CaloCellContainer *CellContainer) const

◆ fillCollectionFromClusterContainer()

StatusCode HIEventShapeFillerTool::fillCollectionFromClusterContainer ( std::unique_ptr< xAOD::HIEventShapeContainer > & evtShape,
const xAOD::CaloClusterContainer * theClusters,
const EventContext & ctx ) const
virtual

Definition at line 111 of file HIEventShapeFillerTool.cxx.

112{
113 constexpr float area_slice = HI::TowerBins::getBinArea() * HI::TowerBins::numPhiBins();
114 evtShape->reserve(HI::TowerBins::numEtaBins());
115 for (unsigned int eb = 0; eb < HI::TowerBins::numEtaBins(); eb++)
116 {
118 evtShape->push_back(e);
119 e->setLayer(0);
120 e->setEtaMin(HI::TowerBins::getBinLowEdgeEta(eb));
121 e->setEtaMax(HI::TowerBins::getBinUpEdgeEta(eb));
122 e->etCos().assign(m_numOrders, 0);
123 e->etSin().assign(m_numOrders, 0);
124 e->setArea(area_slice);
125 e->setNCells(HI::TowerBins::numPhiBins());
126 }
127
128
129 static const SG::AuxElement::Decorator< float > decorator("HIEtaPhiWeight");
130 static const SG::AuxElement::Decorator< float > cm_decorator("HIMag");
131 static const SG::AuxElement::Accessor<float> acc_mcell_sumE("mcell_sumE");
132
133 constexpr float area_cluster = HI::TowerBins::getBinArea();
134 int runIndex = -1;
135 if(!theClusters->empty() && m_towerWeightTool)
136 {
137 runIndex = m_towerWeightTool->getRunIndex(ctx);
138 }
139
140 for (auto cl : *theClusters) {
141
142 double mcell_sumE = 0;
143 if (acc_mcell_sumE.isAvailable(*cl)) {
144 if(acc_mcell_sumE(*cl) > 1) {
145 mcell_sumE = acc_mcell_sumE(*cl);
146 ATH_MSG_DEBUG("Energy corrected from mirror cell to cluster: " << mcell_sumE);
147 }
148 }
149
150 double ET = (cl->e()+mcell_sumE) / std::cosh(cl->eta0());
151 double phi = cl->phi0();
152 double eta = cl->eta0();
153 unsigned int eb = HI::TowerBins::findBinEta(eta);
154 xAOD::HIEventShape* slice = evtShape->at(eb);
155 float weight = 1;
157 {
158 float recip = m_towerWeightTool->getEtaPhiResponse(eta, phi, runIndex);
159 if (recip != 0.) weight = 1. / recip;
160 }
161 decorator(*cl) = weight;
162
163 //HIMag back in rel 22 (removed by mistake in 21)
164 float etot2 = 0;
165 float er2 = 0;
166
167 for (unsigned int sample = 0; sample < 24; sample++)
168 {
170 if (!cl->hasSampling(s)) continue;
171 float esamp = std::abs(cl->eSample(s));
172 float w1 = m_towerWeightTool->getWeight(eta, phi, s);
173 float wr = m_towerWeightTool->getWeightMag(eta, phi, s);
174 etot2 += esamp * w1;
175 er2 += esamp * wr;
176
177 }
178 float cm = 0;
179 if (etot2 != 0) cm = er2 / etot2;
180 //float cm=er2/etot2;
181 cm_decorator(*cl) = cm;
182
183 //update members
184 slice->setEt(slice->et() + weight * ET);
185 slice->setRho(slice->rho() + weight * ET / area_cluster);
186
187 for (unsigned int i = 0; i < static_cast<unsigned int>(m_numOrders); i++)
188 {
189 float nn = i + 1;
190 float tmp_cos = slice->etCos().at(i);
191 slice->etCos()[i] = tmp_cos + weight * ET * std::cos(nn * phi);
192 float tmp_sin = slice->etSin().at(i);
193 slice->etSin()[i] = tmp_sin + weight * ET * std::sin(nn * phi);
194 }
195 }
196 ATH_MSG_DEBUG("DUMPING HIEVENTSHAPE");
197 for (auto es : *evtShape)
198 {
199 ATH_MSG_DEBUG(std::setw(10) << es->etaMin()
200 << std::setw(10) << es->etaMax()
201 << std::setw(15) << es->et() * 1e-3);
202
203 for (unsigned int i = 0; i < static_cast<unsigned int>(m_numOrders); i++)
204 {
205 ATH_MSG_DEBUG(std::setw(40) << i
206 << std::setw(15) << es->etCos().at(i)
207 << std::setw(15) << es->etSin().at(i));
208 }
209
210 }
211 return StatusCode::SUCCESS;
212}
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
#define ATH_MSG_DEBUG(x)
bool empty() const noexcept
Returns true if the collection is empty.
ToolHandle< IHITowerWeightTool > m_towerWeightTool
Gaudi::Property< int > m_numOrders
float getBinUpEdgeEta(unsigned int eb)
Definition HIEventDefs.h:39
float getBinLowEdgeEta(unsigned int eb)
Definition HIEventDefs.h:38
constexpr float getBinArea()
Definition HIEventDefs.h:34
constexpr unsigned int numPhiBins()
Definition HIEventDefs.h:22
unsigned int findBinEta(float eta)
Definition HIEventDefs.h:46
constexpr unsigned int numEtaBins()
Definition HIEventDefs.h:19
cl
print [x.__class__ for x in toList(dqregion.getSubRegions()) ]
HIEventShape_v2 HIEventShape
Definition of the latest event info version.

◆ fillCollectionFromTowerContainer()

StatusCode HIEventShapeFillerTool::fillCollectionFromTowerContainer ( std::unique_ptr< xAOD::HIEventShapeContainer > & evtShape,
const INavigable4MomentumCollection * navInColl ) const
virtual

Definition at line 66 of file HIEventShapeFillerTool.cxx.

67{
68
69 SG::ReadHandle<CaloCellContainer> cellContainer{m_caloCellKey};
70 //loop on towers
71 for (INavigable4MomentumCollection::const_iterator towerItr = navInColl->begin();
72 towerItr != navInColl->end(); ++towerItr)
73 {
74 //navigate back to cells
75 //Default is to sort the cells by either pointer values leading to irreproducible output
76 //CaloCellIDFcn ensures cells are ordered by their IDs
77 NavigationToken<CaloCell, double, CaloCellIDFcn> cellToken;
78 (*towerItr)->fillToken(cellToken, double(1.));
79
80 // Use eta/phi of tower in shape calculation
81 float eta0 = (*towerItr)->eta();
82 float phi0 = (*towerItr)->phi();
83
84 if (cellToken.size() == 0) continue;
86 cellItr != cellToken.end(); ++cellItr)
87 {
88
89 const CaloCell* cell=*cellItr;
90 std::unique_ptr<const CaloCell> mirroredCell{};
91
92 bool isDeadFEB = (!cell->caloDDE()->is_tile() && LArProv::test(cell->provenance(),LArProv::DEADFEB));
93
94 if (isDeadFEB) {
95 mirroredCell=getMirroredCell(cell,cellContainer.cptr());
96 if (mirroredCell)
97 cell=mirroredCell.get();
98 else {
99 ATH_MSG_WARNING("Failed to obtain mirrored cell for deadFEB cell with id" << std::hex << cell->ID().get_compact());
100 }
101
102 }//end if dead FEB
103
104 updateShape(evtShape, m_index, cell, cellToken.getParameter(*cellItr), eta0, phi0);
105 }
106 }//end tower loop
107 return StatusCode::SUCCESS;
108}
DataModel_detail::const_iterator< DataVector > const_iterator
Definition DataVector.h:838
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.
SG::ReadHandleKey< CaloCellContainer > m_caloCellKey
const_iterator begin() const
CHILDPAR getParameter(const_child_ptr data) const
NavigationTokenIterator const_iterator
const_iterator end() const
unsigned int size()
const_pointer_type cptr()
Dereference the pointer.

◆ fillCollectionFromTowers()

StatusCode HIEventShapeFillerTool::fillCollectionFromTowers ( std::unique_ptr< xAOD::HIEventShapeContainer > & evtShape,
const SG::ReadHandleKey< xAOD::CaloClusterContainer > & tower_container_key,
const SG::ReadHandleKey< INavigable4MomentumCollection > & navi_container_key,
const EventContext & ctx ) const
overridevirtual

Implements IHIEventShapeFiller.

Definition at line 51 of file HIEventShapeFillerTool.cxx.

52{
53 //retrieve the tower container from store
54 if (m_useClusters)
55 {
56 SG::ReadHandle<xAOD::CaloClusterContainer> readHandleCaloClus(tower_container_key, ctx);
57 ATH_CHECK(readHandleCaloClus.isValid());
58 return fillCollectionFromClusterContainer(evtShape, readHandleCaloClus.cptr(),ctx);
59 }
60 SG::ReadHandle<INavigable4MomentumCollection> readHandleINav(navi_container_key, ctx);
61 ATH_CHECK(readHandleINav.isValid());
62 return fillCollectionFromTowerContainer(evtShape, readHandleINav.cptr());
63}
#define ATH_CHECK
Evaluate an expression and check for errors.
Gaudi::Property< bool > m_useClusters
virtual StatusCode fillCollectionFromClusterContainer(std::unique_ptr< xAOD::HIEventShapeContainer > &evtShape, const xAOD::CaloClusterContainer *theClusters, const EventContext &ctx) const
virtual StatusCode fillCollectionFromTowerContainer(std::unique_ptr< xAOD::HIEventShapeContainer > &evtShape, const INavigable4MomentumCollection *navInColl) const

◆ getContainerName()

const std::string & IHIEventShapeFiller::getContainerName ( ) const
inlineinherited

Definition at line 37 of file IHIEventShapeFiller.h.

37{ return m_outputContainerName; };
std::string m_outputContainerName

◆ getKey()

SG::sgkey_t asg::AsgTool::getKey ( const void * ptr) const
inherited

Get the (hashed) key of an object that is in the event store.

This is a bit of a special one. StoreGateSvc and xAOD::TEvent both provide ways for getting the SG::sgkey_t key for an object that is in the store, based on a bare pointer. But they provide different interfaces for doing so.

In order to allow tools to efficiently perform this operation, they can use this helper function.

See also
asg::AsgTool::getName
Parameters
ptrThe bare pointer to the object that the event store should know about
Returns
The hashed key of the object in the store. If not found, an invalid (zero) key.

Definition at line 119 of file AsgTool.cxx.

119 {
120
121#ifdef XAOD_STANDALONE
122 // In case we use @c xAOD::TEvent, we have a direct function call
123 // for this.
124 return evtStore()->event()->getKey( ptr );
125#else
126 const SG::DataProxy* proxy = evtStore()->proxy( ptr );
127 return ( proxy == nullptr ? 0 : proxy->sgkey() );
128#endif // XAOD_STANDALONE
129 }
ServiceHandle< StoreGateSvc > & evtStore()

◆ getMirroredCell()

std::unique_ptr< const CaloCell > HIEventShapeFillerTool::getMirroredCell ( const CaloCell * pCell,
const CaloCellContainer * ccc ) const
private

Definition at line 278 of file HIEventShapeFillerTool.cxx.

278 {
279
280 const Identifier id = pCell->ID();
281 const int subCalo = m_calo_id->sub_calo(id);
282 const int pos_neg = m_calo_id->pos_neg(id);
283 const int sampling = m_calo_id->sampling(id);
284 const int region = m_calo_id->region(id);
285 const int eta = m_calo_id->eta(id);
286 const int phi = m_calo_id->phi(id);
287
288 ATH_MSG_VERBOSE("DeadFEB cell parameter: (" << subCalo << "," << pos_neg << "," << sampling << "," << region << "," << eta << "," << phi << ")");
289
290 const Identifier mirroredID = m_calo_id->cell_id(subCalo,
291 -pos_neg, // flip to get cell in oposite eta
292 sampling, region, eta, phi);
293
294 const CaloCell* mirroredCell = ccc->findCell(m_calo_id->calo_cell_hash(mirroredID));
295 if (!mirroredCell) {
296 return nullptr;
297 }
298 ATH_MSG_VERBOSE("DeadFEB cell (et,layer,deta,dphi): (" << pCell->et() << "," << pCell->caloDDE()->getSampling() << "," << pCell->caloDDE()->eta() << ","
299 << pCell->caloDDE()->phi() << ")");
300
301 ATH_MSG_VERBOSE("Mirror cell (et,layer,deta,dphi): " << mirroredCell->et() << "," << mirroredCell->caloDDE()->getSampling() << ","
302 << mirroredCell->caloDDE()->eta() << "," << mirroredCell->caloDDE()->phi() << ")");
303
304 // Build a fake-cell with the DDE of the cell we are replacing and
305 // energy,time,etc from the eta-mirrored cell
306 return std::make_unique<const CaloCell>(pCell->caloDDE(), mirroredCell->energy(), mirroredCell->time(), mirroredCell->quality(), mirroredCell->provenance(),
307 mirroredCell->gain());
308}
#define ATH_MSG_VERBOSE(x)
const CaloCell * findCell(const IdentifierHash theHash) const
fast find method given identifier hash.
float time() const
get time (data member)
Definition CaloCell.h:368
double energy() const
get energy (data member)
Definition CaloCell.h:327
const CaloDetDescrElement * caloDDE() const
get pointer to CaloDetDescrElement (data member)
Definition CaloCell.h:321
uint16_t provenance() const
get provenance (data member)
Definition CaloCell.h:354
uint16_t quality() const
get quality (data member)
Definition CaloCell.h:348
CaloGain::CaloGain gain() const
get gain (data member )
Definition CaloCell.h:361
virtual double et() const override final
get et
Definition CaloCell.h:423
Identifier ID() const
get ID (from cached data member) non-virtual and inline for fast access
Definition CaloCell.h:295
CaloCell_ID::CaloSample getSampling() const
cell sampling
const CaloCell_ID * m_calo_id

◆ getName()

const std::string & asg::AsgTool::getName ( const void * ptr) const
inherited

Get the name of an object that is / should be in the event store.

This is a bit of a special one. StoreGateSvc and xAOD::TEvent both provide ways for getting the std::string name for an object that is in the store, based on a bare pointer. But they provide different interfaces for doing so.

In order to allow tools to efficiently perform this operation, they can use this helper function.

See also
asg::AsgTool::getKey
Parameters
ptrThe bare pointer to the object that the event store should know about
Returns
The string name of the object in the store. If not found, an empty string.

Definition at line 106 of file AsgTool.cxx.

106 {
107
108#ifdef XAOD_STANDALONE
109 // In case we use @c xAOD::TEvent, we have a direct function call
110 // for this.
111 return evtStore()->event()->getName( ptr );
112#else
113 const SG::DataProxy* proxy = evtStore()->proxy( ptr );
114 static const std::string dummy = "";
115 return ( proxy == nullptr ? dummy : proxy->name() );
116#endif // XAOD_STANDALONE
117 }

◆ getProperty()

template<class T>
const T * asg::AsgTool::getProperty ( const std::string & name) const
inherited

Get one of the tool's properties.

◆ initialize()

StatusCode HIEventShapeFillerTool::initialize ( void )
overridevirtual

Dummy implementation of the initialisation function.

It's here to allow the dual-use tools to skip defining an initialisation function. Since many are doing so...

Reimplemented from asg::AsgTool.

Definition at line 24 of file HIEventShapeFillerTool.cxx.

25{
26
27 ATH_MSG_INFO("In HIEventShapeFillerTool::initialize()");
28
29 ATH_CHECK( detStore()->retrieve(m_calo_id, "CaloCell_ID") );
31
32 return StatusCode::SUCCESS;
33}
#define ATH_MSG_INFO(x)
const ServiceHandle< StoreGateSvc > & detStore() const
retrieve(aClass, aKey=None)
Definition PyKernel.py:110

◆ initializeEventShapeContainer()

StatusCode HIEventShapeFillerTool::initializeEventShapeContainer ( std::unique_ptr< xAOD::HIEventShapeContainer > & evtShape) const
overridevirtual

Implements IHIEventShapeFiller.

Definition at line 43 of file HIEventShapeFillerTool.cxx.

44{
45 //use tool to initialize event shape object
46 if (!m_useClusters) m_index->initializeEventShapeContainer(evtShape, m_numOrders);
47 return StatusCode::SUCCESS;
48}

◆ initializeIndex()

StatusCode HIEventShapeFillerTool::initializeIndex ( )
overridevirtual

Implements IHIEventShapeFiller.

Definition at line 36 of file HIEventShapeFillerTool.cxx.

37{
39 return StatusCode::SUCCESS;
40}
ToolHandle< IHIEventShapeMapTool > m_eventShapeMapTool
@ COMPACT
Definition HIEventDefs.h: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.

◆ msg()

MsgStream & AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ msg_level_name()

const std::string & asg::AsgTool::msg_level_name ( ) const
inherited

A deprecated function for getting the message level's name.

Instead of using this, weirdly named function, user code should get the string name of the current minimum message level (in case they really need it...), with:

MSG::name( msg().level() )

This function's name doesn't follow the ATLAS coding rules, and as such will be removed in the not too distant future.

Returns
The string name of the current minimum message level that's printed

Definition at line 101 of file AsgTool.cxx.

101 {
102
103 return MSG::name( msg().level() );
104 }
MsgStream & msg() const
const std::string & name(Level lvl)
Convenience function for translating message levels to strings.
Definition MsgLevel.cxx:19

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

◆ print()

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

◆ setContainerName()

void IHIEventShapeFiller::setContainerName ( const std::string & cname)
inlineinherited

Definition at line 38 of file IHIEventShapeFiller.h.

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

◆ updateShape()

void HIEventShapeFillerTool::updateShape ( std::unique_ptr< xAOD::HIEventShapeContainer > & shape,
const HIEventShapeIndex * index,
const CaloCell * theCell,
float geoWeight,
float eta0,
float phi0,
bool isNeg = false ) const
private

Definition at line 248 of file HIEventShapeFillerTool.cxx.

249{
250 float sgn = (isNeg) ? -1 : 1;
251
252 int layer = theCell->caloDDE()->getSampling();
253 float cell_et = theCell->et();
254
255 xAOD::HIEventShape* slice = index->getShape(eta0, layer, shape);
256 //update members
257 slice->setNCells(slice->nCells() + sgn);
258 slice->setEt(slice->et() + sgn * cell_et * geoWeight);
259 float deta = theCell->caloDDE()->deta();
260 float dphi = theCell->caloDDE()->dphi();
261 float area = std::abs(deta * dphi);
262 float rho = 0;
263 if (area != 0.) rho = cell_et / area;
264 slice->setArea(slice->area() + sgn * area * geoWeight);
265 slice->setRho(slice->rho() + sgn * rho);
266
267 for (unsigned int ih = 0; ih < slice->etCos().size(); ih++)
268 {
269 float ih_f = ih + 1;
270 float tmp_cos = slice->etCos().at(ih);
271 slice->etCos()[ih] = tmp_cos + cell_et * cos(ih_f * phi0) * geoWeight;
272
273 float tmp_sin = slice->etSin().at(ih);
274 slice->etSin()[ih] = tmp_sin + cell_et * sin(ih_f * phi0) * geoWeight;
275 }
276}
double area(double R)
str index
Definition DeMoScan.py:362
@ layer
Definition HitInfo.h:79

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

const CaloCell_ID* HIEventShapeFillerTool::m_calo_id {nullptr}
private

Definition at line 45 of file HIEventShapeFillerTool.h.

45{nullptr};

◆ m_caloCellKey

SG::ReadHandleKey<CaloCellContainer> HIEventShapeFillerTool::m_caloCellKey {this, "CaloCellContainerKey","","cell container for mirror"}
private

Definition at line 54 of file HIEventShapeFillerTool.h.

54{this, "CaloCellContainerKey","","cell container for mirror"};

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

ToolHandle<IHIEventShapeMapTool> HIEventShapeFillerTool::m_eventShapeMapTool { this, "EventShapeMapTool", "HIEventShapeMapTool", "Handle to Event Shape Map Tool" }
private

Definition at line 52 of file HIEventShapeFillerTool.h.

52{ this, "EventShapeMapTool", "HIEventShapeMapTool", "Handle to Event Shape Map Tool" };

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

const HIEventShapeIndex* HIEventShapeFillerTool::m_index
private

Definition at line 44 of file HIEventShapeFillerTool.h.

◆ m_numOrders

Gaudi::Property< int > HIEventShapeFillerTool::m_numOrders { this, "OrderOfFlowHarmonics", 7, "The number of Orders of harmonic flow to store in the EventShape" }
private

Definition at line 57 of file HIEventShapeFillerTool.h.

57{ this, "OrderOfFlowHarmonics", 7, "The number of Orders of harmonic flow to store in the EventShape" };

◆ m_outputContainerName

std::string IHIEventShapeFiller::m_outputContainerName
privateinherited

Definition at line 42 of file IHIEventShapeFiller.h.

◆ m_towerWeightTool

ToolHandle<IHITowerWeightTool> HIEventShapeFillerTool::m_towerWeightTool { this, "TowerWeightTool", "", "Handle to Tower Weight Tool" }
private

Definition at line 51 of file HIEventShapeFillerTool.h.

51{ this, "TowerWeightTool", "", "Handle to Tower Weight Tool" };

◆ m_useClusters

Gaudi::Property< bool > HIEventShapeFillerTool::m_useClusters { this, "UseClusters", false, "use Clusters boolean switch" }
private

Definition at line 56 of file HIEventShapeFillerTool.h.

56{ this, "UseClusters", false, "use Clusters boolean switch" };

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