30 unsigned int l1 = transObj->
sumEVec().size();
31 unsigned int l2 = transObj->
eta().size();
32 unsigned int l3 = transObj->
val().size();
33 unsigned int l4 = transObj->
qual().size();
35 if (l1>15 || l2>15 || l3>15 || l4>15) {
36 log << MSG::ERROR <<
"TOO BIG SIZE IN TileL2Cnv_p2::transToPers !!! "
48 persObj->
m_fval.reserve(l1+4*l2);
49 persObj->
m_ival.reserve(l3+l4);
54 for (
float f : transObj->
sumEVec()) {
55 persObj->
m_fval.push_back( f );
56 if (fabs(f) > 1.e-6) allzeros=
false;
65 persObj->
m_ID = (l1<<28) | (l2<<24) | (l3<<20) | (l4<<16) | (transObj->
identify() & 0xFFFF);
70 transObj->
eta().begin(),
71 transObj->
eta().end());
75 transObj->
enemu0().begin(),
81 transObj->
enemu1().begin(),
86 transObj->
enemu2().begin(),
89 if (l1 + 4*l2 != persObj->
m_fval.size()) {
90 log << MSG::ERROR <<
"WRONG SIZE IN TileL2Cnv_p2::transToPers !!! "
93 <<
"(" << transObj->
eta().size()
94 <<
"," << transObj->
enemu0().size()
95 <<
"," << transObj->
enemu1().size()
96 <<
"," << transObj->
enemu2().size()
97 <<
") f_size=" << persObj->
m_fval.size()
104 transObj->
val().begin(),
105 transObj->
val().end());
109 transObj->
qual().begin(),
110 transObj->
qual().end());
115 std::cout <<
"pers TileL2 0x"<< std::hex << persObj->
m_ID <<
" " << std::dec;
116 for (
unsigned int i=0; i<persObj->
m_fval.size(); ++i)
117 std::cout << persObj->
m_fval[i] <<
" ";
118 for (
unsigned int i=0; i<persObj->
m_ival.size(); ++i)
119 std::cout <<
" " << persObj->
m_ival[i];
120 std::cout << std::endl;
127 unsigned int l0 = persObj->
m_ID;
130 *transObj =
TileL2 (l0 & 0xFFFF);
132 unsigned int l1 = (l0 >> 28) & 0xF;
133 unsigned int l2 = (l0 >> 24) & 0xF;
134 unsigned int l3 = (l0 >> 20) & 0xF;
135 unsigned int l4 = (l0 >> 16) & 0xF;
137 std::vector<float>::const_iterator it = persObj->
m_fval.begin();
138 std::vector<unsigned int>::const_iterator iti = persObj->
m_ival.begin();
140 if (l1 + 4*l2 != persObj->
m_fval.size() || l3+l4 != persObj->
m_ival.size()) {
141 log << MSG::ERROR <<
"WRONG SIZE IN TileL2Cnv_p2::persToTrans !!! "
142 <<
" id=0x" << MSG::hex << l0 << MSG::dec
143 <<
" f_size=" << persObj->
m_fval.size()
144 <<
" i_size=" << persObj->
m_ival.size()
149 std::vector<float> sumE;
150 if (l1>2 || l3 == 2*l2 ) {
151 sumE.assign (it, it+l1); it += l1;
157 log << MSG::INFO <<
"Old format detected in TileL2Cnv_p2::persToTrans"
168 sumE[0] = (*iti++)-9000.;
178 transObj->
setEt (std::move(sumE));
181 std::vector<float>
eta (it, it+l2); it += l2;
183 std::vector<float> enemu0 (it, it+l2); it += l2;
185 std::vector<float> enemu1 (it, it+l2); it += l2;
187 std::vector<float> enemu2 (it, it+l2); it += l2;
190 std::vector<unsigned int> val (iti, iti+l3); iti += l3;
193 std::vector<unsigned int> qual (iti, iti+l4); iti += l4;
204 std::cout <<
"pers TileL2 0x"<< std::hex << persObj->
m_ID <<
" " << std::dec;
205 for (
unsigned int i=0; i<persObj->
m_fval.size(); ++i)
206 std::cout << persObj->
m_fval[i] <<
" ";
207 for (
unsigned int i=0; i<persObj->
m_ival.size(); ++i)
208 std::cout <<
" " << persObj->
m_ival[i];
209 std::cout << std::endl;
Scalar eta() const
pseudorapidity method
static std::atomic< bool > old_format_print
virtual void persToTrans(const TileL2_p2 *persObj, TileL2 *transObj, MsgStream &log) const override
Method creating the transient representation TileL2 from its persistent representation TileL2_p2.
virtual void transToPers(const TileL2 *transObj, TileL2_p2 *persObj, MsgStream &log) const override
Method creating the persistent representation TileL2_p2 from its transient representation TileL2.
std::vector< unsigned int > m_ival
std::vector< float > m_fval
Class to store TileMuId and Et quantities computed at the TileCal ROD DSPs.
float enemu1(unsigned int ind) const
Return energy deposited in central layer (BC cells)
void setMu(const std::vector< float > &eta, const std::vector< float > &enemu0, const std::vector< float > &enemu1, const std::vector< float > &enemu2, const std::vector< unsigned int > &qual, const std::vector< unsigned int > &val)
Set Muon Info in TileL2.
int identify(void) const
Return Identifier.
void setEt(std::vector< float > &&sumE)
Set sumE vector in TileL2.
const std::vector< float > & sumEVec() const
unsigned int val(unsigned int i) const
Return Data.
void print(void) const
Printing for debugging.
float enemu2(unsigned int ind) const
Return energy deposited in outermost layer (D cells)
unsigned int qual(unsigned int ind) const
Return quality flag (0 or 1): set to 0 if the "energy deposition path" is MIP like in all three sampl...
float enemu0(unsigned int ind) const
Return energy deposited in innermost layer (A cells)
float eta(unsigned int ind) const
Return eta (computed as the average of the eta values of the TileCal cells where the muon goes throug...