2#include "HltDataTypes/EFResult.h"
18 if(
vec.size()+pos>54) {
19 std::cout <<
"***EFResult:EFResult(): vector size error!" << std::endl;
23 for(
unsigned int i=0;i<54;++i){
24 if(i<pos||i>=
vec.size()+pos) m_efVec.push_back(0);
25 else m_efVec.push_back(
vec[i-pos]);
57 if(pos>=m_efVec.size())
return 0;
58 else return m_efVec[pos];
62 if(m_efVec.size()>0&&m_efVec.size()<54)
return false;
63 if(m_efVec.size()==0) m_efVec.resize(54,0);
64 m_efVec.push_back(val);
70 if(pos>=54)
return false;
71 if(m_efVec.size()!=0&&m_efVec.size()<54){
72 std::cout <<
"EFResult::appToEFVec-->size error!" <<std::endl;
74 if(m_efVec.size()==0) m_efVec.resize(54,0);
76 float *
f=(
float*)&m_efVec[pos];
83 if(pos>=54)
return false;
84 if(m_efVec.size()!=0&&m_efVec.size()<54){
85 std::cout <<
"EFResult::addToEFVec-->size error!" <<std::endl;
87 if(m_efVec.size()==0) m_efVec.resize(54,0);
96 if(vecpos>=54)
return false;
97 if(bend>=32||bbegin>bend)
return false;
98 if(m_efVec.size()==0) m_efVec.resize(54,0);
99 uint32_t bits=0xFFFFFFFF>>(31-bend+bbegin);
100 m_efVec[vecpos]&= (~((bits)<<bbegin));
101 m_efVec[vecpos]|= (val&bits)<<bbegin;
107 if(vecpos>=54)
return false;
108 if(bitpos>=32)
return false;
109 if(m_efVec.size()==0) m_efVec.resize(54,0);
110 if(val) m_efVec[vecpos]|=(1<<bitpos);
111 else m_efVec[vecpos]&=(~(1<<bitpos));
119 std::vector<std::string>::iterator itVs = m_answerVector.begin();
120 std::vector<std::string>::iterator endVs = m_answerVector.end();
121 for (;itVs != endVs && m_answerIndex == -1; ++itVs) {
122 if (*itVs == answer) {
123 m_answerIndex = iCount;
137 std::vector<std::string>::iterator itVs = m_answerVector.begin();
138 std::vector<std::string>::iterator endVs = m_answerVector.end();
139 for (;itVs != endVs && m_answerIndex == -1; ++itVs) {
140 if (*itVs == answer) {
141 m_midanswerIndex = iCount;
156 m_midanswerIndex = -1;
157 if(m_efVec.size()>=54){
158 m_efVec.resize(54,0);
159 for(
unsigned int i=0;i<m_efVec.size();++i) m_efVec[i]=0;
161 else if(m_efVec.size()!=0){
162 std::cout <<
"EFResult::reset(): m_efVec size check error!"<<std::endl;
bool addToEFVec(uint32_t val, uint32_t pos)
const std::string getAnswer() const
const int getMidAnswerIndex() const
static const CLID & classID()
void setAnswer(std::string &answer)
bool appToEFVec(double val, uint32_t pos)
const int getAnswerIndex() const
void setMidAnswer(std::string &answer)
const std::string getMidAnswer() const
virtual const CLID & clID() const
bool setVecBit(uint32_t val, uint32_t vecpos, uint32_t bbegin, uint32_t bend)
const std::vector< uint32_t > getEFVec() const
bool push_back(uint32_t val)
TFile f("ana_bhabha660a_dqa_mcPat_zy_old.root")