51 if(
object.
IsA()->InheritsFrom(
"TH1" ) ) {
54 throw dqm_core::BadConfig( ERS_HERE,
name,
"dimension > 2 " );
57 throw dqm_core::BadConfig( ERS_HERE,
name,
"does not inherit from TH1" );
69 if (
histogram->GetEntries() < minstat ) {
81 catch( dqm_core::Exception & ex ) {
82 throw dqm_core::BadConfig( ERS_HERE,
name, ex.what(), ex );
86 std::vector<double> stripsMedian;
87 std::vector<double> stripsAvg;
88 std::vector<double> stripsVariance;
91 std::vector<double> onestrip;
94 if (
histogram->GetBinContent(
i,j) == ignoreval)
continue;
95 float binvalue =
histogram->GetBinContent(
i,j);
96 onestrip.push_back(binvalue);
98 if(binvalue > maxInMap) {
102 stripsAvg.push_back(stripSum/onestrip.size());
108 for (
int j =
range[2]; j <=
range[3]; ++j ) {
109 if (
histogram->GetBinContent(
i,j) == ignoreval)
continue;
110 double binvalue =
histogram->GetBinContent(
i,j);
117 stripsVariance.push_back(variance);
120 std::vector<bin> redbins;
121 std::vector<bin> yellowbins;
122 std::vector<bin> Allbins;
126 if (binvalue== ignoreval)
continue;
127 double strip_median = stripsMedian[
k-
range[0]];
128 if(stripsMedian[
k-
range[0]]==0 && stripsVariance[
k-
range[0]]==0)
continue;
129 else if(stripsMedian[
k-
range[0]]==0 && stripsVariance[
k-
range[0]]!=0 && stripsAvg[
k-
range[0]]!=0) strip_median = stripsAvg[
k-
range[0]];
130 else if(stripsMedian[
k-
range[0]]==0 && stripsVariance[
k-
range[0]]!=0 && stripsAvg[
k-
range[0]]==0)
continue;
131 double outstandingRatio=0;
132 if(std::abs(strip_median) > 0.00001 ) outstandingRatio= (binvalue-strip_median)/std::sqrt(std::abs(strip_median));
136 bin onebin = {
eta,
phi,
k,
l,binvalue,outstandingRatio};
137 Allbins.push_back(onebin);
138 if(std::abs(outstandingRatio) > rthreshold ) {
139 if( VisualMode && (binvalue / maxInMap < suppressRedFactor) )
141 redbins.push_back(onebin);
143 else if(std::abs(outstandingRatio) > gthreshold ){
144 if( VisualMode && (binvalue / maxInMap < suppressFactor) )
146 yellowbins.push_back(onebin);
151 int count_yellow_c = 0;
152 std::vector<std::vector<colorbin> > ColorBinMap;
156 std::vector<colorbin> oneColorStrip;
158 colorbin oneColorBin = {
static_cast<double>(
k),
static_cast<double>(
l), -1, -1, -1,
green, 1};
159 oneColorStrip.push_back(oneColorBin);
161 ColorBinMap.push_back(oneColorStrip);
165 for(
unsigned int i=0;
i<redbins.size();
i++){
166 int k=redbins[
i].m_ix;
167 int l=redbins[
i].m_iy;
169 ColorBinMap[
k-
range[0]][
l-
range[2]].m_eta = redbins[
i].m_eta;
171 ColorBinMap[
k-
range[0]][
l-
range[2]].m_phi = redbins[
i].m_phi;
172 ColorBinMap[
k-
range[0]][
l-
range[2]].m_value = redbins[
i].m_value;
178 for(
unsigned int i=0;
i<yellowbins.size();
i++){
179 int k=yellowbins[
i].m_ix;
180 int l=yellowbins[
i].m_iy;
181 ColorBinMap[
k-
range[0]][
l-
range[2]].m_eta = yellowbins[
i].m_eta;
182 ColorBinMap[
k-
range[0]][
l-
range[2]].m_phi = yellowbins[
i].m_phi;
183 ColorBinMap[
k-
range[0]][
l-
range[2]].m_value = yellowbins[
i].m_value;
189 std::vector<colorcluster > clusterArray;
190 for(
unsigned int i=0;
i<redbins.size();
i++){
191 const int k=redbins[
i].m_ix;
192 const int l=redbins[
i].m_iy;
195 if(onecluster.
m_size > 1) clusterArray.push_back(onecluster);
198 for(
unsigned int i=0;
i<yellowbins.size();
i++){
199 const int k=yellowbins[
i].m_ix;
200 const int l=yellowbins[
i].m_iy;
203 if(onecluster.
m_size > 1) clusterArray.push_back(onecluster);
208 for(
unsigned int i=0;
i<clusterArray.size();
i++){
210 if(clusterArray[
i].m_color==
red){
211 sprintf(
tmp,
"CR%i-(eta,phi)(r)(size)=(%0.3f,%0.3f)(%0.3f)(%i)",count_red_c,clusterArray[
i].m_eta,clusterArray[
i].m_phi,clusterArray[
i].m_radius,clusterArray[
i].m_size);
214 else if(clusterArray[
i].m_color==
yellow){
215 sprintf(
tmp,
"CY%i-(eta,phi)(r)(size)=(%0.3f,%0.3f)(%0.3f)(%i)",count_yellow_c,clusterArray[
i].m_eta,clusterArray[
i].m_phi,clusterArray[
i].m_radius,clusterArray[
i].m_size);
221 result->tags_[
"NRedClusters"] = count_red_c;
222 result->tags_[
"NYellowClusters"] = count_yellow_c;
232 for(
unsigned int i=0;
i<redbins.size();
i++){
233 if(ClusterResult && ColorBinMap[redbins[
i].m_ix-
range[0]][redbins[
i].m_iy-
range[2]].m_status==0 )
continue;
236 sprintf(
tmp,
"R%i-(eta,phi)[OSRatio]=(%0.3f,%0.3f)[%0.2e]",count_red,redbins[
i].m_eta,redbins[
i].m_phi,redbins[
i].m_outstandingRatio);
242 if(count_red > NpublishRed)
break;
248 for(
unsigned int i=0;
i<yellowbins.size();
i++){
249 if(ClusterResult &&ColorBinMap[yellowbins[
i].m_ix-
range[0]][yellowbins[
i].m_iy-
range[2]].m_status==0)
continue;
250 if(publish && (count_red+count_yellow) < Nmaxpublish ){
252 sprintf(
tmp,
"Y%i-(eta,phi)[OSRatio]=(%0.3f,%0.3f)[%.2e]",count_yellow,yellowbins[
i].m_eta,yellowbins[
i].m_phi,yellowbins[
i].m_outstandingRatio);
258 result->tags_[
"NRedBins"] = count_red;
259 result->tags_[
"NYellowBins"] = count_yellow;
261 if(count_red+count_yellow==0 && Allbins.size()>=5 ){
262 for(
int i=0;
i<5;
i++){
264 sprintf(tmptmp,
"LeadingBin%i-(eta,phi)=(%0.3f,%0.3f)",
i,Allbins[
i].m_eta,Allbins[
i].m_phi);
265 std::string tagtag = tmptmp;
266 result->tags_[tagtag] = Allbins[
i].m_value;
273 else if (count_yellow>0||count_yellow_c>0)
result->status_ = dqm_core::Result::Yellow;