1 #if !defined(__CINT__) || defined(__MAKECINT__) 11 #include <TObjArray.h> 17 TDraw(
const char *name,
const char *fname=
"tempinfo.root");
61 TFile *inf = TFile::Open(
"tempinfo.root");
62 fArr =
dynamic_cast<TObjArray*
>(inf->Get(Form(
"temperatures_%s",name)));
94 cout <<
"Known bad sensors: " << nbad <<
" (";
107 for (
Int_t i=0;i<rns;++i) {
112 cout <<
"Setting nfaulty to " << nbad <<
" for run " << i << endl;
117 cout <<
"Run " << i <<
" with run number " << tinfo->
GetRunNo() <<
" below threshold: " << frac << endl;
124 cout <<
"Sensor " << ns <<
" marked bad, but has fraction: " << frac << endl;
129 cout <<
"Sensor " << ns <<
" below threshold: " << frac << endl;
135 TString cname(Form(
"cTempAll_%s",GetName()));
137 c1->Print(Form(
"%s.pdf[",cname.Data()));
138 c1->Print(Form(
"%s.pdf",cname.Data()));
140 c2->Print(Form(
"%s.pdf",cname.Data()));
142 c3->Print(Form(
"%s.pdf",cname.Data()));
143 for (
Int_t i=0; i < 20; i++){
145 c5->Print(Form(
"%s.pdf",cname.Data()));
150 TCanvas *c4 =
new TCanvas(lab,lab,1200,800);
154 for (
Int_t i=0;i<rns;++i) {
161 h->Draw(
"colz,text");
163 hm->DrawCopy(
"box,same");
164 c4->Print(Form(
"%s.pdf",cname.Data()));
166 c4->Print(Form(
"%s.pdf]",cname.Data()));
171 TString lab(Form(
"cOccRun_%s",GetName()));
172 TCanvas *
c =
new TCanvas(lab,lab,1200,800);
183 c->Print(Form(
"%s.pdf",c->GetName()));
189 TString lab(Form(
"cOccSensor2D_%s",GetName()));
190 TCanvas *
c =
new TCanvas(lab,lab,1200,800);
192 h2->Draw(
"colz,text");
194 c->Print(Form(
"%s.pdf",c->GetName()));
200 TString lab(Form(
"cOcc2D_%s",GetName()));
201 TCanvas *
c =
new TCanvas(lab,lab);
205 c->Print(Form(
"%s.pdf",c->GetName()));
212 TCanvas *
c =
new TCanvas(lab,lab,1200,800);
215 TLegend *leg =
new TLegend(0.92,0.1,0.99,0.99);
219 hAv->SetMarkerStyle(20);
220 hAv->SetMarkerSize(1.4);
221 hAv->SetMarkerColor(kBlack);
222 hAv->SetLineColor(kBlack);
223 hAv->SetLineWidth(3);
224 hAv->SetName(Form(
"sm%d",sm));
226 leg->AddEntry(hAv,hAv->GetName(),
"p");
228 for (
Int_t i=0;i<8;++i) {
231 h->SetMarkerStyle(24+(i%2));
232 h->SetMarkerSize(1.2);
233 h->SetMarkerColor(col);
234 h->SetLineColor(col);
236 h->SetName(Form(
"sensor%d",i));
239 if (h->GetMaximum()>-1){
242 if (minh<minp) minp=minh;
244 if (maxh>maxp) maxp=maxh;
245 leg->AddEntry(h,h->GetName(),
"p");
248 minp=0.9*minp; maxp=1.1*maxp;
250 h2f->SetTitle(Form(
"T per sensor in SM%d: run %d to %d, min=%.1f, max=%.1f",sm,
GetRunNo(0),
GetRunNo(
GetNRuns()-1), min, max));
254 for (
Int_t i=0;i<arr.GetEntries();++i)
255 arr.At(i)->Draw(
"same, p, hist");
259 c->Print(Form(
"%s.pdf",c->GetName()));
266 TCanvas *
c =
new TCanvas(lab,lab,1200,800);
269 TLegend *leg =
new TLegend(0.92,0.1,0.99,0.99);
271 for (
Int_t i=0;i<20;++i) {
275 case 9: col=kOrange+2;
break;
276 case 10: col=kOrange+10;
break;
277 case 11: col=kMagenta+2;
break;
278 case 12: col=kCyan+2;
break;
279 case 13: col=kYellow+2;
break;
280 case 14: col=kGray+2;
break;
281 case 15: col=kOrange-2;
break;
282 case 16: col=kViolet+2;
break;
283 case 17: col=kRed-2;
break;
284 case 18: col=kGreen+2;
break;
285 case 19: col=kGray+2;
break;
287 h->SetMarkerStyle(20+(i%2));
288 h->SetMarkerSize(1.2);
289 h->SetMarkerColor(col);
290 h->SetLineColor(col);
292 h->SetName(Form(
"SM%d",i));
296 if (minh<minp) minp=minh;
298 if (maxh>maxp) maxp=maxh;
299 leg->AddEntry(h,h->GetName(),
"p");
301 minp=0.9*minp; maxp=1.1*maxp;
303 h2f->SetTitle(Form(
"Average T per SM: run %d to %d, min=%.1f, max=%.1f",
GetRunNo(0),
GetRunNo(
GetNRuns()-1), min, max));
307 for (
Int_t i=0;i<arr.GetEntries();++i)
308 arr.At(i)->Draw(
"same, p, hist");
312 c->Print(Form(
"%s.pdf",c->GetName()));
319 TCanvas *
c =
new TCanvas(lab,lab);
323 c->Print(Form(
"%s.pdf",c->GetName()));
331 h =
new TH2F(
"hBadMask",
";col;rows",8,-0.5,7.5,20,-0.5,19.5);
340 h->SetBinContent(bin,-1);
342 h->SetBinContent(bin,-100);
351 TH1F *ret =
new TH1F(
"hOccRun",Form(
";run idx;fraction"),rns,0,rns);
353 ret->SetDirectory(0);
355 ret->SetMarkerStyle(20);
356 ret->SetMarkerSize(1);
358 for (
Int_t i=0;i<rns;++i) {
363 ret->SetBinContent(i+1,val);
372 ret->SetDirectory(0);
374 ret->SetMarkerStyle(20);
375 ret->SetMarkerSize(1);
376 for (
Int_t i=0;i<rns;++i) {
390 TH2F *hOcc2D =
new TH2F(
"hOccSensor2D",
";col;rows",8,-0.5,7.5,20,-0.5,19.5);
392 hOcc2D->SetDirectory(0);
394 hOcc2D->SetMinimum(-1);
395 hOcc2D->SetMaximum(+1);
401 hOcc2D->SetBinContent(bin,frac);
410 ret->SetDirectory(0);
412 for (
Int_t i=0;i<rns;++i) {
418 ret->SetBinContent(ret->FindBin(i,j),val);
428 for (
Int_t i=0;i<rns;++i) {
443 for (
Int_t i=0;i<rns;++i) {
460 for (
Int_t i=0;i<rns;++i) {
475 for (
Int_t i=0;i<rns;++i) {
492 for (
Int_t ns=0,first=0;ns<nbad;++ns) {
503 TProfile *ret =
new TProfile(Form(
"h%d%d",sm,type),Form(
";run idx"),rns,0,rns);
504 ret->SetDirectory(0);
506 for (
Int_t i=0;i<rns;++i) {
511 cout << i <<
"\t" << sm <<
"\t" << val << endl;
520 TProfile *ret =
new TProfile(Form(
"h%d%d",nsensor,type),Form(
";run idx"),rns,0,rns);
521 ret->SetDirectory(0);
523 for (
Int_t i=0;i<rns;++i) {
529 val = tinfo->
T(nsensor,type);
539 TH2F *ret =
new TH2F(Form(
"h2f_%d",type),Form(
"%s: %s;run idx;sensor idx",GetName(),title.Data()),rns,0,rns,
TInfo::NSensors(),0,
TInfo::NSensors());
540 ret->SetDirectory(0);
542 for (
Int_t i=0;i<rns;++i) {
550 ret->SetBinContent(ret->FindBin(i,j),val);
560 for (
Int_t i=0;i<rns;++i) {
572 cout <<
"Period: " << GetName() <<
" with " << rns <<
" runs" << endl;
575 cout <<
"Channel " << ns <<
" " <<
GetFraction(ns) << endl;
576 for (
Int_t i=0;i<rns;++i) {
580 cout <<
"-> " << i <<
": run=" << tinfo->
GetRunNo() <<
" frac=" << tinfo->
Fraction() <<
" minT=" << tinfo->
AbsMinT()<<
" maxT=" << tinfo->
AbsMaxT() << endl;
597 for (
Int_t i = 0; i < 20; i++)
TH2 * GetOccSensor2D() const
void plotT_period(const char *period, Bool_t doprint=0)
TCanvas * DrawTPerSM(Int_t type=3) const
Int_t GetBad(Int_t ns) const
TH1 * GetOccSensor() const
Float_t AbsMaxT(Int_t t=2) const
static Int_t GetBin(Int_t ns)
TCanvas * DrawT2D(Int_t type=3) const
Double_t GetMinTperS(Int_t ns, Int_t type=3) const
Double_t GetMinT(Int_t type=3) const
Bool_t IsGood(Int_t ns) const
void SetBad(Int_t ns, Bool_t b)
Bool_t IsValid(Int_t ns) const
TH1 * GetT(Int_t nsensor, Int_t type=3) const
void SetPrint(Bool_t b=1)
Double_t GetFraction(Int_t ns) const
void plotOCDB_Temperature(const char *period="lhc18d")
Float_t AvgTempSM(Int_t sm, Int_t type=3) const
TH2 * GetHist(Int_t type=1) const
TCanvas * DrawTSensorsPerSM(Int_t type, Int_t sm) const
Int_t GetNRunsValid(Int_t ns) const
TCanvas * DrawOccRun() const
void Print(Option_t *option="") const
Double_t GetMaxTperS(Int_t ns, Int_t type=3) const
void Print(Option_t *opt="") const
Float_t T(Int_t ns, Int_t t) const
TDraw(const char *name, const char *fname="tempinfo.root")
TCanvas * DrawOccSensor2D() const
TH2 * GetT2D(Int_t type=3) const
TH1 * GetTSM(Int_t sm, Int_t type=3) const
Float_t AbsMinT(Int_t t=1) const
Double_t Fraction() const
static const char * Type(Int_t t)
TCanvas * DrawOcc2D() const
Int_t GetRunNo(Int_t run) const
Double_t GetMaxT(Int_t type=3) const