24 using namespace HcalObjRepresent;
57 HcalGains::tAllContWithNames::const_iterator iter;
58 std::vector<HcalGain>::const_iterator contIter;
60 ss <<
"Total HCAL containers: " << allContainers.size() << std::endl;
64 typedef std::pair<std::pair< std::vector<float>, std::vector<float> >,
int> tPora;
66 std::vector<tPora> vec(allContainers.size());
68 std::vector<tPora>::iterator iMaz = vec.begin();
70 float sum = 0.0,
average = 0.0, std_dev = 0.0, sqr_sum = 0.0;
74 for (iter = allContainers.begin(), iMaz = vec.begin(); iter != allContainers.end(); ++iter, ++iMaz){
75 ss <<
"---------------------------------------------" << std::endl;
76 ss <<
"Detector: " << (*iter).first <<
"; Total values: "<< (*iter).second.size() << std::endl;
80 iMaz->second = (*iter).second.size();
81 (iMaz->first).
first = std::vector<float>(4, 0.0);
82 (iMaz->first).
second = std::vector<float>(4, 0.0);
85 for (contIter = (*iter).second.begin(); contIter != (*iter).second.end(); ++contIter){
88 for (
int i = 0;
i < capIdSize; ++
i){
89 capValue = (*contIter).getValue(
i);
90 (iMaz->first).
first[
i] += capValue;
91 (iMaz->first).
second[
i]+= (capValue * capValue);
98 size = (*iMaz).second;
100 for (
int i = 0;
i < capIdSize; ++
i){
101 sum = ((*iMaz).first).
first[
i];
102 sqr_sum = ((*iMaz).first).
second[
i];
105 ss <<
" Gain " <<
i <<
" :"<< std::endl;
106 ss <<
" Average: " << average <<
"; "<< std::endl;
107 ss <<
" Standart deviation: " << std_dev <<
"; " << std::endl;
116 gStyle->SetPalette(1);
117 const Int_t NCont = 999;
118 gStyle->SetNumberContours(NCont);
119 TCanvas
canvas(
"CC map",
"CC map",840,369*4);
121 TPad pad1(
"pad1",
"pad1", 0.0, 0.75, 1.0, 1.0);
123 TPad pad2(
"pad2",
"pad2", 0.0, 0.5, 1.0, 0.75);
125 TPad pad3(
"pad3",
"pad3", 0.0, 0.25, 1.0, 0.5);
127 TPad pad4(
"pad4",
"pad4", 0.0, 0.0, 1.0, 0.25);
132 graphData[0].SetStats(0);
133 graphData[0].Draw(
"colz");
136 graphData[1].SetStats(0);
137 graphData[1].Draw(
"colz");
140 graphData[2].SetStats(0);
141 graphData[2].Draw(
"colz");
144 graphData[3].SetStats(0);
145 graphData[3].Draw(
"colz");
147 canvas.SaveAs(filename.c_str());
153 std::vector<int>
const&,
154 std::vector<float>
const& )
const
157 unsigned int numOfValues = 4;
162 typedef std::vector<TH2F> graphData;
163 std::vector< graphData > graphDataVec(numOfValues);
164 std::vector< graphData >::iterator bigIter;
166 std::stringstream ss, plotname_i;
170 for (bigIter = graphDataVec.begin(); bigIter != graphDataVec.end(); ++bigIter){
171 plotname_i << plotname <<
i ;
172 ss << filename <<
"_Gain_"<<i<<
".png";
173 fillOneGain((*bigIter), allContainers, plotname_i.str(),
i);
175 draw((*bigIter), ss.str());
void draw(std::vector< TH2F > &graphData, std::string filename)
#define PYTHON_WRAPPER(_class, _name)
U second(std::pair< T, U > const &p)
void fillOneGain(std::vector< TH2F > &graphData, HcalGains::tAllContWithNames &allContainers, std::string name, int id, std::string units="")
void FillUnphysicalHEHFBins(std::vector< TH2F > &hh)
tuple size
Write out results.
std::vector< tHcalCont > tAllContWithNames