45{
47
48 if(
object.
IsA()->InheritsFrom(
"TH2" ) ) {
50 int dimension =
histogram->GetDimension();
51 if (dimension != 2 ){
52 throw dqm_core::BadConfig( ERS_HERE, name, "dimension != 2 " );
53 }
54 } else {
55 throw dqm_core::BadConfig( ERS_HERE, name, "does not inherit from TH2" );
56 }
58
60 if(nXBins > 25) {
61 nXBins = 25;
62 }
63 const int nYBins =
histogram -> GetNbinsY();
64
65
66
67 int colflags[4];
72
73 bool doflags[2];
76
77 dqm_core::Result*
result =
new dqm_core::Result();
78 colflags[0] = ((colflags[0] > 0) && (colflags[0] <= nXBins)) ? colflags[0] : 1;
79 colflags[1] = ((colflags[1] >= colflags[0]) && (colflags[1] <= nXBins)) ? colflags[1] : nXBins;
80 colflags[2] = ((colflags[2] > 0) && (colflags[2] <= nXBins)) ? colflags[2] : 1;
81 colflags[3] = ((colflags[3] >= colflags[2]) && (colflags[3] <= nXBins)) ? colflags[3] : nXBins;
82 bool yellowFlagComp = false, redFlagComp = false;
83 int ycnt = 0, rcnt = 0;
84
85
87 if(doflags[0]) {
88 for( int j = colflags[0]; j <= colflags[1]; j++ ) {
89 TString binLabel =
histogram->GetXaxis()->GetBinLabel(j);
90 TH1D *hprojy =
histogram->ProjectionY(Form(
"hpy1yf%02d_%s",j,binLabel.Data()),j,j+1,
"egoff");
91 if(hprojy) {
92 float uflow = std::abs(hprojy->GetBinContent(0));
93 float oflow = std::abs(hprojy->GetBinContent(nYBins+1));
94 float btotal = hprojy->Integral();
95
96
97
98 if(((uflow > epsilon) || (oflow > epsilon)) && (btotal < epsilon)) {
99 yellowFlagComp = true;
100
101 ycnt++;
102 }
103 delete hprojy; hprojy = 0;
104 }
105 }
106 }
107
108
109 if(doflags[1]) {
110 for( int j = colflags[2]; j <= colflags[3]; j++ ) {
111 TString binLabel =
histogram->GetXaxis()->GetBinLabel(j);
112 TH1D *hprojy =
histogram->ProjectionY(Form(
"hpy1rf%02d_%s",j,binLabel.Data()),j,j+1,
"egoff");
113 if(hprojy) {
114 float uflow = std::abs(hprojy->GetBinContent(0));
115 float oflow = std::abs(hprojy->GetBinContent(nYBins+1));
116 float btotal = hprojy->Integral();
117
118
119 if(((uflow > epsilon) || (oflow > epsilon)) && (btotal < epsilon)) {
120 redFlagComp = true;
121 rcnt++;
122 }
123 delete hprojy; hprojy = 0;
124 }
125 }
126 }
127
128
129 result->status_ = dqm_core::Result::Green;
130 if(doflags[0] && yellowFlagComp) {
131 result->status_ = dqm_core::Result::Yellow;
132 }
133 if(doflags[1] && redFlagComp) {
134 result->status_ = dqm_core::Result::Red;
135 }
136 result->tags_[
"YellowMETComponents"] = ycnt;
137 result->tags_[
"RedMETComponents"] = rcnt;
138
140
142}
#define IsA
Declare the TObject style functions.