37{
39 if (
obj.IsA()->InheritsFrom(
"TH2") ||
obj.IsA()->InheritsFrom(
"TH3") )
40 {
41 throw dqm_core::BadConfig( ERS_HERE , name , " dimension > 1 ");
42 }
43 if (
obj.IsA()->InheritsFrom(
"TH1") )
44 {
45 ERS_DEBUG(2,
"Got TH1 called: "<<
obj.GetName()<<
" of type:"<<
obj.IsA()->GetName());
47 }
48 else
49 {
50 throw dqm_core::BadConfig( ERS_HERE ,name , " does not inherit from TH1");
51 }
52
55
56 const double notFound = -99999;
60 const int maxbin = (
xmax == notFound) ?
histo->GetNbinsX() :
histo->GetXaxis()->FindBin(
xmax);
61
62 double grThr, reThr;
63 try
64 {
65 grThr = dqm_algorithms::tools::GetFromMap("Threshold",config.getGreenThresholds() );
66 reThr = dqm_algorithms::tools::GetFromMap("Threshold",config.getRedThresholds() );
67 }
68 catch ( dqm_core::Exception & ex )
69 {
70 throw dqm_core::BadConfig(ERS_HERE,name,"Paramter: 'Threshold' is mandatory, cannot continue");
71 }
72
73 if (
m_name==
"SideBand_Relative" && (grThr>1.0 || reThr>1.0) )
74
75 {
76 throw dqm_core::BadConfig(ERS_HERE,
m_name,
"Configuration Error: Threshold>100%");
77 }
78#if DEBUG_LEVEL > 1
79 std::stringstream configuration;
80 configuration
81 << " - UseUnderFlow = " << UseUnderFlow << " - UseOverFlow = " << UseOverFlow
82 <<
" - Min = " <<
xmin <<
" - Max = " <<
xmax
83 << " - Green Threshold = " << grThr << " - Red Threshold = " << reThr;
84 ERS_DEBUG(2,"Configuration:"<<configuration.str());
85#endif
86
87 const bool AbsoluteValue = (
m_name ==
"SideBand_Absolute" );
89 Double_t
inside =
histo->Integral( minbin , maxbin );
90 if ( UseUnderFlow )
tot+=
histo->GetBinContent(0);
91 if ( UseOverFlow )
tot+=
histo->GetBinContent(
histo->GetNbinsX()+1);
93 if ( !AbsoluteValue ) {
94
95 if (tot > 0. || tot < 0.) {
97 }
98 }
99 ERS_DEBUG(2,"Total:"<<tot<<" SideBand:"<<sideband);
100 dqm_core::Result *
result =
new dqm_core::Result;
101 result->tags_.insert(std::make_pair(
"TotalIntegral",tot));
102 result->tags_.insert(std::make_pair(
"SideBands",sideband));
103
104
105 if (reThr> grThr) {
106 if ( sideband>reThr ){
107 ERS_DEBUG(1,"[RED] Result : "<<sideband);
108 result->status_=dqm_core::Result::Red;
110 } else if ( sideband > grThr ){
111 ERS_DEBUG(1,"[YELLOW] Result : "<<sideband);
112 result->status_=dqm_core::Result::Yellow;
114 }
115 }else {
116 if ( sideband < reThr ){
117 ERS_DEBUG(1,"[RED] Result : "<<sideband);
118 result->status_=dqm_core::Result::Red;
120 } else if ( sideband < grThr ){
121 ERS_DEBUG(1,"[YELLOW] Result : "<<sideband);
122 result->status_=dqm_core::Result::Yellow;
124 }
125 }
126
127 ERS_DEBUG(1,"[GREEN] Result");
128 result->status_=dqm_core::Result::Green;
130}
Int_t FindBin(const TAxis *axis, const double x)