25 using namespace HcalObjRepresent;
52 :
ADataRepr(total), allContainers(allCont){}
59 void doFillIn(std::vector<TH2F> &graphData)
override{
61 HcalPedestals::tAllContWithNames::const_iterator iter;
62 std::vector<HcalPedestal>::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 = 8;
100 HcalPedestals::tAllContWithNames::const_iterator iter;
101 std::vector<HcalPedestal>::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];
144 ss <<
" PedestalWidth " << (
i - 4) <<
" :"<< std::endl;
145 ss <<
" Average: " << average <<
"; "<< std::endl;
146 ss <<
" Standart deviation: " << std_dev <<
"; " << std::endl;
149 ss <<
" Pedestal " <<
i <<
" :"<< std::endl;
150 ss <<
" Average: " << average <<
"; "<< std::endl;
151 ss <<
" Standart deviation: " << std_dev <<
"; " << std::endl;
162 std::vector<int>
const&,
163 std::vector<float>
const& )
const
167 unsigned int numOfValues = 8;
174 datarepr.
rootname.str(
"_Pedestalrootvalue_");
175 datarepr.
plotname.str(
"PedestalValue ");
177 datarepr.
filename << filename <<
"_Pedestal_";
179 typedef std::vector<TH2F> graphData;
180 std::vector< graphData > graphDataVec(numOfValues);
181 std::vector< graphData >::iterator imageIter;
184 for (imageIter = graphDataVec.begin(); imageIter != graphDataVec.end(); ++imageIter){
185 if (datarepr.
nr == 4){
187 datarepr.
rootname.str(
"_PedestalWidthrootname_");
188 datarepr.
plotname.str(
"PedestalWidth ");
190 datarepr.
filename << filename <<
"_PedestalWidth_";
std::stringstream rootname
void doFillIn(std::vector< TH2F > &graphData) override
#define PYTHON_WRAPPER(_class, _name)
HcalPedestalsDataRepr(unsigned int total, HcalPedestals::tAllContWithNames const &allCont)
U second(std::pair< T, U > const &p)
int depth() const
get the tower depth
HcalPedestals::tAllContWithNames allContainers
std::stringstream plotname
void fillOneGain(std::vector< TH2F > &graphData, std::string units="")
std::stringstream filename
tuple size
Write out results.
std::vector< tHcalCont > tAllContWithNames