1104 << me-> getFullname() <<
"\n";
1112 nbinsX = me->
getTH1F()->GetXaxis()->GetNbins();
1113 nbinsY = me->
getTH1F()->GetYaxis()->GetNbins();
1119 nbinsX = me->
getTH1S()->GetXaxis()->GetNbins();
1120 nbinsY = me->
getTH1S()->GetYaxis()->GetNbins();
1126 nbinsX = me->
getTH1D()->GetXaxis()->GetNbins();
1127 nbinsY = me->
getTH1D()->GetYaxis()->GetNbins();
1133 nbinsX = me->
getTH2F()->GetXaxis()->GetNbins();
1134 nbinsY = me->
getTH2F()->GetYaxis()->GetNbins();
1140 nbinsX = me->
getTH2S()->GetXaxis()->GetNbins();
1141 nbinsY = me->
getTH2S()->GetYaxis()->GetNbins();
1147 nbinsX = me->
getTH2D()->GetXaxis()->GetNbins();
1148 nbinsY = me->
getTH2D()->GetYaxis()->GetNbins();
1156 <<
" does not contain TH1F/TH1S/TH1D or TH2F/TH2S/TH2D, exiting\n";
1168 unsigned xMax = nbinsX;
1169 unsigned yMax = nbinsY;
1174 unsigned Xbinnum = 1;
1175 unsigned Ybinnum =1;
1176 unsigned XWidth = 0;
1177 unsigned YWidth = 0;
1179 if (neighborsX==999){
1182 if (neighborsY==999){
1203 if (neighborsX*2 >= nbinsX) {
1204 if (nbinsX%2 == 0) {
1205 neighborsX = nbinsX/2 - 1;
1207 else { neighborsX = (nbinsX - 1)/2; }
1210 if (neighborsY*2 >= nbinsY) {
1211 if (nbinsY%2 == 0) {
1212 neighborsY = nbinsY/2 - 1;
1214 else { neighborsY = (nbinsY - 1)/2; }
1224 Xbinnum = nbinsX/XBlocks;
1225 Ybinnum = nbinsY/YBlocks;
1226 for (
unsigned groupx=0; groupx<XBlocks; ++groupx){
1227 for (
unsigned groupy=0; groupy<YBlocks; ++groupy){
1229 double blocksum = 0;
1230 for (
unsigned binx=0; binx<Xbinnum; ++binx){
1231 for (
unsigned biny=0; biny<Ybinnum; ++biny){
1232 if (groupx*Xbinnum+xMin+binx<=xMax && groupy*Ybinnum+yMin+biny<=yMax){
1233 blocksum +=
abs(h->GetBinContent(groupx*Xbinnum+xMin+binx,groupy*Ybinnum+yMin+biny));
1238 double sum =
getNeighborSum(groupx, groupy, XBlocks, YBlocks, neighborsX, neighborsY, h);
1241 if (neighborsX>groupx){
1242 XWidth = neighborsX + groupx + 1;
1243 }
else if (neighborsX>(XBlocks-(groupx+1))){
1244 XWidth = (XBlocks-groupx)+neighborsX;
1246 XWidth = 2*neighborsX+1;
1248 if (neighborsY>groupy){
1249 YWidth = neighborsY + groupy + 1;
1250 }
else if (neighborsY>(YBlocks-(groupy+1))){
1251 YWidth = (YBlocks-groupy)+neighborsY;
1253 YWidth = 2*neighborsY+1;
1256 double average = sum/(XWidth*YWidth - 1);
1257 double sigma =
getNeighborSigma(average, groupx, groupy, XBlocks, YBlocks, neighborsX, neighborsY, h);
1258 sigma -= (average-blocksum) * (average-blocksum);
1259 double sigma_2 =
sqrt(sigma)/
sqrt(XWidth*YWidth - 2);
1260 double sigma_real = sigma_2/(XWidth*YWidth - 1);
1262 double avg_uncrt = 3*sigma_real;
1264 double probNoisy = ROOT::Math::poisson_cdf_c(blocksum - 1, average + avg_uncrt);
1265 double probDead = ROOT::Math::poisson_cdf(blocksum, average - avg_uncrt);
1267 double thresholdDead = ROOT::Math::normal_cdf(-1 *
toleranceDead_);
1269 int failureNoisy = 0;
1270 int failureDead = 0;
1274 if (blocksum > average) {
1275 failureNoisy = probNoisy < thresholdNoisy;
1277 failureDead = probDead < thresholdDead;
1280 if (blocksum > average) {
1281 failureNoisy = probNoisy < thresholdNoisy;
1284 if (blocksum < average) {
1285 failureDead = probDead < thresholdDead;
1287 }
else {
std::cout<<
"No test type selected!\n"; }
1294 if (failureNoisy || failureDead) {
1301 return 1.*((XBlocks*YBlocks)-fail)/(XBlocks*YBlocks);
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
TObject * getRootObject() const
Abs< T >::type abs(const T &t)
const std::string getFullname() const
get full name of ME including Pathname
double getNeighborSigma(double average, unsigned groupx, unsigned groupy, unsigned Xblocks, unsigned Yblocks, unsigned neighborsX, unsigned neighborsY, const TH1 *h) const
std::vector< DQMChannel > badChannels_
double getNeighborSum(unsigned groupx, unsigned groupy, unsigned Xblocks, unsigned Yblocks, unsigned neighborsX, unsigned neighborsY, const TH1 *h) const
for each bin get sum of the surrounding neighbors
static std::string getAlgoName()
Kind kind() const
Get the type of the monitor element.