]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - T0/AliT0QAChecker.cxx
Get in sync with the base class
[u/mrichter/AliRoot.git] / T0 / AliT0QAChecker.cxx
index 7aa20cbb24e09fba37c2f10fcff62771c933507f..e3fa1ab95d9ab44e935985e8d3f626b61508c6da 100644 (file)
 //  Checks the quality assurance. 
 //  By comparing with reference data
 //  Skeleton for T0
+//---------------------------------------------
+//checkig without reference data:
+//for RAW QA all histograms should have approximatly the same 
+//number of entries as RefPoint
+//for Rec Points checks 
+//  - amplitude measured by 2 methos
+//  - online and offline T0 measurements
+// for ESD quality of reconstruction ( and measurements):
+// RMS of vertex and T0 less than 75ps
+//
+// Alla.Maevskaya@cern.ch   
 //...
 
 // --- ROOT system ---
 
 ClassImp(AliT0QAChecker)
 
-//__________________________________________________________________
-AliT0QAChecker& AliT0QAChecker::operator = (const AliT0QAChecker& qac )
-{
-  // Equal operator.
-  this->~AliT0QAChecker();
-  new(this) AliT0QAChecker(qac);
-  return *this;
-}
-//__________________________________________________________________
 
-const Double_t AliT0QAChecker::Check(AliQA::ALITASK_t index,TObjArray * list)
+//__________________________________________________________________
+Double_t AliT0QAChecker::Check(AliQA::ALITASK_t index,TObjArray * list)
 {
 
   // Super-basic check on the QA histograms on the input list:
   // look whether they are empty!
 
-  cout<<" GetAliTaskName "<<AliQA::GetAliTaskName(index)<<" index "<<index<<endl;
 
-
-  Double_t test = 0.0  ;
+  Double_t test = 10.0  ;
+   
   Int_t count = 0 ;
-  Double_t nent[100];
-  memset(nent,0,100*sizeof(Double_t));
-  Double_t w[100];
-  memset(w,1.,100*sizeof(Double_t));
+  Double_t nent[250], nentraw[250];
+  TString hname[250];
+  const char *cname;
+  memset(nent,0,250*sizeof(Double_t));
+  Double_t w[250];
+  memset(w,1,250*sizeof(Double_t));
   TH1 *fhRecLEDAmp[24];  TH1 * fhRecQTC[24];
-  TH1 *fhOnlineMean;  TH1 * fhRecMean;
+  TH1 *fhOnlineMean = 0x0;  
+  TH1 * fhRecMean = 0x0;
+  TH1 *fhESDMean = 0x0;
+  TH1 *fhESDVertex = 0x0;
   TString dataType = AliQA::GetAliTaskName(index);
 
   if (list->GetEntries() == 0){
@@ -82,62 +89,89 @@ const Double_t AliT0QAChecker::Check(AliQA::ALITASK_t index,TObjArray * list)
     count = 0 ;
     while ( (hdata = dynamic_cast<TH1 *>(next())) ) {
       if (hdata) {
+       //     if (count>199) continue;
        nent[count] = hdata->GetEntries();
-               AliDebug(10,Form("count %i %s -> %f",count, hdata->GetName(),nent[count])) ;
-
+       cname = hdata->GetName();
+       hname[count] = cname;
+       AliDebug(10,Form("count %i %s -> %f",count, hname[count].Data(),nent[count])) ;
        if(index==2){
          if(count>23 && count<48)fhRecLEDAmp[count-24] = hdata;
          if(count>47 && count<72)fhRecQTC[count-48] = hdata;
-         if(count == 72) fhOnlineMean = hdata; 
-         if(count == 73) fhRecMean = hdata; 
+         if(count == 72)  fhOnlineMean = hdata; 
+         if(count == 73)  fhRecMean = hdata; 
+       }
+       
+
+       if(index==3){
+         if(count==0) fhESDMean = hdata;
+         if(count==1) fhESDVertex = hdata;
+         if(count>1){
+           AliWarning("Unknowm ESD QA histograms");
+           return 0;
+         }
        }
        count++ ;
+       
         Double_t rv = 0.;
         if(hdata->GetEntries()>0) rv = 1;
        //   AliInfo(Form("%s -> %f", hdata->GetName(), rv)) ;
         test += rv ;
+       
      }
       else{
         AliError("Data type cannot be processed") ;
       }
 
     }
-
+    
     if (count != 0) {
       if (test==0) {
         AliWarning("Histograms are there, but they are all empty: setting flag to kWARNING");
         test = 0.5;  //upper limit value to set kWARNING flag for a task
       }
       else {
-
        if(index == 2){
-         if ( TMath::Abs(fhRecMean->GetMean() - fhOnlineMean->GetMean()) > 5) 
-           AliWarning(Form("rec mean %f -> online mean %f",fhRecMean->GetMean(), fhOnlineMean->GetMean())) ;
+         //rec points
+         //        printf("rec mean %f -> online mean %f",fhRecMean->GetMean(), fhOnlineMean->GetMean()) ;
+          if ( TMath::Abs(fhRecMean->GetMean() - fhOnlineMean->GetMean()) > 5) 
+            AliDebug(1,Form("rec mean %f -> online mean %f",fhRecMean->GetMean(), fhOnlineMean->GetMean())) ;
          Double_t meanLED, meanQTC;
          for (Int_t idet=0; idet<24; idet++) {
            meanLED = fhRecLEDAmp[idet]->GetMean();
            meanQTC = fhRecQTC[idet]->GetMean();
            if (TMath::Abs(meanLED-meanQTC)> 1.) 
-           AliWarning(Form("Amplitude measurements are different in channel %i : Amp LED %f -> Amp QTC %f",idet,meanLED, meanQTC)) ;
+             AliDebug(1,Form("Amplitude measurements are different in channel %i : Amp LED %f -> Amp QTC %f",idet,meanLED, meanQTC)) ;
          }
        }       
-       else
-         {
-           AliDebug(10,Form(" MaxElement %f ", TMath::MaxElement(count,nent)));        
-           if(TMath::MaxElement(count,nent) > 1000) {
-             Double_t mean = TMath::Mean(count,nent,w);
-             AliDebug(10,Form(" Mean %f ", mean));     
-             for (Int_t i=0; i<count; i++) 
-               {
-                 Double_t diff = TMath::Abs(nent[i]-mean);
-                 if (diff > 0.1*mean )
-                   AliWarning(Form("Problem in Number of entried in hist %i  is %f\n", i, nent[i])) ; 
-         }
+        
+       
+       if (index == 0) {
+         //raw data
+         for (Int_t i=0; i<count; i++) 
+           {
+             if( nent[i] == 0)
+               AliDebug(1,Form("Histogram %s is empty  \n",hname[i].Data()  )) ; 
+           }
        }
-         }
+       if (index == 3) {
+         //ESD
+         Double_t rmsMeanTime = fhESDMean->GetRMS();
+         if (rmsMeanTime>3)            
+           AliDebug(1,Form("Mean time with bad resolution, RMS= %f",rmsMeanTime)) ; 
+         Double_t rmsVertex = fhESDVertex->GetRMS();
+         if (rmsVertex>3)              
+           AliDebug(1,Form("Vertex with bad resolution, RMS= %f",rmsVertex)) ; 
+       }
       }
+      
     }
+
+
   } //  if (list->GetEntries() != 0
+  
   AliInfo(Form("Test Result = %f", test)) ;
+
   return test ;
 }
+