StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
SpyCorruption.cxx
1 #include<stdio.h>
2 
3 #include <TH1.h>
4 
5 #include "SpyCorruption.h"
6 
7 //------------------------------
8 //------------------------------
9 SpyCorruption:: SpyCorruption(){ //none
10  lastSum=0;
11 };
12 
13 //------------------------------
14 //------------------------------
15 bool
16 SpyCorruption::sense(FILE *fd) {
17  int sumCorr=(int)h->Integral();
18  bool isBad=sumCorr>lastSum;
19  //fprintf(fd,"\n SpyCorruption: %s scanned\n",text.Data());
20  if(isBad) {
21  fprintf(fd,"\nSpyCorruption: %s total=%d eve,\n details (type=value):",text.Data(),sumCorr);
22  int i;
23  int k=0;
24  for(i=1;i<=h->GetNbinsX();i++) {
25  fprintf(fd,"%d=%.0f, ",i,h->GetBinContent(i));
26  if(h->GetBinContent(i) <=0) continue;
27  k++;
28  }
29  fprintf(fd," --> nTypes=%d\n",k);
30  fprintf(fd," for definition see:\n @ http://www.star.bnl.gov/STAR/eemc/software/panitkin2005/\n");
31  }
32  lastSum=sumCorr;
33  return isBad;
34 }
35