]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
realistic QA REC checker
authoralla <alla@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 28 Apr 2008 10:45:48 +0000 (10:45 +0000)
committeralla <alla@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 28 Apr 2008 10:45:48 +0000 (10:45 +0000)
T0/AliT0QAChecker.cxx
T0/AliT0QADataMakerRec.cxx
T0/AliT0Reconstructor.cxx

index 7e52865a44a7523533a22e6b99773d4934d31e24..0839d4c6fe1fea096c0388fdf1404aa3248f50e9 100644 (file)
@@ -38,6 +38,7 @@
 #include "AliQA.h"
 #include "AliQAChecker.h"
 #include "AliT0QAChecker.h"
+#include "iostream.h"
 
 ClassImp(AliT0QAChecker)
 
@@ -51,19 +52,24 @@ AliT0QAChecker& AliT0QAChecker::operator = (const AliT0QAChecker& qac )
 }
 //__________________________________________________________________
 
-const Double_t AliT0QAChecker::Check(TObjArray * list)
+const 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  ;
   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));
-
+  TH1 *fhRecLEDAmp[24];  TH1 * fhRecQTC[24];
+  TH1 *fhOnlineMean;  TH1 * fhRecMean;
+  TString dataType = AliQA::GetAliTaskName(index);
 
   if (list->GetEntries() == 0){
     test = 1. ; // nothing to check
@@ -72,18 +78,25 @@ const Double_t AliT0QAChecker::Check(TObjArray * list)
     
     TIter next(list) ;
     TH1 * hdata ;
+    
     count = 0 ;
     while ( (hdata = dynamic_cast<TH1 *>(next())) ) {
       if (hdata) {
        nent[count] = hdata->GetEntries();
-               AliDebug(1,Form("count %i %s -> %f",count, hdata->GetName(),nent[count])) ;
+               AliDebug(10,Form("count %i %s -> %f",count, hdata->GetName(),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; 
+       }
+       count++ ;
         Double_t rv = 0.;
         if(hdata->GetEntries()>0) rv = 1;
-        count++ ;
+       //   AliInfo(Form("%s -> %f", hdata->GetName(), rv)) ;
         test += rv ;
-       
-      }
+     }
       else{
         AliError("Data type cannot be processed") ;
       }
@@ -96,21 +109,35 @@ const Double_t AliT0QAChecker::Check(TObjArray * list)
         test = 0.5;  //upper limit value to set kWARNING flag for a task
       }
       else {
-        test /= count ;
-       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++) 
+
+       if(index == 2){
+         if ( TMath::Abs(fhRecMean->GetMean() - fhOnlineMean->GetMean()) > 5) 
+           AliWarning(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)) ;
+         }
+       }       
+       else
          {
-           Double_t diff = TMath::Abs(nent[i]-mean);
-           if (diff > 0.1*mean )
-             AliInfo(Form("Problem in Number of entried in hist %i  is %f\n", i, nent[i])) ; 
+           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 (list->GetEntries() != 0
   AliInfo(Form("Test Result = %f", test)) ;
   return test ;
 }
index accd0aafa89da4d39b3e1f6aba7e8af43a6e60fd..450a07dd41a23a56f11ea6f33bfb4686da85ab11 100644 (file)
@@ -173,14 +173,14 @@ void AliT0QADataMakerRec::InitRecPoints()
       qtcname += i;
       fhRecCFD[i] = new TH1F(timename.Data(), timename.Data(),100,2100,2800);
      Add2RecPointsList ( fhRecCFD[i],i);
-      fhRecLEDAmp[i] = new TH1F(ampname.Data(), ampname.Data(),100,3000,4000);
+      fhRecLEDAmp[i] = new TH1F(ampname.Data(), ampname.Data(),100,0, 100);
     Add2RecPointsList ( fhRecLEDAmp[i],i+24);
-      fhRecQTC[i] = new TH1F(qtcname.Data(), qtcname.Data(),100,0,10000);
+      fhRecQTC[i] = new TH1F(qtcname.Data(), qtcname.Data(),100,0,100);
     Add2RecPointsList ( fhRecQTC[i],i+48);
      }
    
-  TH1F *fhRecEff = new TH1F("hRecEff","Efficiency rec.points",25,-0.5,24.5);
-  Add2RecPointsList ( fhRecEff,72);
+  TH1F *fhOnlineMean = new TH1F("hOnlineMean","online mean",100,2400,2500);
+  Add2RecPointsList ( fhOnlineMean,72);
   TH1F * fhRecMean = new TH1F("hRecMean"," reconstructed mean signal",100,2400,2500);
   Add2RecPointsList( fhRecMean,73);
   //  printf(" !!!!!!  AliT0QADataMakerRec::InitRecPoints() ended\n");
@@ -191,13 +191,13 @@ void AliT0QADataMakerRec::InitRecPoints()
 void AliT0QADataMakerRec::InitESDs()
 {
   //create ESDs histograms in ESDs subdir
-  ///  printf(" !!!!!  AliT0QADataMakerESD::InitRecPoints() started\n");
+  printf(" !!!!!  AliT0QADataMakerESD::InitESD() started\n");
   TH1F *fhESDMean = new TH1F("hESDmean"," ESD mean",100,2400,2500);
   Add2ESDsList(fhESDMean, 0) ;
- TH1F * fhESDVertex = new TH1F("hESDvertex","EAD vertex",100,-50,50);
 TH1F * fhESDVertex = new TH1F("hESDvertex","EAD vertex",100,-50,50);
   Add2ESDsList(fhESDVertex, 1) ;
-
-  //  printf(" !!!!!!  AliT0QADataMakerRec::InitESD() ended\n");
+  
+  printf(" !!!!!!  AliT0QADataMakerRec::InitESD() ended\n");
 
 }
 
@@ -288,7 +288,8 @@ void AliT0QADataMakerRec::MakeRecPoints(TTree * clustersTree)
     
     //  if(frecpoints -> GetTime(i) > 0) fhRecEff->Fill(i);
   }
-     GetRecPointsData(72) ->Fill(frecpoints->GetMeanTime());
+     GetRecPointsData(72) ->Fill(frecpoints->GetOnlineMean());
+     GetRecPointsData(73) ->Fill(frecpoints->GetMeanTime());
      //  printf(" !!!!!  AliT0QADataMakerRec::MakeRecPoints() end\n");
   
 }
@@ -297,7 +298,7 @@ void AliT0QADataMakerRec::MakeRecPoints(TTree * clustersTree)
 void AliT0QADataMakerRec::MakeESDs(AliESDEvent * esd)
 {
   //fills QA histos for ESD
-  //  printf(" !!!!!  AliT0QADataMakerRec::MakeESD() started\n");
+  printf(" !!!!!  AliT0QADataMakerRec::MakeESD() started\n");
 
   GetESDsData(0) -> Fill(esd->GetT0());
   GetESDsData(1)-> Fill(esd->GetT0zVertex());
index 29f1164f36f658c2ebf67f09cdf6f8a33d42d04a..4105db9f1be1c5271417db88aa912dba069e0565 100644 (file)
@@ -171,12 +171,13 @@ void AliT0Reconstructor::Reconstruct(TTree*digitsTree, TTree*clustersTree) const
       //LED
       Double_t sl = (timeLED->At(ipmt) - time[ipmt])*channelWidth;
       Double_t qt=((TGraph*)fAmpLEDrec.At(ipmt))->Eval(sl/1000.);
+      Float_t ampLED = qt/Float_t(mv2MIP);
       AliDebug(1,Form(" ipmt %i QTC %f ch QTC in MIP %f, time in chann %f (led-cfd) %f in MIPs %f",
-                     ipmt, adc[ipmt], adc[ipmt]/Float_t(mv2MIP), time[ipmt],sl, qt/Float_t(mv2MIP)));
+                     ipmt, adc[ipmt], adc[ipmt]/Float_t(mv2MIP), time[ipmt],sl,ampLED ));
 
       frecpoints->SetTime(ipmt,time[ipmt]);
       frecpoints->SetAmp(ipmt,adc[ipmt]/Float_t(mv2MIP));
-      frecpoints->SetAmpLED(ipmt,qt/Float_t(mv2MIP));
+      frecpoints->SetAmpLED(ipmt,ampLED);
     }
     else {
       time[ipmt] = 0;