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

#include <L1CaloTTIdTools.h>

Inheritance diagram for LVL1::L1CaloTTIdTools:
Collaboration diagram for LVL1::L1CaloTTIdTools:

Public Member Functions

 L1CaloTTIdTools (const std::string &name)
 Create a proper constructor for Athena.
virtual ~L1CaloTTIdTools ()
 destructor
 L1CaloTTIdTools ()=delete
 delete the big 4
 L1CaloTTIdTools (const L1CaloTTIdTools &rhs)=delete
 L1CaloTTIdTools (L1CaloTTIdTools &&rhs)=delete
L1CaloTTIdToolsoperator= (const L1CaloTTIdTools &rhs)=delete
virtual StatusCode initialize ()
 Dummy implementation of the initialisation function.
virtual StatusCode finalize ()
int side (const HWIdentifier &id)
 Declare the interface that the class provides.
int sampling (const HWIdentifier &id)
int region (const HWIdentifier &id)
int eta (const HWIdentifier &id)
int phi (const HWIdentifier &id)
int layer (const HWIdentifier &id)
int PPM_type (const HWIdentifier &id)
int module_type (const HWIdentifier &id)
int barrel_endcap_fcal (const HWIdentifier &id)
double IDeta (const Identifier &id) const
double IDphi (const Identifier &id) const
LVL1::InternalTriggerTowerfindInternalTriggerTower (std::map< unsigned int, LVL1::InternalTriggerTower * > *pIntTTContainer, const Identifier &towerId, bool bCreate=true)
LVL1::InternalTriggerTowerfindInternalTriggerTower (std::map< unsigned int, LVL1::InternalTriggerTower * > *pIntTTContainer, double tt_phi, double tt_eta, unsigned int key, bool bCreate=true)
double etaWidth (const double eta) const
double phiWidth (const double eta) const
int pos_neg_z (const double eta) const
int regionIndex (const double eta) const
int etaIndex (const double eta) const
int phiIndex (const double eta, const double phi) 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
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

Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

const TTOnlineIDm_l1ttonlineHelper
const CaloLVL1_IDm_l1ttofflineHelper
bool m_bInitialized
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

Static Private Attributes

static const double BASEDETA = 0.1
static const double BASEDPHI = 0.098175
static const double FCALDETA = 0.425
static const double ETAMAXREGION0 = 2.5
static const double ETAMAXREGION1 = 3.1
static const double ETAMAXREGION2 = 3.2
static const double ETAMAXREGION3 = 4.9
static const double ETAMIN = -4.9
static const double PHIMIN = 0.

Detailed Description

Definition at line 35 of file L1CaloTTIdTools.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

◆ L1CaloTTIdTools() [1/4]

LVL1::L1CaloTTIdTools::L1CaloTTIdTools ( const std::string & name)

Create a proper constructor for Athena.

constructor

Definition at line 21 of file L1CaloTTIdTools.cxx.

21 :
22 asg::AsgTool( name ),
25 m_bInitialized(false)
26 {
27 }
const CaloLVL1_ID * m_l1ttofflineHelper
const TTOnlineID * m_l1ttonlineHelper

◆ ~L1CaloTTIdTools()

virtual LVL1::L1CaloTTIdTools::~L1CaloTTIdTools ( )
inlinevirtual

destructor

Definition at line 44 of file L1CaloTTIdTools.h.

44{}

◆ L1CaloTTIdTools() [2/4]

LVL1::L1CaloTTIdTools::L1CaloTTIdTools ( )
delete

delete the big 4

◆ L1CaloTTIdTools() [3/4]

LVL1::L1CaloTTIdTools::L1CaloTTIdTools ( const L1CaloTTIdTools & rhs)
delete

◆ L1CaloTTIdTools() [4/4]

LVL1::L1CaloTTIdTools::L1CaloTTIdTools ( L1CaloTTIdTools && rhs)
delete

Member Function Documentation

◆ barrel_endcap_fcal()

int LVL1::L1CaloTTIdTools::barrel_endcap_fcal ( const HWIdentifier & id)
virtual

Implements LVL1::IL1CaloTTIdTools.

Definition at line 353 of file L1CaloTTIdTools.cxx.

353 {
354 int crate = m_l1ttonlineHelper->crate(id);
355
356 if(crate==0 || crate==1 || crate==6 || crate==7) return 0; // barrel
357 else if(crate==2 || crate==3) return 1; //endcap
358 else if(crate==4 || crate==5) {
359 int ppm_type = PPM_type(id);
360 if(ppm_type == 9) return 2; // fcal
361 else if (ppm_type>=5 && ppm_type<=8) return 1; //endcap
362 else return 999;
363 } else return 999;
364 }
int PPM_type(const HWIdentifier &id)

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

◆ eta()

int LVL1::L1CaloTTIdTools::eta ( const HWIdentifier & id)
virtual

Implements LVL1::IL1CaloTTIdTools.

Definition at line 160 of file L1CaloTTIdTools.cxx.

160 {
161 int region = this->region(id);
162
163 //int pos_neg = m_l1ttonlineHelper->pos_neg(id);
164 int pos_neg = this->side(id);
165 //int module = m_l1ttonlineHelper->module(id);
166 int submodule = m_l1ttonlineHelper->submodule(id);
167 int channel = m_l1ttonlineHelper->channel(id);
168
169 int ppm_type = PPM_type(id);
170
171 //-- REGION 0 --//
172 if(region==0) {
173 if(ppm_type==7) return 24;
174 else {
175 int module_eta_offset = 0;
176 int submodule_eta_offset = 0;
177 int channel_eta_offset = 0;
178
179 module_eta_offset = (ppm_type-1)*4;
180
181 if(pos_neg==1) {
182 if( (submodule%4)==0 || (submodule%4)==3 ) submodule_eta_offset = 0;
183 else submodule_eta_offset = 2;
184 channel_eta_offset = channel/2;
185 } else {
186 if( (submodule%4)==0 || (submodule%4)==3 ) submodule_eta_offset = 2;
187 else submodule_eta_offset = 0;
188 channel_eta_offset = 1-channel/2;
189 }
190 return module_eta_offset + submodule_eta_offset + channel_eta_offset;
191 }
192
193 //-- REGION 1 --//
194 } else if (region==1) {
195 if(ppm_type==8) return 2;
196 else {
197 if(pos_neg==1) {
198 if(submodule%4==1 || submodule%4 ==2) return 1;
199 else return 0;
200 } else {
201 if(submodule%4==0 || submodule%4 ==3) return 1;
202 else return 0;
203 }
204 }
205
206 //-- REGION 2 --//
207 } else if (region==2) {
208 return 0;
209
210 //-- REGION 3 --//
211 } else if (region==3) {
212 //int em_had = m_l1ttonlineHelper->em_had(id);
213 int em_had = this->sampling(id);
214 if(pos_neg==1) {
215 if(em_had==0) { //Em
216 if(channel%4==0) return 0;
217 else if(channel%4==1) return 3;
218 else if(channel%4==2) return 1;
219 else if(channel%4==3) return 2;
220 else return -1;
221 } else { //Had
222 // these fcal had channels have the same eta position, but belong to different layers (FCAL_2&FCAL_3)
223 // if(channel%4==0 || channel%4==2) return 0;
224 // else if(channel%4==1 || channel%4==3) return 1;
225 // else return -1;
226
227 //the following assignation to eta indexes is FALSE for FCAL3 channels (3&1),
228 //but necessary to match with the way offline Ids are designed
229
230 // this mapping is not correct in regard of the one used in the bytestream decoder
231 // if(channel%4==0) return 0;
232 // else if(channel%4==1) return 3;
233 // else if(channel%4==2) return 2;
234 // else if(channel%4==3) return 1;
235 // else return -1;
236
237 // This mapping follow the BS decoder channel ordering for FCal
238 if(channel%4==0) return 0;
239 else if(channel%4==1) return 3;
240 else if(channel%4==2) return 1;
241 else if(channel%4==3) return 2;
242 else return -1;
243
244 }
245 } else {
246 if(em_had==0) { //Em
247 if(channel%4==0) return 3;
248 else if(channel%4==1) return 0;
249 else if(channel%4==2) return 2;
250 else if(channel%4==3) return 1;
251 else return -1;
252 } else { //Had
253 // these fcal had channels have the same eta position, but belong to different layers (FCAL_2&FCAL_3)
254 // if(channel%4==0 || channel%4==2) return 1;
255 // else if(channel%4==1 || channel%4==3) return 0;
256 // else return -1;
257
258 //the following assignation to eta indexes is FALSE for FCAL3 channels (3&1),
259 //but necessary to match with the way offline Ids are designed
260
261 // this mapping is not correct in regard of the one used in the bytestream decoder
262 // if(channel%4==0) return 1;
263 // else if(channel%4==1) return 2;
264 // else if(channel%4==2) return 3;
265 // else if(channel%4==3) return 0;
266 // else return -1;
267
268 // This mapping follow the BS decoder channel ordering for FCal
269 if(channel%4==0) return 3;
270 else if(channel%4==1) return 0;
271 else if(channel%4==2) return 2;
272 else if(channel%4==3) return 1;
273 else return -1;
274
275
276 }
277 }
278 }
279 return -1;
280 }
int region(const HWIdentifier &id)
int side(const HWIdentifier &id)
Declare the interface that the class provides.
int sampling(const HWIdentifier &id)

◆ etaIndex()

int LVL1::L1CaloTTIdTools::etaIndex ( const double eta) const
virtual

Implements LVL1::IL1CaloTTIdTools.

Definition at line 519 of file L1CaloTTIdTools.cxx.

519 {
520 int etacenter = -1;
521 double deta = this->etaWidth(eta);
522 double abseta = fabs(eta);
523
524 if(abseta<ETAMAXREGION0) {
525 etacenter = (int) floor(abseta/deta);
526
527 } else if(abseta<ETAMAXREGION1) {
528 etacenter = (int) (floor((abseta-ETAMAXREGION0)/deta));
529
530 } else if (abseta<ETAMAXREGION2) {
531 etacenter = (int) (floor((abseta-ETAMAXREGION1)/deta));
532
533 } else if (abseta<ETAMAXREGION3){
534 etacenter = (int) (floor((abseta-ETAMAXREGION2)/deta));
535 }
536 return etacenter;
537 }
static const double ETAMAXREGION1
int eta(const HWIdentifier &id)
double etaWidth(const double eta) const
static const double ETAMAXREGION3
static const double ETAMAXREGION2
static const double ETAMAXREGION0

◆ etaWidth()

double LVL1::L1CaloTTIdTools::etaWidth ( const double eta) const
virtual

Implements LVL1::IL1CaloTTIdTools.

Definition at line 483 of file L1CaloTTIdTools.cxx.

483 {
484 double abseta = fabs(eta);
485 if(abseta<ETAMAXREGION0) {
486 return BASEDETA;
487
488 } else if(abseta<ETAMAXREGION1) {
489 return BASEDETA*2.;
490
491 } else if (abseta<ETAMAXREGION2) {
492 return BASEDETA;
493
494 } else {
495 return FCALDETA;
496 }
497 }
static const double BASEDETA
static const double FCALDETA

◆ 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

◆ finalize()

StatusCode LVL1::L1CaloTTIdTools::finalize ( )
virtual

Definition at line 59 of file L1CaloTTIdTools.cxx.

59 {
60 return StatusCode::SUCCESS;
61 }

◆ findInternalTriggerTower() [1/2]

LVL1::InternalTriggerTower * LVL1::L1CaloTTIdTools::findInternalTriggerTower ( std::map< unsigned int, LVL1::InternalTriggerTower * > * pIntTTContainer,
const Identifier & towerId,
bool bCreate = true )
virtual

Implements LVL1::IL1CaloTTIdTools.

Definition at line 456 of file L1CaloTTIdTools.cxx.

456 {
457 // Create tower key from towerId
458 double tower_eta = this->IDeta(towerId);
459 double tower_phi = this->IDphi(towerId);
460 LVL1::TriggerTowerKey towerKey;
461 unsigned int key = towerKey.ttKey(tower_phi,tower_eta);
462 double tt_phi = towerKey.phi();
463 double tt_eta = towerKey.eta();
464
465 return this->findInternalTriggerTower(pIntTTContainer, tt_phi, tt_eta, key, bCreate);
466 }
virtual double eta() const
returns the centre of the TT at eta_coord:
virtual double phi() const
returns phi coordinate of centre of relevant trigger tower.
double IDphi(const Identifier &id) const
LVL1::InternalTriggerTower * findInternalTriggerTower(std::map< unsigned int, LVL1::InternalTriggerTower * > *pIntTTContainer, const Identifier &towerId, bool bCreate=true)
double IDeta(const Identifier &id) const
virtual unsigned int ttKey(const TriggerTower &tower)
returns the key of the passed tower

◆ findInternalTriggerTower() [2/2]

LVL1::InternalTriggerTower * LVL1::L1CaloTTIdTools::findInternalTriggerTower ( std::map< unsigned int, LVL1::InternalTriggerTower * > * pIntTTContainer,
double tt_phi,
double tt_eta,
unsigned int key,
bool bCreate = true )
virtual

Implements LVL1::IL1CaloTTIdTools.

Definition at line 468 of file L1CaloTTIdTools.cxx.

468 {
469 std::map<unsigned int, LVL1::InternalTriggerTower*>::iterator it = pIntTTContainer->find( key );
470 LVL1::InternalTriggerTower* TT = 0;
471 if (it == pIntTTContainer->end()){
472 if(bCreate) {
473 // no TT yet. Create it!
474 TT = new LVL1::InternalTriggerTower(tt_phi,tt_eta, key);
475 pIntTTContainer->insert(std::map<unsigned int, LVL1::InternalTriggerTower*>::value_type(key,TT)); //and put it in the map.
476 }
477 }else{
478 TT = (it->second);
479 } // end else
480 return TT;
481 }

◆ 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()

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

◆ IDeta()

double LVL1::L1CaloTTIdTools::IDeta ( const Identifier & id) const
virtual

Implements LVL1::IL1CaloTTIdTools.

Definition at line 429 of file L1CaloTTIdTools.cxx.

429 {
430 int region = m_l1ttofflineHelper->region(id);
431 int ieta = m_l1ttofflineHelper->eta(id);
432 int sign = m_l1ttofflineHelper->pos_neg_z(id);
433
434 double gran[4] = {0.1, 0.2, 0.1, 0.425};
435 double offset[4] = {0., 2.5, 3.1, 3.2};
436 double eta;
437
438 if (region>=0 && region<=3) {
439 eta = sign* ( ( (ieta+0.5) * gran[region] ) + offset[region] );
440 }
441 else {
442 eta = 0.;
443 }
444 return eta;
445 }
int sign(int a)

◆ IDphi()

double LVL1::L1CaloTTIdTools::IDphi ( const Identifier & id) const
virtual

Implements LVL1::IL1CaloTTIdTools.

Definition at line 447 of file L1CaloTTIdTools.cxx.

447 {
448 Identifier regId = m_l1ttofflineHelper->region_id(id);
449
450 double phiMax = m_l1ttofflineHelper->phi_max(regId);
451 int iphi = m_l1ttofflineHelper->phi(id);
452 double phi = (iphi+0.5)*2.*M_PI/(phiMax+1.);
453 return phi;
454 }
#define M_PI
int phi(const HWIdentifier &id)

◆ initialize()

StatusCode LVL1::L1CaloTTIdTools::initialize ( void )
virtual

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 29 of file L1CaloTTIdTools.cxx.

29 {
30
31 ATH_MSG_INFO("Initializing LVL1::L1CaloTTIdTools");
32
34
35 const TTOnlineID* l1ttonline_id = nullptr;
36 sc = detStore()->retrieve(l1ttonline_id, "TTOnlineID");
37 if(sc.isFailure()){
38 ATH_MSG_ERROR("Could not get TTOnlineID helper !");
39 return sc;
40 } else {
41 m_l1ttonlineHelper = l1ttonline_id;
42 ATH_MSG_DEBUG(" Found the TTOnlineID helper. ");
43 }
44
45 const CaloLVL1_ID* l1ttoffline_id;
46 sc = detStore()->retrieve(l1ttoffline_id, "CaloLVL1_ID");
47 if(sc.isFailure()) {
48 ATH_MSG_DEBUG("Could not get CaloLVL1_ID helper !");
49 return sc;
50 } else {
51 m_l1ttofflineHelper = l1ttoffline_id;
52 ATH_MSG_DEBUG(" Found the CaloLVL1_ID helper. ");
53 }
54
55 m_bInitialized = true;
56 return sc;
57 }
#define ATH_MSG_ERROR(x)
#define ATH_MSG_INFO(x)
#define ATH_MSG_DEBUG(x)
static Double_t sc
const ServiceHandle< StoreGateSvc > & detStore() const
::StatusCode StatusCode
StatusCode definition for legacy code.

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

◆ layer()

int LVL1::L1CaloTTIdTools::layer ( const HWIdentifier & id)
virtual

Implements LVL1::IL1CaloTTIdTools.

Definition at line 342 of file L1CaloTTIdTools.cxx.

342 {
343 int region = this->region(id);
344 int channel = m_l1ttonlineHelper->channel(id);
345
346 if(region==3 && this->sampling(id)==1 ) {
347 if(channel%4== 0 || channel%4==3) return 0; // FCAL_2
348 else if(channel%4== 2 || channel%4==1) return 1; // FCAL_3
349 else return -1;
350 } else return -1;
351 }

◆ module_type()

int LVL1::L1CaloTTIdTools::module_type ( const HWIdentifier & id)
virtual

Implements LVL1::IL1CaloTTIdTools.

Definition at line 366 of file L1CaloTTIdTools.cxx.

366 {
367 int crate = m_l1ttonlineHelper->crate(id);
368 int module = m_l1ttonlineHelper->module(id);
369
370 if(crate==0) {
371 if(module>=5 && module<=20) return 1; // PPM
372 else return 999;
373
374 } else if(crate==1) {
375 if(module>=5 && module<=20) return 1; // PPM
376 else return 999;
377
378 } else if(crate==2) {
379 if( (module>=6 && module<=20) && module!=13) return 1; // PPM
380 else return 999;
381
382 } else if(crate==3) {
383 if( (module>=6 && module<=20) && module!=13) return 1; // PPM
384 else return 999;
385
386 } else if(crate==4) {
387 if(module>=5 && module<=20) return 1; // PPM
388 else return 999;
389
390 } else if(crate==5) {
391 if(module>=5 && module<=20) return 1; // PPM
392 else return 999;
393
394 } else if(crate==6) {
395 if(module>=5 && module<=20) return 1; // PPM
396 else return 999;
397
398 } else if(crate==7) {
399 if(module>=5 && module<=20) return 1; // PPM
400 else return 999;
401
402 } else if(crate==8) {
403 if(module>=5 && module<=18) return 2; // CPM
404 else return 999;
405
406 } else if(crate==9) {
407 if(module>=5 && module<=18) return 2; // CPM
408 else return 999;
409
410 } else if(crate==10) {
411 if(module>=5 && module<=18) return 2; // CPM
412 else return 999;
413
414 } else if(crate==11) {
415 if(module>=5 && module<=18) return 2; // CPM
416 else return 999;
417
418 } else if(crate==12) {
419 if(module>=4 && module<=19) return 3; // JEM
420 else return 999;
421
422 } else if(crate==13) {
423 if(module>=4 && module<=19) return 3; // JEM
424 else return 999;
425
426 } else return 999;
427 }

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

◆ operator=()

L1CaloTTIdTools & LVL1::L1CaloTTIdTools::operator= ( const L1CaloTTIdTools & rhs)
delete

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

◆ phi()

int LVL1::L1CaloTTIdTools::phi ( const HWIdentifier & id)
virtual

Implements LVL1::IL1CaloTTIdTools.

Definition at line 282 of file L1CaloTTIdTools.cxx.

282 {
283 int region = this->region(id);
284
285 //int crate = m_l1ttonlineHelper->crate(id);
286 int module = m_l1ttonlineHelper->module(id);
287 int submodule = m_l1ttonlineHelper->submodule(id);
288 int channel = m_l1ttonlineHelper->channel(id);
289
290 int ppm_type = PPM_type(id);
291
292 int module_phi_offset = 0;
293 int submodule_phi_offset = 0;
294 int channel_phi_offset = 0;
295
296
297 //-- REGION 0 --//
298 if(region==0) {
299 module_phi_offset = int((module-5)/4)*16;
300 submodule_phi_offset = int(submodule/2)*2;
301 channel_phi_offset = channel%2;
302
303 return module_phi_offset + submodule_phi_offset + channel_phi_offset;
304
305 //-- REGION 1 --//
306 } else if (region==1) {
307 if(ppm_type==7) {
308 module_phi_offset = int((module-5)/4)*8;
309 submodule_phi_offset = int(submodule/2)*1;
310 channel_phi_offset = 0;
311
312 } else if(ppm_type==8) {
313 if(module==9) module_phi_offset = 0;
314 if(module==17) module_phi_offset = 16;
315 submodule_phi_offset = submodule;
316 channel_phi_offset = 0;
317 } else return -1;
318
319 return module_phi_offset + submodule_phi_offset + channel_phi_offset;
320
321 //-- REGION 2 --//
322 } else if (region==2) {
323 if(module==9) module_phi_offset = 0;
324 if(module==17) module_phi_offset = 16;
325 submodule_phi_offset = submodule;
326 channel_phi_offset = 0;
327
328 return module_phi_offset + submodule_phi_offset + channel_phi_offset;
329
330 //-- REGION 3 --//
331 } else if (region==3) {
332 module_phi_offset = 0;
333 submodule_phi_offset = submodule;
334 channel_phi_offset = 0;
335
336 return module_phi_offset + submodule_phi_offset + channel_phi_offset;
337 }
338 return -1;
339 }

◆ phiIndex()

int LVL1::L1CaloTTIdTools::phiIndex ( const double eta,
const double phi ) const
virtual

Implements LVL1::IL1CaloTTIdTools.

Definition at line 539 of file L1CaloTTIdTools.cxx.

539 {
540 double dphi = this->phiWidth(eta);
541 int phicenter = (int) floor(phi/dphi);
542 return phicenter;
543 }
double phiWidth(const double eta) const

◆ phiWidth()

double LVL1::L1CaloTTIdTools::phiWidth ( const double eta) const
virtual

Implements LVL1::IL1CaloTTIdTools.

Definition at line 499 of file L1CaloTTIdTools.cxx.

499 {
500 double abseta = fabs(eta);
501 if(abseta<ETAMAXREGION0) {
502 return BASEDPHI;
503
504 } else if(abseta<ETAMAXREGION1) {
505 return BASEDPHI*2.;
506
507 } else if (abseta<ETAMAXREGION2) {
508 return BASEDPHI*2.;
509
510 } else {
511 return BASEDPHI*4.;
512 }
513 }
static const double BASEDPHI

◆ pos_neg_z()

int LVL1::L1CaloTTIdTools::pos_neg_z ( const double eta) const
virtual

Implements LVL1::IL1CaloTTIdTools.

Definition at line 515 of file L1CaloTTIdTools.cxx.

515 {
516 return (eta>=0) ? +1 : -1;
517 }

◆ PPM_type()

int LVL1::L1CaloTTIdTools::PPM_type ( const HWIdentifier & id)
virtual

Implements LVL1::IL1CaloTTIdTools.

Definition at line 144 of file L1CaloTTIdTools.cxx.

144 {
145 int crate = m_l1ttonlineHelper->crate(id);
146 int module = m_l1ttonlineHelper->module(id);
147 if(crate==0 || crate==6 ) return (module-5)%4+1;
148 if(crate==1 || crate==7 ) return 4-(module-5)%4;
149 if(crate==2 || crate==4 ) {
150 if(module==5 || module==13) return 9;
151 else return (module-6)%4+5;
152 }
153 if(crate==3 || crate==5 ) {
154 if(module==5 || module==13) return 9;
155 else return 8-(module-5)%4;
156 }
157 return -1;
158 }

◆ print()

◆ region()

int LVL1::L1CaloTTIdTools::region ( const HWIdentifier & id)
virtual

Implements LVL1::IL1CaloTTIdTools.

Definition at line 83 of file L1CaloTTIdTools.cxx.

83 {
84 int ppm_type = PPM_type(id);
85
86 if ( ppm_type<=6 ) {
87 return 0;
88 } else if ( ppm_type==7 && this->side(id)==1 ) {
89
90 int submodule = m_l1ttonlineHelper->submodule(id);
91 int normalized_submodule_number = submodule%4;
92
93 // Module 1 & 2 -> region 1
94 if( normalized_submodule_number==1 || normalized_submodule_number ==2) return 1;
95
96 // Module 0 & 3
97 else {
98 int channel = m_l1ttonlineHelper->channel(id);
99 // channel 2 of modules 0&3 ->region 1
100 if( channel==2 ) return 1;
101 // channel 1&2 of modules 1&4 ->region 0
102 else if ( channel==0 || channel ==1 ) return 0;
103 else return -1;
104 }
105 } else if ( ppm_type==7 && this->side(id)==0 ) {
106
107 int submodule = m_l1ttonlineHelper->submodule(id);
108 int normalized_submodule_number = submodule%4;
109
110 // Module 0 & 3 -> region 1
111 if( normalized_submodule_number==0 || normalized_submodule_number ==3) return 1;
112
113 // Module 1 & 2
114 else {
115 int channel = m_l1ttonlineHelper->channel(id);
116 // channel 0 of modules 1&2 ->region 1
117 if( channel==0 ) return 1;
118 // channel 2&3 of modules 1&2 ->region 0
119 else if ( channel==2 || channel ==3 ) return 0;
120 else return -1;
121 }
122 } else if ( ppm_type==8 && this->side(id)==1 ) {
123 int channel = m_l1ttonlineHelper->channel(id);
124 // channel 0 -> region 1
125 if(channel==0) return 1;
126 // channel 3 ->region 2
127 else if(channel==2) return 2;
128 else return -1;
129 } else if ( ppm_type==8 && this->side(id)==0 ) {
130 int channel = m_l1ttonlineHelper->channel(id);
131 // channel 2 -> region 1
132 if(channel==2) return 1;
133 // channel 3 ->region 2
134 else if(channel==0) return 2;
135 else return -1;
136 } else if ( ppm_type==9 ) {
137 return 3;
138 } else return -1;
139 }

◆ regionIndex()

int LVL1::L1CaloTTIdTools::regionIndex ( const double eta) const
virtual

Implements LVL1::IL1CaloTTIdTools.

Definition at line 545 of file L1CaloTTIdTools.cxx.

545 {
546 int region = -1;
547 double abseta = fabs(eta);
548
549 if(abseta<ETAMAXREGION0) {
550 region = 0;
551
552 } else if(abseta<ETAMAXREGION1) {
553 region = 1;
554
555 } else if (abseta<ETAMAXREGION2) {
556 region = 2;
557
558 } else if (abseta<ETAMAXREGION3) {
559 region = 3;
560
561 }
562 return region;
563 }

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

◆ sampling()

int LVL1::L1CaloTTIdTools::sampling ( const HWIdentifier & id)
virtual

Implements LVL1::IL1CaloTTIdTools.

Definition at line 72 of file L1CaloTTIdTools.cxx.

72 {
73 int crate = m_l1ttonlineHelper->crate(id);
74 if(crate==0 || crate==1 || crate==2 || crate==3) return 0; //EM -> 0
75 else if(crate==6 || crate ==7 ) return 1; //HAd -> 1
76 else if (crate==4 || crate ==5) {
77 int module = m_l1ttonlineHelper->module(id);
78 if (module==5) return 0; //EM
79 else return 1; //HAD
80 } else return 999;
81 }

◆ side()

int LVL1::L1CaloTTIdTools::side ( const HWIdentifier & id)
virtual

Declare the interface that the class provides.

Implements LVL1::IL1CaloTTIdTools.

Definition at line 65 of file L1CaloTTIdTools.cxx.

65 {
66 int crate = m_l1ttonlineHelper->crate(id);
67 if(crate==0 || crate==2 || crate==4 || crate==6) return 1;
68 else if(crate==1 || crate==3 || crate==5 || crate==7) return 0;
69 else return 999;
70 }

◆ 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

◆ BASEDETA

const double LVL1::L1CaloTTIdTools::BASEDETA = 0.1
staticprivate

Definition at line 89 of file L1CaloTTIdTools.h.

◆ BASEDPHI

const double LVL1::L1CaloTTIdTools::BASEDPHI = 0.098175
staticprivate

Definition at line 90 of file L1CaloTTIdTools.h.

◆ ETAMAXREGION0

const double LVL1::L1CaloTTIdTools::ETAMAXREGION0 = 2.5
staticprivate

Definition at line 93 of file L1CaloTTIdTools.h.

◆ ETAMAXREGION1

const double LVL1::L1CaloTTIdTools::ETAMAXREGION1 = 3.1
staticprivate

Definition at line 94 of file L1CaloTTIdTools.h.

◆ ETAMAXREGION2

const double LVL1::L1CaloTTIdTools::ETAMAXREGION2 = 3.2
staticprivate

Definition at line 95 of file L1CaloTTIdTools.h.

◆ ETAMAXREGION3

const double LVL1::L1CaloTTIdTools::ETAMAXREGION3 = 4.9
staticprivate

Definition at line 96 of file L1CaloTTIdTools.h.

◆ ETAMIN

const double LVL1::L1CaloTTIdTools::ETAMIN = -4.9
staticprivate

Definition at line 98 of file L1CaloTTIdTools.h.

◆ FCALDETA

const double LVL1::L1CaloTTIdTools::FCALDETA = 0.425
staticprivate

Definition at line 91 of file L1CaloTTIdTools.h.

◆ m_bInitialized

bool LVL1::L1CaloTTIdTools::m_bInitialized
private

Definition at line 86 of file L1CaloTTIdTools.h.

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

const CaloLVL1_ID* LVL1::L1CaloTTIdTools::m_l1ttofflineHelper
private

Definition at line 84 of file L1CaloTTIdTools.h.

◆ m_l1ttonlineHelper

const TTOnlineID* LVL1::L1CaloTTIdTools::m_l1ttonlineHelper
private

Definition at line 83 of file L1CaloTTIdTools.h.

◆ m_varHandleArraysDeclared

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

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.

◆ PHIMIN

const double LVL1::L1CaloTTIdTools::PHIMIN = 0.
staticprivate

Definition at line 99 of file L1CaloTTIdTools.h.


The documentation for this class was generated from the following files: