13#include "Identifier/Identifier.h"
21 size_t size = transCont->
size();
22 if (log.level() <= MSG::DEBUG)
24 <<
" *** Writing SrCaloCalibrationHitContainer_p1 of size: " << size
28 std::vector<float> tempE;
29 tempE.reserve(size * 4);
30 std::vector<unsigned int> tempPID;
31 tempPID.reserve(size);
34 std::multimap<unsigned long long, unsigned int>
37 for (
unsigned int w = 0; w < size; ++w) {
38 unsigned long long id = (*it)->cellID().get_compact();
39 map_hashPositions.insert(std::pair<unsigned long long, int>(
id, w));
43 std::multimap<unsigned long long, unsigned int>::const_iterator iter;
44 unsigned long long old = 0;
46 for (iter = map_hashPositions.begin(); iter != map_hashPositions.end();
48 unsigned long long pHash = (iter->first) - old;
50 unsigned int pos = iter->second;
53 tempE.push_back(
static_cast<float>(hit.
energyEM()));
54 tempE.push_back(
static_cast<float>(hit.
energyNonEM()));
57 tempPID.push_back(
static_cast<unsigned int>(hit.
particleID()));
63 persCont->
m_energy = std::move(tempE);
72 if (log.level() <= MSG::DEBUG)
74 <<
" *** Reading SrCaloCalibrationHitContainer of size: " << cells
83 const std::vector<float>& tempE = persCont->
m_energy;
87 unsigned long long sum = 0;
88 for (
unsigned int i = 0; i < cells; ++i) {
91 static_cast<Identifier>(sum), tempE[i * 4], tempE[i * 4 + 1],
92 tempE[i * 4 + 2], tempE[i * 4 + 3],
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
Class to store calorimeter calibration hit.
double energyNonEM() const
double energyEscaped() const
double energyInvisible() const
virtual void transToPers(const SrCaloCalibrationHitContainer *transColl, SrCaloCalibrationHitContainer_p1 *persColl, MsgStream &log)
virtual void persToTrans(const SrCaloCalibrationHitContainer_p1 *persColl, SrCaloCalibrationHitContainer *transColl, MsgStream &log)
std::vector< unsigned int > m_particleID
std::vector< unsigned long long > m_channelHash
const std::string & name() const
std::vector< float > m_energy
constexpr int INVALID_PARTICLE_ID