|
ATLAS Offline Software
|
Go to the documentation of this file.
9 #include "GaudiKernel/StatusCode.h"
14 m_storeGate(
"StoreGateSvc",
"TileCellContainerCnv")
56 ATH_MSG_WARNING(
"Unable to retrieve MbtsDetDescrManager from DetectorStore");
80 return StatusCode::SUCCESS;
99 auto vecCell = std::make_unique<TileCellVec>();
107 std::vector<const TileCell *> allCells;
114 <<
" time=" <<
cell->time()
115 <<
" qual=" << (
int)
cell->qual1()
116 <<
" gain=" << (
int)
cell->gain());
117 unsigned int id =
cell->ID().get_identifier32().get_compact();
119 unsigned int tim = 0x8000 +
round16(
cell->time()*100.);
122 unsigned int tqg = (tim<<16) | (qua<<8) | gai;
123 vecCell->push_back(
id);
124 vecCell->push_back((
unsigned int)ene);
125 vecCell->push_back(tqg);
127 " " << ene <<
" " << tqg << MSG::dec);
146 allCells.push_back(
cell);
149 allCells.push_back(
cell);
166 quality=
cell->qual1();
170 " ene=" <<
cell->energy() <<
171 " time=" <<
cell->time() <<
172 " qual=" << (
int)
cell->qual1() <<
173 " gain=" << (
int)
cell->gain());
184 unsigned int ene =
energy+0x10000;
187 unsigned int gqe = (gai << 28) | (qua<<20) | ene;
188 vecCell->push_back(gqe);
191 MSG::hex << gqe << MSG::dec);
200 unsigned int tqg = (tim<<16) | (qua<<8) | gai;
201 vecCell->push_back(ene);
202 vecCell->push_back(tqg);
205 MSG::hex << ene <<
" " << tqg << MSG::dec);
220 " ene=" <<
cell->energy() <<
221 " time=" <<
cell->time() <<
222 " qual=" << (
int)
cell->qual1() <<
223 " gain=" << (
int)
cell->gain());
225 unsigned int id =
cell->ID().get_identifier32().get_compact();
227 unsigned int tim = 0x8000 +
round16(
cell->time()*100.);
230 unsigned int tqg = (tim<<16) | (qua<<8) | gai;
231 vecCell->push_back(
id);
232 vecCell->push_back((
unsigned int)ene);
233 vecCell->push_back(tqg);
236 MSG::hex <<
id <<
" " << ene <<
" " << tqg << MSG::dec);
246 ATH_MSG_DEBUG(
"Storing data vector of size " << vecCell->size() <<
" with version " << vecCell->front());
248 return vecCell.release();
255 std::unique_ptr<TileCellVec>
vec(this->poolReadObject<TileCellVec>());
260 auto cont = std::make_unique<TileCellContainer>();
262 TileCellVec::const_iterator
it =
vec->begin();
263 TileCellVec::const_iterator last =
vec->end();
271 for (;
it != last; ) {
274 int ene = (
int)(*
it++);
275 unsigned int tqg = *
it++;
277 float ener = ene*1
e-3;
278 float time = ((
int)(tqg>>16) - 0x8000 ) * 0.01;
281 int gain = (
int)(tqg & 0xFF) - 0x80;
284 MSG::hex <<
id << MSG::dec <<
" " << ene <<
" " <<
285 MSG::hex << tqg << MSG::dec);
288 " qual=" <<
qual <<
" gain=" <<
gain);
291 cont->push_back(
cell);
297 for (;
it != last; ) {
315 int ene = (
int)(*
it++);
318 msg() << MSG::hex <<
id <<
" " << ene <<
" " << MSG::dec;
326 ener = ((ene & 0xFFFFF) - 0x10000) * 1
e-3;
327 qual = ((ene>>20) & 0xFF);
332 unsigned int tqg = *
it++;
335 ener = (ene - 0x40000000) * 1
e-3;
336 time = ((
int)(tqg>>16) - 0x8000 ) * 0.01;
337 qual = ((tqg>>8) & 0xFF);
338 gain = (
int)(tqg & 0xFF) - 0x80;
344 int ene = (
int)(*
it++);
345 unsigned int tqg = *
it++;
348 " " << MSG::hex << tqg << MSG::dec);
351 time = ((
int)(tqg>>16) - 0x8000 ) * 0.01;
352 qual = ((tqg>>8) & 0xFF);
353 gain = (
int)(tqg & 0xFF) - 0x80;
357 <<
" qual=" <<
qual <<
" gain=" <<
gain);
361 cont->push_back(
cell);
375 return cont.release();
Identifier channel_id(int type, int module, int channel) const
identifer for one channel of a Tile testbeam detector
Scalar phi() const
phi method
bool is_tiletb(const Identifier &id) const
Test ID if it is TileTBID.
Scalar eta() const
pseudorapidity method
virtual StatusCode initialize() override
initialization
This class groups all DetDescr information related to a CaloCell. Provides a generic interface for al...
std::vector< size_t > vec
#define ATH_MSG_VERBOSE(x)
int type(const Identifier &id) const
extract type field from TileTB identifier
TileCellContainerCnv(ISvcLocator *svcloc)
ServiceHandle< StoreGateSvc > m_storeGate
virtual StatusCode initialize() override
Gaudi Service Interface method implementations:
int module(const Identifier &id) const
extract module field from TileTB identifier
const TileTBID * m_tileTBID
Identifier m_id[NCELLMBTS]
const MbtsDetDescrManager * m_mbtsMgr
typename vecDetail::vec_typedef< T, N >::type vec
Define a nice alias for the vectorized type.
virtual TileCellVec * createPersistent(TileCellContainer *cont) override
bool msgLvl(const MSG::Level lvl) const
Test the output level.
virtual TileCellContainer * createTransient() override
Compatibility for old converter classes that don't get passed the key.
::StatusCode StatusCode
StatusCode definition for legacy code.
int cell_index(int side, int phi, int eta) const
CaloDetDescrElement * get_element(const Identifier &elementId) const
const ServiceHandle< StoreGateSvc > & detStore() const
Handle to DetectorStore.
MsgStream & msg() const
The standard message stream.
int channel(const Identifier &id) const
extract channel field from TileTB identifier
CaloDetDescrElement * m_dde[NCELLMBTS]
virtual ~TileCellContainerCnv()
def time(flags, cells_name, *args, **kw)
#define ATH_MSG_WARNING(x)
static const int NCELLMBTS