19 using namespace HcalObjRepresent;
46 :
ADataRepr(total), allContainers(allCont){}
53 void doFillIn(std::vector<TH2F> &graphData)
override{
55 HcalZSThresholds::tAllContWithNames::const_iterator iter;
56 std::vector<HcalZSThreshold>::const_iterator contIter;
60 for (iter = allContainers.begin(); iter != allContainers.end(); ++iter){
62 for (contIter = (*iter).second.begin(); contIter != (*iter).second.end(); ++contIter){
63 hcal_id =
HcalDetId((uint32_t)(*contIter).rawId());
65 depth = hcal_id.
depth();
66 if (depth<1 || depth>4)
73 ieta>0 ? ++ieta : --ieta;
76 value = (*contIter).getValue();
80 graphData[depth-1].Fill(ieta,iphi, value);
89 unsigned int totalValues = 1;
94 HcalZSThresholds::tAllContWithNames::const_iterator iter;
95 std::vector<HcalZSThreshold>::const_iterator contIter;
97 ss <<
"Total HCAL containers: " << allContainers.size() << std::endl;
99 typedef std::pair<std::pair< std::vector<float>, std::vector<float> >,
int> tPora;
101 std::vector<tPora> vec(allContainers.size());
103 std::vector<tPora>::iterator iMaz = vec.begin();
105 float sum = 0.0,
average = 0.0, std_dev = 0.0, sqr_sum = 0.0;
109 for (iter = allContainers.begin(), iMaz = vec.begin(); iter != allContainers.end(); ++iter, ++iMaz){
110 ss <<
"---------------------------------------------" << std::endl;
111 ss <<
"Detector: " << (*iter).first <<
"; Total values: "<< (*iter).second.size() << std::endl;
113 iMaz->second = (*iter).second.size();
114 (iMaz->first).
first = std::vector<float>(totalValues, 0.0);
115 (iMaz->first).
second = std::vector<float>(totalValues, 0.0);
118 for (contIter = (*iter).second.begin(); contIter != (*iter).second.end(); ++contIter){
121 for (
unsigned int i = 0;
i < totalValues; ++
i){
122 capValue = (*contIter).getValue();
123 (iMaz->first).
first[
i] += capValue;
124 (iMaz->first).
second[
i]+= (capValue * capValue);
131 size = (*iMaz).second;
132 for (
unsigned int i = 0;
i < totalValues; ++
i){
133 sum = ((*iMaz).first).
first[
i];
134 sqr_sum = ((*iMaz).first).
second[
i];
139 ss <<
" ZSThreshold " <<
" :"<< std::endl;
140 ss <<
" Average: " << average <<
"; "<< std::endl;
141 ss <<
" Standart deviation: " << std_dev <<
"; " << std::endl;
152 std::vector<int>
const&,
153 std::vector<float>
const& )
const
157 unsigned int numOfValues = 1;
164 datarepr.
rootname.str(
"_ZSThresholdrootvalue_");
165 datarepr.
plotname.str(
"ZSThreshold ");
167 datarepr.
filename << filename <<
"";
169 typedef std::vector<TH2F> graphData;
170 std::vector< graphData > graphDataVec(numOfValues);
171 std::vector< graphData >::iterator imageIter;
174 for (imageIter = graphDataVec.begin(); imageIter != graphDataVec.end(); ++imageIter){
void doFillIn(std::vector< TH2F > &graphData) override
std::stringstream rootname
#define PYTHON_WRAPPER(_class, _name)
U second(std::pair< T, U > const &p)
int depth() const
get the tower depth
std::stringstream plotname
void fillOneGain(std::vector< TH2F > &graphData, std::string units="")
HcalZSThresholds::tAllContWithNames allContainers
std::stringstream filename
HcalZSThresholdsDataRepr(unsigned int total, HcalZSThresholds::tAllContWithNames const &allCont)
tuple size
Write out results.
std::vector< tHcalCont > tAllContWithNames