ATLAS Offline Software
TileCellContainerCnv.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef TileCellContainerCnv_H
6 #define TileCellContainerCnv_H
7 
11 
12 class TileTBID;
15 
17 
19 {
20 
21  friend class CnvFactory<TileCellContainerCnv >;
22 public:
23  TileCellContainerCnv(ISvcLocator* svcloc);
24 
25  virtual ~TileCellContainerCnv();
26 
28  virtual StatusCode initialize() override;
29 
30  virtual TileCellVec* createPersistent(TileCellContainer* cont) override;
31  virtual TileCellContainer* createTransient() override;
32 
33 private:
35 
36  const TileTBID* m_tileTBID{nullptr};
37  const MbtsDetDescrManager* m_mbtsMgr{nullptr};
38 
39  int m_version{0};
40 
41  static const int NSIDE = 2;
42  static const int NPHI = 8;
43  static const int NETA = 2;
44  static const int NCELLMBTS = NSIDE*NPHI*NETA;
45 
46  inline int cell_index(int side, int phi, int eta) const { return (side*NPHI+phi)*NETA+eta; }
47  void initIdToIndex();
48 
51  int m_gainIndex[17]{};
52  int m_gain[8]{};
53 
54  inline int round32(double x) {
55  if (x<-2147483647.) return -0x7FFFFFFF;
56  else if (x>2147483647.) return 0x7FFFFFFF;
57  else return (int)lround(x);
58  }
59 
60  inline int round16(double x) {
61  if (x<-32767.) return -0x7FFF;
62  else if (x>32767.) return 0x7FFF;
63  else return (int)lround(x);
64  }
65 };
66 
67 #endif
TileCellContainerCnv::m_gainIndex
int m_gainIndex[17]
Definition: TileCellContainerCnv.h:51
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:67
TileCellContainerCnv::NPHI
static const int NPHI
Definition: TileCellContainerCnv.h:42
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
TileCellContainerCnv::round16
int round16(double x)
Definition: TileCellContainerCnv.h:60
TileCellContainerCnv::m_gain
int m_gain[8]
Definition: TileCellContainerCnv.h:52
TileCellContainerCnv::initialize
virtual StatusCode initialize() override
initialization
Definition: TileCellContainerCnv.cxx:22
CaloDetDescrElement
This class groups all DetDescr information related to a CaloCell. Provides a generic interface for al...
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:66
TileCellContainerCnv::NETA
static const int NETA
Definition: TileCellContainerCnv.h:43
x
#define x
TileCellContainerCnv::TileCellContainerCnv
TileCellContainerCnv(ISvcLocator *svcloc)
Definition: TileCellContainerCnv.cxx:12
TileCellContainerCnv::m_version
int m_version
Definition: TileCellContainerCnv.h:39
TileCellContainerCnv::m_storeGate
ServiceHandle< StoreGateSvc > m_storeGate
Definition: TileCellContainerCnv.h:34
TileCellContainerCnv::m_tileTBID
const TileTBID * m_tileTBID
Definition: TileCellContainerCnv.h:36
MbtsDetDescrManager
Definition: MbtsDetDescrManager.h:16
TRT::Hit::side
@ side
Definition: HitInfo.h:83
TileCellContainerCnv::m_id
Identifier m_id[NCELLMBTS]
Definition: TileCellContainerCnv.h:49
TileCellContainerCnv::NSIDE
static const int NSIDE
Definition: TileCellContainerCnv.h:41
TileCellContainerCnv::m_mbtsMgr
const MbtsDetDescrManager * m_mbtsMgr
Definition: TileCellContainerCnv.h:37
TileCellContainerCnv::createPersistent
virtual TileCellVec * createPersistent(TileCellContainer *cont) override
Definition: TileCellContainerCnv.cxx:94
TileCellContainerCnv::createTransient
virtual TileCellContainer * createTransient() override
Definition: TileCellContainerCnv.cxx:251
TileCellContainerCnv
Definition: TileCellContainerCnv.h:19
T_AthenaPoolCustomCnv
Compatibility for old converter classes that don't get passed the key.
Definition: T_AthenaPoolCustomCnv.h:132
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
TileCellContainerCnv::cell_index
int cell_index(int side, int phi, int eta) const
Definition: TileCellContainerCnv.h:46
TileCellVec
Definition: TileContainer.h:73
T_AthenaPoolCustomCnv.h
his file contains the class definition for the templated T_AthenaPoolCustomCnv class.
CnvFactory
Abstract factory to create the converter.
Definition: ToyConverter.h:16
TileCellContainerCnv::round32
int round32(double x)
Definition: TileCellContainerCnv.h:54
TileCellContainerCnv::m_dde
CaloDetDescrElement * m_dde[NCELLMBTS]
Definition: TileCellContainerCnv.h:50
TileCellContainerCnv::~TileCellContainerCnv
virtual ~TileCellContainerCnv()
Definition: TileCellContainerCnv.cxx:18
TileCellContainerCnvBase
T_AthenaPoolCustomCnv< TileCellContainer, TileCellVec > TileCellContainerCnvBase
Definition: TileCellContainerCnv.h:14
TileTBID
Helper class for TileCal offline identifiers of ancillary testbeam detectors and MBTS.
Definition: Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h:65
TileCellContainerCnv::NCELLMBTS
static const int NCELLMBTS
Definition: TileCellContainerCnv.h:44
TileContainer
Definition: TileContainer.h:38
StoreGateSvc.h
TileCellContainerCnv::initIdToIndex
void initIdToIndex()
Definition: TileCellContainerCnv.cxx:83
TileCellContainer.h
ServiceHandle< StoreGateSvc >
Identifier
Definition: IdentifierFieldParser.cxx:14