![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
ATLAS Offline Software
|
Go to the documentation of this file.
9 #include "GaudiKernel/StatusCode.h"
10 #include "GaudiKernel/MsgStream.h"
11 #include "GaudiKernel/IChronoStatSvc.h"
41 return StatusCode::FAILURE;
48 MsgStream
log(
msgSvc(),
"TileCellContainerCnv");
49 log << MSG::INFO <<
"TileCellContainerCnv::initialize(), packing format version " <<
m_version <<
endmsg;
55 log << MSG::ERROR <<
"StoreGate service not found !" <<
endmsg;
64 log << MSG::ERROR <<
"DetectorStore service not found!" <<
endmsg;
72 log << MSG::ERROR <<
"No TileTBID helper" <<
endmsg;
87 log << MSG::WARNING <<
"Unable to retrieve MbtsDetDescrManager from DetectorStore" <<
endmsg;
111 return StatusCode::SUCCESS;
129 MsgStream
log(
msgSvc(),
"TileCellContainerCnv" );
135 auto vecCell = std::make_unique<TileCellVec>();
143 std::vector<const TileCell *> allCells;
151 <<
"ene=" <<
cell->energy()
152 <<
" time=" <<
cell->time()
153 <<
" qual=" << (
int)
cell->qual1()
154 <<
" gain=" << (
int)
cell->gain()
156 unsigned int id =
cell->ID().get_identifier32().get_compact();
158 unsigned int tim = 0x8000 +
round16(
cell->time()*100.);
161 unsigned int tqg = (tim<<16) | (qua<<8) | gai;
162 vecCell->push_back(
id);
163 vecCell->push_back((
unsigned int)ene);
164 vecCell->push_back(tqg);
167 << MSG::hex <<
id <<
" " << ene <<
" " << tqg << MSG::dec <<
endmsg;
186 allCells.push_back(
cell);
189 allCells.push_back(
cell);
206 quality=
cell->qual1();
212 <<
" ene=" <<
cell->energy()
213 <<
" time=" <<
cell->time()
214 <<
" qual=" << (
int)
cell->qual1()
215 <<
" gain=" << (
int)
cell->gain()
222 <<
" create MBTS cell with zero energy"
231 unsigned int ene =
energy+0x10000;
234 unsigned int gqe = (gai << 28) | (qua<<20) | ene;
235 vecCell->push_back(gqe);
239 << MSG::hex << gqe << MSG::dec <<
endmsg;
248 unsigned int tqg = (tim<<16) | (qua<<8) | gai;
249 vecCell->push_back(ene);
250 vecCell->push_back(tqg);
254 << MSG::hex << ene <<
" " << tqg << MSG::dec <<
endmsg;
271 <<
" ene=" <<
cell->energy()
272 <<
" time=" <<
cell->time()
273 <<
" qual=" << (
int)
cell->qual1()
274 <<
" gain=" << (
int)
cell->gain()
277 unsigned int id =
cell->ID().get_identifier32().get_compact();
279 unsigned int tim = 0x8000 +
round16(
cell->time()*100.);
282 unsigned int tqg = (tim<<16) | (qua<<8) | gai;
283 vecCell->push_back(
id);
284 vecCell->push_back((
unsigned int)ene);
285 vecCell->push_back(tqg);
289 << MSG::hex <<
id <<
" " << ene <<
" " << tqg << MSG::dec <<
endmsg;
299 if (lDebug)
log <<
MSG::DEBUG <<
"Storing data vector of size " << vecCell->size() <<
" with version " << vecCell->front() <<
endmsg;
301 return vecCell.release();
308 MsgStream
log(
msgSvc(),
"TileCellContainerCnv");
313 std::unique_ptr<TileCellVec>
vec(this->poolReadObject<TileCellVec>());
318 auto cont = std::make_unique<TileCellContainer>();
320 TileCellVec::const_iterator
it =
vec->begin();
321 TileCellVec::const_iterator last =
vec->end();
329 for (;
it != last; ) {
332 int ene = (
int)(*
it++);
333 unsigned int tqg = *
it++;
335 float ener = ene*1
e-3;
336 float time = ((
int)(tqg>>16) - 0x8000 ) * 0.01;
339 int gain = (
int)(tqg & 0xFF) - 0x80;
343 << MSG::hex <<
id << MSG::dec <<
" " << ene <<
" "
344 << MSG::hex << tqg << MSG::dec <<
endmsg;
350 cont->push_back(
cell);
356 for (;
it != last; ) {
374 int ene = (
int)(*
it++);
377 log << MSG::hex <<
id <<
" " << ene <<
" " << MSG::dec;
385 ener = ((ene & 0xFFFFF) - 0x10000) * 1
e-3;
386 qual = ((ene>>20) & 0xFF);
391 unsigned int tqg = *
it++;
393 log << MSG::hex << tqg << MSG::dec <<
endmsg;
395 ener = (ene - 0x40000000) * 1
e-3;
396 time = ((
int)(tqg>>16) - 0x8000 ) * 0.01;
397 qual = ((tqg>>8) & 0xFF);
398 gain = (
int)(tqg & 0xFF) - 0x80;
404 int ene = (
int)(*
it++);
405 unsigned int tqg = *
it++;
408 log << MSG::hex <<
id << MSG::dec <<
" " << ene <<
" "
409 << MSG::hex << tqg << MSG::dec <<
endmsg;
412 time = ((
int)(tqg>>16) - 0x8000 ) * 0.01;
413 qual = ((tqg>>8) & 0xFF);
414 gain = (
int)(tqg & 0xFF) - 0x80;
423 cont->push_back(
cell);
435 log << MSG::ERROR <<
"Unknown version of TileCellVec, ver="<<
version <<
endmsg;
438 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
StoreGateSvc * m_storeGate
This class groups all DetDescr information related to a CaloCell. Provides a generic interface for al...
logLevel
If HLT PSK is set on command line read it from DB instead of COOL (ATR-25974)
std::vector< size_t > vec
int type(const Identifier &id) const
extract type field from TileTB identifier
TileCellContainerCnv(ISvcLocator *svcloc)
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.
The Athena Transient Store API.
virtual TileCellVec * createPersistent(TileCellContainer *cont) override
virtual TileCellContainer * createTransient() override
msgSvc
Provide convenience handles for various services.
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
int channel(const Identifier &id) const
extract channel field from TileTB identifier
virtual SG::DataProxy * proxy(const void *const pTransient) const override final
get proxy for a given data object address in memory
virtual const name_type & name() const override final
Retrieve data object key == string.
CaloDetDescrElement * m_dde[NCELLMBTS]
virtual ~TileCellContainerCnv()
def time(flags, cells_name, *args, **kw)
static const int NCELLMBTS