1 #ifndef HcalObjRepresent_h 2 #define HcalObjRepresent_h 32 #include "TPaveLabel.h" 38 template<
class Items,
class Item>
48 typedef std::tuple<int, int, int>
Coord;
51 typedef std::map< std::pair< std::string, int >, TH2F* >
DepthMap;
81 std::vector<Item> itemsVec;
82 std::pair<std::string,int> depthKey;
83 const char* histLabel;
84 for(std::pair<
std::string, std::vector<Item> > cont : (*payload_).getAllContainers()){
85 subDetName = std::get<0>(cont);
86 itemsVec = std::get<1>(cont);
90 for(Item item : itemsVec){
94 depth = detId.
depth();
95 Coord coord = std::make_tuple(depth,ieta,iphi);
97 if(subDetName[0] ==
'H' && depth != 0){
98 valContainer->insert( std::pair<std::tuple<int,int,int>,Item>(coord,item));
101 depthKey = std::make_pair(subDetName, depth);
103 auto depthVal =
depths_.find(depthKey);
105 histLabel = (
"run" + std::to_string(
run_) +
"_" + subDetName +
"_d" + std::to_string(depth)).c_str();
106 depths_.insert(std::make_pair(std::make_pair(subDetName, depth),
new TH2F(histLabel,histLabel, 83, -42.5, 41.5, 71, 0.5, 71.5)));
126 Item* cell =
nullptr;
127 Coord coord = std::make_tuple(depth,ieta,iphi);
130 auto it = valContainer->find(coord);
131 if (it != valContainer->end()) cell = &it->second;
136 <<
"Unavailable Conditions of type " <<
payload_->myname() <<
" for cell " << subDetName <<
" (" << depth <<
", " << ieta <<
", " << iphi <<
")";
158 DepthMap::iterator depth1;
159 std::pair<std::string,int>
key;
161 DepthMap theirDepths = dataCont2->
GetDepths();
162 for(depth1 = myDepths.begin(); depth1 != myDepths.end(); depth1++){
164 if(theirDepths.count(key) != 0) {
165 myDepths.at(key)->Divide((
const TH1*)theirDepths.at(key));
167 throw cms::Exception (
"Unaligned Conditions") <<
"trying to plot conditions for " <<
payload_->myname() <<
"; found value for " << std::get<0>(
key) <<
" depth " << std::to_string(std::get<1>(key)) <<
" in run " <<
GetRun() <<
" but not in run " << dataCont2->
GetRun();
177 DepthMap::iterator depth1;
178 std::pair<std::string,int>
key;
180 DepthMap theirDepths = dataCont2->
GetDepths();
181 for(depth1 = myDepths.begin(); depth1 != myDepths.end(); depth1++){
183 if(theirDepths.count(key) != 0) {
184 myDepths.at(key)->Add(myDepths.at(key), theirDepths.at(key), 1, -1);
186 throw cms::Exception (
"Unaligned Conditions") <<
"trying to plot conditions for " <<
payload_->myname() <<
"; found value for " << std::get<0>(
key) <<
" depth " << std::to_string(std::get<1>(key)) <<
" in run " <<
GetRun() <<
" but not in run " << dataCont2->
GetRun();
197 Double_t adjustMin = 1; Double_t tempMin;
198 int nBinsX = hist->GetXaxis()->GetNbins();
int nBinsY = hist->GetYaxis()->GetNbins();
199 for(
int i = 0;
i < nBinsX;
i++) {
200 for(
int j = 0; j < nBinsY; j++) {
201 tempMin = hist->GetBinContent(
i,j);
202 if((tempMin != 0) && (tempMin < adjustMin)) adjustMin = tempMin;
205 amp =
std::max((1 - adjustMin),(hist->GetMaximum() - 1) );
207 return std::make_pair( 1 - amp, 1 + amp);
211 amp =
std::max((0 - hist->GetMinimum()),hist->GetMaximum() );
212 return std::make_pair( (-1 * amp), amp);
215 Double_t adjustMin = 10000; Double_t tempMin;
216 int nBinsX = hist->GetXaxis()->GetNbins();
int nBinsY = hist->GetYaxis()->GetNbins();
217 for(
int i = 0;
i < nBinsX;
i++) {
218 for(
int j = 0; j < nBinsY; j++) {
219 tempMin = hist->GetBinContent(
i,j);
220 if((tempMin != 0) && (tempMin < adjustMin)) adjustMin = tempMin;
223 return std::make_pair(((adjustMin==10000) ? hist->GetMinimum() : adjustMin), hist->GetMaximum());
230 gStyle->SetOptStat(0);
231 gStyle->SetPalette(1);
232 gStyle->SetOptFit(0);
233 gStyle->SetLabelFont(42);
234 gStyle->SetLabelFont(42);
235 gStyle->SetTitleFont(42);
236 gStyle->SetTitleFont(42);
237 gStyle->SetMarkerSize(0);
238 gStyle->SetTitleOffset(1.3,
"Y");
239 gStyle->SetTitleOffset(1.0,
"X");
240 gStyle->SetNdivisions(510);
241 gStyle->SetStatH(0.11);
242 gStyle->SetStatW(0.33);
243 gStyle->SetTitleW(0.4);
244 gStyle->SetTitleX(0.13);
245 gStyle->SetPadTickX(1);
246 gStyle->SetPadTickY(1);
259 int xBins = (plotType==
"EtaProfile") ? 83 : 71;
261 int xMin = (plotType==
"EtaProfile") ? etaMin :
phiMin;
263 int otherMin = (plotType==
"EtaProfile") ?
phiMin : etaMin;
264 int otherMax = (plotType==
"EtaProfile") ?
phiMax :
etaMax;
265 TH1D* retHist =
new TH1D(newName,newName, xBins,xMin,xMax);
271 for(
int i = xMin;
i <=
xMax;
i++ && bin++) {
272 numChannels = 0; sumVal = 0;
273 for(
int j = otherMin; j <= otherMax; j++) {
274 ieta = (plotType==
"EtaProfile") ?
i : j; ieta += 42;
275 iphi = (plotType==
"EtaProfile") ? j :
i; iphi += -1;
276 channelVal = hist->GetBinContent(ieta,iphi);
278 if(channelVal != 0 ) {
279 sumVal += channelVal;
284 if(sumVal !=0) retHist->Fill(
i,sumVal/((Double_t)numChannels));
296 std::pair< float, float> range;
303 if(
depths_.count(std::make_pair(subDetName,
i)) == 0) {
307 padNum =
i+startCanv-1;
308 if(subDetName==
"HO") padNum = padNum - 3;
310 canvas->GetPad(padNum)->SetGridx(1);
311 canvas->GetPad(padNum)->SetGridy(1);
315 if(plotForm ==
"2DHist"){
316 canvas->GetPad(padNum)->SetRightMargin(0.13);
318 depths_[std::make_pair(subDetName,
i)]->Draw(
"colz");
319 depths_[std::make_pair(subDetName,
i)]->SetContour(100);
320 depths_[std::make_pair(subDetName,
i)]->GetXaxis()->SetTitle(
"ieta");
321 depths_[std::make_pair(subDetName,
i)]->GetYaxis()->SetTitle(
"iphi");
322 depths_[std::make_pair(subDetName,
i)]->GetXaxis()->CenterTitle();
323 depths_[std::make_pair(subDetName,
i)]->GetYaxis()->CenterTitle();
324 depths_[std::make_pair(subDetName,
i)]->GetZaxis()->SetRangeUser(std::get<0>(range), std::get<1>(range));
325 depths_[std::make_pair(subDetName,
i)]->GetYaxis()->SetTitleSize(0.06);
326 depths_[std::make_pair(subDetName,
i)]->GetYaxis()->SetTitleOffset(0.80);
327 depths_[std::make_pair(subDetName,
i)]->GetXaxis()->SetTitleSize(0.06);
328 depths_[std::make_pair(subDetName,
i)]->GetXaxis()->SetTitleOffset(0.80);
329 depths_[std::make_pair(subDetName,
i)]->GetYaxis()->SetLabelSize(0.055);
330 depths_[std::make_pair(subDetName,
i)]->GetXaxis()->SetLabelSize(0.055);
332 canvas->GetPad(padNum)->SetLeftMargin(0.152);
333 canvas->GetPad(padNum)->SetRightMargin(0.02);
335 newName = (
"run_" + std::to_string(
run_) +
"_" + subDetName +
"_d" + std::to_string(
i) +
"_" + (plotForm==
"EtaProfile" ?
"ieta" :
"iphi")).c_str();
339 projection->Draw(
"hist");
340 projection->GetXaxis()->SetTitle((plotForm==
"EtaProfile" ?
"ieta" :
"iphi"));
341 projection->GetXaxis()->CenterTitle();
344 label.SetTextAlign(26);
345 label.SetTextSize(0.05);
346 label.DrawLatex(0.3, 0.95, (
"run_" + std::to_string(
run_) +
"_" + subDetName +
"_d" + std::to_string(
i)).c_str());
347 projection->GetYaxis()->CenterTitle();
348 projection->GetXaxis()->SetTitleSize(0.06);
349 projection->GetYaxis()->SetTitleSize(0.06);
350 projection->GetXaxis()->SetTitleOffset(0.80);
351 projection->GetXaxis()->SetLabelSize(0.055);
352 projection->GetYaxis()->SetTitleOffset(1.34);
353 projection->GetYaxis()->SetLabelSize(0.055);
368 TCanvas *HAll =
new TCanvas(
"HAll",
"HAll", 1680, (
GetTopoMode()==
"2015/2016")?1680:2500);
369 HAll->Divide(3, (
GetTopoMode()==
"2015/2016")?3:6, 0.02,0.01);
381 TCanvas *
HF =
new TCanvas(
"HF",
"HF", 1600, 1000);
382 HF->Divide(3, 2,0.02,0.01);
390 TCanvas *
HE =
new TCanvas(
"HE",
"HE", 1680, 1680);
391 HE->Divide(3, 3,0.02,0.01);
398 TCanvas *HBHO =
new TCanvas(
"HBHO",
"HBHO", 1680, 1680);
399 HBHO->Divide(3, 3,0.02,0.01);
402 FillCanv(HBHO,
"HB",1,4,
"EtaProfile");
403 FillCanv(HBHO,
"HO",4,6,
"EtaProfile");
404 FillCanv(HBHO,
"HB",1,7,
"PhiProfile");
405 FillCanv(HBHO,
"HO",4,9,
"PhiProfile");
412 if(unit.empty())
return "";
413 else return "("+unit+
")";
434 std::map<std::string, std::string>
units_ = {
435 {
"HcalPedestals",
"ADC" },
437 {
"HcalL1TriggerObjects",
"" },
438 {
"HcalPedestalWidths",
"ADC" },
439 {
"HcalRespCorrs",
"" },
440 {
"Dark Current",
"" },
456 else if(subDetString ==
"ZDC_EM" || subDetString ==
"ZDC" || subDetString ==
"ZDC_HAD" || subDetString ==
"ZDC_LUM")
return &
ZDCvalContainer;
457 else throw cms::Exception (
"subDetString "+subDetString+
" not found in Item");
465 if(depths_.count(std::make_pair(
"HF",4))!=0 || depths_.count(std::make_pair(
"HE",7))!=0) TopoMode_ =
"2017";
467 else if(HEvalContainer.count(std::make_tuple(7,-26,63))!=0) TopoMode_ =
"2018";
469 else TopoMode_ =
"2015/2016";
471 if(TopoMode_ ==
"2018" || TopoMode_ ==
"2017") {
472 subDetDepths_.insert(std::pair<std::string,int>(
"HB",2));
473 subDetDepths_.insert(std::pair<std::string,int>(
"HE",7));
474 subDetDepths_.insert(std::pair<std::string,int>(
"HF",4));
475 subDetDepths_.insert(std::pair<std::string,int>(
"HO",1));
476 }
else if(TopoMode_ ==
"2015/2016") {
477 subDetDepths_.insert(std::pair<std::string,int>(
"HB",2));
478 subDetDepths_.insert(std::pair<std::string,int>(
"HE",3));
479 subDetDepths_.insert(std::pair<std::string,int>(
"HF",2));
480 subDetDepths_.insert(std::pair<std::string,int>(
"HO",1));
492 TLine*
l =
new TLine;
494 for (
int i = 1;
i < nbRows;
i++) {
495 double y = (double)
i;
496 l =
new TLine(0., y, nbColumns, y);
500 for (
int i = 1;
i < nbColumns;
i++) {
501 double x = (double)
i;
502 double y = (double) nbRows;
503 l =
new TLine(x, 0., x, y);
514 std::ostringstream streamObj2;
516 if(num==-1)
return "NOT FOUND";
530 std::stringstream ss;
531 unsigned int mask = 1<<31;
532 for (
unsigned short int i = 0;
i < 32; ++
i){
547 unsigned int statadd = 0x1<<(bitnumber);
548 return (status&statadd)?(
true):(
false);
553 std::stringstream ss;
554 for (
unsigned int i = 0;
i < 9; ++
i){
556 ss <<
"[" <<bitMap[
i]<<
"]" << statusBitArray[bitMap[
i]] <<
"; ";
568 for (
unsigned int i=0;
i<depth.size();++
i)
570 depth[
i].SetXTitle(
"i#eta");
571 depth[
i].SetYTitle(
"i#phi");
574 std::stringstream
label;
577 for (
int i=-41;
i<=-29;
i=
i+2)
580 depth[0].GetXaxis()->SetBinLabel(i+42,label.str().c_str());
581 depth[1].GetXaxis()->SetBinLabel(i+42,label.str().c_str());
584 depth[0].GetXaxis()->SetBinLabel(14,
"-29HE");
585 depth[1].GetXaxis()->SetBinLabel(14,
"-29HE");
588 for (
int i=-27;
i<=27;
i=
i+2)
591 depth[0].GetXaxis()->SetBinLabel(i+43,label.str().c_str());
594 depth[0].GetXaxis()->SetBinLabel(72,
"29HE");
595 for (
int i=29;
i<=41;
i=
i+2)
598 depth[0].GetXaxis()->SetBinLabel(i+44,label.str().c_str());
601 for (
int i=16;
i<=28;
i=
i+2)
604 depth[1].GetXaxis()->SetBinLabel(i,label.str().c_str());
607 depth[1].GetXaxis()->SetBinLabel(29,
"NULL");
608 for (
int i=15;
i<=27;
i=
i+2)
611 depth[1].GetXaxis()->SetBinLabel(i+15,label.str().c_str());
615 depth[1].GetXaxis()->SetBinLabel(44,
"29HE");
616 for (
int i=29;
i<=41;
i=
i+2)
619 depth[1].GetXaxis()->SetBinLabel(i+16,label.str().c_str());
624 depth[2].GetXaxis()->SetBinLabel(1,
"-28");
625 depth[2].GetXaxis()->SetBinLabel(2,
"-27");
626 depth[2].GetXaxis()->SetBinLabel(3,
"Null");
627 depth[2].GetXaxis()->SetBinLabel(4,
"-16");
628 depth[2].GetXaxis()->SetBinLabel(5,
"Null");
629 depth[2].GetXaxis()->SetBinLabel(6,
"16");
630 depth[2].GetXaxis()->SetBinLabel(7,
"Null");
631 depth[2].GetXaxis()->SetBinLabel(8,
"27");
632 depth[2].GetXaxis()->SetBinLabel(9,
"28");
637 const int binmapd2[]={-42,-41,-40,-39,-38,-37,-36,-35,-34,-33,-32,-31,-30,
638 -29,-28,-27,-26,-25,-24,-23,-22,-21,-20,-19,-18,-17,
639 -16,-15,-9999, 15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,
640 30,31,32,33,34,35,36,37,38,39,40,41,42};
644 const int binmapd3[]={-28,-27,-9999,-16,-9999,16,-9999,27,28};
664 ieta < 0 ? etabin-- : etabin++;
691 if (ieta==-28) etabin=0;
692 else if (ieta==-27) etabin=1;
693 else if (ieta==-16) etabin=3;
694 else if (ieta==16) etabin=5;
695 else if (ieta==27) etabin=7;
696 else if (ieta==28) etabin=8;
716 if (ieta==0)
return -9999;
722 if (ieta==0)
return -9999;
723 if (ieta==17 || ieta == -17)
736 else if (eta>71) ieta--;
743 if (ieta<=-30) ieta++;
744 else if (ieta>=30) ieta--;
758 if (
abs(ieta)>29 ||
abs(ieta)<18)
return -9999;
759 if (ieta==0)
return -9999;
764 if (eta<0 || eta>8)
return -9999;
767 if (ieta==0)
return -9999;
779 if (
abs(ieta)>15)
return -9999;
780 if (ieta==0)
return -9999;
784 if (ieta==0)
return -9999;
796 if (eta<0)
return ieta;
801 else if (eta>71) ieta--;
802 if (ieta==0) ieta=-9999;
807 if (eta>57)
return -9999;
811 if (ieta==-9999)
return ieta;
812 if (ieta==0)
return -9999;
813 if (ieta==17 || ieta == -17)
return -9999;
814 else if (ieta<=-30) ieta++;
815 else if (ieta>=30) ieta--;
821 if (eta>8)
return -9999;
824 if (ieta==0)
return -9999;
830 if (
abs(ieta)>15)
return -9999;
831 if (ieta==0)
return -9999;
842 std::vector<std::string>
name;
843 name.push_back(
"HB HE HF Depth 1 ");
844 name.push_back(
"HB HE HF Depth 2 ");
845 name.push_back(
"HE Depth 3 ");
846 name.push_back(
"HO Depth 4 ");
853 if (depth>2)
return false;
854 else if (depth<1)
return false;
858 if (ieta==-9999)
return false;
861 if (
abs(ieta)<=16 )
return true;
866 if (
abs(ieta)==15 ||
abs(ieta)==16)
return true;
875 if (depth>3)
return false;
876 else if (depth<1)
return false;
880 if (ieta==-9999)
return false;
883 if (
abs(ieta)>=17 &&
abs(ieta)<=28 )
return true;
884 if (ieta==-29 && etabin==13)
return true;
885 if (ieta==29 && etabin == 71)
return true;
889 if (
abs(ieta)>=17 &&
abs(ieta)<=28 )
return true;
890 if (ieta==-29 && etabin==13)
return true;
891 if (ieta==29 && etabin == 43)
return true;
901 if (depth>2)
return false;
902 else if (depth<1)
return false;
906 if (ieta==-9999)
return false;
909 if (ieta==-29 && etabin==13)
return false;
910 else if (ieta==29 && etabin == 71)
return false;
911 else if (
abs(ieta)>=29 )
return true;
915 if (ieta==-29 && etabin==13)
return false;
916 else if (ieta==29 && etabin==43)
return false;
917 else if (
abs(ieta)>=29 )
return true;
925 if (depth!=4)
return false;
927 if (ieta!=-9999)
return true;
935 if (depth!=4)
return false;
937 if (ieta>=5 && ieta <=10 && iphi>=47 && iphi<=58)
return true;
939 if (ieta>=11 && ieta<=15 && iphi>=59 && iphi<=70)
return true;
951 const int ie (
abs( ies ) ) ;
953 return ( ( ip >= 1 ) &&
960 ( ( ( ie == 15 ) || ( ie == 16 ) ) &&
980 ( ip%2 == 1 ) ) ) ) ||
991 ( ip%4 == 3 ) ) ) ) ) ) ;
1002 std::stringstream
label;
1003 for (
int i=-41;
i<=-29;
i=
i+2)
1006 h.GetXaxis()->SetBinLabel(i+42,label.str().c_str());
1009 h.GetXaxis()->SetBinLabel(14,
"-29HE");
1012 for (
int i=-27;
i<=27;
i=
i+2)
1015 h.GetXaxis()->SetBinLabel(i+43,label.str().c_str());
1018 h.GetXaxis()->SetBinLabel(72,
"29HE");
1019 for (
int i=29;
i<=41;
i=
i+2)
1022 h.GetXaxis()->SetBinLabel(i+44,label.str().c_str());
1035 for (
unsigned int d=0;
d<3;++
d)
1043 if (ieta==-9999 ||
abs(ieta)<21)
continue;
1044 for (
int phi=0;phi <hh[
d].GetNbinsY();++phi)
1047 if (iphi%2==1 &&
abs(ieta)<40 && iphi<73)
1049 hh[
d].SetBinContent(
eta+1,iphi+1,hh[
d].GetBinContent(
eta+1,iphi));
1053 else if (
abs(ieta)>39 && iphi%4==3 && iphi<73)
1056 hh[
d].SetBinContent(
eta+1,(iphi)%72+1, hh[
d].GetBinContent(
eta+1,iphi));
1057 hh[
d].SetBinContent(
eta+1,(iphi+1)%72+1, hh[
d].GetBinContent(
eta+1,iphi));
1058 hh[
d].SetBinContent(
eta+1,(iphi+2)%72+1, hh[
d].GetBinContent(
eta+1,iphi));
1079 int etabins = hh.GetNbinsX();
1080 int phibins = hh.GetNbinsY();
1085 if (ieta==-9999 ||
abs(ieta)<21)
continue;
1087 for (
int phi=0;phi<phibins;++phi)
1090 if (iphi%2==1 &&
abs(ieta)<40 && iphi<73)
1092 binval=hh.GetBinContent(
eta+1,iphi);
1093 hh.SetBinContent(
eta+1,iphi+1,binval);
1095 else if (
abs(ieta)>39 && iphi%4==3 && iphi<73)
1099 hh.SetBinContent(
eta+1, (iphi)%72+1, hh.GetBinContent(
eta+1,iphi));
1100 hh.SetBinContent(
eta+1, (iphi+1)%72+1, hh.GetBinContent(
eta+1,iphi));
1101 hh.SetBinContent(
eta+1, (iphi+2)%72+1, hh.GetBinContent(
eta+1,iphi));
1117 depth[
id.depth()-1].Fill(
id.ieta()<0 ?
id.ieta()-1 :
id.ieta()+1,
id.iphi(), val);
1119 depth[
id.depth()-1].Fill(
id.ieta(),
id.iphi(),val);
1124 for (
unsigned int d=0;
d<depth.size();
d++)
1135 unittitle =
"No Units";
1139 unitname =
" " +
units;
1146 depth.push_back(TH2F((
"HB HE HF Depth 1 "+name+unitname).c_str(),
1147 (name+
" Depth 1 -- HB HE HF ("+unittitle+
")").c_str(),
1153 for (
int i=0;
i<=72;
i++) ybins[
i]=(
float)(
i+0.5);
1154 float xbinsd2[]={-42.5,-41.5,-40.5,-39.5,-38.5,-37.5,-36.5,-35.5,-34.5,-33.5,-32.5,-31.5,-30.5,-29.5,
1155 -28.5,-27.5,-26.5,-25.5,-24.5,-23.5,-22.5,-21.5,-20.5,-19.5,-18.5,-17.5,-16.5,
1158 16.5,17.5,18.5,19.5,20.5,21.5,22.5,23.5,24.5,25.5,26.5,27.5,28.5,29.5,30.5,
1159 31.5,32.5,33.5,34.5,35.5,36.5,37.5,38.5,39.5,40.5,41.5,42.5};
1162 depth.push_back(TH2F((
"HB HE HF Depth 2 "+name+unitname).c_str(),
1163 (name+
" Depth 2 -- HB HE HF ("+unittitle+
")").c_str(),
1164 57, xbinsd2, 72, ybins));
1167 float xbins[]={-28.5,-27.5,-26.5,-16.5,-15.5,
1168 15.5,16.5,26.5,27.5,28.5};
1170 depth.push_back(TH2F((
"HE Depth 3 "+name+unitname).c_str(),
1171 (name+
" Depth 3 -- HE ("+unittitle+
")").c_str(),
1173 9, xbins, 72, ybins));
1176 depth.push_back(TH2F((
"HO Depth 4 "+name+unitname).c_str(),
1177 (name+
" Depth 4 -- HO ("+unittitle+
")").c_str(),
1181 for (
unsigned int i=0;
i<depth.size();++
i)
1182 depth[
i].Draw(
"colz");
1188 setup(graphData, name);
1190 std::stringstream x;
1192 for (
unsigned int d=0;
d < graphData.size();++
d){
1193 graphData[
d].Reset();
1194 x <<
"Gain "<<
id <<
" for HCAL depth " <<
d+1;
1198 graphData[
d].SetTitle(x.str().c_str());
1203 int ieta,
depth, iphi;
1210 HcalGains::tAllContWithNames::const_iterator iter;
1211 std::vector<HcalGain>::const_iterator contIter;
1218 for (iter = allContainers.begin(); iter != allContainers.end(); ++iter){
1220 for (contIter = (*iter).second.begin(); contIter != (*iter).second.end(); ++contIter){
1221 hcal_id =
HcalDetId((uint32_t)(*contIter).rawId());
1223 depth = hcal_id.
depth();
1224 if (depth<1 || depth>4)
1227 ieta=hcal_id.
ieta();
1228 iphi=hcal_id.
iphi();
1231 ieta>0 ? ++ieta : --ieta;
1234 gain = (*contIter).getValue(i);
1238 graphData[depth-1].Fill(ieta,iphi, gain);
1256 unsigned int nr,
id;
1260 std::stringstream ss(
"");
1263 ss << rootname.str() <<
" for HCAL depth ";
1265 ss << rootname.str() << nr <<
" for HCAL depth ";
1267 setup(graphData, ss.str());
1270 for (
unsigned int d=0;
d < graphData.size();++
d){
1271 graphData[
d].Reset();
1275 ss << plotname.str() <<
" for HCAL depth " <<
d+1;
1277 ss << plotname.str() << nr <<
" for HCAL depth " <<
d+1;
1282 graphData[
d].SetTitle(ss.str().c_str());
1286 doFillIn(graphData);
1292 ss << filename.str() <<
".png";
1294 ss << filename.str() << nr <<
".png";
1295 draw(graphData, ss.str());
1306 virtual void doFillIn(std::vector<TH2F> &graphData) = 0;
1313 gStyle->SetPalette(1);
1314 const Int_t NCont = 999;
1315 gStyle->SetNumberContours(NCont);
1316 TCanvas
canvas(
"CC map",
"CC map",840,369*4);
1318 TPad pad1(
"pad1",
"pad1", 0.0, 0.75, 1.0, 1.0);
1320 TPad pad2(
"pad2",
"pad2", 0.0, 0.5, 1.0, 0.75);
1322 TPad pad3(
"pad3",
"pad3", 0.0, 0.25, 1.0, 0.5);
1324 TPad pad4(
"pad4",
"pad4", 0.0, 0.0, 1.0, 0.25);
1329 graphData[0].SetStats(
false);
1330 graphData[0].Draw(
"colz");
1333 graphData[1].SetStats(
false);
1334 graphData[1].Draw(
"colz");
1337 graphData[2].SetStats(
false);
1338 graphData[2].Draw(
"colz");
1341 graphData[3].SetStats(
false);
1342 graphData[3].Draw(
"colz");
1344 canvas.SaveAs(filename.c_str());
1352 unittitle =
"No Units";
1356 unitname =
" " +
units;
1363 depth.push_back(TH2F((
"HB HE HF Depth 1 "+name+unitname).c_str(),
1364 (name+
" Depth 1 -- HB HE HF ("+unittitle+
")").c_str(),
1370 for (
int i=0;
i<=72;
i++) ybins[
i]=(
float)(
i+0.5);
1371 float xbinsd2[]={-42.5,-41.5,-40.5,-39.5,-38.5,-37.5,-36.5,-35.5,-34.5,-33.5,-32.5,-31.5,-30.5,-29.5,
1372 -28.5,-27.5,-26.5,-25.5,-24.5,-23.5,-22.5,-21.5,-20.5,-19.5,-18.5,-17.5,-16.5,
1375 16.5,17.5,18.5,19.5,20.5,21.5,22.5,23.5,24.5,25.5,26.5,27.5,28.5,29.5,30.5,
1376 31.5,32.5,33.5,34.5,35.5,36.5,37.5,38.5,39.5,40.5,41.5,42.5};
1379 depth.push_back(TH2F((
"HB HE HF Depth 2 "+name+unitname).c_str(),
1380 (name+
" Depth 2 -- HB HE HF ("+unittitle+
")").c_str(),
1381 57, xbinsd2, 72, ybins));
1384 float xbins[]={-28.5,-27.5,-26.5,-16.5,-15.5,
1385 15.5,16.5,26.5,27.5,28.5};
1387 depth.push_back(TH2F((
"HE Depth 3 "+name+unitname).c_str(),
1388 (name+
" Depth 3 -- HE ("+unittitle+
")").c_str(),
1390 9, xbins, 72, ybins));
1393 depth.push_back(TH2F((
"HO Depth 4 "+name+unitname).c_str(),
1394 (name+
" Depth 4 -- HO ("+unittitle+
")").c_str(),
1398 for (
unsigned int i=0;
i<depth.size();++
i)
1399 depth[
i].Draw(
"colz");
1408 for (
unsigned int i=0;
i<depth.size();++
i)
1410 depth[
i].SetXTitle(
"i#eta");
1411 depth[
i].SetYTitle(
"i#phi");
1414 std::stringstream
label;
1417 for (
int i=-41;
i<=-29;
i=
i+2)
1420 depth[0].GetXaxis()->SetBinLabel(i+42,label.str().c_str());
1421 depth[1].GetXaxis()->SetBinLabel(i+42,label.str().c_str());
1424 depth[0].GetXaxis()->SetBinLabel(14,
"-29HE");
1425 depth[1].GetXaxis()->SetBinLabel(14,
"-29HE");
1428 for (
int i=-27;
i<=27;
i=
i+2)
1431 depth[0].GetXaxis()->SetBinLabel(i+43,label.str().c_str());
1434 depth[0].GetXaxis()->SetBinLabel(72,
"29HE");
1435 for (
int i=29;
i<=41;
i=
i+2)
1438 depth[0].GetXaxis()->SetBinLabel(i+44,label.str().c_str());
1441 for (
int i=16;
i<=28;
i=
i+2)
1444 depth[1].GetXaxis()->SetBinLabel(i,label.str().c_str());
1447 depth[1].GetXaxis()->SetBinLabel(29,
"NULL");
1448 for (
int i=15;
i<=27;
i=
i+2)
1451 depth[1].GetXaxis()->SetBinLabel(i+15,label.str().c_str());
1455 depth[1].GetXaxis()->SetBinLabel(44,
"29HE");
1456 for (
int i=29;
i<=41;
i=
i+2)
1459 depth[1].GetXaxis()->SetBinLabel(i+16,label.str().c_str());
1464 depth[2].GetXaxis()->SetBinLabel(1,
"-28");
1465 depth[2].GetXaxis()->SetBinLabel(2,
"-27");
1466 depth[2].GetXaxis()->SetBinLabel(3,
"Null");
1467 depth[2].GetXaxis()->SetBinLabel(4,
"-16");
1468 depth[2].GetXaxis()->SetBinLabel(5,
"Null");
1469 depth[2].GetXaxis()->SetBinLabel(6,
"16");
1470 depth[2].GetXaxis()->SetBinLabel(7,
"Null");
1471 depth[2].GetXaxis()->SetBinLabel(8,
"27");
1472 depth[2].GetXaxis()->SetBinLabel(9,
"28");
std::vector< std::string > HcalEtaPhiHistNames()
std::map< std::string, int > subDetDepths_
tHcalValCont ZDCvalContainer
std::map< Coord, Item > tHcalValCont
tHcalValCont HEvalContainer
TCanvas * getCanvasHBHO()
void Divide(HcalDataContainer *dataCont2)
void SetEtaPhiLabels(TH2F &h)
tHcalValCont HOvalContainer
HcalSubdetector subdet() const
get the subdetector
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
tHcalValCont CALIBvalContainer
void Subtract(HcalDataContainer *dataCont2)
std::stringstream rootname
tHcalValCont HTvalContainer
std::string getBitsSummary(uint32_t bits, std::string statusBitArray[], short unsigned int bitMap[])
bool validDetId(HcalSubdetector sd, int ies, int ip, int dp)
void setBinLabels(std::vector< TH2F > &depth)
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision bits
ADataRepr(unsigned int d)
bool isHE(int etabin, int depth)
virtual float getValue(Item *item)
void drawTable(int nbRows, int nbColumns)
tHcalValCont HBvalContainer
std::tuple< int, int, int > Coord
std::string IntToBinary(unsigned int number)
void setTopoModeFromValConts(bool throwOnFail=false)
bool isHB(int etabin, int depth)
void FillCanv(TCanvas *canvas, std::string subDetName, int startDepth=1, int startCanv=1, std::string plotForm="2DHist")
std::map< std::pair< std::string, int >, TH2F * > DepthMap
int depth() const
get the tower depth
def draw(name, histos, styles=_defaultStyles, legendLabels=[], kwargs)
int CalcIeta(int subdet, int eta, int depth)
bool isSiPM(int ieta, int iphi, int depth)
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
int ieta() const
get the cell ieta
const bool isBitSet(unsigned int bitnumber, unsigned int status)
TCanvas * getCanvasAll(std::string profile="2DHist")
Abs< T >::type abs(const T &t)
void draw(std::vector< TH2F > &graphData, std::string filename)
void fillOneGain(std::vector< TH2F > &graphData, std::string units="")
int CalcEtaBin(int subdet, int ieta, int depth)
void fillOneGain(std::vector< TH2F > &graphData, HcalGains::tAllContWithNames &allContainers, std::string name, int id, std::string units="")
tHcalValCont CASTORvalContainer
bin
set the eta bin as selection string.
std::string SciNotatStr(float num)
int iphi() const
get the cell iphi
TH1D * GetProjection(TH2F *hist, std::string plotType, const char *newName, std::string subDetName, int depth)
HcalDataContainer(std::shared_ptr< Items > payload, unsigned int run)
Item * getItemFromValCont(std::string subDetName, int depth, int ieta, int iphi, bool throwOnFail)
bool isHF(int etabin, int depth)
void FillUnphysicalHEHFBins(std::vector< TH2F > &hh)
std::pair< float, float > GetRange(TH1 *hist)
std::map< std::string, int > GetSubDetDepths()
TString units(TString variable, Char_t axis)
tHcalValCont HFvalContainer
bool isHO(int etabin, int depth)
void Reset(std::vector< TH2F > &depth)
tHcalValCont * getContFromString(std::string subDetString)
void setBinLabels(std::vector< TH2F > &depth)
std::map< std::string, std::string > units_
virtual ~HcalDataContainer()
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
std::shared_ptr< Items > payload_
std::vector< tHcalCont > tAllContWithNames
std::string GetTopoMode()
std::string GetUnit(std::string type)