25 using namespace HcalObjRepresent;
58 :
ADataRepr(total), allContainers(allCont), fCapId(0), fRange(0), slopeOrOffset(
false){}
66 HcalQIEData::tAllContWithNames::const_iterator iter;
67 std::vector<HcalQIECoder>::const_iterator contIter;
71 for (iter = allContainers.begin(); iter != allContainers.end(); ++iter){
73 for (contIter = (*iter).second.begin(); contIter != (*iter).second.end(); ++contIter){
74 hcal_id =
HcalDetId((uint32_t)(*contIter).rawId());
76 depth = hcal_id.
depth();
77 if (depth<1 || depth>4)
84 ieta>0 ? ++ieta : --ieta;
89 value = (*contIter).slope(fCapId, fRange);
91 value = (*contIter).offset(fCapId, fRange);
96 graphData[depth-1].Fill(ieta,iphi, value);
104 int tens = 0, ones = 0;
109 ones = numer - (tens*
base);
110 formated_nr = tens*10 + ones;
111 std::stringstream ss;
118 std::stringstream ss;
123 HcalQIEData::tAllContWithNames::const_iterator iter;
124 std::vector<HcalQIECoder>::const_iterator contIter;
126 ss <<
"Total HCAL containers: " << allContainers.size() << std::endl;
128 typedef std::pair<std::pair< float, float >,
int> tPora;
133 std::vector<tPora> vOffsets(allContainers.size());
134 std::vector<tPora> vSlopes(allContainers.size());
136 std::vector<tPora>::iterator iOffset = vOffsets.begin();
137 std::vector<tPora>::iterator iSlope = vSlopes.begin();
144 for (iter = allContainers.begin(); iter != allContainers.end(); ++iter, ++iOffset, ++iSlope){
145 iOffset->second = (*iter).second.size();
146 iSlope->second = (*iter).second.size();
148 (iOffset->first).
first = .0;
149 (iOffset->first).
second = .0;
150 (iSlope->first).
first = .0;
151 (iSlope->first).
second = .0;
155 for (contIter = (*iter).second.begin(); contIter != (*iter).second.end(); ++contIter){
158 for (
unsigned int fCapId = 0; fCapId < 4; ++fCapId){
159 for (
unsigned int fRange = 0; fRange < 4; ++fRange){
160 offset = (*contIter).offset (fCapId, fRange);
161 (iOffset->first).
first += offset;
162 (iOffset->first).
second+= (offset * offset);
164 slope = (*contIter).slope (fCapId, fRange);
165 (iSlope->first).
first += slope;
166 (iSlope->first).
second+= (slope * slope);
176 iOffset = vOffsets.begin();
177 iSlope = vSlopes.begin();
178 float sumOffset = 0.0, averageOffset = 0.0, std_devOffset = 0.0, sqr_sumOffset = 0.0;
181 float sumSlope = 0.0, averageSlope = 0.0, std_devSlope = 0.0, sqr_sumSlope = 0.0;
184 sizeOffset = (*iOffset).second;
185 sizeSlope = (*iSlope).second;
190 for (iter = allContainers.begin(); iter != allContainers.end(); ++iter, ++
i, ++iSlope, ++iOffset){
192 ss <<
"---------------------------------------------" << std::endl;
193 ss <<
"Detector: " << (*iter).first <<
"; Total values: "<< (*iter).second.size() << std::endl;
194 sumOffset = ((*iOffset).first).
first;
195 sqr_sumOffset = ((*iOffset).first).
second;
196 averageOffset = sumOffset/sizeOffset;
198 std_devOffset =
sqrt( fabs((sqr_sumOffset / sizeOffset) - (averageOffset * averageOffset)) );
200 sumSlope = ((*iSlope).first).
first;
201 sqr_sumSlope = ((*iSlope).first).
second;
202 averageSlope = sumSlope/sizeSlope;
204 std_devSlope =
sqrt( fabs((sqr_sumSlope / sizeSlope) - (averageSlope * averageSlope)) );
206 ss <<
" Offset: " << std::endl;
207 ss <<
" Average: " << averageOffset <<
"; "<< std::endl;
208 ss <<
" Standart deviation: " << std_devOffset <<
"; " << std::endl;
209 ss <<
" Slope: " << std::endl;
210 ss <<
" Average: " << averageSlope <<
"; "<< std::endl;
211 ss <<
" Standart deviation: " << std_devSlope <<
"; " << std::endl;
220 std::vector<int>
const&,
221 std::vector<float>
const& )
const
225 unsigned int numOfValues = 32;
230 typedef std::vector<TH2F> graphData;
231 std::vector< graphData > graphDataVec(numOfValues);
232 std::vector< graphData >::iterator imageIter;
233 imageIter = graphDataVec.begin();
240 datarepr.
rootname.str(
"_Offsetrootvalue_");
247 for (
unsigned int fCapId = 0; fCapId < 4; ++fCapId){
248 for (
unsigned int fRange = 0; fRange < 4; ++fRange){
254 if (datarepr.
nr == 0){
256 datarepr.
filename << filename << name <<
"0";
257 }
else if ( datarepr.
nr == 10)
275 datarepr.
rootname.str(
"_Sloperootname_");
284 for (
unsigned int fCapId = 0; fCapId < 4; ++fCapId){
285 for (
unsigned int fRange = 0; fRange < 4; ++fRange){
291 if (datarepr.
nr == 0){
293 datarepr.
filename << filename << name <<
"0";
294 }
else if ( datarepr.
nr == 10)
std::stringstream rootname
static const double slope[3]
#define PYTHON_WRAPPER(_class, _name)
HcalQIEDataDataRepr(unsigned int total, HcalQIEData::tAllContWithNames const &allCont)
U second(std::pair< T, U > const &p)
int depth() const
get the tower depth
std::stringstream plotname
unsigned int offset(bool)
void doFillIn(std::vector< TH2F > &graphData)
void fillOneGain(std::vector< TH2F > &graphData, std::string units="")
std::stringstream filename
HcalQIEData::tAllContWithNames allContainers
std::string QIEDataCounter(const int nr, unsigned int &formated_nr, int base=4)
std::vector< tHcalCont > tAllContWithNames