ATLAS Offline Software
Loading...
Searching...
No Matches
LVL1::gSuperCellTowerMapper Class Reference

#include <gSuperCellTowerMapper.h>

Inheritance diagram for LVL1::gSuperCellTowerMapper:
Collaboration diagram for LVL1::gSuperCellTowerMapper:

Public Member Functions

 gSuperCellTowerMapper (const std::string &type, const std::string &name, const IInterface *parent)
virtual ~gSuperCellTowerMapper ()
virtual StatusCode initialize () override
 standard Athena-Algorithm method
virtual StatusCode AssignSuperCellsToTowers (std::unique_ptr< gTowerContainer > &my_gTowerContainerRaw) const override
virtual StatusCode AssignTriggerTowerMapper (std::unique_ptr< gTowerContainer > &my_gTowerContainerRaw) const override
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

virtual int FindAndConnectTower (std::unique_ptr< gTowerContainer > &my_gTowerContainerRaw, CaloSampling::CaloSample sample, const int region, const int pos_neg, const int eta_index, const int phi_index, Identifier ID, float et, int prov, bool doPrint) const override
virtual void ConnectSuperCellToTower (std::unique_ptr< gTowerContainer > &my_gTowerContainerRaw, int iGTower, Identifier ID, float et) const override
virtual int FindTowerIDForSuperCell (int towereta, int towerphi, int nphi) const override
virtual void PrintCellSpec (const CaloSampling::CaloSample sample, const int region, const int eta_index, const int phi_index, const int pos_neg, int towereta, int towerphi, int nphi, int towerID_Modifier, int iGTower, int prov, Identifier ID) const override
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

SG::ReadHandleKey< CaloCellContainerm_scellsCollectionSGKey {this, "SCell", "SCell", "SCell"}
SG::ReadHandleKey< xAOD::TriggerTowerContainerm_triggerTowerCollectionSGKey {this, "xODTriggerTowers", "xAODTriggerTowers", "xAODTriggerTowers"}
Gaudi::Property< bool > m_apply_masking {this, "SCellMasking", false, "Applies masking. Only use for data"}
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 25 of file gSuperCellTowerMapper.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

◆ gSuperCellTowerMapper()

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

Definition at line 22 of file gSuperCellTowerMapper.cxx.

22 :
23 AthAlgTool(type,name,parent)
24{
25 declareInterface<IgSuperCellTowerMapper>(this);
26
27}
AthAlgTool()
Default constructor:

◆ ~gSuperCellTowerMapper()

LVL1::gSuperCellTowerMapper::~gSuperCellTowerMapper ( )
virtual

Definition at line 29 of file gSuperCellTowerMapper.cxx.

30{
31}

Member Function Documentation

◆ AssignSuperCellsToTowers()

StatusCode LVL1::gSuperCellTowerMapper::AssignSuperCellsToTowers ( std::unique_ptr< gTowerContainer > & my_gTowerContainerRaw) const
overridevirtual

Implements LVL1::IgSuperCellTowerMapper.

Definition at line 96 of file gSuperCellTowerMapper.cxx.

97{
98 bool doPrint = true;
99
100 SG::ReadHandle<CaloCellContainer> scellsCollection(m_scellsCollectionSGKey/*,ctx*/);
101 if(!scellsCollection.isValid()){
102 ATH_MSG_FATAL("Could not retrieve scellsCollection " << m_scellsCollectionSGKey.key() );
103 return StatusCode::FAILURE;
104 }
105
106
107 const CaloCell_Base_ID* idHelper = nullptr;
108 ATH_CHECK( detStore()->retrieve (idHelper, "CaloCell_SuperCell_ID") );
109
110 for (const CaloCell* cell : * scellsCollection){
111
112 const CaloSampling::CaloSample sample = (cell)->caloDDE()->getSampling();
113 const Identifier ID = (cell)->ID(); // super cell unique ID
114 int region = idHelper->region(ID);
115 int pos_neg = idHelper->pos_neg(ID);
116 int eta_index = idHelper->eta(ID);
117 const int phi_index = idHelper->phi(ID);
118 float et = (cell)->energy()/std::cosh((cell)->eta());
119 int prov = (cell)->provenance();
120
121
122 // std::cout<< ID << " " << (cell)->eta() << " " << (cell)->phi() << " " << sample << " " << region << std::endl;
123 // The following is to check if any SuperCells from data are permanently masked, and if so the masking is applied
124 int SCprov = prov&0xFFF;
125 bool isMasked = (SCprov&0x80)==0x80;//prov looks like 0000 0000 1000 0000 if the cell is masked
126 if (isMasked and m_apply_masking) et = 0;
127
128 // I removed the LOCAL TO GLOBAL ETA INDEX PATCH for gFEX
129 // Since in any case the SC assignment won't be regular, the eta and phi bins are combined directly in the FindAndConnectTower
130 FindAndConnectTower(my_gTowerContainerRaw,sample,region,pos_neg,eta_index,phi_index,ID,et,prov,doPrint);
131
132
133 }
134
135 for (auto gTower : *my_gTowerContainerRaw)
136 {
137 gTower->setET();
138
139 }
140
141
142 return StatusCode::SUCCESS;
143
144}
Scalar eta() const
pseudorapidity method
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_FATAL(x)
float et(const xAOD::jFexSRJetRoI *j)
const ServiceHandle< StoreGateSvc > & detStore() const
int phi(const Identifier id) const
LAr field values (NOT_VALID == invalid request).
int region(const Identifier id) const
LAr field values (NOT_VALID == invalid request).
int pos_neg(const Identifier id) const
LAr field values (NOT_VALID == invalid request).
int eta(const Identifier id) const
LAr field values (NOT_VALID == invalid request).
Gaudi::Property< bool > m_apply_masking
SG::ReadHandleKey< CaloCellContainer > m_scellsCollectionSGKey
virtual int FindAndConnectTower(std::unique_ptr< gTowerContainer > &my_gTowerContainerRaw, CaloSampling::CaloSample sample, const int region, const int pos_neg, const int eta_index, const int phi_index, Identifier ID, float et, int prov, bool doPrint) const override
ID
//////////////////////////////////////// JetAlgorithmType::ID defines most common physics jet finding...

◆ AssignTriggerTowerMapper()

StatusCode LVL1::gSuperCellTowerMapper::AssignTriggerTowerMapper ( std::unique_ptr< gTowerContainer > & my_gTowerContainerRaw) const
overridevirtual

Implements LVL1::IgSuperCellTowerMapper.

Definition at line 42 of file gSuperCellTowerMapper.cxx.

42 {
43
44 static constexpr float delta_phi = M_PI/32;
45 static constexpr float delta_eta = 0.1;
46
47 SG::ReadHandle<xAOD::TriggerTowerContainer> triggerTowerCollection(m_triggerTowerCollectionSGKey/*,ctx*/);
48 if(!triggerTowerCollection.isValid()){
49 ATH_MSG_FATAL("Could not retrieve triggerTowerCollection " << m_triggerTowerCollectionSGKey.key() );
50 return StatusCode::FAILURE;
51 }
52
53
54 for(auto eachTower : *triggerTowerCollection) {
55
56 if(std::abs(eachTower->eta())<1.5 && eachTower->sampling()==1) {
57 int tile_iphi = int(eachTower->phi()/delta_phi);
58 int tower_iphi = tile_iphi/2;
59 int tile_ieta = int(std::abs(eachTower->eta())/delta_eta);
60 int tower_ieta = tile_ieta/2;
61 int nphi = 32;
62 int etaSign{-1};
63 int towerID_Modifier{100000};
64
65
66 if (eachTower->eta() > 0) {
67 etaSign = 1;
68 towerID_Modifier = 200000;
69 }
70
71 if(tower_ieta * etaSign == -7) {
72 towerID_Modifier = 300000;
73 }
74
75 else if (tower_ieta * etaSign == 7) {
76 towerID_Modifier = 400000;
77 }
78 int towerid = FindTowerIDForSuperCell(tower_ieta, tower_iphi, nphi) + towerID_Modifier;
79
80 LVL1::gTower * targetTower;
81 if((targetTower = my_gTowerContainerRaw->findTower(towerid)))
82 {
83 // Set the ET to the gTower, with layer 1 to specify this comes from the HAD
84 targetTower->addET(static_cast<int>(eachTower->jepET()) * 1000., 1);
85 } else
86 {
87 ATH_MSG_WARNING("\n==== gSuperCellTowerMapper ============ Tower id is officially unknown - it will be ignored. (Needs investigation). Please report this!");
88 }
89 }
90 }
91 return StatusCode::SUCCESS;
92}
#define M_PI
#define ATH_MSG_WARNING(x)
SG::ReadHandleKey< xAOD::TriggerTowerContainer > m_triggerTowerCollectionSGKey
virtual int FindTowerIDForSuperCell(int towereta, int towerphi, int nphi) const override
void addET(float et, int layer)
Add ET in MeV, layer refers to EM or HAD (Tile).
Definition gTower.cxx:58
delta_phi(phi1, phi2)
Definition eFEXNTuple.py:14

◆ ConnectSuperCellToTower()

void LVL1::gSuperCellTowerMapper::ConnectSuperCellToTower ( std::unique_ptr< gTowerContainer > & my_gTowerContainerRaw,
int iGTower,
Identifier ID,
float et ) const
overrideprivatevirtual

Implements LVL1::IgSuperCellTowerMapper.

Definition at line 147 of file gSuperCellTowerMapper.cxx.

147 {
148
149 LVL1::gTower * tmpTower = my_gTowerContainerRaw->findTower(iGTower);
150
151 if(tmpTower){
152 tmpTower->setSCID(ID);
153 tmpTower->addET(et, 0); // layer is always 0 (EM) for SuperCells
154
155 }
156
157}
void setSCID(Identifier ID)
Set supercell position ID.
Definition gTower.cxx:95

◆ 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

◆ FindAndConnectTower()

int LVL1::gSuperCellTowerMapper::FindAndConnectTower ( std::unique_ptr< gTowerContainer > & my_gTowerContainerRaw,
CaloSampling::CaloSample sample,
const int region,
const int pos_neg,
const int eta_index,
const int phi_index,
Identifier ID,
float et,
int prov,
bool doPrint ) const
overrideprivatevirtual

Implements LVL1::IgSuperCellTowerMapper.

Definition at line 159 of file gSuperCellTowerMapper.cxx.

160{
161
162 bool validcell = true;
163
164 // We tell the gTower which supercell unique ID is in each tower
165 int nphi = -1; // to be filled with number of phi bins
166 int towereta = -99; // to be filled with tower eta value to help find it
167 int towerphi = -99; // to be filled with tower phi value to help find it
168 int iGTower = -99; // The tower ID which the supercell will be assigned to
169 int towerID_Modifier = -999999999; // adjustable tower ID modifier to fit tower Id scheme
170
171
172 //----------------------------------------------------------
173
174 // Begin assigning supercells to Towers
175
176 //----------------------------------------------------------
177
178 switch (sample) {
179 // E.M. Barrel (EMB)
180 case CaloSampling::PreSamplerB: {
181 // The following divides integers by 2 and truncates away the decimals (rounds DOWN to an integer)
182 towereta = eta_index / 2; // Layer 0 has super cells which are 0.1 x 0.1 - gTower is 0.2 x 0.2
183 towerphi = phi_index / 2; // phi is 32 for gTowers
184
185 nphi = 32;
186
187 if(eta_index == 14){ // special treatment for the tower where EMB and EMEC overlap (for gFEX: Eta Range 1.4-1.6)
188 if(pos_neg < 0){ towerID_Modifier = 300000; }
189 else if(pos_neg > 0){ towerID_Modifier = 400000; }
190 }
191 else{ // standard treatment for non-transition towers
192 if(pos_neg < 0){ towerID_Modifier = 100000; }
193 else if(pos_neg > 0){ towerID_Modifier = 200000; }
194 }
195
196 break;
197 }
198 case CaloSampling::EMB1:
199 case CaloSampling::EMB2: {
200
201 nphi = 32;
202
203 if (region == 0) {
204 towereta = eta_index / 8;
205 towerphi = phi_index / 2;
206 if(pos_neg < 0){ towerID_Modifier = 100000; }
207 else if(pos_neg > 0){ towerID_Modifier = 200000; }
208 }
209 else if (region == 1){
210 towereta = 7;
211 towerphi = phi_index/2;
212 if(pos_neg < 0){ towerID_Modifier = 300000; }
213 else if(pos_neg > 0){ towerID_Modifier = 400000; }
214 }
215 else {
216 ATH_MSG_DEBUG("[CaloSampling::EMB1 or CaloSampling::EMB2] -> invalid 'region' value: " << region << " (Under investigation) ");
217 }
218
219 switch(sample){
220 case CaloSampling::EMB1: {
221 break;
222 }
223 case CaloSampling::EMB2: {
224 break;
225 }
226 //coverity[DEADCODE]
227 default: {
228 ATH_MSG_DEBUG("CaloSampling::EMBX -> invalid sample for assigning iCell value! " << sample << " (Under investigation) ");
229 break;
230 }
231 }
232
233 break;
234 }
235 case CaloSampling::EMB3: {
236
237 nphi = 32;
238 towereta = eta_index/2; // Analogous to PreSamplerB
239 towerphi = phi_index/2;
240
241
242 if(pos_neg < 0){ towerID_Modifier = 100000; }
243 else if(pos_neg > 0){ towerID_Modifier = 200000; }
244
245 break;
246 }
247 // E.M. End-cap (EMEC)
248 case CaloSampling::PreSamplerE: {
249
250 nphi = 32;
251 // towereta = 7 + std::ceil(eta_index / 2.); //This is a special case, as there are only 3 cells in eta 1.56 (gFEX bin 7), 1.66 (gFEX bin 8), 1.76 (gFEX bin 8)
252 if (eta_index < 1) {towereta = 7;}
253 else {towereta = 8;}
254 towerphi = phi_index / 2; // phi is 32 for gTowers
255
256
257 if (towereta == 7){
258 if(pos_neg < 0){ towerID_Modifier = 300000; }
259 else if(pos_neg > 0){ towerID_Modifier = 400000; }
260 }
261 else if (towereta != 7){
262 if(pos_neg < 0){ towerID_Modifier = 500000; }
263 else if(pos_neg > 0){ towerID_Modifier = 600000; }
264 }
265
266 break;
267 }
268 case CaloSampling::EME1: {
269
270 nphi = 32;
271
272 switch (region) {
273 case 0: {
274
275 towereta = 7;
276 towerphi = phi_index/2;
277
278 break;
279 }
280 case 2: {
281
282 if (eta_index < 4) {towereta = 7;}
283 else {towereta = 8;}
284 towerphi = phi_index/2;
285
286 break;
287 }
288 case 3: {
289
290 if (eta_index < 11) {towereta = 8;}
291 else {towereta = 9;}
292 towerphi = phi_index/2;
293 break;
294
295 }
296 case 4: {
297
298 if (eta_index < 8) {towereta = 10;}
299 else {towereta = 11;}
300 towerphi = phi_index/2;
301
302 break;
303 }
304 case 5: {
305
306 towereta = 11 ;
307 towerphi = phi_index/2;
308
309 break;
310 }
311 default: {
312 ATH_MSG_DEBUG("CaloSampling::EME1 -> invalid 'region' value: " << region << " (Under investigation) ");
313 break;
314 }
315 break;
316 }
317
318 if (towereta == 7){
319 if(pos_neg < 0){ towerID_Modifier = 300000; }
320 else if(pos_neg > 0){ towerID_Modifier = 400000; }
321 }
322 else if (towereta != 7){
323 if(pos_neg < 0){ towerID_Modifier = 500000; }
324 else if(pos_neg > 0){ towerID_Modifier = 600000; }
325 }
326
327 break;
328 }
329 case CaloSampling::EME2: {
330
331 nphi = 32;
332
333 switch (region) {
334 case 0: {
335
336 if(abs(pos_neg) == 2){
337 towereta = 7;
338 towerphi = phi_index/2;
339 }
340 else if(abs(pos_neg) == 3){
341 if (eta_index == 0){
342 towereta = 12;
343 towerphi = phi_index;
344 }
345 else if (eta_index == 1){
346 towereta = 13;
347 towerphi = phi_index;
348 }
349 else if (eta_index == 2){
350 towereta = 14;
351 towerphi = phi_index;
352 }
353 }
354 break;
355 }
356 case 1: {
357 if(abs(pos_neg) == 2){
358 towerphi = phi_index/2;
359 if (eta_index < 7) {towereta = 7;}
360 else if (eta_index < 15) {towereta = 8;}
361 else if (eta_index < 23) {towereta = 9;}
362 else if (eta_index < 31) {towereta = 10;}
363 else if (eta_index < 43) {towereta = 11;}
364 }
365 else if(abs(pos_neg) == 3){
366 towerphi = phi_index;
367 towereta = 15;
368 }
369 break;
370 }
371
372 default: {
373 ATH_MSG_DEBUG("CaloSampling::EME2 -> invalid 'region' value: " << region << " (Under investigation) ");
374 break;
375 }
376 break;
377 }
378
379 if (towereta == 7){
380 if(pos_neg < 0){ towerID_Modifier = 300000; }
381 else if(pos_neg > 0){ towerID_Modifier = 400000; }
382 }
383 else if (towereta == 12 || towereta == 13 || towereta == 14 || towereta == 15){
384 if(pos_neg < 0){ towerID_Modifier = 700000; }
385 else if(pos_neg > 0){ towerID_Modifier = 800000; }
386 }
387 else {
388 if(pos_neg < 0){ towerID_Modifier = 500000; }
389 else if(pos_neg > 0){ towerID_Modifier = 600000; }
390 }
391
392 break;
393 }
394 case CaloSampling::EME3: {
395
396 nphi = 32;
397 switch (region) {
398 case 0: {
399 if(abs(pos_neg) == 2){
400 towerphi = phi_index/2;
401 if (eta_index == 0){
402 towereta = 7;
403 }
404 else if(eta_index < 3){
405 towereta = 8;
406 }
407 else if(eta_index < 5){
408 towereta = 9;
409 }
410 else if(eta_index < 7){
411 towereta = 10;
412 }
413 else if(eta_index < 10){
414 towereta = 11;
415 }
416
417 }
418 else if(abs(pos_neg) == 3){
419 if (eta_index == 0){
420 towereta = 12;
421 towerphi = phi_index;
422 }
423 else if (eta_index == 1){
424 towereta = 13;
425 towerphi = phi_index;
426 }
427 else if (eta_index == 2){
428 towereta = 14;
429 towerphi = phi_index;
430 }
431 }
432 break;
433 }
434 case 1: { // we only have the case: abs(pos_neg) = 3
435 towerphi = phi_index;
436 towereta = 15;
437 break;
438 }
439 default: {
440 ATH_MSG_DEBUG("CaloSampling::EME3 -> invalid 'region' value: " << region << " (Under investigation) ");
441 break;
442 }
443 break;
444 }
445
446 if (towereta == 7){
447 if(pos_neg < 0){ towerID_Modifier = 300000; }
448 else if(pos_neg > 0){ towerID_Modifier = 400000; }
449 }
450 else if (towereta == 12 || towereta == 13 || towereta == 14 || towereta == 15){
451 if(pos_neg < 0){ towerID_Modifier = 700000; }
452 else if(pos_neg > 0){ towerID_Modifier = 800000; }
453 }
454 else {
455 if(pos_neg < 0){ towerID_Modifier = 500000; }
456 else if(pos_neg > 0){ towerID_Modifier = 600000; }
457 }
458 break;
459 }
460 // Hadronic End-cap (HEC)
461 case CaloSampling::HEC0:{
462 nphi = 32;
463 switch(region){
464 case 0: {
465 if(abs(pos_neg) == 2){
466 towerphi = phi_index/2;
467 if (eta_index == 0){
468 towereta = 7;
469 }
470 else if(eta_index < 3){
471 towereta = 8;
472 }
473 else if(eta_index < 5){
474 towereta = 9;
475 }
476 else if(eta_index < 7){
477 towereta = 10;
478 }
479 else if(eta_index < 10){
480 towereta = 11;
481 }
482 }
483 break;
484
485 }
486
487 case 1: {
488 if(abs(pos_neg) == 2){
489 if (eta_index == 0){
490 towereta = 12;
491 towerphi = phi_index;
492 }
493 else if(eta_index == 1){
494 towereta = 13;
495 towerphi = phi_index;
496 }
497 else if(eta_index == 2){
498 towereta = 14;
499 towerphi = phi_index;
500 }
501 else if(eta_index == 3){
502 towereta = 15;
503 towerphi = phi_index;
504 }
505 }
506 break;
507
508 }
509
510 default: {
511 ATH_MSG_DEBUG("CaloSampling::HEC0 -> invalid 'region' value: " << region << " (Under investigation) ");
512 break;
513 }
514
515 }
516
517 // Tower connection
518 if (towereta == 7){
519 nphi = 32;
520 if(pos_neg < 0){ towerID_Modifier = 300000; }
521 else if(pos_neg > 0){ towerID_Modifier = 400000; }
522 }
523 else if (towereta == 12 || towereta == 13 || towereta == 14 || towereta == 15){
524 if(pos_neg < 0){ towerID_Modifier = 700000; }
525 else if(pos_neg > 0){ towerID_Modifier = 800000; }
526 }
527 else {
528 nphi = 32;
529 if(pos_neg < 0){ towerID_Modifier = 500000; }
530 else if(pos_neg > 0){ towerID_Modifier = 600000; }
531 }
532
533 break;
534 }
535 case CaloSampling::TileBar0:
536 case CaloSampling::TileBar1:
537 case CaloSampling::TileBar2: {
538 REPORT_MESSAGE_WITH_CONTEXT (MSG::DEBUG, "gSuperCellTowerMapper") << "Supercell is from Tile Barrel - it will be ignored.";
539 validcell = false;
540 ATH_MSG_DEBUG("\n==== gSuperCellTowerMapper ============ Supercell is from Tile Barrel - it will be ignored.");
541 break;
542 }
543 case CaloSampling::TileGap1:
544 case CaloSampling::TileGap2:
545 case CaloSampling::TileGap3: {
546 ATH_MSG_DEBUG("\n==== gSuperCellTowerMapper ============ Supercell is from Tile Gap (ITC and scintillator) - it will be ignored.");
547 validcell = false;
548 break;
549 }
550 case CaloSampling::TileExt0:
551 case CaloSampling::TileExt1:
552 case CaloSampling::TileExt2: {
553 ATH_MSG_DEBUG("\n==== gSuperCellTowerMapper ============ Supercell is from Tile Extended Barrel - it will be ignored.");
554 validcell = false;
555 break;
556 }
557 case CaloSampling::FCAL0:{
558 nphi = 16;
559 towerphi = phi_index;
560 if(eta_index < 5){
561 towereta = 16;
562 }
563 else if(eta_index < 8){
564 towereta = 17;
565 }
566 else if(eta_index < 10){
567 towereta = 18;
568 }
569 else if(eta_index < 12){
570 towereta = 19;
571 }
572
573 if(pos_neg < 0){ towerID_Modifier = 900000; }
574 else if(pos_neg > 0){ towerID_Modifier = 1000000; }
575
576 break;
577 }
578 case CaloSampling::FCAL1:{
579 nphi = 16;
580 towerphi = phi_index;
581 if (eta_index < 4){
582 towereta = 16;
583 }
584 else if(eta_index < 6){
585 towereta = 17;
586 }
587 else if(eta_index < 7){
588 towereta = 18;
589 }
590 else if(eta_index < 8){
591 towereta = 19;
592 }
593
594 if(pos_neg < 0){ towerID_Modifier = 900000; }
595 else if(pos_neg > 0){ towerID_Modifier = 1000000; }
596
597 break;
598 }
599 case CaloSampling::FCAL2:{
600 nphi = 16;
601 towerphi = phi_index;
602 if (eta_index < 1){
603 towereta = 16;
604 }
605 else if(eta_index < 3){
606 towereta = 17;
607 }
608 else if(eta_index < 4){
609 towereta = 18;
610 }
611
612 if(pos_neg < 0){ towerID_Modifier = 900000; }
613 else if(pos_neg > 0){ towerID_Modifier = 1000000; }
614 break;
615 }
616
617
618 case CaloSampling::MINIFCAL0:
619 case CaloSampling::MINIFCAL1:
620 case CaloSampling::MINIFCAL2:
621 case CaloSampling::MINIFCAL3: {
622 ATH_MSG_DEBUG("\n==== gSuperCellTowerMapper ============ Supercells is from MiniFCAL - it will be ignored.");
623 validcell = false;
624 break;
625 }
626 case CaloSampling::Unknown: {
627 ATH_MSG_WARNING("\n==== gSuperCellTowerMapper ============ Supercell sampling is officially unknown - it will be ignored. (Needs investigation). Please report this!");
628 validcell = false;
629 break;
630 }
631 default: {
632 ATH_MSG_DEBUG("\n==== gSuperCellTowerMapper ============ Supercell has invalid CaloSampling value: " << sample << " (Needs investigation). Please report this!");
633 validcell = false;
634 break;
635 }
636 }
637
638 if(validcell){
639 iGTower = FindTowerIDForSuperCell(towereta, towerphi, nphi) + towerID_Modifier;
640 if(doPrint){
641 PrintCellSpec(sample, region, eta_index, phi_index, pos_neg, towereta, towerphi, nphi, towerID_Modifier, iGTower, prov, ID);
642 }
643 ConnectSuperCellToTower(my_gTowerContainerRaw, iGTower, ID, et);
644 }
645
646 // END ITERATING OVER SUPER CELLS+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++
647
648 return 1;
649
650}
#define ATH_MSG_DEBUG(x)
#define REPORT_MESSAGE_WITH_CONTEXT(LVL, CONTEXT_NAME)
Report a message, with an explicitly specified context name.
virtual void PrintCellSpec(const CaloSampling::CaloSample sample, const int region, const int eta_index, const int phi_index, const int pos_neg, int towereta, int towerphi, int nphi, int towerID_Modifier, int iGTower, int prov, Identifier ID) const override
virtual void ConnectSuperCellToTower(std::unique_ptr< gTowerContainer > &my_gTowerContainerRaw, int iGTower, Identifier ID, float et) const override

◆ FindTowerIDForSuperCell()

int LVL1::gSuperCellTowerMapper::FindTowerIDForSuperCell ( int towereta,
int towerphi,
int nphi ) const
overrideprivatevirtual

Implements LVL1::IgSuperCellTowerMapper.

Definition at line 652 of file gSuperCellTowerMapper.cxx.

653{
654
655 return (towerphi + (nphi * towereta));
656
657}

◆ initialize()

StatusCode LVL1::gSuperCellTowerMapper::initialize ( )
overridevirtual

standard Athena-Algorithm method

Definition at line 33 of file gSuperCellTowerMapper.cxx.

34{
35
36 ATH_CHECK( m_scellsCollectionSGKey.initialize() );
38
39 return StatusCode::SUCCESS;
40}

◆ 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 & LVL1::IgSuperCellTowerMapper::interfaceID ( )
inlinestaticinherited

Definition at line 41 of file IgSuperCellTowerMapper.h.

42 {
44 }
static const InterfaceID IID_IgSuperCellTowerMapper("LVL1::IgSuperCellTowerMapper", 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.

◆ PrintCellSpec()

void LVL1::gSuperCellTowerMapper::PrintCellSpec ( const CaloSampling::CaloSample sample,
const int region,
const int eta_index,
const int phi_index,
const int pos_neg,
int towereta,
int towerphi,
int nphi,
int towerID_Modifier,
int iGTower,
int prov,
Identifier ID ) const
overrideprivatevirtual

Implements LVL1::IgSuperCellTowerMapper.

Definition at line 659 of file gSuperCellTowerMapper.cxx.

663{
664
665 std::string sampleName = "";
666
667 switch (sample) {
668 case CaloSampling::PreSamplerB: { sampleName = "PreSamplerB"; break; }
669 case CaloSampling::EMB1: { sampleName = "EMB1"; break; }
670 case CaloSampling::EMB2: { sampleName = "EMB2"; break; }
671 case CaloSampling::EMB3: { sampleName = "EMB3"; break; }
672 case CaloSampling::PreSamplerE: { sampleName = "PreSamplerE"; break; }
673 case CaloSampling::EME1: { sampleName = "EME1"; break; }
674 case CaloSampling::EME2: { sampleName = "EME2"; break; }
675 case CaloSampling::EME3: { sampleName = "EME3"; break; }
676 case CaloSampling::HEC0: { sampleName = "HEC0"; break; }
677 case CaloSampling::HEC1: { sampleName = "HEC1"; break; }
678 case CaloSampling::HEC2: { sampleName = "HEC2"; break; }
679 case CaloSampling::HEC3: { sampleName = "HEC3"; break; }
680 case CaloSampling::TileBar0: { sampleName = "TileBar0"; break; }
681 case CaloSampling::TileBar1: { sampleName = "TileBar1"; break; }
682 case CaloSampling::TileBar2: { sampleName = "TileBar2"; break; }
683 case CaloSampling::TileGap1: { sampleName = "TileGap1"; break; }
684 case CaloSampling::TileGap2: { sampleName = "TileGap2"; break; }
685 case CaloSampling::TileGap3: { sampleName = "TileGap3"; break; }
686 case CaloSampling::TileExt0: { sampleName = "TileExt0"; break; }
687 case CaloSampling::TileExt1: { sampleName = "TileExt1"; break; }
688 case CaloSampling::TileExt2: { sampleName = "TileExt2"; break; }
689 case CaloSampling::FCAL0: { sampleName = "FCAL0"; break; }
690 case CaloSampling::FCAL1: { sampleName = "FCAL1"; break; }
691 case CaloSampling::FCAL2: { sampleName = "FCAL2"; break; }
692
693 default: {
694 ATH_MSG_DEBUG("\n==== gSuperCellTowerMapper ============ Supercell has invalid CaloSampling value: " << sample << " (Needs investigation). Please report this!");
695 break;
696 }
697 }
698
699 ATH_MSG_DEBUG("ASSIGNED CELL::: CASE: " << sampleName
700 << "\tSample: " << sample
701 << "\tRegion: " << region
702 << "\tEta_Index: " << eta_index
703 << "\tPhi_Index: " << phi_index
704 << "\tPosNeg: " << pos_neg
705 << "\tgTower Eta: " << towereta
706 << "\tgTower Phi: " << towerphi
707 << "\tgTower nphi: " << nphi
708 << "\tgTower modifier: " << towerID_Modifier
709 << "\tiGTower: " << iGTower
710 << "\tProvenance: " << prov
711 << "\tID: " << ID
712 << " ");
713
714
715 return;
716}

◆ 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 >, and AthCheckedComponent<::AthAlgTool >.

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

Gaudi::Property<bool> LVL1::gSuperCellTowerMapper::m_apply_masking {this, "SCellMasking", false, "Applies masking. Only use for data"}
private

Definition at line 43 of file gSuperCellTowerMapper.h.

43{this, "SCellMasking", false, "Applies masking. Only use for data"};

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

SG::ReadHandleKey<CaloCellContainer> LVL1::gSuperCellTowerMapper::m_scellsCollectionSGKey {this, "SCell", "SCell", "SCell"}
private

Definition at line 40 of file gSuperCellTowerMapper.h.

40{this, "SCell", "SCell", "SCell"};

◆ m_triggerTowerCollectionSGKey

SG::ReadHandleKey<xAOD::TriggerTowerContainer> LVL1::gSuperCellTowerMapper::m_triggerTowerCollectionSGKey {this, "xODTriggerTowers", "xAODTriggerTowers", "xAODTriggerTowers"}
private

Definition at line 41 of file gSuperCellTowerMapper.h.

41{this, "xODTriggerTowers", "xAODTriggerTowers", "xAODTriggerTowers"};

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