25 using namespace HcalObjRepresent;
52 :
ADataRepr(total), allContainers(allCont){}
59 void doFillIn(std::vector<TH2F> &graphData)
override{
61 HcalLutMetadata::tAllContWithNames::const_iterator iter;
62 std::vector<HcalLutMetadatum>::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;
84 value = (*contIter).getRCalib();
87 value = (*contIter).getLutGranularity();
90 value = (*contIter).getOutputLutThreshold();
93 throw(
"Trying to access not existing value!");
100 graphData[depth-1].Fill(ieta,iphi, value);
108 std::stringstream ss;
110 unsigned int totalValues = 3;
116 HcalLutMetadata::tAllContWithNames::const_iterator iter;
117 std::vector<HcalLutMetadatum>::const_iterator contIter;
119 ss <<
"Total HCAL containers: " << allContainers.size() << std::endl;
121 typedef std::pair<std::pair< std::vector<float>, std::vector<float> >,
int> tPora;
123 std::vector<tPora> vec(allContainers.size());
125 std::vector<tPora>::iterator iMaz = vec.begin();
127 float sum = 0.0,
average = 0.0, std_dev = 0.0, sqr_sum = 0.0;
131 for (iter = allContainers.begin(), iMaz = vec.begin(); iter != allContainers.end(); ++iter, ++iMaz){
132 ss <<
"---------------------------------------------" << std::endl;
133 ss <<
"Detector: " << (*iter).first <<
"; Total values: "<< (*iter).second.size() << std::endl;
135 iMaz->second = (*iter).second.size();
136 (iMaz->first).
first = std::vector<float>(totalValues, 0.0);
137 (iMaz->first).
second = std::vector<float>(totalValues, 0.0);
138 float capValue = 0.0;
140 for (contIter = (*iter).second.begin(); contIter != (*iter).second.end(); ++contIter){
143 for (
unsigned int i = 0;
i < totalValues; ++
i){
148 capValue = (*contIter).getRCalib();
151 capValue = (*contIter).getLutGranularity();
154 capValue = (*contIter).getOutputLutThreshold();
157 throw(
"Trying to access not existing value!");
161 (iMaz->first).
first[
i] += capValue;
162 (iMaz->first).
second[
i]+= (capValue * capValue);
169 size = (*iMaz).second;
170 for (
unsigned int i = 0;
i < totalValues; ++
i){
171 sum = ((*iMaz).first).
first[
i];
172 sqr_sum = ((*iMaz).first).
second[
i];
179 ss <<
" LutMetadata RecHit calibration:"<< std::endl;
182 ss <<
" LutMetadata LUT granularity:"<< std::endl;
185 ss <<
" LutMetadata output LUT threshold :"<< std::endl;
188 throw(
"Trying to access not existing value!");
191 ss <<
" Average: " << average <<
"; "<< std::endl;
192 ss <<
" Standart deviation: " << std_dev <<
"; " << std::endl;
202 std::vector<int>
const&,
203 std::vector<float>
const& )
const
207 unsigned int numOfValues = 3;
214 datarepr.
rootname.str(
"_LutMetadatumrootvalue_");
215 datarepr.
plotname.str(
"LutMetadatumValue ");
217 datarepr.
filename << filename <<
"_LutMetadatum_";
219 typedef std::vector<TH2F> graphData;
220 std::vector< graphData > graphDataVec(numOfValues);
221 std::vector< graphData >::iterator imageIter;
223 for (imageIter = graphDataVec.begin(); imageIter != graphDataVec.end(); ++imageIter){
226 datarepr.
rootname.str(
"_RCalibrootvalue_");
229 datarepr.
filename << filename <<
"_RCalib_";
232 datarepr.
rootname.str(
"_LutGranularityrootvalue_");
233 datarepr.
plotname.str(
"LutGranularity ");
235 datarepr.
filename << filename <<
"_LutGranularity_";
238 datarepr.
rootname.str(
"_OutputLutThresholdrootvalue_");
239 datarepr.
plotname.str(
"OutputLutThreshold ");
241 datarepr.
filename << filename <<
"_OutputLutThreshold_";
244 throw(
"Trying to access not existing value!");
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="")
std::stringstream filename
tuple size
Write out results.
std::vector< tHcalCont > tAllContWithNames