ATLAS Offline Software
LArCellContFakeCreator.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef ATHENAPOOLTEST_LARCELLCONTFAKECREATOR_H
6 #define ATHENAPOOLTEST_LARCELLCONTFAKECREATOR_H
7 
28 //<<<<<< INCLUDES >>>>>>
29 
30 #include "GaudiKernel/MsgStream.h"
32 #include "LArRecEvent/LArCell.h"
33 
34 //<<<<<< CLASS DECLARATIONS >>>>>>
35 
37 {
38 public:
39 
42 
45  const CaloDetDescrManager* caloMgr,
46  MsgStream& log) const;
47 
48 
49 };
50 
51 
52 //<<<<<< INLINE PUBLIC FUNCTIONS >>>>>>
53 //<<<<<< INLINE MEMBER FUNCTIONS >>>>>>
54 
56 {
57 }
58 
59 
60 inline CaloCellContainer*
62  const CaloDetDescrManager* caloMgr,
63  MsgStream& log) const
64 {
65 
66 
67  // Create container
68  CaloCellContainer* caloCont = new CaloCellContainer();
69 
70 
71  log << MSG::DEBUG << "Created CaloCellContainer" << endmsg;
72 
73  // add 10 cells to container
74  for (int eta = 1; eta < 5; ++eta) {
75  for (int phi = 3; phi < 5; ++phi) {
76 
77  Identifier id = calocellId->cell_id (0, 1, 1, 0, eta, phi);
78  IdentifierHash idHash = calocellId->calo_cell_hash (id);
79  const CaloDetDescrElement* elem = caloMgr->get_element (idHash);
80 
81  //log << MSG::DEBUG << "Found elem" << elem << endmsg;
82 
83  double energy = 5.0*eta;
84  double time = 0.0;
85  uint16_t quality = 0;
86  uint16_t prov = 0;
87  // time and quality/prov use the same bits - only write one out
88  if (4 == phi) {
89  time = 10.0*phi;
90  quality = 2*eta;
91  prov = 2*phi | 0x2000;
92  }
94 
95  LArCell* cell = new LArCell(elem, energy, time, quality, prov, gain);
96  caloCont->push_back(cell);
97 
98  //log << MSG::DEBUG << "Created CaloCellContainer" << endmsg;
99 
100  }
101  }
102 
103  return (caloCont);
104 }
105 
106 #endif // SRC_LARCELLCONTFAKECREATOR_H
107 
108 
109 
CaloCell_Base_ID::calo_cell_hash
IdentifierHash calo_cell_hash(const Identifier cellId) const
create hash id from 'global' cell id
ReadCellNoiseFromCool.cell
cell
Definition: ReadCellNoiseFromCool.py:53
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:67
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
CaloDetDescrElement
This class groups all DetDescr information related to a CaloCell. Provides a generic interface for al...
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:66
CaloCondBlobAlgs_fillNoiseFromASCII.gain
gain
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:110
CaloDetDescrManager_Base::get_element
const CaloDetDescrElement * get_element(const Identifier &cellId) const
get element by its identifier
Definition: CaloDetDescrManager.cxx:159
RunTileCalibRec.CaloCellContainer
CaloCellContainer
Definition: RunTileCalibRec.py:403
LArCellContFakeCreator::createCaloCellContainer
CaloCellContainer * createCaloCellContainer(const CaloCell_ID *calocellId, const CaloDetDescrManager *caloMgr, MsgStream &log) const
Create a CaloCellContainer with LAr cells.
Definition: LArCellContFakeCreator.h:61
ParticleGun_FastCalo_ChargeFlip_Config.energy
energy
Definition: ParticleGun_FastCalo_ChargeFlip_Config.py:78
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:93
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
CaloCell_ID
Helper class for offline cell identifiers.
Definition: CaloCell_ID.h:34
LArCellContFakeCreator
Create a CaloCellContainer with LArCells for POOL I/O tests algs.
Definition: LArCellContFakeCreator.h:37
LArCell.h
LArCell
Data object for LAr calorimeter readout cell.
Definition: LArCell.h:53
CaloGain::LARHIGHGAIN
@ LARHIGHGAIN
Definition: CaloGain.h:18
CaloCellContainer.h
CaloCellContainer
Container class for CaloCell.
Definition: CaloCellContainer.h:55
CaloCell_Base_ID::cell_id
Identifier cell_id(const int subCalo, const int barec_or_posneg, const int sampling_or_fcalmodule, const int region_or_dummy, const int eta, const int phi) const
Make a cell (== channel) ID from constituting fields and subCalo index; for (Mini)FCAL,...
CaloGain::CaloGain
CaloGain
Definition: CaloGain.h:11
CaloDetDescrManager
This class provides the client interface for accessing the detector description information common to...
Definition: CaloDetDescrManager.h:473
CaloSwCorrections.time
def time(flags, cells_name, *args, **kw)
Definition: CaloSwCorrections.py:242
CaloCellContainer::push_back
void push_back(CaloCell *)
reimplementation of const push_back
Definition: CaloCellContainer.cxx:74
LArCellContFakeCreator::LArCellContFakeCreator
LArCellContFakeCreator()
Default constructor.
Definition: LArCellContFakeCreator.h:55
DEBUG
#define DEBUG
Definition: page_access.h:11
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
IdentifierHash
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
Definition: IdentifierHash.h:25
Identifier
Definition: IdentifierFieldParser.cxx:14