diff --git a/TileCalorimeter/TileSvc/TileEventAthenaPool/src/TileBeamElemContainerCnv.cxx b/TileCalorimeter/TileSvc/TileEventAthenaPool/src/TileBeamElemContainerCnv.cxx index 5c58a8edf61c44cd1d71e79a9862efb4a1bfa86d..efab938611f6b9e8c09d7406f67c2877e0ca28df 100755 --- a/TileCalorimeter/TileSvc/TileEventAthenaPool/src/TileBeamElemContainerCnv.cxx +++ b/TileCalorimeter/TileSvc/TileEventAthenaPool/src/TileBeamElemContainerCnv.cxx @@ -8,14 +8,14 @@ #include "GaudiKernel/MsgStream.h" TileBeamElemContainer_PERS* TileBeamElemContainerCnv::createPersistent(TileBeamElemContainer* transCont) { - MsgStream mlog(messageService(), "TileBeamElemContainerConverter" ); + MsgStream mlog(msgSvc(), "TileBeamElemContainerConverter" ); TileBeamElemContainerCnv_p1 converter; TileBeamElemContainer_PERS *persObj = converter.createPersistent( transCont, mlog ); return persObj; } TileBeamElemContainer* TileBeamElemContainerCnv::createTransient() { - MsgStream mlog(messageService(), "TileBeamElemContainerConverter" ); + MsgStream mlog(msgSvc(), "TileBeamElemContainerConverter" ); TileBeamElemContainerCnv_p1 converter_p1; TileBeamElemContainer *trans_cont(0); @@ -32,7 +32,7 @@ TileBeamElemContainer* TileBeamElemContainerCnv::createTransient() { TileBeamElemCollectionVec* rdoV = this->poolReadObject<TileBeamElemCollectionVec>(); if (mlog.level()<=MSG::DEBUG) - mlog << MSG::DEBUG << "Read IDC, size " << rdoV->size() << endreq; + mlog << MSG::DEBUG << "Read IDC, size " << rdoV->size() << endmsg; // TileFragHash::TYPE type = rdoV->m_type; @@ -51,7 +51,7 @@ TileBeamElemContainer* TileBeamElemContainerCnv::createTransient() { TileBeamElemCollection::ID id_coll = rdoColl->identify(); StatusCode sc = trans_cont->addCollection(rdoColl,trans_cont->hashFunc()(id_coll)); if(sc.isFailure()) { - mlog << MSG::ERROR << "Can't add collection " << id_coll << " to container " << endreq; + mlog << MSG::ERROR << "Can't add collection " << id_coll << " to container " << endmsg; } } delete rdoV; diff --git a/TileCalorimeter/TileSvc/TileEventAthenaPool/src/TileCellContainerCnv.cxx b/TileCalorimeter/TileSvc/TileEventAthenaPool/src/TileCellContainerCnv.cxx index 57ae8d19cdc987509bb7778a08d2ef249da2439c..b6758800abb33c06aaa0b670bbe11e74f1fd4868 100755 --- a/TileCalorimeter/TileSvc/TileEventAthenaPool/src/TileCellContainerCnv.cxx +++ b/TileCalorimeter/TileSvc/TileEventAthenaPool/src/TileCellContainerCnv.cxx @@ -15,6 +15,8 @@ // Athena #include "StoreGate/StoreGateSvc.h" +// false positive +// cppcheck-suppress uninitMemberVar TileCellContainerCnv::TileCellContainerCnv(ISvcLocator* svcloc) : TileCellContainerCnvBase::T_AthenaPoolCustCnv(svcloc) // Must create DataVector that does NOT own elements @@ -46,15 +48,15 @@ StatusCode TileCellContainerCnv::initialize() m_version = 2; // Get the messaging service, print where you are - MsgStream log(messageService(), "TileCellContainerCnv"); - log << MSG::INFO << "TileCellContainerCnv::initialize(), packing format version " << m_version << endreq; + MsgStream log(msgSvc(), "TileCellContainerCnv"); + log << MSG::INFO << "TileCellContainerCnv::initialize(), packing format version " << m_version << endmsg; // get StoreGate service StatusCode sc=service("StoreGateSvc",m_storeGate); if (sc.isFailure()) { this->initIdToIndex(); - log << MSG::ERROR << "StoreGate service not found !" << endreq; - // log << MSG::FATAL << "StoreGate service not found !" << endreq; + log << MSG::ERROR << "StoreGate service not found !" << endmsg; + // log << MSG::FATAL << "StoreGate service not found !" << endmsg; // return StatusCode::FAILURE; } @@ -62,16 +64,16 @@ StatusCode TileCellContainerCnv::initialize() sc=service("DetectorStore",detStore); if (sc.isFailure()) { this->initIdToIndex(); - log << MSG::ERROR << "DetectorStore service not found!" << endreq; - // log << MSG::FATAL << "DetectorStore service not found!" << endreq; + log << MSG::ERROR << "DetectorStore service not found!" << endmsg; + // log << MSG::FATAL << "DetectorStore service not found!" << endmsg; // return StatusCode::FAILURE; } sc = detStore->retrieve(m_tileTBID); if (sc.isFailure()) { this->initIdToIndex(); - log << MSG::ERROR << "No TileTBID helper" << endreq; - // log << MSG::FATAL << "No TileTBID helper" << endreq; + log << MSG::ERROR << "No TileTBID helper" << endmsg; + // log << MSG::FATAL << "No TileTBID helper" << endmsg; // return StatusCode::FAILURE; } else { for (int side=0; side<NSIDE; ++side) { @@ -85,7 +87,7 @@ StatusCode TileCellContainerCnv::initialize() sc = detStore->retrieve(m_mbtsMgr); if (sc.isFailure()) { - log << MSG::WARNING << "Unable to retrieve MbtsDetDescrManager from DetectorStore" << endreq; + log << MSG::WARNING << "Unable to retrieve MbtsDetDescrManager from DetectorStore" << endmsg; memset(m_dde,0,sizeof(m_dde)); } else { for (int side=0; side<NSIDE; ++side) { @@ -99,7 +101,8 @@ StatusCode TileCellContainerCnv::initialize() // set CaloGain <-> gain index mapping for all possible TileCal gains - for (int i=0; i<17; ++i) m_gainIndex[i] = 8; m_gain[0] = -2; // put non-existing gain here + for (int i=0; i<17; ++i) m_gainIndex[i] = 8; + m_gain[0] = -2; // put non-existing gain here m_gainIndex[-CaloGain::TILELOWLOW] = 8 + 1; m_gain[1] = (int)CaloGain::TILELOWLOW; m_gainIndex[-CaloGain::TILELOWHIGH] = 8 + 2; m_gain[2] = (int)CaloGain::TILELOWHIGH; m_gainIndex[-CaloGain::TILEHIGHLOW] = 8 + 3; m_gain[3] = (int)CaloGain::TILEHIGHLOW; @@ -126,7 +129,7 @@ StatusCode TileCellContainerCnv::transToPers(TileCellContainer* cont, TileCellVe { // Convert every TileCell to 3 32-bit integers: ID,Ene, and (time,qual,qain) - MsgStream log(messageService(),"TileCellContainerCnv" ); + MsgStream log(msgSvc(),"TileCellContainerCnv" ); MSG::Level logLevel = log.level(); bool lDebug = (logLevel<=MSG::DEBUG); bool lVerbose = (logLevel<=MSG::VERBOSE); @@ -137,7 +140,7 @@ StatusCode TileCellContainerCnv::transToPers(TileCellContainer* cont, TileCellVe } TileCellVec & vecCell = m_vecCellAll[name]; - if (lDebug) log << MSG::DEBUG << "storing TileCells from " << name << " in POOL" << endreq; + if (lDebug) log << MSG::DEBUG << "storing TileCells from " << name << " in POOL" << endmsg; // Clear vector from previous write vecCell.clear(); @@ -158,7 +161,7 @@ StatusCode TileCellContainerCnv::transToPers(TileCellContainer* cont, TileCellVe << " time=" << cell->time() << " qual=" << (int)cell->qual1() << " gain=" << (int)cell->gain() - << endreq; + << endmsg; unsigned int id = cell->ID().get_identifier32().get_compact(); int ene = round32(cell->energy() * 1000.); unsigned int tim = 0x8000 + round16(cell->time()*100.); @@ -170,7 +173,7 @@ StatusCode TileCellContainerCnv::transToPers(TileCellContainer* cont, TileCellVe vecCell.push_back(tqg); if (lVerbose) log << MSG::VERBOSE << "packing cell in three words " - << MSG::hex << id << " " << ene << " " << tqg << MSG::dec << endreq; + << MSG::hex << id << " " << ene << " " << tqg << MSG::dec << endmsg; } break; @@ -220,14 +223,14 @@ StatusCode TileCellContainerCnv::transToPers(TileCellContainer* cont, TileCellVe << " time=" << cell->time() << " qual=" << (int)cell->qual1() << " gain=" << (int)cell->gain() - << endreq; + << endmsg; } else { if (lVerbose) log << MSG::VERBOSE << "ind=" << ind << " create MBTS cell with zero energy" - << endreq; + << endmsg; } // put correct MBTS cells in one word @@ -243,7 +246,7 @@ StatusCode TileCellContainerCnv::transToPers(TileCellContainer* cont, TileCellVe if (lVerbose) log << MSG::VERBOSE << "packing cell " << ind << " in one word " - << MSG::hex << gqe << MSG::dec << endreq; + << MSG::hex << gqe << MSG::dec << endmsg; } else { // cells with time, use 2 words for channel // but make sure that upper most bit in energy word is zero @@ -258,7 +261,7 @@ StatusCode TileCellContainerCnv::transToPers(TileCellContainer* cont, TileCellVe if (lVerbose) log << MSG::VERBOSE << "packing cell " << ind << " in two words " - << MSG::hex << ene << " " << tqg << MSG::dec << endreq; + << MSG::hex << ene << " " << tqg << MSG::dec << endmsg; } } @@ -279,7 +282,7 @@ StatusCode TileCellContainerCnv::transToPers(TileCellContainer* cont, TileCellVe << " time=" << cell->time() << " qual=" << (int)cell->qual1() << " gain=" << (int)cell->gain() - << endreq; + << endmsg; unsigned int id = cell->ID().get_identifier32().get_compact(); int ene = round32(cell->energy() * 1000.); @@ -293,17 +296,17 @@ StatusCode TileCellContainerCnv::transToPers(TileCellContainer* cont, TileCellVe if (lVerbose) log << MSG::VERBOSE << "packing cell " << ind << " in three words " - << MSG::hex << id << " " << ene << " " << tqg << MSG::dec << endreq; + << MSG::hex << id << " " << ene << " " << tqg << MSG::dec << endmsg; } break; default: - log << MSG::ERROR << "Unknown version of TileCellVec, ver="<<m_version << endreq; + log << MSG::ERROR << "Unknown version of TileCellVec, ver="<<m_version << endmsg; return StatusCode::FAILURE; } - if (lDebug) log << MSG::DEBUG << "Storing data vector of size " << m_vecCellAll[name].size() << " with version " << m_vecCellAll[name][0] << endreq; + if (lDebug) log << MSG::DEBUG << "Storing data vector of size " << m_vecCellAll[name].size() << " with version " << m_vecCellAll[name][0] << endmsg; persObj = &vecCell; return StatusCode::SUCCESS; @@ -313,12 +316,12 @@ StatusCode TileCellContainerCnv::persToTrans(TileCellContainer*& cont, TileCellV { // Fill TileCellContainer from vector, creating cells from 3 integers - MsgStream log(messageService(), "TileCellContainerCnv"); + MsgStream log(msgSvc(), "TileCellContainerCnv"); MSG::Level logLevel = log.level(); bool lDebug = (logLevel<=MSG::DEBUG); bool lVerbose = (logLevel<=MSG::VERBOSE); - if (lDebug) log << MSG::DEBUG << "Read TileCell Vec, size " << vec->size() << endreq; + if (lDebug) log << MSG::DEBUG << "Read TileCell Vec, size " << vec->size() << endmsg; // create the TileCellContainer cont = new TileCellContainer(); @@ -347,9 +350,9 @@ StatusCode TileCellContainerCnv::persToTrans(TileCellContainer*& cont, TileCellV if (lVerbose) { log << MSG::VERBOSE << "reading cell " << (iCell++) << " " << MSG::hex << id << MSG::dec << " " << ene << " " - << MSG::hex << tqg << MSG::dec << endreq; + << MSG::hex << tqg << MSG::dec << endmsg; log << MSG::VERBOSE << "ene=" << ener << " time=" << time - << " qual=" << qual << " gain=" << gain << endreq; + << " qual=" << qual << " gain=" << gain << endmsg; } TileCell * cell = new TileCell(NULL,id,ener,time,qual,qbit,(CaloGain::CaloGain)gain); @@ -385,7 +388,7 @@ StatusCode TileCellContainerCnv::persToTrans(TileCellContainer*& cont, TileCellV if (ene < 0 ) { // upper most bit is set, it means that everything is packed in one word if (lVerbose) - log << endreq; + log << endmsg; time = 0.0; // time was zero and it was not saved ener = ((ene & 0xFFFFF) - 0x10000) * 1e-3; @@ -396,7 +399,7 @@ StatusCode TileCellContainerCnv::persToTrans(TileCellContainer*& cont, TileCellV unsigned int tqg = *it++; if (lVerbose) - log << MSG::hex << tqg << MSG::dec << endreq; + log << MSG::hex << tqg << MSG::dec << endmsg; ener = (ene - 0x40000000) * 1e-3; time = ((int)(tqg>>16) - 0x8000 ) * 0.01; @@ -412,7 +415,7 @@ StatusCode TileCellContainerCnv::persToTrans(TileCellContainer*& cont, TileCellV if (lVerbose) log << MSG::hex << id << MSG::dec << " " << ene << " " - << MSG::hex << tqg << MSG::dec << endreq; + << MSG::hex << tqg << MSG::dec << endmsg; ener = ene*1e-3; time = ((int)(tqg>>16) - 0x8000 ) * 0.01; @@ -422,7 +425,7 @@ StatusCode TileCellContainerCnv::persToTrans(TileCellContainer*& cont, TileCellV if (lVerbose) log << MSG::VERBOSE << "ene=" << ener << " time=" << time - << " qual=" << qual << " gain=" << gain << endreq; + << " qual=" << qual << " gain=" << gain << endmsg; if (gain != m_gain[0]) { // don't create cells with non-existing gain TileCell * cell = new TileCell(dde,id,ener,time,qual,qbit,(CaloGain::CaloGain)gain); @@ -430,7 +433,7 @@ StatusCode TileCellContainerCnv::persToTrans(TileCellContainer*& cont, TileCellV } else { if (lVerbose) - log << MSG::VERBOSE << "Don't create MBTS cell with invalid gain" << endreq; + log << MSG::VERBOSE << "Don't create MBTS cell with invalid gain" << endmsg; } ++iCell; } @@ -438,7 +441,7 @@ StatusCode TileCellContainerCnv::persToTrans(TileCellContainer*& cont, TileCellV default: - log << MSG::ERROR << "Unknown version of TileCellVec, ver="<<version << endreq; + log << MSG::ERROR << "Unknown version of TileCellVec, ver="<<version << endmsg; return StatusCode::FAILURE; } diff --git a/TileCalorimeter/TileSvc/TileEventAthenaPool/src/TileCosmicMuonContainerCnv.cxx b/TileCalorimeter/TileSvc/TileEventAthenaPool/src/TileCosmicMuonContainerCnv.cxx index fc05377475e87ecf215bda07c020d6d2db175914..256172ad5938dacb7b35eaaa9e01dc7085a756e7 100644 --- a/TileCalorimeter/TileSvc/TileEventAthenaPool/src/TileCosmicMuonContainerCnv.cxx +++ b/TileCalorimeter/TileSvc/TileEventAthenaPool/src/TileCosmicMuonContainerCnv.cxx @@ -30,7 +30,7 @@ TileCosmicMuonContainerCnv::createPersistent( TileCosmicMuonContainer* transCont TileCosmicMuonContainer_PERS *persObj = cnv.createPersistent( transCont, msg ); if (msg.level()<=MSG::DEBUG) - msg << MSG::DEBUG << "::createPersistent [Success]" << endreq; + msg << MSG::DEBUG << "::createPersistent [Success]" << endmsg; return persObj; } diff --git a/TileCalorimeter/TileSvc/TileEventAthenaPool/src/TileDigitsContainerCnv.cxx b/TileCalorimeter/TileSvc/TileEventAthenaPool/src/TileDigitsContainerCnv.cxx index 1ab31d85e0f6f6c42a0f147947d98ba7c3925c27..77e8dab02f21eab346e0ef3b1f60ecd11f7ff587 100755 --- a/TileCalorimeter/TileSvc/TileEventAthenaPool/src/TileDigitsContainerCnv.cxx +++ b/TileCalorimeter/TileSvc/TileEventAthenaPool/src/TileDigitsContainerCnv.cxx @@ -3,27 +3,41 @@ */ #include "TileTPCnv/TileDigitsContainerCnv_p1.h" +#include "TileTPCnv/TileDigitsContainerCnv_p2.h" +#include "TileTPCnv/TileDigitsContainerCnv_p3.h" #include "TileDigitsContainerCnv.h" // Gaudi #include "GaudiKernel/MsgStream.h" TileDigitsContainer_PERS* TileDigitsContainerCnv::createPersistent(TileDigitsContainer* transCont) { - MsgStream mlog(messageService(), "TileDigitsContainerConverter" ); - TileDigitsContainerCnv_p1 converter; + MsgStream mlog(msgSvc(), "TileDigitsContainerConverter" ); + TileDigitsContainerCnv_p3 converter; TileDigitsContainer_PERS *persObj = converter.createPersistent( transCont, mlog ); return persObj; } TileDigitsContainer* TileDigitsContainerCnv::createTransient() { - MsgStream mlog(messageService(), "TileDigitsContainerConverter" ); + MsgStream mlog(msgSvc(), "TileDigitsContainerConverter" ); TileDigitsContainerCnv_p1 converter_p1; + TileDigitsContainerCnv_p2 converter_p2; + TileDigitsContainerCnv_p3 converter_p3; TileDigitsContainer *trans_cont(0); + static const pool::Guid p3_guid("8CC01C7A-B330-413E-BEF9-DFA18F15B1FA"); + static const pool::Guid p2_guid("2F82DE4C-65FA-4F01-BCB5-15330224E357"); static const pool::Guid p1_guid("F9386A42-43A7-4482-8A5B-F33EDE586FB2"); static const pool::Guid p0_guid("EB51ED70-5EC0-4F31-97D3-14453F77C88B"); - if( this->compareClassGuid(p1_guid)) { + if( this->compareClassGuid(p3_guid)) { + std::auto_ptr< TileDigitsContainer_p3 > cont( this->poolReadObject< TileDigitsContainer_p3 >() ); + trans_cont = converter_p3.createTransient( cont.get(), mlog ); + } + else if( this->compareClassGuid(p2_guid)) { + std::auto_ptr< TileDigitsContainer_p2 > cont( this->poolReadObject< TileDigitsContainer_p2 >() ); + trans_cont = converter_p2.createTransient( cont.get(), mlog ); + } + else if( this->compareClassGuid(p1_guid)) { std::auto_ptr< TileDigitsContainer_p1 > cont( this->poolReadObject< TileDigitsContainer_p1 >() ); trans_cont = converter_p1.createTransient( cont.get(), mlog ); } @@ -32,7 +46,7 @@ TileDigitsContainer* TileDigitsContainerCnv::createTransient() { TileDigitsCollectionVec* rdoV = this->poolReadObject<TileDigitsCollectionVec>(); if (mlog.level()<=MSG::DEBUG) - mlog << MSG::DEBUG << "Read IDC, size " << rdoV->size() << endreq; + mlog << MSG::DEBUG << "Read IDC, size " << rdoV->size() << endmsg; // TileFragHash::TYPE type = rdoV->m_type; @@ -51,7 +65,7 @@ TileDigitsContainer* TileDigitsContainerCnv::createTransient() { TileDigitsCollection::ID id_coll = rdoColl->identify(); StatusCode sc = trans_cont->addCollection(rdoColl,trans_cont->hashFunc()(id_coll)); if(sc.isFailure()) { - mlog << MSG::ERROR << "Can't add collection " << id_coll << " to container " << endreq; + mlog << MSG::ERROR << "Can't add collection " << id_coll << " to container " << endmsg; } } delete rdoV; diff --git a/TileCalorimeter/TileSvc/TileEventAthenaPool/src/TileDigitsContainerCnv.h b/TileCalorimeter/TileSvc/TileEventAthenaPool/src/TileDigitsContainerCnv.h index e99e763fe3e1aefecaba2df579179889905b0cbe..b15a95e7717a605cebd387b27f653bd18235ac49 100755 --- a/TileCalorimeter/TileSvc/TileEventAthenaPool/src/TileDigitsContainerCnv.h +++ b/TileCalorimeter/TileSvc/TileEventAthenaPool/src/TileDigitsContainerCnv.h @@ -7,9 +7,11 @@ #include "TileEvent/TileDigitsContainer.h" #include "TileTPCnv/TileDigitsContainer_p1.h" +#include "TileTPCnv/TileDigitsContainer_p2.h" +#include "TileTPCnv/TileDigitsContainer_p3.h" #include "AthenaPoolCnvSvc/T_AthenaPoolCustomCnv.h" // typedef to the latest persistent version -typedef TileDigitsContainer_p1 TileDigitsContainer_PERS; +typedef TileDigitsContainer_p3 TileDigitsContainer_PERS; class TileDigitsContainerCnv : public T_AthenaPoolCustomCnv<TileDigitsContainer, TileDigitsContainer_PERS > { friend class CnvFactory<TileDigitsContainerCnv>; diff --git a/TileCalorimeter/TileSvc/TileEventAthenaPool/src/TileHitContainerCnv.cxx b/TileCalorimeter/TileSvc/TileEventAthenaPool/src/TileHitContainerCnv.cxx index e36d2ac0f332c7a7f0873a808fb239221aeac203..a0f29652c12ff0faa46ad793be6e3aace086eb2b 100755 --- a/TileCalorimeter/TileSvc/TileEventAthenaPool/src/TileHitContainerCnv.cxx +++ b/TileCalorimeter/TileSvc/TileEventAthenaPool/src/TileHitContainerCnv.cxx @@ -8,14 +8,14 @@ #include "GaudiKernel/MsgStream.h" TileHitContainer_PERS* TileHitContainerCnv::createPersistent(TileHitContainer* transCont) { - MsgStream mlog(messageService(), "TileHitContainerConverter" ); + MsgStream mlog(msgSvc(), "TileHitContainerConverter" ); TileHitContainerCnv_p1 converter; TileHitContainer_PERS *persObj = converter.createPersistent( transCont, mlog ); return persObj; } TileHitContainer* TileHitContainerCnv::createTransient() { - MsgStream mlog(messageService(), "TileHitContainerConverter" ); + MsgStream mlog(msgSvc(), "TileHitContainerConverter" ); TileHitContainerCnv_p1 converter_p1; TileHitContainer *trans_cont(0); @@ -32,7 +32,7 @@ TileHitContainer* TileHitContainerCnv::createTransient() { TileHitCollectionVec* rdoV = this->poolReadObject<TileHitCollectionVec>(); if (mlog.level()<=MSG::DEBUG) - mlog << MSG::DEBUG << "Read IDC, size " << rdoV->size() << endreq; + mlog << MSG::DEBUG << "Read IDC, size " << rdoV->size() << endmsg; // TileFragHash::TYPE type = rdoV->m_type; @@ -51,7 +51,7 @@ TileHitContainer* TileHitContainerCnv::createTransient() { TileHitCollection::ID id_coll = rdoColl->identify(); StatusCode sc = trans_cont->addCollection(rdoColl,trans_cont->hashFunc()(id_coll)); if(sc.isFailure()) { - mlog << MSG::ERROR << "Can't add collection " << id_coll << " to container " << endreq; + mlog << MSG::ERROR << "Can't add collection " << id_coll << " to container " << endmsg; } } delete rdoV; diff --git a/TileCalorimeter/TileSvc/TileEventAthenaPool/src/TileL2ContainerCnv.cxx b/TileCalorimeter/TileSvc/TileEventAthenaPool/src/TileL2ContainerCnv.cxx index e7add1f2ee8a6c1bcc167740dfccc627452e7cae..32761fbb18d0eae11d1146b7df732cbfe2d4c49e 100755 --- a/TileCalorimeter/TileSvc/TileEventAthenaPool/src/TileL2ContainerCnv.cxx +++ b/TileCalorimeter/TileSvc/TileEventAthenaPool/src/TileL2ContainerCnv.cxx @@ -29,7 +29,7 @@ TileL2ContainerCnv::createPersistent( TileL2Container* transCont ) TileL2Container_PERS *persObj = cnv.createPersistent( transCont, msg ); if (msg.level()<=MSG::DEBUG) - msg << MSG::DEBUG << "::createPersistent [Success]" << endreq; + msg << MSG::DEBUG << "::createPersistent [Success]" << endmsg; return persObj; } diff --git a/TileCalorimeter/TileSvc/TileEventAthenaPool/src/TileMuContainerCnv.cxx b/TileCalorimeter/TileSvc/TileEventAthenaPool/src/TileMuContainerCnv.cxx index af34d2cacaf6c76fa2c25040cf6f343b88899852..bc64114622a95bed8886aedbd69e4e82ede90323 100755 --- a/TileCalorimeter/TileSvc/TileEventAthenaPool/src/TileMuContainerCnv.cxx +++ b/TileCalorimeter/TileSvc/TileEventAthenaPool/src/TileMuContainerCnv.cxx @@ -28,7 +28,7 @@ TileMuContainerCnv::createPersistent( TileMuContainer* transCont ) TileMuContainer_PERS *persObj = cnv.createPersistent( transCont, msg ); if (msg.level()<=MSG::DEBUG) - msg << MSG::DEBUG << "::createPersistent [Success]" << endreq; + msg << MSG::DEBUG << "::createPersistent [Success]" << endmsg; return persObj; } diff --git a/TileCalorimeter/TileSvc/TileEventAthenaPool/src/TileMuonReceiverContainerCnv.cxx b/TileCalorimeter/TileSvc/TileEventAthenaPool/src/TileMuonReceiverContainerCnv.cxx index ab2905bc8e4d55c2117ec674459721bd7f983afc..9d9ef487545e8f168d32b5f91acd7565534e3e1d 100755 --- a/TileCalorimeter/TileSvc/TileEventAthenaPool/src/TileMuonReceiverContainerCnv.cxx +++ b/TileCalorimeter/TileSvc/TileEventAthenaPool/src/TileMuonReceiverContainerCnv.cxx @@ -28,7 +28,7 @@ TileMuonReceiverContainerCnv::createPersistent( TileMuonReceiverContainer* trans TileMuonReceiverContainer_PERS *persObj = cnv.createPersistent( transCont, msg ); if (msg.level()<=MSG::DEBUG) - msg << MSG::DEBUG << "::createPersistent [Success]" << endreq; + msg << MSG::DEBUG << "::createPersistent [Success]" << endmsg; return persObj; } diff --git a/TileCalorimeter/TileSvc/TileEventAthenaPool/src/TileRawChannelContainerCnv.cxx b/TileCalorimeter/TileSvc/TileEventAthenaPool/src/TileRawChannelContainerCnv.cxx index 609ce1c16e7a1e5ae1a03613f2ad37ee75fc2749..5f1049b38f66bc59f39942b09a9f468f9a66aac7 100755 --- a/TileCalorimeter/TileSvc/TileEventAthenaPool/src/TileRawChannelContainerCnv.cxx +++ b/TileCalorimeter/TileSvc/TileEventAthenaPool/src/TileRawChannelContainerCnv.cxx @@ -8,14 +8,14 @@ #include "GaudiKernel/MsgStream.h" TileRawChannelContainer_PERS* TileRawChannelContainerCnv::createPersistent(TileRawChannelContainer* transCont) { - MsgStream mlog(messageService(), "TileRawChannelContainerConverter" ); + MsgStream mlog(msgSvc(), "TileRawChannelContainerConverter" ); TileRawChannelContainerCnv_p1 converter; TileRawChannelContainer_PERS *persObj = converter.createPersistent( transCont, mlog ); return persObj; } TileRawChannelContainer* TileRawChannelContainerCnv::createTransient() { - MsgStream mlog(messageService(), "TileRawChannelContainerConverter" ); + MsgStream mlog(msgSvc(), "TileRawChannelContainerConverter" ); TileRawChannelContainerCnv_p1 converter_p1; TileRawChannelContainer *trans_cont(0); @@ -33,12 +33,12 @@ TileRawChannelContainer* TileRawChannelContainerCnv::createTransient() { bool lDebug = (mlog.level()<=MSG::DEBUG); if (lDebug) - mlog << MSG::DEBUG << "Read IDC, size " << rdoV->size() << endreq; + mlog << MSG::DEBUG << "Read IDC, size " << rdoV->size() << endmsg; // fixing bug with units in 13.0.20 - should be removed once all RDO files produced with 13.0.20 disappear if (rdoV->m_type == 104) { if (lDebug) - mlog << MSG::DEBUG << "fixing units bug in 13.0.20 RDO data: if (type=104) type=4;" << endreq; + mlog << MSG::DEBUG << "fixing units bug in 13.0.20 RDO data: if (type=104) type=4;" << endmsg; rdoV->m_type = (TileFragHash::TYPE)4; } @@ -49,7 +49,7 @@ TileRawChannelContainer* TileRawChannelContainerCnv::createTransient() { if (lDebug) mlog << MSG::DEBUG << MSG::hex << "m_type=" << rdoV->m_type - << " " << bsflags << " " << unit << " " << type << " " << hashType << MSG::dec << endreq; + << " " << bsflags << " " << unit << " " << type << " " << hashType << MSG::dec << endmsg; // create the Tile IdentifiableContainer to contain the rdo collections trans_cont = new TileRawChannelContainer(false,hashType,unit,SG::OWN_ELEMENTS); @@ -68,7 +68,7 @@ TileRawChannelContainer* TileRawChannelContainerCnv::createTransient() { TileRawChannelCollection::ID id_coll = rdoColl->identify(); StatusCode sc = trans_cont->addCollection(rdoColl,trans_cont->hashFunc()(id_coll)); if(sc.isFailure()) { - mlog << MSG::ERROR << "Can't add collection " << id_coll << " to container" << endreq; + mlog << MSG::ERROR << "Can't add collection " << id_coll << " to container" << endmsg; } } delete rdoV; diff --git a/TileCalorimeter/TileSvc/TileEventAthenaPool/src/TileTTL1ContainerCnv.cxx b/TileCalorimeter/TileSvc/TileEventAthenaPool/src/TileTTL1ContainerCnv.cxx index 858ebf332a065260433c2dc553b0e827a92f824a..b6ced096e0c45f99ce365f2c2549885115a52d7f 100755 --- a/TileCalorimeter/TileSvc/TileEventAthenaPool/src/TileTTL1ContainerCnv.cxx +++ b/TileCalorimeter/TileSvc/TileEventAthenaPool/src/TileTTL1ContainerCnv.cxx @@ -28,7 +28,7 @@ TileTTL1ContainerCnv::createPersistent( TileTTL1Container* transCont ) TileTTL1Container_PERS *persObj = cnv.createPersistent( transCont, msg ); if (msg.level()<=MSG::DEBUG) - msg << MSG::DEBUG << "::createPersistent [Success]" << endreq; + msg << MSG::DEBUG << "::createPersistent [Success]" << endmsg; return persObj; } diff --git a/TileCalorimeter/TileSvc/TileTPCnv/CMakeLists.txt b/TileCalorimeter/TileSvc/TileTPCnv/CMakeLists.txt index 0f55dd70d97c37dc14e4ab9bdfa1e0b138e0017c..f086c63bf019903731c4c51f8250e36524e40b67 100644 --- a/TileCalorimeter/TileSvc/TileTPCnv/CMakeLists.txt +++ b/TileCalorimeter/TileSvc/TileTPCnv/CMakeLists.txt @@ -65,6 +65,18 @@ atlas_add_test( TileDigitsCnv_p1_test INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaPoolCnvSvcLib TileEvent TileSimEventTPCnv TestTools AthenaKernel IdDictParser GaudiKernel TileConditionsLib TileIdentifier TileTPCnv ) +atlas_add_test( TileDigitsCnv_p2_test + SOURCES + test/TileDigitsCnv_p2_test.cxx + INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} + LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaPoolCnvSvcLib TileEvent TileSimEventTPCnv TestTools AthenaKernel IdDictParser GaudiKernel TileConditionsLib TileIdentifier TileTPCnv ) + +atlas_add_test( TileDigitsCnv_p3_test + SOURCES + test/TileDigitsCnv_p3_test.cxx + INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} + LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaPoolCnvSvcLib TileEvent TileSimEventTPCnv TestTools AthenaKernel IdDictParser GaudiKernel TileConditionsLib TileIdentifier TileTPCnv ) + atlas_add_test( TileRawChannelCnv_p1_test SOURCES test/TileRawChannelCnv_p1_test.cxx diff --git a/TileCalorimeter/TileSvc/TileTPCnv/TileTPCnv/T_TilePoolContainerCnv.h b/TileCalorimeter/TileSvc/TileTPCnv/TileTPCnv/T_TilePoolContainerCnv.h index 6df5945e425cfb62c8db7b2c70341c80e74bb4ff..98332371654122c9cf3693c441f4379711c71c43 100644 --- a/TileCalorimeter/TileSvc/TileTPCnv/TileTPCnv/T_TilePoolContainerCnv.h +++ b/TileCalorimeter/TileSvc/TileTPCnv/TileTPCnv/T_TilePoolContainerCnv.h @@ -50,7 +50,7 @@ public: log << MSG::DEBUG << MSG::hex << "pers_type= 0x" << pers_type << " - " << bsflags << " " << unit << " " << type << " " << hashType - << MSG::dec << " Nelements= " << vec.size() << endreq; + << MSG::dec << " Nelements= " << vec.size() << endmsg; //trans->clear(); // only remove elements trans->cleanup(); // remove all collections @@ -58,7 +58,7 @@ public: if ( abs(trans->get_hashType()-hashType) > 0xF) { log << MSG::DEBUG << "Pers hash type " << hashType << " does not match Trans hash type " << trans->get_hashType() - << " ==> reinitializing hash " << endreq; + << " ==> reinitializing hash " << endmsg; trans->initialize(false,(TileFragHash::TYPE)hashType); } @@ -103,7 +103,7 @@ public: << " " << trans->get_unit() << " " << trans->get_type() << " " << trans->get_hashType() - << MSG::dec << " Nelements= " << pers->getVector().size() << endreq; + << MSG::dec << " Nelements= " << pers->getVector().size() << endmsg; } private: diff --git a/TileCalorimeter/TileSvc/TileTPCnv/TileTPCnv/TileDigitsCnv_p2.h b/TileCalorimeter/TileSvc/TileTPCnv/TileTPCnv/TileDigitsCnv_p2.h new file mode 100644 index 0000000000000000000000000000000000000000..620a5559970aa0dec6170373710a6fa199c1af37 --- /dev/null +++ b/TileCalorimeter/TileSvc/TileTPCnv/TileTPCnv/TileDigitsCnv_p2.h @@ -0,0 +1,46 @@ +///////////////////////// -*- C++ -*- ///////////////////////////// + +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +// TileDigitsCnv_p2.h +// Transient/Persistent converter for TileDigits class +// Author: Alexander Solodkov <Sanya.Solodkov@cern.ch> +// Date: June 2009 +/////////////////////////////////////////////////////////////////// +#ifndef TILETPCNV_TILEDIGITSCNV_P2_H +#define TILETPCNV_TILEDIGITSCNV_P2_H + +// AthenaPoolCnvSvc includes +#include "AthenaPoolCnvSvc/T_AthenaPoolTPConverter.h" + +// TileTPCnv includes +#include "TileTPCnv/TileDigits_p2.h" + +// TileEvent includes +#include "TileEvent/TileDigits.h" + +class MsgStream; + +class TileDigitsCnv_p2 : public T_AthenaPoolTPCnvBase<TileDigits, TileDigits_p2> { + +public: + + /** Default constructor: + */ + TileDigitsCnv_p2() {} + + /** Method creating the transient representation TileDigits + * from its persistent representation TileDigits_p2 + */ + virtual void persToTrans(const TileDigits_p2* persObj, TileDigits* transObj, MsgStream &log); + + /** Method creating the persistent representation TileDigits_p2 + * from its transient representation TileDigits + */ + virtual void transToPers(const TileDigits* transObj, TileDigits_p2* persObj, MsgStream &log); + +}; + +#endif //> TILETPCNV_TILEDIGITSCNV_P2_H diff --git a/TileCalorimeter/TileSvc/TileTPCnv/TileTPCnv/TileDigitsCnv_p3.h b/TileCalorimeter/TileSvc/TileTPCnv/TileTPCnv/TileDigitsCnv_p3.h new file mode 100644 index 0000000000000000000000000000000000000000..4b72eff142b01b15a255cc562bb62c94f870ffa0 --- /dev/null +++ b/TileCalorimeter/TileSvc/TileTPCnv/TileTPCnv/TileDigitsCnv_p3.h @@ -0,0 +1,46 @@ +///////////////////////// -*- C++ -*- ///////////////////////////// + +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +// TileDigitsCnv_p3.h +// Transient/Persistent converter for TileDigits class +// Author: Alexander Solodkov <Sanya.Solodkov@cern.ch> +// Date: June 2009 +/////////////////////////////////////////////////////////////////// +#ifndef TILETPCNV_TILEDIGITSCNV_P3_H +#define TILETPCNV_TILEDIGITSCNV_P3_H + +// AthenaPoolCnvSvc includes +#include "AthenaPoolCnvSvc/T_AthenaPoolTPConverter.h" + +// TileTPCnv includes +#include "TileTPCnv/TileDigits_p3.h" + +// TileEvent includes +#include "TileEvent/TileDigits.h" + +class MsgStream; + +class TileDigitsCnv_p3 : public T_AthenaPoolTPCnvBase<TileDigits, TileDigits_p3> { + +public: + + /** Default constructor: + */ + TileDigitsCnv_p3() {} + + /** Method creating the transient representation TileDigits + * from its persistent representation TileDigits_p3 + */ + virtual void persToTrans(const TileDigits_p3* persObj, TileDigits* transObj, MsgStream &log); + + /** Method creating the persistent representation TileDigits_p3 + * from its transient representation TileDigits + */ + virtual void transToPers(const TileDigits* transObj, TileDigits_p3* persObj, MsgStream &log); + +}; + +#endif //> TILETPCNV_TILEDIGITSCNV_P3_H diff --git a/TileCalorimeter/TileSvc/TileTPCnv/TileTPCnv/TileDigitsContainerCnv_p2.h b/TileCalorimeter/TileSvc/TileTPCnv/TileTPCnv/TileDigitsContainerCnv_p2.h new file mode 100644 index 0000000000000000000000000000000000000000..8c6857601cab1be9eb36cfe6eb13425b5fc845e2 --- /dev/null +++ b/TileCalorimeter/TileSvc/TileTPCnv/TileTPCnv/TileDigitsContainerCnv_p2.h @@ -0,0 +1,32 @@ +///////////////////////// -*- C++ -*- ///////////////////////////// + +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +// TileDigitsContainerCnv_p2.h +// Header file for class TileDigitsContainerCnv_p2 +// Author: Alexander Solodkov <Sanya.Solodkov@cern.ch> +// Date: June 2009 +/////////////////////////////////////////////////////////////////// +#ifndef TILETPCNV_TILEDIGITSCONTAINERCNV_P2_H +#define TILETPCNV_TILEDIGITSCONTAINERCNV_P2_H + +// TileTPCnv includes +#define private public +#include "TileTPCnv/TileDigitsContainer_p2.h" +#undef private +#include "TileTPCnv/TileDigitsCnv_p2.h" +#include "TileTPCnv/T_TilePoolContainerCnv.h" + +// Tile includes +#include "TileEvent/TileDigitsContainer.h" + +typedef T_TilePoolContainerCnv< + TileDigitsContainer, + TileDigitsContainer_p2, + TileDigitsCnv_p2 + > TileDigitsContainerCnv_p2; + +#endif //> TILETPCNV_TILEDIGITSCONTAINERCNV_P2_H + diff --git a/TileCalorimeter/TileSvc/TileTPCnv/TileTPCnv/TileDigitsContainerCnv_p3.h b/TileCalorimeter/TileSvc/TileTPCnv/TileTPCnv/TileDigitsContainerCnv_p3.h new file mode 100644 index 0000000000000000000000000000000000000000..43d7edeeab4860f2b0095351dd0918fc31337689 --- /dev/null +++ b/TileCalorimeter/TileSvc/TileTPCnv/TileTPCnv/TileDigitsContainerCnv_p3.h @@ -0,0 +1,32 @@ +///////////////////////// -*- C++ -*- ///////////////////////////// + +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +// TileDigitsContainerCnv_p3.h +// Header file for class TileDigitsContainerCnv_p3 +// Author: Alexander Solodkov <Sanya.Solodkov@cern.ch> +// Date: June 2009 +/////////////////////////////////////////////////////////////////// +#ifndef TILETPCNV_TILEDIGITSCONTAINERCNV_P3_H +#define TILETPCNV_TILEDIGITSCONTAINERCNV_P3_H + +// TileTPCnv includes +#define private public +#include "TileTPCnv/TileDigitsContainer_p3.h" +#undef private +#include "TileTPCnv/TileDigitsCnv_p3.h" +#include "TileTPCnv/T_TilePoolContainerCnv.h" + +// Tile includes +#include "TileEvent/TileDigitsContainer.h" + +typedef T_TilePoolContainerCnv< + TileDigitsContainer, + TileDigitsContainer_p3, + TileDigitsCnv_p3 + > TileDigitsContainerCnv_p3; + +#endif //> TILETPCNV_TILEDIGITSCONTAINERCNV_P3_H + diff --git a/TileCalorimeter/TileSvc/TileTPCnv/TileTPCnv/TileDigitsContainer_p2.h b/TileCalorimeter/TileSvc/TileTPCnv/TileTPCnv/TileDigitsContainer_p2.h new file mode 100644 index 0000000000000000000000000000000000000000..3b239f802c8db773f6a4b2d7f6786b6b28c929c4 --- /dev/null +++ b/TileCalorimeter/TileSvc/TileTPCnv/TileTPCnv/TileDigitsContainer_p2.h @@ -0,0 +1,46 @@ +///////////////////////// -*- C++ -*- ///////////////////////////// + +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +// TileDigitsContainer_p2.h +// Persistent represenation of a TileDigitsContainer +// Author: Alexander Solodkov <Sanya.Solodkov@cern.ch> +// Date: June 2009 +/////////////////////////////////////////////////////////////////// +#ifndef TILEDIGITSCONTAINER_P2_H +#define TILEDIGITSCONTAINER_P2_H + +#include "TileTPCnv/TileDigits_p2.h" +#include <vector> + +class TileDigitsContainer_p2 +{ +public: + /// typedefs + typedef std::vector<TileDigits_p2> ElemVector; + typedef ElemVector::const_iterator const_iterator; + typedef ElemVector::iterator iterator; + + /// Default constructor + TileDigitsContainer_p2 () : m_param(), m_cont() {} + + // Accessors + const std::vector<unsigned int>& getParam() const {return m_param;} + const ElemVector& getVector() const {return m_cont;} + + // Clear methods + void clear() {m_param.clear(); m_cont.clear(); } + void reserve(unsigned int size1, unsigned int size2) { m_param.reserve(size1); m_cont.reserve(size2); } + + // Fill methods + void push_back_param (unsigned int param) {m_param.push_back(param); } + TileDigits_p2 * newElem () { m_cont.push_back(TileDigits_p2()); return &m_cont.back(); } + +private: + std::vector<unsigned int> m_param; + std::vector<TileDigits_p2> m_cont; +}; + +#endif diff --git a/TileCalorimeter/TileSvc/TileTPCnv/TileTPCnv/TileDigitsContainer_p3.h b/TileCalorimeter/TileSvc/TileTPCnv/TileTPCnv/TileDigitsContainer_p3.h new file mode 100644 index 0000000000000000000000000000000000000000..c447b25d73dce2cabe7b45b32906acfad73673b0 --- /dev/null +++ b/TileCalorimeter/TileSvc/TileTPCnv/TileTPCnv/TileDigitsContainer_p3.h @@ -0,0 +1,46 @@ +///////////////////////// -*- C++ -*- ///////////////////////////// + +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +// TileDigitsContainer_p3.h +// Persistent represenation of a TileDigitsContainer +// Author: Alexander Solodkov <Sanya.Solodkov@cern.ch> +// Date: June 2009 +/////////////////////////////////////////////////////////////////// +#ifndef TILEDIGITSCONTAINER_P3_H +#define TILEDIGITSCONTAINER_P3_H + +#include "TileTPCnv/TileDigits_p3.h" +#include <vector> + +class TileDigitsContainer_p3 +{ +public: + /// typedefs + typedef std::vector<TileDigits_p3> ElemVector; + typedef ElemVector::const_iterator const_iterator; + typedef ElemVector::iterator iterator; + + /// Default constructor + TileDigitsContainer_p3 () : m_param(), m_cont() {} + + // Accessors + const std::vector<unsigned int>& getParam() const {return m_param;} + const ElemVector& getVector() const {return m_cont;} + + // Clear methods + void clear() {m_param.clear(); m_cont.clear(); } + void reserve(unsigned int size1, unsigned int size2) { m_param.reserve(size1); m_cont.reserve(size2); } + + // Fill methods + void push_back_param (unsigned int param) {m_param.push_back(param); } + TileDigits_p3 * newElem () { m_cont.push_back(TileDigits_p3()); return &m_cont.back(); } + +private: + std::vector<unsigned int> m_param; + std::vector<TileDigits_p3> m_cont; +}; + +#endif diff --git a/TileCalorimeter/TileSvc/TileTPCnv/TileTPCnv/TileDigits_p2.h b/TileCalorimeter/TileSvc/TileTPCnv/TileTPCnv/TileDigits_p2.h new file mode 100644 index 0000000000000000000000000000000000000000..972d8a74c6144c0086f98f50da30f94d143ae724 --- /dev/null +++ b/TileCalorimeter/TileSvc/TileTPCnv/TileTPCnv/TileDigits_p2.h @@ -0,0 +1,39 @@ +///////////////////////// -*- C++ -*- ///////////////////////////// + +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +// TileDigits_p2.h +// Header file for class TileDigits_p2 +// Author: Alexander Solodkov <Sanya.Solodkov@cern.ch> +// Date: June 2009 +/////////////////////////////////////////////////////////////////// +#ifndef TILETPCNV_TILEDIGITS_P2_H +#define TILETPCNV_TILEDIGITS_P2_H + +#include <vector> + +// forward declarations +class TileDigitsCnv_p2; + +class TileDigits_p2 { + + // Make the AthenaPoolCnv class our friend + friend class TileDigitsCnv_p2; + +public: + + /** Default constructor: + */ + TileDigits_p2() : m_channelID(0), m_digits() {} + +private: + + unsigned int m_channelID; + std::vector<short> m_digits; + +}; + +#endif //> TILETPCNV_TILEDIGITS_P2_H + diff --git a/TileCalorimeter/TileSvc/TileTPCnv/TileTPCnv/TileDigits_p3.h b/TileCalorimeter/TileSvc/TileTPCnv/TileTPCnv/TileDigits_p3.h new file mode 100644 index 0000000000000000000000000000000000000000..374906c93326d43baf7d1d0fe236566f9a326f50 --- /dev/null +++ b/TileCalorimeter/TileSvc/TileTPCnv/TileTPCnv/TileDigits_p3.h @@ -0,0 +1,39 @@ +///////////////////////// -*- C++ -*- ///////////////////////////// + +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +// TileDigits_p3.h +// Header file for class TileDigits_p3 +// Author: Alexander Solodkov <Sanya.Solodkov@cern.ch> +// Date: June 2009 +/////////////////////////////////////////////////////////////////// +#ifndef TILETPCNV_TILEDIGITS_P3_H +#define TILETPCNV_TILEDIGITS_P3_H + +#include <vector> + +// forward declarations +class TileDigitsCnv_p3; + +class TileDigits_p3 { + + // Make the AthenaPoolCnv class our friend + friend class TileDigitsCnv_p3; + +public: + + /** Default constructor: + */ + TileDigits_p3() : m_channelID(0), m_digits() {} + +private: + + unsigned int m_channelID; + std::vector<float> m_digits; + +}; + +#endif //> TILETPCNV_TILEDIGITS_P3_H + diff --git a/TileCalorimeter/TileSvc/TileTPCnv/TileTPCnv/TileTPCnvDict.h b/TileCalorimeter/TileSvc/TileTPCnv/TileTPCnv/TileTPCnvDict.h index ac036515e7abbf4bc7b0fde1ac6c88ccc8c3b46d..c39fb513de596ad51d61ae6e6054600a38834a87 100644 --- a/TileCalorimeter/TileSvc/TileTPCnv/TileTPCnv/TileTPCnvDict.h +++ b/TileCalorimeter/TileSvc/TileTPCnv/TileTPCnv/TileTPCnvDict.h @@ -28,6 +28,12 @@ #include "TileTPCnv/TileDigits_p1.h" #include "TileTPCnv/TileDigitsContainer_p1.h" +#include "TileTPCnv/TileDigits_p2.h" +#include "TileTPCnv/TileDigitsContainer_p2.h" + +#include "TileTPCnv/TileDigits_p3.h" +#include "TileTPCnv/TileDigitsContainer_p3.h" + #include "TileTPCnv/TileBeamElem_p1.h" #include "TileTPCnv/TileBeamElemContainer_p1.h" diff --git a/TileCalorimeter/TileSvc/TileTPCnv/TileTPCnv/selection.xml b/TileCalorimeter/TileSvc/TileTPCnv/TileTPCnv/selection.xml index 5872fd21ee598899d60e0b6ccf247f2e957b4fb0..a3f92df88566371c3a888d1ac0b43a248898f1ce 100644 --- a/TileCalorimeter/TileSvc/TileTPCnv/TileTPCnv/selection.xml +++ b/TileCalorimeter/TileSvc/TileTPCnv/TileTPCnv/selection.xml @@ -30,6 +30,14 @@ <class name="std::vector<TileDigits_p1>" /> <class name="TileDigitsContainer_p1" id="F9386A42-43A7-4482-8A5B-F33EDE586FB2" /> + <class name="TileDigits_p2" /> + <class name="std::vector<TileDigits_p2>" /> + <class name="TileDigitsContainer_p2" id="2F82DE4C-65FA-4F01-BCB5-15330224E357" /> + + <class name="TileDigits_p3" /> + <class name="std::vector<TileDigits_p3>" /> + <class name="TileDigitsContainer_p3" id="8CC01C7A-B330-413E-BEF9-DFA18F15B1FA" /> + <class name="TileBeamElem_p1" /> <class name="std::vector<TileBeamElem_p1>" /> <class name="TileBeamElemContainer_p1" id="CF8DE6AB-8E15-4B5F-881B-39B736EAB4E0" /> diff --git a/TileCalorimeter/TileSvc/TileTPCnv/share/TileDigitsCnv_p2_test.ref b/TileCalorimeter/TileSvc/TileTPCnv/share/TileDigitsCnv_p2_test.ref new file mode 100644 index 0000000000000000000000000000000000000000..8c1cb7f2b7894d103c924327d335f5bfe1da06ba --- /dev/null +++ b/TileCalorimeter/TileSvc/TileTPCnv/share/TileDigitsCnv_p2_test.ref @@ -0,0 +1,21 @@ +TileHWID INFO initialize_from_dictionary +AtlasDetectorIDHelper::initialize_from_dictionary - Warning: unable to find mm region index: group, region size 0 0 +AtlasDetectorIDHelper::initialize_from_dictionary - Warning: unable to find stgc region index: group, region size 0 0 +AtlasDetectorID::initLevelsFromDict - there are no sTGC entries in the dictionary! +AtlasDetectorID::initLevelsFromDict - there are no MM entries in the dictionary! +AtlasDetectorID DEBUG Could not get value for label 'no_side' of field 'DetZside' in dictionary Calorimeter + AtlasDetectorID::initialize_from_dictionary - OK +TileTBID INFO initialize_from_dictionary +AtlasDetectorIDHelper::initialize_from_dictionary - Warning: unable to find mm region index: group, region size 0 0 +AtlasDetectorIDHelper::initialize_from_dictionary - Warning: unable to find stgc region index: group, region size 0 0 +AtlasDetectorID::initLevelsFromDict - there are no sTGC entries in the dictionary! +AtlasDetectorID::initLevelsFromDict - there are no MM entries in the dictionary! +AtlasDetectorID DEBUG Could not get value for label 'no_side' of field 'DetZside' in dictionary Calorimeter + AtlasDetectorID::initialize_from_dictionary - OK +AtlasDetectorIDHelper::initialize_from_dictionary - Warning: unable to find mm region index: group, region size 0 0 +AtlasDetectorIDHelper::initialize_from_dictionary - Warning: unable to find stgc region index: group, region size 0 0 +AtlasDetectorID::initLevelsFromDict - there are no sTGC entries in the dictionary! +AtlasDetectorID::initLevelsFromDict - there are no MM entries in the dictionary! +AtlasDetectorID DEBUG Could not get value for label 'no_side' of field 'DetZside' in dictionary Calorimeter + AtlasDetectorID::initialize_from_dictionary - OK +test1 diff --git a/TileCalorimeter/TileSvc/TileTPCnv/share/TileDigitsCnv_p3_test.ref b/TileCalorimeter/TileSvc/TileTPCnv/share/TileDigitsCnv_p3_test.ref new file mode 100644 index 0000000000000000000000000000000000000000..8c1cb7f2b7894d103c924327d335f5bfe1da06ba --- /dev/null +++ b/TileCalorimeter/TileSvc/TileTPCnv/share/TileDigitsCnv_p3_test.ref @@ -0,0 +1,21 @@ +TileHWID INFO initialize_from_dictionary +AtlasDetectorIDHelper::initialize_from_dictionary - Warning: unable to find mm region index: group, region size 0 0 +AtlasDetectorIDHelper::initialize_from_dictionary - Warning: unable to find stgc region index: group, region size 0 0 +AtlasDetectorID::initLevelsFromDict - there are no sTGC entries in the dictionary! +AtlasDetectorID::initLevelsFromDict - there are no MM entries in the dictionary! +AtlasDetectorID DEBUG Could not get value for label 'no_side' of field 'DetZside' in dictionary Calorimeter + AtlasDetectorID::initialize_from_dictionary - OK +TileTBID INFO initialize_from_dictionary +AtlasDetectorIDHelper::initialize_from_dictionary - Warning: unable to find mm region index: group, region size 0 0 +AtlasDetectorIDHelper::initialize_from_dictionary - Warning: unable to find stgc region index: group, region size 0 0 +AtlasDetectorID::initLevelsFromDict - there are no sTGC entries in the dictionary! +AtlasDetectorID::initLevelsFromDict - there are no MM entries in the dictionary! +AtlasDetectorID DEBUG Could not get value for label 'no_side' of field 'DetZside' in dictionary Calorimeter + AtlasDetectorID::initialize_from_dictionary - OK +AtlasDetectorIDHelper::initialize_from_dictionary - Warning: unable to find mm region index: group, region size 0 0 +AtlasDetectorIDHelper::initialize_from_dictionary - Warning: unable to find stgc region index: group, region size 0 0 +AtlasDetectorID::initLevelsFromDict - there are no sTGC entries in the dictionary! +AtlasDetectorID::initLevelsFromDict - there are no MM entries in the dictionary! +AtlasDetectorID DEBUG Could not get value for label 'no_side' of field 'DetZside' in dictionary Calorimeter + AtlasDetectorID::initialize_from_dictionary - OK +test1 diff --git a/TileCalorimeter/TileSvc/TileTPCnv/src/TileDigitsCnv_p1.cxx b/TileCalorimeter/TileSvc/TileTPCnv/src/TileDigitsCnv_p1.cxx index 8eda39598c3da8fb283e3f15570fa3bef90352b3..097838757fbec78a1a9ef0be282e69731e13d4b1 100644 --- a/TileCalorimeter/TileSvc/TileTPCnv/src/TileDigitsCnv_p1.cxx +++ b/TileCalorimeter/TileSvc/TileTPCnv/src/TileDigitsCnv_p1.cxx @@ -17,7 +17,7 @@ void TileDigitsCnv_p1::persToTrans(const TileDigits_p1* persObj, TileDigits* transObj, MsgStream &/*log*/) { - std::vector<double> digits; + std::vector<float> digits; digits.reserve(persObj->m_digits.size()); for (short d : persObj->m_digits) { digits.push_back( d / 16. ); @@ -35,7 +35,7 @@ TileDigitsCnv_p1::transToPers(const TileDigits* transObj, TileDigits_p1* persObj persObj->m_digits.reserve(transObj->nsamples()); for (float d : transObj->samples()) { - short val = (short)(std::min(d,float(2047.))*16.); + short val = (short)(std::min(d,2047.F)*16.); persObj->m_digits.push_back( val ); } } diff --git a/TileCalorimeter/TileSvc/TileTPCnv/src/TileDigitsCnv_p2.cxx b/TileCalorimeter/TileSvc/TileTPCnv/src/TileDigitsCnv_p2.cxx new file mode 100644 index 0000000000000000000000000000000000000000..a1003a242d046a061b7f0c131c53078bc1dc4486 --- /dev/null +++ b/TileCalorimeter/TileSvc/TileTPCnv/src/TileDigitsCnv_p2.cxx @@ -0,0 +1,35 @@ +///////////////////////// -*- C++ -*- ///////////////////////////// + +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +// TileDigitsCnv_p2.cxx +// Implementation file for class TileDigitsCnv_p2 +// Author: Alexander Solodkov <Sanya.Solodkov@cern.ch> +// Date: June 2009 +/////////////////////////////////////////////////////////////////// + +#include "TileEvent/TileDigits.h" +#include "TileTPCnv/TileDigitsCnv_p2.h" + + +void +TileDigitsCnv_p2::persToTrans(const TileDigits_p2* persObj, TileDigits* transObj, MsgStream &/*log*/) +{ + *transObj = TileDigits (HWIdentifier(Identifier32(persObj->m_channelID)), + persObj->m_digits); +} + + +void +TileDigitsCnv_p2::transToPers(const TileDigits* transObj, TileDigits_p2* persObj, MsgStream &/*log*/) +{ + persObj->m_channelID = transObj->adc_HWID().get_identifier32().get_compact(); + + persObj->m_digits.reserve(transObj->nsamples()); + for (float d : transObj->samples()) { + short val = (short)(std::min(d,32767.F)); + persObj->m_digits.push_back( val ); + } +} diff --git a/TileCalorimeter/TileSvc/TileTPCnv/src/TileDigitsCnv_p3.cxx b/TileCalorimeter/TileSvc/TileTPCnv/src/TileDigitsCnv_p3.cxx new file mode 100644 index 0000000000000000000000000000000000000000..13b103ee9d2d9c285415917b8b77a1ea790e586c --- /dev/null +++ b/TileCalorimeter/TileSvc/TileTPCnv/src/TileDigitsCnv_p3.cxx @@ -0,0 +1,30 @@ +///////////////////////// -*- C++ -*- ///////////////////////////// + +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +// TileDigitsCnv_p3.cxx +// Implementation file for class TileDigitsCnv_p3 +// Author: Alexander Solodkov <Sanya.Solodkov@cern.ch> +// Date: June 2009 +/////////////////////////////////////////////////////////////////// + +#include "TileEvent/TileDigits.h" +#include "TileTPCnv/TileDigitsCnv_p3.h" + + +void +TileDigitsCnv_p3::persToTrans(const TileDigits_p3* persObj, TileDigits* transObj, MsgStream &/*log*/) +{ + *transObj = TileDigits (HWIdentifier(Identifier32(persObj->m_channelID)), + persObj->m_digits); +} + + +void +TileDigitsCnv_p3::transToPers(const TileDigits* transObj, TileDigits_p3* persObj, MsgStream &/*log*/) +{ + persObj->m_channelID = transObj->adc_HWID().get_identifier32().get_compact(); + persObj->m_digits = transObj->samples(); +} diff --git a/TileCalorimeter/TileSvc/TileTPCnv/src/TileL2Cnv_p2.cxx b/TileCalorimeter/TileSvc/TileTPCnv/src/TileL2Cnv_p2.cxx index f9bddc5dbe2efb390c89fe27f02300b30e968bad..b0ed8db35ab1f61e811021fcd650c5cd2c19fe7c 100644 --- a/TileCalorimeter/TileSvc/TileTPCnv/src/TileL2Cnv_p2.cxx +++ b/TileCalorimeter/TileSvc/TileTPCnv/src/TileL2Cnv_p2.cxx @@ -41,7 +41,7 @@ void TileL2Cnv_p2::transToPers(const TileL2* transObj, TileL2_p2* persObj, MsgSt << " l2=" << l2 << " l3=" << l3 << " l4=" << l4 - << endreq; + << endmsg; persObj->m_ID = (transObj->m_ID & 0xFFFF); return; } @@ -95,7 +95,7 @@ void TileL2Cnv_p2::transToPers(const TileL2* transObj, TileL2_p2* persObj, MsgSt << "," << transObj->m_enemu1.size() << "," << transObj->m_enemu2.size() << ") f_size=" << persObj->m_fval.size() - << endreq; + << endmsg; } } @@ -142,7 +142,7 @@ void TileL2Cnv_p2::persToTrans(const TileL2_p2* persObj, TileL2* transObj, MsgSt << " id=0x" << MSG::hex << l0 << MSG::dec << " f_size=" << persObj->m_fval.size() << " i_size=" << persObj->m_ival.size() - << endreq; + << endmsg; return; } @@ -161,7 +161,7 @@ void TileL2Cnv_p2::persToTrans(const TileL2_p2* persObj, TileL2* transObj, MsgSt << " l2="<<l2 << " l3="<<l3 << " l4="<<l4 - << endreq; + << endmsg; } transObj->m_sumE.resize(1,0.0); diff --git a/TileCalorimeter/TileSvc/TileTPCnv/src/TileRawChannelCnv_p1.cxx b/TileCalorimeter/TileSvc/TileTPCnv/src/TileRawChannelCnv_p1.cxx index 048b2949149f4e21154e7a4210e9a643695d68a5..7f437f822d5d37018ad972b57c5f4ac7f13958ac 100644 --- a/TileCalorimeter/TileSvc/TileTPCnv/src/TileRawChannelCnv_p1.cxx +++ b/TileCalorimeter/TileSvc/TileTPCnv/src/TileRawChannelCnv_p1.cxx @@ -55,7 +55,7 @@ TileRawChannelCnv_p1::persToTrans(const TileRawChannel_p1* persObj, TileRawChann if (it != persObj->m_data.end()) { log << MSG::ERROR << "TileRawChannelCnv_p1::persToTrans wrong size of data vector: " - << persObj->m_data.size() << MSG::hex << "0x" << persObj->m_length << MSG::dec << endreq; + << persObj->m_data.size() << MSG::hex << "0x" << persObj->m_length << MSG::dec << endmsg; } *transObj = TileRawChannel (HWIdentifier(Identifier32(persObj->m_channelID)), diff --git a/TileCalorimeter/TileSvc/TileTPCnv/src/TileTPCnv.cxx b/TileCalorimeter/TileSvc/TileTPCnv/src/TileTPCnv.cxx index 34b63921040524dd9155b289e81e293ad7e97ccc..5bc7785f50638b56561677f682b6d26e1b4e7ab0 100644 --- a/TileCalorimeter/TileSvc/TileTPCnv/src/TileTPCnv.cxx +++ b/TileCalorimeter/TileSvc/TileTPCnv/src/TileTPCnv.cxx @@ -36,6 +36,14 @@ #include "TileTPCnv/TileDigitsContainer_p1.h" #include "TileTPCnv/TileDigitsContainerCnv_p1.h" +#include "TileTPCnv/TileDigits_p2.h" +#include "TileTPCnv/TileDigitsContainer_p2.h" +#include "TileTPCnv/TileDigitsContainerCnv_p2.h" + +#include "TileTPCnv/TileDigits_p3.h" +#include "TileTPCnv/TileDigitsContainer_p3.h" +#include "TileTPCnv/TileDigitsContainerCnv_p3.h" + #include "TileTPCnv/TileBeamElem_p1.h" #include "TileTPCnv/TileBeamElemContainer_p1.h" #include "TileTPCnv/TileBeamElemContainerCnv_p1.h" @@ -94,8 +102,20 @@ DECLARE_NAMED_TPCNV_FACTORY(TileDigitsContainerCnv_p1, TileDigitsContainerCnv_p1, TileDigitsContainer, TileDigitsContainer_p1, - Athena::TPCnvVers::Current) + Athena::TPCnvVers::Old) +DECLARE_NAMED_TPCNV_FACTORY(TileDigitsContainerCnv_p2, + TileDigitsContainerCnv_p2, + TileDigitsContainer, + TileDigitsContainer_p2, + Athena::TPCnvVers::Old) + +DECLARE_NAMED_TPCNV_FACTORY(TileDigitsContainerCnv_p3, + TileDigitsContainerCnv_p3, + TileDigitsContainer, + TileDigitsContainer_p3, + Athena::TPCnvVers::Current) + DECLARE_NAMED_TPCNV_FACTORY(TileHitContainerCnv_p1, TileHitContainerCnv_p1, TileHitContainer, diff --git a/TileCalorimeter/TileSvc/TileTPCnv/test/TileDigitsCnv_p2_test.cxx b/TileCalorimeter/TileSvc/TileTPCnv/test/TileDigitsCnv_p2_test.cxx new file mode 100644 index 0000000000000000000000000000000000000000..a79db7f2a2511300873d36d9fb1b9aa143925510 --- /dev/null +++ b/TileCalorimeter/TileSvc/TileTPCnv/test/TileDigitsCnv_p2_test.cxx @@ -0,0 +1,86 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +// $Id$ +/** + * @file TileTPCnv/test/TileDigitsCnv_p2_test.cxx + * @author scott snyder <snyder@bnl.gov> + * @date Jan, 2016 + * @brief Tests for TileDigitsCnv_p2. + */ + + +#undef NDEBUG +#include "TileTPCnv/TileDigitsCnv_p2.h" +#include "TileConditions/TileCablingService.h" +#include "TileIdentifier/TileHWID.h" +#include "IdDictParser/IdDictParser.h" +#include "TestTools/initGaudi.h" +#include "GaudiKernel/MsgStream.h" +#include <cassert> +#include <iostream> + + +TileHWID hwid; +TileTBID tbid; +TileID tileid; + +class TileCablingSvc +{ +public: + static + void init_idhelpers() + { + tileid.set_do_neighbours (false); + IdDictParser parser; + IdDictMgr& idd = parser.parse ("IdDictParser/ATLAS_IDS.xml"); + assert (hwid.initialize_from_dictionary (idd) == 0); + assert (tbid.initialize_from_dictionary (idd) == 0); + assert (tileid.initialize_from_dictionary (idd) == 0); + TileCablingService* svc = TileCablingService::getInstance(); + svc->setTileHWID (&hwid); + svc->setTileTBID (&tbid); + svc->setTileID (&tileid); + } +}; + + +void compare (const TileDigits& p1, + const TileDigits& p2) +{ + assert (p1.identify() == p2.identify()); + assert (p1.samples() == p2.samples()); +} + + +void testit (const TileDigits& trans1) +{ + MsgStream log (0, "test"); + TileDigitsCnv_p2 cnv; + TileDigits_p2 pers; + cnv.transToPers (&trans1, &pers, log); + TileDigits trans2; + cnv.persToTrans (&pers, &trans2, log); + + compare (trans1, trans2); +} + + +void test1() +{ + std::cout << "test1\n"; + + std::vector<float> digits {10., 200., 5000., 32000., -1.}; + TileDigits trans1 (hwid.adc_id (1, 2, 3, 0), digits); + + testit (trans1); +} + + +int main() +{ + TileCablingSvc::init_idhelpers(); + test1(); + return 0; +} diff --git a/TileCalorimeter/TileSvc/TileTPCnv/test/TileDigitsCnv_p3_test.cxx b/TileCalorimeter/TileSvc/TileTPCnv/test/TileDigitsCnv_p3_test.cxx new file mode 100644 index 0000000000000000000000000000000000000000..2ff8a689f5e8f6bf711a51416e3e3c2fc9c61129 --- /dev/null +++ b/TileCalorimeter/TileSvc/TileTPCnv/test/TileDigitsCnv_p3_test.cxx @@ -0,0 +1,86 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +// $Id$ +/** + * @file TileTPCnv/test/TileDigitsCnv_p3_test.cxx + * @author scott snyder <snyder@bnl.gov> + * @date Jan, 2016 + * @brief Tests for TileDigitsCnv_p3. + */ + + +#undef NDEBUG +#include "TileTPCnv/TileDigitsCnv_p3.h" +#include "TileConditions/TileCablingService.h" +#include "TileIdentifier/TileHWID.h" +#include "IdDictParser/IdDictParser.h" +#include "TestTools/initGaudi.h" +#include "GaudiKernel/MsgStream.h" +#include <cassert> +#include <iostream> + + +TileHWID hwid; +TileTBID tbid; +TileID tileid; + +class TileCablingSvc +{ +public: + static + void init_idhelpers() + { + tileid.set_do_neighbours (false); + IdDictParser parser; + IdDictMgr& idd = parser.parse ("IdDictParser/ATLAS_IDS.xml"); + assert (hwid.initialize_from_dictionary (idd) == 0); + assert (tbid.initialize_from_dictionary (idd) == 0); + assert (tileid.initialize_from_dictionary (idd) == 0); + TileCablingService* svc = TileCablingService::getInstance(); + svc->setTileHWID (&hwid); + svc->setTileTBID (&tbid); + svc->setTileID (&tileid); + } +}; + + +void compare (const TileDigits& p1, + const TileDigits& p2) +{ + assert (p1.identify() == p2.identify()); + assert (p1.samples() == p2.samples()); +} + + +void testit (const TileDigits& trans1) +{ + MsgStream log (0, "test"); + TileDigitsCnv_p3 cnv; + TileDigits_p3 pers; + cnv.transToPers (&trans1, &pers, log); + TileDigits trans2; + cnv.persToTrans (&pers, &trans2, log); + + compare (trans1, trans2); +} + + +void test1() +{ + std::cout << "test1\n"; + + std::vector<float> digits {4.125, 7.5, 32000.5, 12.001, -1. }; + TileDigits trans1 (hwid.adc_id (1, 2, 3, 0), digits); + + testit (trans1); +} + + +int main() +{ + TileCablingSvc::init_idhelpers(); + test1(); + return 0; +}