7#include "Identifier/Identifier.h"
19#include "GaudiKernel/ServiceHandle.h"
28 if (detStore->retrieve (
m_cellIdHelper,
"CaloCell_ID").isFailure()) {
29 throw std::runtime_error (
"LArHitContainerCnv_p2: Can't get CaloCell_ID");
37 size_t size = transCont->
size();
38 log << MSG::DEBUG <<
" *** Writing LArHitContainer_p2 of size:"<<size<<
endmsg;
41 std::vector<float> tempE; tempE.reserve(size);
42 std::vector<float> tempT; tempT.reserve(size);
46 std::multimap <unsigned int, unsigned int> map_hashPositions;
48 for (
unsigned int w=0;w<size;++w){
50 map_hashPositions.insert(std::pair<unsigned int, int>((
unsigned int)hashId, w));
55 std::multimap<unsigned int, unsigned int>::const_iterator iter;
58 for (iter=map_hashPositions.begin(); iter != map_hashPositions.end(); ++iter) {
60 unsigned int pHash=(iter->first)-old;
62 unsigned int pos=iter->second;
64 tempE.push_back( (
float) (transCont->
At(pos))->energy() );
65 tempT.push_back( (
float) (transCont->
At(pos))->time() );
74 B.reduceToUS(tempT, persCont->
m_time);
86 log << MSG::DEBUG <<
" *** Reading LArHitContainer of size: "<<cells<<
endmsg;
93 std::vector<float> tempE; tempE.reserve(cells);
94 std::vector<float> tempT; tempT.reserve(cells);
96 A.expandFromUStoFloat(persCont->
m_time,tempT);
97 A.expandToFloat(persCont->
m_energy,tempE);
99 for (
unsigned int i=0;i<cells;++i){
104 tempE[i] != 0 ? (
double)(tempT[i])/tempE[i] : 0);
boost::transform_iterator< make_const, typename CONT::const_iterator > const_iterator
void reserve(size_type n)
void setName(const std::string &name)
const T * At(unsigned int pos) const
const_iterator begin() const
const std::string & Name() const
This is a "hash" representation of an Identifier.
virtual void persToTrans(const LArHitContainer_p2 *persColl, LArHitContainer *transColl, MsgStream &log) override
const CaloCell_ID * m_cellIdHelper
virtual void transToPers(const LArHitContainer *transColl, LArHitContainer_p2 *persColl, MsgStream &log) override
Persistent represenation of a LArHitContainer,.
std::vector< unsigned int > m_channelHash
std::vector< unsigned int > m_energy
const std::string & name() const
std::vector< unsigned short > m_time
Class to store hit energy and time in LAr cell from G4 simulation.
hold the test vectors and ease the comparison