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
virtual void reset () 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 99 of file gSuperCellTowerMapper.cxx.

100{
101 bool doPrint = true;
102
103 SG::ReadHandle<CaloCellContainer> scellsCollection(m_scellsCollectionSGKey/*,ctx*/);
104 if(!scellsCollection.isValid()){
105 ATH_MSG_FATAL("Could not retrieve scellsCollection " << m_scellsCollectionSGKey.key() );
106 return StatusCode::FAILURE;
107 }
108
109
110 const CaloCell_Base_ID* idHelper = nullptr;
111 ATH_CHECK( detStore()->retrieve (idHelper, "CaloCell_SuperCell_ID") );
112
113 for (const CaloCell* cell : * scellsCollection){
114
115 const CaloSampling::CaloSample sample = (cell)->caloDDE()->getSampling();
116 const Identifier ID = (cell)->ID(); // super cell unique ID
117 int region = idHelper->region(ID);
118 int pos_neg = idHelper->pos_neg(ID);
119 int eta_index = idHelper->eta(ID);
120 const int phi_index = idHelper->phi(ID);
121 float et = (cell)->energy()/std::cosh((cell)->eta());
122 int prov = (cell)->provenance();
123
124
125 // std::cout<< ID << " " << (cell)->eta() << " " << (cell)->phi() << " " << sample << " " << region << std::endl;
126 // The following is to check if any SuperCells from data are permanently masked, and if so the masking is applied
127 int SCprov = prov&0xFFF;
128 bool isMasked = (SCprov&0x80)==0x80;//prov looks like 0000 0000 1000 0000 if the cell is masked
129 if (isMasked and m_apply_masking) et = 0;
130
131 // I removed the LOCAL TO GLOBAL ETA INDEX PATCH for gFEX
132 // Since in any case the SC assignment won't be regular, the eta and phi bins are combined directly in the FindAndConnectTower
133 FindAndConnectTower(my_gTowerContainerRaw,sample,region,pos_neg,eta_index,phi_index,ID,et,prov,doPrint);
134
135
136 }
137
138 for (auto gTower : *my_gTowerContainerRaw)
139 {
140 gTower->setET();
141
142 }
143
144
145 return StatusCode::SUCCESS;
146
147}
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:60
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 150 of file gSuperCellTowerMapper.cxx.

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

◆ 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 162 of file gSuperCellTowerMapper.cxx.

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

656{
657
658 return (towerphi + (nphi * towereta));
659
660}

◆ 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 46 of file IgSuperCellTowerMapper.h.

47 {
49 }
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 662 of file gSuperCellTowerMapper.cxx.

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

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

◆ reset()

void LVL1::gSuperCellTowerMapper::reset ( )
overridevirtual

Implements LVL1::IgSuperCellTowerMapper.

Definition at line 94 of file gSuperCellTowerMapper.cxx.

94 {
95 return;
96}

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

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

Definition at line 44 of file gSuperCellTowerMapper.h.

44{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 41 of file gSuperCellTowerMapper.h.

41{this, "SCell", "SCell", "SCell"};

◆ m_triggerTowerCollectionSGKey

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

Definition at line 42 of file gSuperCellTowerMapper.h.

42{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: