44{
46
47 if(
object.
IsA()->InheritsFrom(
"TH1" )) {
50 throw dqm_core::BadConfig( ERS_HERE, name, "dimension > 1 " );
51 }
52 } else {
53 throw dqm_core::BadConfig( ERS_HERE, name, "does not inherit from TH1");
54 }
55
56
61 dqm_core::Result *
result =
new dqm_core::Result(dqm_core::Result::Undefined);
64 }
65
66 double gthreshold;
67 double rthreshold;
68 try {
71 }
72 catch( dqm_core::Exception & ex ) {
73 throw dqm_core::BadConfig( ERS_HERE, name, ex.what(), ex );
74 }
75
76
80 dqm_core::Result*
result =
new dqm_core::Result();
81 TH1* resulthisto;
84 }
else if (
histogram->InheritsFrom(
"TH1")) {
86 } else {
87 throw dqm_core::BadConfig( ERS_HERE, name, "does not inherit from TH1" );
88 }
89
90 resulthisto->Reset();
91
92 for (
int i = 1;
i <
range[0]; ++
i ) {
94 if ( content !=0 ) {
96 resulthisto->SetBinContent(i,content);
97 if (publish &&
count<maxpublish) {
99 }
100 }
101 }
102 for (
int j = range[1];
j <=
nbins; ++
j ) {
104 if ( content != 0 ) {
106 resulthisto->SetBinContent(j,content);
107 if (publish &&
count<maxpublish) {
109 }
110 }
111 }
112
113 ERS_DEBUG(1,
"Number of bins with content != 0 is " <<
count );
114 ERS_DEBUG(1,"Green threshold: "<< gthreshold << " bin(s); Red threshold : " << rthreshold << " bin(s) ");
115
116
118 result->object_ = boost::shared_ptr<TObject>(resulthisto);
119
120 if (gthreshold > rthreshold) {
121 if (
count >= gthreshold ) {
122 result->status_ = dqm_core::Result::Green;
123 }
else if (
count > rthreshold ) {
124 result->status_ = dqm_core::Result::Yellow;
125 } else {
126 result->status_ = dqm_core::Result::Red;
127 }
128 } else {
129 if (
count <= gthreshold ) {
130 result->status_ = dqm_core::Result::Green;
131 }
else if (
count < rthreshold ) {
132 result->status_ = dqm_core::Result::Yellow;
133 } else {
134 result->status_ = dqm_core::Result::Red;
135 }
136 }
137
139}
int count(std::string s, const std::string ®x)
count how many occurances of a regx are in a string
float j(const xAOD::IParticle &, const xAOD::TrackMeasurementValidation &hit, const Eigen::Matrix3d &jab_inv)
setBGCode setTAP setLVL2ErrorBits bool
#define IsA
Declare the TObject style functions.