25 using namespace HcalObjRepresent;
52 :
ADataRepr(total), allContainers(allCont){}
59 void doFillIn(std::vector<TH2F> &graphData)
override{
61 HcalGainWidths::tAllContWithNames::const_iterator iter;
62 std::vector<HcalGainWidth>::const_iterator contIter;
66 for (iter = allContainers.begin(); iter != allContainers.end(); ++iter){
68 for (contIter = (*iter).second.begin(); contIter != (*iter).second.end(); ++contIter){
69 hcal_id =
HcalDetId((uint32_t)(*contIter).rawId());
71 depth = hcal_id.depth();
72 if (depth<1 || depth>4)
79 ieta>0 ? ++ieta : --ieta;
82 value = (*contIter).getValue(
id);
86 graphData[depth-1].Fill(ieta,iphi, value);
95 unsigned int totalValues = 4;
100 HcalGainWidths::tAllContWithNames::const_iterator iter;
101 std::vector<HcalGainWidth>::const_iterator contIter;
103 ss <<
"Total HCAL containers: " << allContainers.size() << std::endl;
105 typedef std::pair<std::pair< std::vector<float>, std::vector<float> >,
int> tPora;
107 std::vector<tPora> vec(allContainers.size());
109 std::vector<tPora>::iterator iMaz = vec.begin();
111 float sum = 0.0,
average = 0.0, std_dev = 0.0, sqr_sum = 0.0;
115 for (iter = allContainers.begin(), iMaz = vec.begin(); iter != allContainers.end(); ++iter, ++iMaz){
116 ss <<
"---------------------------------------------" << std::endl;
117 ss <<
"Detector: " << (*iter).first <<
"; Total values: "<< (*iter).second.size() << std::endl;
119 iMaz->second = (*iter).second.size();
120 (iMaz->first).
first = std::vector<float>(totalValues, 0.0);
121 (iMaz->first).
second = std::vector<float>(totalValues, 0.0);
122 float capValue = 0.0;
124 for (contIter = (*iter).second.begin(); contIter != (*iter).second.end(); ++contIter){
127 for (
unsigned int i = 0;
i < totalValues; ++
i){
128 capValue = (*contIter).getValue(
i);
129 (iMaz->first).
first[
i] += capValue;
130 (iMaz->first).
second[
i]+= (capValue * capValue);
137 size = (*iMaz).second;
138 for (
unsigned int i = 0;
i < totalValues; ++
i){
139 sum = ((*iMaz).first).
first[
i];
140 sqr_sum = ((*iMaz).first).
second[
i];
145 ss <<
" GainWidth " <<
i <<
" :"<< std::endl;
146 ss <<
" Average: " << average <<
"; "<< std::endl;
147 ss <<
" Standart deviation: " << std_dev <<
"; " << std::endl;
157 std::vector<int>
const&,
158 std::vector<float>
const& )
const
162 unsigned int numOfValues = 4;
169 datarepr.
rootname.str(
"_GainWidthrootvalue_");
170 datarepr.
plotname.str(
"GainWidthValue ");
172 datarepr.
filename << filename <<
"_GainWidth_";
174 typedef std::vector<TH2F> graphData;
175 std::vector< graphData > graphDataVec(numOfValues);
176 std::vector< graphData >::iterator imageIter;
179 for (imageIter = graphDataVec.begin(); imageIter != graphDataVec.end(); ++imageIter){
void doFillIn(std::vector< TH2F > &graphData) override
std::stringstream rootname
HcalGainWidthsDataRepr(unsigned int total, HcalGainWidths::tAllContWithNames const &allCont)
#define PYTHON_WRAPPER(_class, _name)
U second(std::pair< T, U > const &p)
std::stringstream plotname
HcalGainWidths::tAllContWithNames allContainers
void fillOneGain(std::vector< TH2F > &graphData, std::string units="")
std::stringstream filename
tuple size
Write out results.
std::vector< tHcalCont > tAllContWithNames