1 #if !defined(__CINT__) || defined(__MAKECINT__) 11 #include <TObjArray.h> 17 TDraw(
const char *name,
const char *fname=
"tempinfo.root");
59 TFile *inf = TFile::Open(
"tempinfo.root");
60 fArr =
dynamic_cast<TObjArray*
>(inf->Get(Form(
"temperatures_%s",name)));
92 cout <<
"Known bad sensors: " << nbad <<
" (";
105 for (
Int_t i=0;i<rns;++i) {
110 cout <<
"Setting nfaulty to " << nbad <<
" for run " << i << endl;
115 cout <<
"Run " << i <<
" with run number " << tinfo->
GetRunNo() <<
" below threshold: " << frac << endl;
122 cout <<
"Sensor " << ns <<
" marked bad, but has fraction: " << frac << endl;
127 cout <<
"Sensor " << ns <<
" below threshold: " << frac << endl;
133 TString cname(Form(
"cTempAll_%s",GetName()));
135 c1->Print(Form(
"%s.pdf[",cname.Data()));
136 c1->Print(Form(
"%s.pdf",cname.Data()));
138 c2->Print(Form(
"%s.pdf",cname.Data()));
139 TCanvas *c3=
DrawT(3);
140 c3->Print(Form(
"%s.pdf",cname.Data()));
142 TCanvas *c4 =
new TCanvas(lab,lab,1200,800);
146 for (
Int_t i=0;i<rns;++i) {
153 h->Draw(
"colz,text");
155 hm->DrawCopy(
"box,same");
156 c4->Print(Form(
"%s.pdf",cname.Data()));
158 c4->Print(Form(
"%s.pdf]",cname.Data()));
163 TString lab(Form(
"cOccRun_%s",GetName()));
164 TCanvas *
c =
new TCanvas(lab,lab,1200,800);
175 c->Print(Form(
"%s.pdf",c->GetName()));
181 TString lab(Form(
"cOccSensor2D_%s",GetName()));
182 TCanvas *
c =
new TCanvas(lab,lab,1200,800);
184 h2->Draw(
"colz,text");
186 c->Print(Form(
"%s.pdf",c->GetName()));
192 TString lab(Form(
"cOcc2D_%s",GetName()));
193 TCanvas *
c =
new TCanvas(lab,lab);
197 c->Print(Form(
"%s.pdf",c->GetName()));
204 TCanvas *
c =
new TCanvas(lab,lab,1200,800);
207 TLegend *leg =
new TLegend(0.92,0.1,0.99,0.99);
209 for (
Int_t i=0,n1=0,n2=7;i<20;++i) {
215 case 9: col=kOrange+2;
break;
216 case 10: col=kOrange+10;
break;
217 case 11: col=kMagenta+2;
break;
218 case 12: col=kCyan+2;
break;
219 case 13: col=kYellow+2;
break;
220 case 14: col=kGray+2;
break;
221 case 15: col=kOrange-2;
break;
222 case 16: col=kViolet+2;
break;
223 case 17: col=kRed-2;
break;
224 case 18: col=kGreen+2;
break;
225 case 19: col=kGray+2;
break;
227 h->SetMarkerStyle(20+(i%2));
228 h->SetMarkerSize(1.2);
229 h->SetMarkerColor(col);
230 h->SetLineColor(col);
232 h->SetName(Form(
"SM%d",i));
236 if (minh<minp) minp=minh;
238 if (maxh>maxp) maxp=maxh;
239 leg->AddEntry(h,h->GetName(),
"p");
241 minp=0.9*minp; maxp=1.1*maxp;
243 h2f->SetTitle(Form(
"Average T per SM: run %d to %d, min=%.1f, max=%.1f",
GetRunNo(0),
GetRunNo(
GetNRuns()-1), min, max));
247 for (
Int_t i=0;i<arr.GetEntries();++i)
248 arr.At(i)->Draw(
"same, p, hist");
252 c->Print(Form(
"%s.pdf",c->GetName()));
259 TCanvas *
c =
new TCanvas(lab,lab);
263 c->Print(Form(
"%s.pdf",c->GetName()));
271 h =
new TH2F(
"hBadMask",
";col;rows",8,-0.5,7.5,20,-0.5,19.5);
280 h->SetBinContent(bin,-1);
282 h->SetBinContent(bin,-100);
291 TH1F *ret =
new TH1F(
"hOccRun",Form(
";run idx;fraction"),rns,0,rns);
293 ret->SetDirectory(0);
295 ret->SetMarkerStyle(20);
296 ret->SetMarkerSize(1);
298 for (
Int_t i=0;i<rns;++i) {
303 ret->SetBinContent(i+1,val);
312 ret->SetDirectory(0);
314 ret->SetMarkerStyle(20);
315 ret->SetMarkerSize(1);
316 for (
Int_t i=0;i<rns;++i) {
330 TH2F *hOcc2D =
new TH2F(
"hOccSensor2D",
";col;rows",8,-0.5,7.5,20,-0.5,19.5);
332 hOcc2D->SetDirectory(0);
334 hOcc2D->SetMinimum(-1);
335 hOcc2D->SetMaximum(+1);
341 hOcc2D->SetBinContent(bin,frac);
350 ret->SetDirectory(0);
352 for (
Int_t i=0;i<rns;++i) {
358 ret->SetBinContent(ret->FindBin(i,j),val);
368 for (
Int_t i=0;i<rns;++i) {
383 for (
Int_t i=0;i<rns;++i) {
400 for (
Int_t i=0;i<rns;++i) {
415 for (
Int_t i=0;i<rns;++i) {
432 for (
Int_t ns=0,first=0;ns<nbad;++ns) {
443 TProfile *ret =
new TProfile(Form(
"h%d%d%d",ns1,ns2,type),Form(
";run idx"),rns,0,rns);
444 ret->SetDirectory(0);
446 for (
Int_t i=0;i<rns;++i) {
450 for (
Int_t j=ns1;j<=ns2;++j) {
464 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());
465 ret->SetDirectory(0);
467 for (
Int_t i=0;i<rns;++i) {
475 ret->SetBinContent(ret->FindBin(i,j),val);
485 for (
Int_t i=0;i<rns;++i) {
497 cout <<
"Period: " << GetName() <<
" with " << rns <<
" runs" << endl;
500 cout <<
"Channel " << ns <<
" " <<
GetFraction(ns) << endl;
501 for (
Int_t i=0;i<rns;++i) {
505 cout <<
"-> " << i <<
": run=" << tinfo->
GetRunNo() <<
" frac=" << tinfo->
Fraction() <<
" minT=" << tinfo->
AbsMinT()<<
" maxT=" << tinfo->
AbsMaxT() << endl;
TH2 * GetOccSensor2D() const
void plotT_period(const char *period, Bool_t doprint=0)
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)
TH1 * GetT(Int_t ns1, Int_t ns2, Int_t type=3) const
TCanvas * DrawT2D(Int_t type=3) const
TCanvas * DrawT(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
void SetPrint(Bool_t b=1)
Double_t GetFraction(Int_t ns) const
void plotOCDB_Temperature(const char *period="lhc18d")
TH2 * GetHist(Int_t type=1) 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
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