]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSQASDDChecker.cxx
Adding TDC channel delays to the calib object.
[u/mrichter/AliRoot.git] / ITS / AliITSQASDDChecker.cxx
index 931c2cda138875b2db86ec7b2c5a7222f28380f8..f00ea351d3b5fbeae677e7f9db68d9620c966886 100644 (file)
@@ -1,4 +1,3 @@
-
 /**************************************************************************
  * Copyright(c) 2007-2009, ALICE Experiment at CERN, All rights reserved. *
  *                                                                        *
 
 // --- ROOT system ---
 #include "TH1.h"
-#include <TCanvas.h>
 #include <TH1D.h>
 #include <TH2.h>
-#include <TF1.h>
-
-
-
 // --- AliRoot header files ---
+#include "AliITSQADataMakerRec.h"
 #include "AliITSQASDDChecker.h"
 #include "AliLog.h"
 #include "AliCDBEntry.h"
-#include "AliQAManager.h"
-#include "AliQACheckerBase.h"
-#include "TSystem.h"
+#include "AliCDBManager.h"
+//#include "AliQAManager.h"
+//#include "AliQACheckerBase.h"
+//#include "TSystem.h"
 #include "AliITSCalibrationSDD.h"
 #include "AliITSgeomTGeo.h"
+//#include "AliITSQAChecker.h"
+
 
 ClassImp(AliITSQASDDChecker)
 //__________________________________________________________________
@@ -53,6 +51,8 @@ AliITSQASDDChecker& AliITSQASDDChecker::operator = (const AliITSQASDDChecker& qa
 
 AliITSQASDDChecker::~AliITSQASDDChecker() 
 {
+
+  //destructor
   if(fStepBitSDD) 
     {
       delete[] fStepBitSDD ;
@@ -76,8 +76,9 @@ AliITSQASDDChecker::~AliITSQASDDChecker()
 } // dtor
 
 //__________________________________________________________________
-Double_t AliITSQASDDChecker::Check(AliQAv1::ALITASK_t index, TObjArray * list, const AliDetectorRecoParam * /*recoparam*/) 
-{  
+Double_t AliITSQASDDChecker::Check(AliQAv1::ALITASK_t index, const TObjArray * list, const AliDetectorRecoParam * /*recoparam*/) 
+{
+  //check histograms of the different lists  
   AliInfo(Form("AliITSQASDDChecker called with offset: %d\n", fSubDetOffset) );
 
   AliDebug(1,Form("AliITSQASDDChecker called with offset: %d\n", fSubDetOffset));
@@ -115,7 +116,7 @@ Double_t AliITSQASDDChecker::Check(AliQAv1::ALITASK_t index, TObjArray * list, c
     case AliQAv1::kRAW:
       AliInfo(Form("Check on %s\n",AliQAv1::GetAliTaskName(index)));
       
-      if (list->GetEntries() == 0.){ //check if the list is empty
+      if (list->GetEntries() == 0){ //check if the list is empty
        //printf("test = %f \t value %f\n",test,fHighSDDValue[AliQAv1::kFATAL]);
        test=test+fHighSDDValue[AliQAv1::kFATAL];
        break;
@@ -142,68 +143,74 @@ Double_t AliITSQASDDChecker::Check(AliQAv1::ALITASK_t index, TObjArray * list, c
            TString hname=hdata->GetName();
            if(hname.Contains("SDDchargeMap"))continue;
            if(hname.Contains("SDDModPattern")){
-             hmodule=hdata;
-             entries= hdata->GetEntries();
-             if(entries==0){
-               AliWarning(Form("===================>>>>>> No entries in  %s \n",hname.Data()));
-               //printf("test = %f \t value %f\n",test,fHighSDDValue[AliQAv1::kFATAL]);
-               test=test+fStepBitSDD[AliQAv1::kFATAL];
-             }//endif entries
+             if(hname.Contains("NORM")) continue;
              else{
-               int modmax=hdata->GetNbinsX();
-               Int_t empty=0;
-               Int_t filled=0;
-               Double_t content=0;
-               for(Int_t i=1;i<=modmax;i++){
-                 content=hdata->GetBinContent(i);
-                 if(content==0.){empty++;}
-                 else if(content!=0.){filled++;}
-               }//end for
-               AliInfo(Form(" %s : empty modules %i \t filled modules %i",hname.Data(), empty, filled));
-             }//end else pattern entries !=0         
+               hmodule=hdata;
+               entries= hdata->GetEntries();
+               if(AliITSQADataMakerRec::AreEqual(entries,0.)){
+                 AliWarning(Form("===================>>>>>> No entries in  %s \n",hname.Data()));
+                 //printf("test = %f \t value %f\n",test,fHighSDDValue[AliQAv1::kFATAL]);
+                 test=test+fStepBitSDD[AliQAv1::kFATAL];
+               }//endif entries
+               else{
+                 int modmax=hdata->GetNbinsX();
+                 Int_t empty=0;
+                 Int_t filled=0;
+                 Double_t content=0;
+                 for(Int_t i=1;i<=modmax;i++){
+                   content=hdata->GetBinContent(i);
+                   if(AliITSQADataMakerRec::AreEqual(content,0.)){empty++;}
+                   else if((AliITSQADataMakerRec::AreEqual(content,0.)==kFALSE)){filled++;}
+                 }//end for
+                 AliInfo(Form(" %s : empty modules %i \t filled modules %i",hname.Data(), empty, filled));
+               }//end else pattern entries !=0
+             }//end if norm          
            }//end if modpattern
            else if(hname.Contains("SDDphizL3")||hname.Contains("SDDphizL4")){
-             Int_t layer=0;
-             if(hname.Contains("3"))layer=0;
-             else  if(hname.Contains("4"))layer=1;
-             entries2[layer]=hdata->GetEntries();
-             if(entries2[layer]==0){
-               AliWarning(Form("===================>>>>>> No entries in  %s \n",hname.Data()));
-               //printf("test = %f \t value %f\n",test,fStepBitSDD[AliQAv1::kFATAL]);
-               test=test+fStepBitSDD[AliQAv1::kFATAL];
-               if(entries==0){ 
-                 //return test; 
-                 //break;
-               }
-             }//end if getentries
+             if(hname.Contains("NORM")) continue;
              else{
-               Int_t layer1=0;
-               if(hname.Contains("3"))layer1=0;
-               else  if(hname.Contains("4"))layer1=1;
-               TH2* htemp=dynamic_cast<TH2*>(hdata);
-               hlayer[layer1]=(TH2*)htemp->Clone();
-               char newname[50];
-               sprintf(newname,"%s_copy",hname.Data());
-               hlayer[layer1]->SetName(newname);
-               hlayer[layer1]->RebinX(2);
-               int modmay=hlayer[layer1]->GetNbinsY();
-               TH1D* hproj= hlayer[layer1]->ProjectionY();
-               Double_t ladcontent=0;
-               for(Int_t i=1;i<=modmay;i++) {//loop on the ladders
-                 ladcontent=hproj->GetBinContent(i);
-                 if(ladcontent==0){emptyladders[layer1]++;}
-                 else if(ladcontent!=0){filledladders[layer1]++;} 
-               }//end for
-               AliInfo(Form(" %s : empty ladders %i \t filled ladders %i\n",hname.Data(), emptyladders[layer], filledladders[layer]));//end else layer 3
-               delete hproj;
-               hproj=NULL;     
-               //delete htemp;
-               //htemp=NULL;
-             }//end else entries !=0         
+               Int_t layer=0;
+               if(hname.Contains("3"))layer=0;
+               else  if(hname.Contains("4"))layer=1;
+               entries2[layer]=hdata->GetEntries();
+               if(entries2[layer]==0){
+                 AliWarning(Form("===================>>>>>> No entries in  %s \n",hname.Data()));
+                 //printf("test = %f \t value %f\n",test,fStepBitSDD[AliQAv1::kFATAL]);
+                 test=test+fStepBitSDD[AliQAv1::kFATAL];
+                 if(AliITSQADataMakerRec::AreEqual(entries,0.)){ 
+                   //return test; 
+                   //break;
+                 }
+               }//end if getentries
+               else{
+                 Int_t layer1=0;
+                 if(hname.Contains("3"))layer1=0;
+                 else  if(hname.Contains("4"))layer1=1;
+                 TH2* htemp=dynamic_cast<TH2*>(hdata);
+                 hlayer[layer1]=(TH2*)htemp->Clone();
+                 char newname[50];
+                 sprintf(newname,"%s_copy",hname.Data());
+                 hlayer[layer1]->SetName(newname);
+                 hlayer[layer1]->RebinX(2);
+                 int modmay=hlayer[layer1]->GetNbinsY();
+                 TH1D* hproj= hlayer[layer1]->ProjectionY();
+                 Double_t ladcontent=0;
+                 for(Int_t i=1;i<=modmay;i++) {//loop on the ladders
+                   ladcontent=hproj->GetBinContent(i);
+                   if(AliITSQADataMakerRec::AreEqual(ladcontent,0.)){emptyladders[layer1]++;}
+                   else {filledladders[layer1]++;} 
+                 }//end for
+                 AliInfo(Form(" %s : empty ladders %i \t filled ladders %i\n",hname.Data(), emptyladders[layer], filledladders[layer]));//end else layer 3
+                 delete hproj;
+                 hproj=NULL;   
+                 //delete htemp;
+                 //htemp=NULL;
+               }//end else entries !=0
+             }//end check on norm            
            }//end if layer 3
          }//end if hdata       
        }//end while
-       if(entries==0.&&entries2[0]==0.&&entries2[1]==0.) break;
+       if(AliITSQADataMakerRec::AreEqual(entries,0.)&&AliITSQADataMakerRec::AreEqual(entries2[0],0.)&&AliITSQADataMakerRec::AreEqual(entries2[1],0.)) break;
        else{
          if(hmodule||(hlayer[0]&&hlayer[1])){
            Int_t excluded=0;
@@ -226,13 +233,13 @@ Double_t AliITSQASDDChecker::Check(AliQAv1::ALITASK_t index, TObjArray * list, c
                for(Int_t i=0;i<2;i++)contentlayer[i]=0.;
                if(hmodule)content=hmodule->GetBinContent(imod+1);//if expert bit is active the histogram has been created 
                contentlayer[lay-3]=hlayer[lay-3]->GetBinContent(det,lad);
-               if(content!=0.||contentlayer[lay-3]!=0.)
+               if(AliITSQADataMakerRec::AreEqual(content,0.)==kFALSE||AliITSQADataMakerRec::AreEqual(contentlayer[lay-3],0.)==kFALSE)
                  {
                    filledmodules[lay-3]++;
                    AliWarning(Form("The module %d (layer %i, ladder %i det %i ) excluded from the acquisition, took data \n ",module,lay,lad,det));
                    exactive++;
                  }
-               else if(content==0.&&contentlayer[lay-3]==0.)emptymodules[lay-3]++;
+               else if(AliITSQADataMakerRec::AreEqual(content,0.)&&AliITSQADataMakerRec::AreEqual(contentlayer[lay-3],0.))emptymodules[lay-3]++;
                //AliInfo(Form("The module %d (layer %i, ladder %i det %i ) is bad, content %f content layer %f  filled modules position %d ",module,lay,lad,det,contentlayer[lay-3],content,lay-3) );
              }//end if bad
              else
@@ -241,8 +248,8 @@ Double_t AliITSQASDDChecker::Check(AliQAv1::ALITASK_t index, TObjArray * list, c
                  active++;
                  //printf("lay: %i\t det %i \t lad %i \n",lay,det,lad );
                  contentgood=hlayer[lay-3]->GetBinContent(det,lad);
-                 if(contentgood==0.){emptymodules[lay-3]++;}
-                 else if(contentgood!=0.){filledmodules[lay-3]++;}
+                 if(AliITSQADataMakerRec::AreEqual(contentgood,0.)){emptymodules[lay-3]++;}
+                 else {filledmodules[lay-3]++;}
                }
              
              //delete cal;
@@ -287,7 +294,7 @@ Double_t AliITSQASDDChecker::Check(AliQAv1::ALITASK_t index, TObjArray * list, c
       AliInfo(Form("Check on %s\n",AliQAv1::GetAliTaskName(index))); 
       //TH1*hdata=NULL;
       if(list->GetUniqueID()==40){
-       if (list->GetEntries() == 0.){ //check if the list is empty
+       if (list->GetEntries() == 0){ //check if the list is empty
          //printf("test = %f \t value %f\n",test,fHighSDDValue[AliQAv1::kFATAL]);
          test=fHighSDDValue[AliQAv1::kFATAL];
          
@@ -298,7 +305,7 @@ Double_t AliITSQASDDChecker::Check(AliQAv1::ALITASK_t index, TObjArray * list, c
        
          while( hdata = dynamic_cast<TH1* >(next()) ){
            if (hdata){
-             if(hdata->GetEntries()==0)test=test+fStepBitSDD[AliQAv1::kFATAL];
+             if(AliITSQADataMakerRec::AreEqual(hdata->GetEntries(),0.))test=test+fStepBitSDD[AliQAv1::kFATAL];
              else
                {
                  TString hname=hdata->GetName();
@@ -375,7 +382,7 @@ Double_t AliITSQASDDChecker::Check(AliQAv1::ALITASK_t index, TObjArray * list, c
       if(uid==60)
        {
          //digits
-         if (list->GetEntries() == 0.){ //check if the list is empty
+         if (list->GetEntries() == 0){ //check if the list is empty
            //printf("test = %f \t value %f\n",test,fHighSDDValue[AliQAv1::kFATAL]);
            test=fHighSDDValue[AliQAv1::kFATAL];
            
@@ -420,7 +427,7 @@ Double_t AliITSQASDDChecker::Check(AliQAv1::ALITASK_t index, TObjArray * list, c
       else if(uid==50)
        {
          //hits
-         if (list->GetEntries() == 0.){ //check if the list is empty
+         if (list->GetEntries() == 0){ //check if the list is empty
            //printf("test = %f \t value %f\n",test,fHighSDDValue[AliQAv1::kFATAL]);
            test=fHighSDDValue[AliQAv1::kFATAL];
            
@@ -461,7 +468,7 @@ Double_t AliITSQASDDChecker::Check(AliQAv1::ALITASK_t index, TObjArray * list, c
       else if(uid==70)
        {
          //sdigits
-         if (list->GetEntries() == 0.){ //check if the list is empty
+         if (list->GetEntries() == 0){ //check if the list is empty
            //printf("test = %f \t value %f\n",test,fHighSDDValue[AliQAv1::kFATAL]);
            test=fHighSDDValue[AliQAv1::kFATAL];
            
@@ -513,14 +520,15 @@ Double_t AliITSQASDDChecker::Check(AliQAv1::ALITASK_t index, TObjArray * list, c
 //__________________________________________________________________
 void AliITSQASDDChecker::SetTaskOffset(Int_t taskoffset)
 {
+  //set the number of the histograms already present in the list before the SDD histograms
   fSubDetOffset = taskoffset;
 }
 
 
 //__________________________________________________________________
-void AliITSQASDDChecker::SetStepBit(Double_t *steprange)
+void AliITSQASDDChecker::SetStepBit(const Double_t *steprange)
 {
-
+  //set the values of the step bit for each QA bit range calculated in the AliITSQAChecker class
   fStepBitSDD = new Double_t[AliQAv1::kNBIT];
   for(Int_t bit=0;bit<AliQAv1::kNBIT;bit++)
     {
@@ -529,9 +537,9 @@ void AliITSQASDDChecker::SetStepBit(Double_t *steprange)
 }
 
 //__________________________________________________________________
-void  AliITSQASDDChecker::SetSDDLimits(Float_t *lowvalue, Float_t * highvalue)
+void  AliITSQASDDChecker::SetSDDLimits(const Float_t *lowvalue, const Float_t * highvalue)
 {
-
+  //set the low and high values in for each QA bit range calculated in the AliITSQAChecker class
   fLowSDDValue = new Float_t[AliQAv1::kNBIT];
   fHighSDDValue= new Float_t[AliQAv1::kNBIT];