Main Page
Namespaces
Classes
Package Documentation
src
DPGAnalysis
SiStripTools
bin
SiStripQualityHistoryPlots.cc
Go to the documentation of this file.
1
#include "
SiStripQualityHistoryPlots.h
"
2
#include <iostream>
3
#include <algorithm>
4
#include <vector>
5
#include <string>
6
#include <map>
7
#include "TPad.h"
8
#include "TFile.h"
9
#include "TH2F.h"
10
#include "TH1F.h"
11
#include "TProfile.h"
12
#include "TGraph.h"
13
#include "
DPGAnalysis/SiStripTools/interface/CommonAnalyzer.h
"
14
#include "TCanvas.h"
15
#include "TStyle.h"
16
17
18
TH1D*
AverageRunBadChannels
(TFile&
ff
,
const
char
*
module
,
const
char
*
histo
,
const
bool
excludeLastBins) {
19
20
CommonAnalyzer
camult(&ff,
""
,module);
21
22
TH1D* badchannels =
new
TH1D(
"badchannels"
,
"Average Number of Bad Channels vs run"
,10,0.,10.);
23
badchannels->SetCanExtend(TH1::kXaxis);
24
25
std::vector<unsigned int>
runs
= camult.
getRunList
();
26
std::sort
(runs.begin(),runs.end());
27
28
{
29
for
(
unsigned
int
i
=0;
i
<runs.size();++
i
) {
30
31
char
runlabel[100];
32
sprintf(runlabel,
"%d"
,runs[
i
]);
33
char
runpath[100];
34
sprintf(runpath,
"run_%d"
,runs[i]);
35
camult.
setPath
(runpath);
36
37
38
TProfile* multvstime=
nullptr
;
39
if
(multvstime==
nullptr
) multvstime = (TProfile*)camult.
getObject
(histo);
40
if
(multvstime) {
41
// compute mean exlucing the last filled bins
42
43
if
(excludeLastBins) {
44
int
lastbin= multvstime->GetNbinsX()+1;
45
int
firstbin= 1;
46
for
(
int
ibin=multvstime->GetNbinsX()+1;ibin>0;--ibin) {
47
if
(multvstime->GetBinEntries(ibin)!=0) {
48
lastbin=ibin;
49
break
;
50
}
51
}
52
53
std::cout
<<
"Restricted range: "
<< firstbin <<
" "
<< lastbin << std::endl;
54
multvstime->GetXaxis()->SetRangeUser(multvstime->GetBinLowEdge(firstbin),multvstime->GetBinLowEdge(lastbin-2));
55
}
56
// fill the summary
57
badchannels->Fill(runlabel,multvstime->GetMean(2));
58
59
}
60
}
61
}
62
return
badchannels;
63
64
65
66
}
67
68
TCanvas*
StripCompletePlot
(TFile&
ff
,
const
char
*
module
,
const
bool
excludeLastBins) {
69
70
TCanvas* cc =
new
TCanvas();
71
72
TH1D* cabling =
AverageRunBadChannels
(ff,module,
"badmodrun_Cabling"
,excludeLastBins);
73
TH1D* runinfo =
AverageRunBadChannels
(ff,module,
"badmodrun_RunInfo"
,excludeLastBins);
74
TH1D* badchannel =
AverageRunBadChannels
(ff,module,
"badmodrun_BadChannel"
,excludeLastBins);
75
TH1D* dcs =
AverageRunBadChannels
(ff,module,
"badmodrun_DCS"
,excludeLastBins);
76
TH1D* badfiber =
AverageRunBadChannels
(ff,module,
"badmodrun_BadFiber"
,excludeLastBins);
77
78
cabling->SetLineColor(kRed);
79
runinfo->SetLineColor(kMagenta);
80
badchannel->SetLineColor(kCyan);
81
dcs->SetLineColor(kGreen);
82
badfiber->SetLineColor(kBlue);
83
84
badfiber->Draw();
85
dcs->Draw(
"same"
);
86
badchannel->Draw(
"same"
);
87
runinfo->Draw(
"same"
);
88
cabling->Draw(
"same"
);
89
90
return
cc;
91
}
jetUpdater_cfi.sort
sort
Definition:
jetUpdater_cfi.py:29
mps_fire.i
i
Definition:
mps_fire.py:338
CommonAnalyzer::getObject
TObject * getObject(const char *name) const
Definition:
CommonAnalyzer.cc:44
CommonAnalyzer
Definition:
CommonAnalyzer.h:12
CommonAnalyzer.h
alignCSCRings.ff
ff
Definition:
alignCSCRings.py:148
StripCompletePlot
TCanvas * StripCompletePlot(TFile &ff, const char *module, const bool excludeLastBins)
Definition:
SiStripQualityHistoryPlots.cc:68
SiStripQualityHistoryPlots.h
AverageRunBadChannels
TH1D * AverageRunBadChannels(TFile &ff, const char *module, const char *histo, const bool excludeLastBins)
Definition:
SiStripQualityHistoryPlots.cc:18
writedatasetfile.runs
runs
Definition:
writedatasetfile.py:27
CommonAnalyzer::setPath
void setPath(const char *path)
Definition:
CommonAnalyzer.cc:36
CommonAnalyzer::getRunList
const std::vector< unsigned int > getRunList() const
Definition:
CommonAnalyzer.cc:74
trackerHits.histo
histo
Definition:
trackerHits.py:12
gather_cfg.cout
cout
Definition:
gather_cfg.py:144
module
Definition:
vlib.h:208
Generated for CMSSW Reference Manual by
1.8.11