Updated version of ITS QA Checker and related modifications (Melinda)
authormasera <masera@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sun, 29 Nov 2009 01:09:23 +0000 (01:09 +0000)
committermasera <masera@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sun, 29 Nov 2009 01:09:23 +0000 (01:09 +0000)
24 files changed:
ITS/AliITSQAChecker.cxx
ITS/AliITSQAChecker.h
ITS/AliITSQADataMakerRec.cxx
ITS/AliITSQADataMakerRec.h
ITS/AliITSQADataMakerSim.cxx
ITS/AliITSQADataMakerSim.h
ITS/AliITSQASDDChecker.cxx
ITS/AliITSQASDDChecker.h
ITS/AliITSQASDDDataMakerRec.cxx
ITS/AliITSQASDDDataMakerRec.h
ITS/AliITSQASDDDataMakerSim.cxx
ITS/AliITSQASDDDataMakerSim.h
ITS/AliITSQASPDChecker.cxx
ITS/AliITSQASPDChecker.h
ITS/AliITSQASPDDataMakerRec.cxx
ITS/AliITSQASPDDataMakerRec.h
ITS/AliITSQASPDDataMakerSim.cxx
ITS/AliITSQASPDDataMakerSim.h
ITS/AliITSQASSDChecker.cxx
ITS/AliITSQASSDChecker.h
ITS/AliITSQASSDDataMakerRec.cxx
ITS/AliITSQASSDDataMakerRec.h
ITS/AliITSQASSDDataMakerSim.cxx
ITS/AliITSQASSDDataMakerSim.h

index 8c203b6..f8cfad6 100644 (file)
@@ -42,22 +42,29 @@ fLDC(0),
 fSPDOffset(0), 
 fSDDOffset(0), 
 fSSDOffset(0),
+fSPDHisto(0),
+fSDDHisto(0),
+fSSDHisto(0),
 fSPDChecker(0),  // SPD Checker
 fSDDChecker(0),  // SDD Checker
 fSSDChecker(0)  // SSD Checker
+
 {
   // Standard constructor
   fkOnline = kMode; fDet = subDet; fLDC = ldc;
   if(fDet == 0 || fDet == 1) {
     AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQAChecker::Create SPD Checker\n");
+    fSPDChecker = new AliITSQASPDChecker();
   }
   if(fDet == 0 || fDet == 2) {
     AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQAChecker::Create SDD Checker\n");
+    fSDDChecker = new AliITSQASDDChecker();
   }
   if(fDet == 0 || fDet == 3) {
     AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQAChecker::Create SSD Checker\n");
+    fSSDChecker = new AliITSQASSDChecker();
   }
-
+  InitQACheckerLimits();
 }
 
 //____________________________________________________________________________
@@ -69,9 +76,13 @@ fLDC(qac.fLDC),
 fSPDOffset(qac.fSPDOffset), 
 fSDDOffset(qac.fSDDOffset), 
 fSSDOffset(qac.fSSDOffset), 
-fSPDChecker(0), 
-fSDDChecker(0), 
-fSSDChecker(0) {
+fSPDHisto(qac.fSPDHisto),
+fSDDHisto(qac.fSDDHisto),
+fSSDHisto(qac.fSSDHisto),
+fSPDChecker(qac.fSPDChecker), 
+fSDDChecker(qac.fSDDChecker), 
+fSSDChecker(qac.fSSDChecker)
+{
   // copy constructor
   AliError("Copy should not be used with this class\n");
 }
@@ -86,10 +97,13 @@ AliITSQAChecker& AliITSQAChecker::operator=(const AliITSQAChecker& qac){
 //____________________________________________________________________________
 Double_t * AliITSQAChecker::Check(AliQAv1::ALITASK_t index, TObjArray ** list, AliDetectorRecoParam * /*recoParam*/)
 {
-  
+
+
   // Super-basic check on the QA histograms on the input list:
   // look whether they are empty!
+  //for the ITS subdetectorQA (Raws Digits Hits RecPoints SDigits) return the worst (= lowest) value of the three result
   if(index == AliQAv1::kESD){
+
     Double_t * rv = new Double_t[AliRecoParam::kNSpecies] ; 
     for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) {
       rv[specie] = 0.0 ; 
@@ -109,6 +123,9 @@ Double_t * AliITSQAChecker::Check(AliQAv1::ALITASK_t index, TObjArray ** list, A
         rv[specie] = 0.; // nothing to check
       }
       else {
+       Double_t *stepbit=new Double_t[AliQAv1::kNBIT];
+       Double_t histonumb= list[specie]->GetEntries();
+       CreateStepForBit(histonumb,stepbit); 
         TIter next1(list[specie]);
         TH1 * hdata;
         Int_t nskipped=0;
@@ -229,57 +246,82 @@ Double_t * AliITSQAChecker::Check(AliQAv1::ALITASK_t index, TObjArray ** list, A
   Double_t * retval = new Double_t[AliRecoParam::kNSpecies] ; 
   //____________________________________________________________________________
 
-  Double_t spdCheck, sddCheck, ssdCheck;
-  //pixel
-  if(fDet == 0 || fDet == 1) {
-    AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQAChecker::Create SPD Checker\n");
-    if(!fSPDChecker) {
-      fSPDChecker = new AliITSQASPDChecker();
-    }
-    fSPDChecker->SetTaskOffset(fSPDOffset);
-    for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) {
-      retval[specie] = 1.0 ; 
-      if ( AliQAv1::Instance()->IsEventSpecieSet(specie) ) {
-        spdCheck = fSPDChecker->Check(index, list[specie]);
-        if(spdCheck<retval[specie])retval[specie] = spdCheck;
-      }
-    }
-  }
-  //drift
-  if(fDet == 0 || fDet == 2) {
-    AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQAChecker::Create SDD Checker\n");
-    if(!fSDDChecker) {
-      fSDDChecker = new AliITSQASDDChecker();
-    }
-    fSDDChecker->SetTaskOffset(fSDDOffset);
-    for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) {
-      retval[specie] = 1.0 ; 
-      if ( AliQAv1::Instance()->IsEventSpecieSet(specie) ) {
-        sddCheck = fSDDChecker->Check(index, list[specie]);
-        if(sddCheck<retval[specie])retval[specie] = sddCheck;
-      }
-    }
-  }
-  //strip
-  if(fDet == 0 || fDet == 3) {
-    AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQAChecker::Create SSD Checker\n");
-    if(!fSSDChecker) {
-      fSSDChecker = new AliITSQASSDChecker();
-      AliDebug(AliQAv1::GetQADebugLevel(), Form("Number of monitored objects SSD: %d", list[AliRecoParam::kDefault]->GetEntries()));
-    }
-    fSSDChecker->SetTaskOffset(fSSDOffset);
+  Double_t spdCheck[AliRecoParam::kNSpecies] ;
+  Double_t sddCheck[AliRecoParam::kNSpecies] ;
+  Double_t ssdCheck[AliRecoParam::kNSpecies] ;
+
+
+
     for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) {
-      retval[specie] = 1.0 ; 
       if ( AliQAv1::Instance()->IsEventSpecieSet(specie) ) {
-        ssdCheck = fSSDChecker->Check(index, list[specie]);
-        if(ssdCheck<retval[specie])retval[specie] = ssdCheck;  
-      }
-    }
-  }
-  // here merging part for common ITS QA result
-  // 
+       Double_t histotot=list[specie]->GetEntries();
+       if(histotot!=0)
+         {
+           spdCheck[specie]=0.;
+           sddCheck[specie]=0.;
+           ssdCheck[specie]=0.;
+           retval[specie] = 0.0 ;// 
+           //pixel
+           if(fDet == 0 || fDet == 1) {
+             fSPDChecker->SetTaskOffset(fSPDOffset);
+             //printf("spdoffset = %i \n",fSPDOffset );
+             Double_t histoSPD=double(GetSPDHisto());
 
-  return retval;  
+             Double_t *stepSPD=new Double_t[AliQAv1::kNBIT];
+             CreateStepForBit(histoSPD,stepSPD);
+             fSPDChecker->SetStepBit(stepSPD);
+             spdCheck[specie] = fSPDChecker->Check(index, list[specie]);
+             if(spdCheck[specie]>fUpTestValue[AliQAv1::kFATAL]||spdCheck[specie]<0.)
+               {
+                 AliInfo(Form("SPD check result for %s  is out of range (%f)!!! Retval of specie %s is sit to -1\n ",AliQAv1::GetAliTaskName(index),spdCheck[specie],AliRecoParam::GetEventSpecieName(specie)));
+                 spdCheck[specie]=fUpTestValue[AliQAv1::kFATAL];
+               }
+             //if(spdCheck[specie]<0.5)AliInfo(Form("SPD check result  for %s (%s) is < 0.5 .The result is %f ",AliQAv1::GetAliTaskName(index),AliRecoParam::GetEventSpecieName(specie),spdCheck[specie]) );
+             delete []stepSPD;
+             retval[specie]=spdCheck[specie];
+           }
+           //drift
+           if(fDet == 0 || fDet == 2) {
+             fSDDChecker->SetTaskOffset(fSDDOffset);
+             Double_t histoSDD=double(GetSDDHisto());
+             Double_t *stepSDD=new Double_t[AliQAv1::kNBIT];
+             CreateStepForBit(histoSDD,stepSDD);
+             fSDDChecker->SetStepBit(stepSDD);
+             sddCheck[specie] = fSDDChecker->Check(index, list[specie]);
+             if(sddCheck[specie]>fUpTestValue[AliQAv1::kFATAL]||sddCheck[specie]<0.)
+               {
+                 AliInfo(Form("SDD check result for %s  is out of range (%f)!!! Retval of specie %s is sit to -1\n ",AliQAv1::GetAliTaskName(index),sddCheck[specie],AliRecoParam::GetEventSpecieName(specie)));
+                 sddCheck[specie]=fUpTestValue[AliQAv1::kFATAL];
+               }
+             //if(sddCheck[specie]<0.5)AliInfo(Form("SDD check result  for %s (%s) is < 0.5 .The result is %f\f ",AliQAv1::GetAliTaskName(index),AliRecoParam::GetEventSpecieName(specie),sddCheck[specie]) );
+             delete []stepSDD;
+             if(sddCheck[specie]>retval[specie])retval[specie]=sddCheck[specie];  
+           }
+           //strip
+           if(fDet == 0 || fDet == 3) {
+             fSSDChecker->SetTaskOffset(fSSDOffset);
+             Double_t histoSSD=double(GetSSDHisto());
+             Double_t *stepSSD=new Double_t[AliQAv1::kNBIT];
+             CreateStepForBit(histoSSD,stepSSD);
+             fSSDChecker->SetStepBit(stepSSD);
+             ssdCheck[specie] = fSSDChecker->Check(index, list[specie]);
+             if(ssdCheck[specie]>fUpTestValue[AliQAv1::kFATAL]||ssdCheck[specie]<0.)
+               {
+                 AliInfo(Form("SSD check result for %s is out of range (%f)!!! Retval of specie %s is sit to -1\n ",AliQAv1::GetAliTaskName(index),ssdCheck[specie],AliRecoParam::GetEventSpecieName(specie)));
+                 ssdCheck[specie]=fUpTestValue[AliQAv1::kFATAL];
+               }
+             //if(ssdCheck[specie]<0.5)AliInfo(Form("SSD check result  for %s (%s) is < 0.5 . The result is %f ",AliQAv1::GetAliTaskName(index),AliRecoParam::GetEventSpecieName(specie),ssdCheck[specie]) );
+             delete [] stepSSD;
+             if(ssdCheck[specie]>retval[specie])retval[specie]=ssdCheck[specie];
+           }
+           
+           AliInfo(Form("Check result for %s: \n\t  SPD %f \n\t  SDD %f \n\t  SSD %f \n Check result %f \n ",AliQAv1::GetAliTaskName(index),spdCheck[specie],sddCheck[specie],ssdCheck[specie],retval[specie]));
+           // here merging part for common ITS QA result
+           // 
+         }//end entries
+      }//end if event specie
+    }//end for
+    return retval;  
 }
 
 
@@ -292,6 +334,15 @@ void AliITSQAChecker::SetTaskOffset(Int_t SPDOffset, Int_t SDDOffset, Int_t SSDO
   fSSDOffset = SSDOffset;
 }
 
+//____________________________________________________________________________
+void AliITSQAChecker::SetHisto(Int_t SPDhisto, Int_t SDDhisto, Int_t SSDhisto)
+{
+  //Setting the 3 offsets for each task called
+  fSPDHisto = SPDhisto;
+  fSDDHisto = SDDhisto;
+  fSSDHisto = SSDhisto;
+}
+
  //____________________________________________________________________________
  void AliITSQAChecker::SetDetTaskOffset(Int_t subdet,Int_t offset)
  {
@@ -311,3 +362,101 @@ void AliITSQAChecker::SetTaskOffset(Int_t SPDOffset, Int_t SDDOffset, Int_t SSDO
      break;
    }
  }
+
+ //____________________________________________________________________________
+ void AliITSQAChecker::SetDetHisto(Int_t subdet,Int_t histo)
+ {
+   switch(subdet){
+   case 1:
+     SetSPDHisto(histo);
+     break;
+   case 2:
+     SetSDDHisto(histo);
+     break;
+   case 3:
+     SetSSDHisto(histo);
+     break;
+   default:
+     AliWarning("No specific (SPD,SDD or SSD) subdetector correspond to to this number!!! all offsets set to zero for all the detectors\n");
+     SetHisto(0, 0, 0);
+     break;
+   }
+ }
+
+//_____________________________________________________________________________
+
+void AliITSQAChecker::InitQACheckerLimits()
+{
+  
+  AliInfo("Setting of tolerance values\n");
+
+  Float_t lowtolerancevalue[AliQAv1::kNBIT];
+
+  Float_t hightolerancevalue[AliQAv1::kNBIT];
+  for(Int_t bit=0;bit<AliQAv1::kNBIT;bit++)
+    {
+      lowtolerancevalue[bit]=(bit*1000.);
+      hightolerancevalue[bit]=((bit+1.)*1000.);
+    }
+  SetHiLo(hightolerancevalue,lowtolerancevalue);
+  //  AliInfo(Form("Range Value  \n INFO    -> %f <  value <  %f \n WARNING -> %f <  value <= %f \n ERROR   -> %f <  value <= %f \n FATAL   -> %f <= value <  %f \n", fLowTestValue[AliQAv1::kINFO], fUpTestValue[AliQAv1::kINFO], fLowTestValue[AliQAv1::kWARNING], fUpTestValue[AliQAv1::kWARNING], fLowTestValue[AliQAv1::kERROR], fUpTestValue[AliQAv1::kERROR], fLowTestValue[AliQAv1::kFATAL], fUpTestValue[AliQAv1::kFATAL]  ));
+
+  if(fDet == 0 || fDet == 1) {
+    fSPDChecker->SetSPDLimits( lowtolerancevalue,hightolerancevalue );
+  }
+  if(fDet == 0 || fDet == 2) {
+    fSDDChecker->SetSDDLimits( lowtolerancevalue,hightolerancevalue );
+  }
+  if(fDet == 0 || fDet == 3) {
+    fSSDChecker->SetSSDLimits( lowtolerancevalue,hightolerancevalue );
+  }
+
+
+  
+}
+
+
+//_____________________________________________________________________________
+
+void AliITSQAChecker::CreateStepForBit(Double_t histonumb,Double_t *steprange)
+{
+  for(Int_t bit=0;bit < AliQAv1::kNBIT; bit++)
+    {       
+      //printf("%i\t %f \t %f \t %f \n",bit, fUpTestValue[bit],fLowTestValue[AliQAv1::kINFO],histonumb);
+      steprange[bit]=double((fUpTestValue[bit] - fLowTestValue[AliQAv1::kINFO])/histonumb);
+      //printf("%i\t %f \t %f \t %f \t %f\n",bit, fUpTestValue[bit],fLowTestValue[AliQAv1::kINFO],histonumb,steprange[bit] );
+    }
+  //AliInfo(Form("StepBitValue:numner of histo %f\n\t INFO %f \t WARNING %f \t ERROR %f \t FATAL %f \n",histonumb, steprange[AliQAv1::kINFO],steprange[AliQAv1::kWARNING],steprange[AliQAv1::kERROR],steprange[AliQAv1::kFATAL]));
+}
+
+
+//_____________________________________________________________________________
+void AliITSQAChecker::SetQA(AliQAv1::ALITASK_t index, Double_t * value) const
+{
+
+  AliQAv1 * qa = AliQAv1::Instance(index) ;
+
+
+  for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) {
+
+    if (! qa->IsEventSpecieSet(AliRecoParam::ConvertIndex(specie)))
+      continue ;
+    if (  value == NULL ) { // No checker is implemented, set all QA to Fatal
+      qa->Set(AliQAv1::kFATAL, specie) ; 
+    } else {
+      if ( value[specie] > fLowTestValue[AliQAv1::kFATAL] && value[specie] <= fUpTestValue[AliQAv1::kFATAL] ) 
+        qa->Set(AliQAv1::kFATAL, AliRecoParam::ConvertIndex(specie)) ; 
+      else if ( value[specie] > fLowTestValue[AliQAv1::kERROR] && value[specie] <= fUpTestValue[AliQAv1::kERROR]  )
+        qa->Set(AliQAv1::kERROR, AliRecoParam::ConvertIndex(specie)) ; 
+      else if ( value[specie] > fLowTestValue[AliQAv1::kWARNING] && value[specie] <= fUpTestValue[AliQAv1::kWARNING]  )
+        qa->Set(AliQAv1::kWARNING, AliRecoParam::ConvertIndex(specie)) ;
+      else if ( value[specie] > fLowTestValue[AliQAv1::kINFO] && value[specie] <= fUpTestValue[AliQAv1::kINFO] ) 
+        qa->Set(AliQAv1::kINFO, AliRecoParam::ConvertIndex(specie)) ;  
+      //else if(value[specie]==0) qa->Set(AliQAv1::kFATAL, AliRecoParam::ConvertIndex(specie)) ; //no ckeck has been done
+    }
+    qa->ShowStatus(AliQAv1::kITS,index,AliRecoParam::ConvertIndex(specie));
+  }//end for
+
+}
+
+
index 102e662..16d92ac 100644 (file)
@@ -45,7 +45,17 @@ public:
   Short_t GetSubDet() { return fDet; }
   Short_t GetLDC() { return fLDC; }
   virtual void SetTaskOffset(Int_t SPDOffset, Int_t SDDOffset, Int_t SSDOffset);
+  virtual void SetHisto(Int_t SPDhisto, Int_t SDDhisto, Int_t SSDhisto);
   virtual void SetDetTaskOffset(Int_t subdet=0,Int_t offset=0);
+  virtual void InitQACheckerLimits();
+  virtual void CreateStepForBit(Double_t histonumb,Double_t *steprange);
+  virtual void SetQA(AliQAv1::ALITASK_t index, Double_t * value) const;
+  virtual void SetDetHisto(Int_t subdet=0,Int_t histo=0);
+
+  virtual Int_t GetSPDHisto(){return fSPDHisto;} ;
+  virtual Int_t GetSDDHisto(){return fSDDHisto;} ;
+  virtual Int_t GetSSDHisto(){return fSSDHisto;} ;
+
 
 protected:
   virtual Double_t * Check(AliQAv1::ALITASK_t index, TObjArray ** list, AliDetectorRecoParam * recoParam) ;
@@ -53,15 +63,24 @@ protected:
   virtual void SetSDDTaskOffset(Int_t SDDOffset){fSDDOffset = SDDOffset;} ;
   virtual void SetSSDTaskOffset(Int_t SSDOffset){fSSDOffset = SSDOffset;} ;
 
+  virtual void SetSPDHisto(Int_t SPDhisto){fSPDHisto = SPDhisto;} ;
+  virtual void SetSDDHisto(Int_t SDDhisto){fSDDHisto = SDDhisto;} ;
+  virtual void SetSSDHisto(Int_t SSDhisto){fSSDHisto = SSDhisto;} ;
+
 private:
 
   Bool_t  fkOnline;
   Short_t fDet;  
   Short_t fLDC;
+
   Int_t fSPDOffset; //starting point for the QACheck list
   Int_t fSDDOffset;
   Int_t fSSDOffset;
 
+  Int_t fSPDHisto;
+  Int_t fSDDHisto;
+  Int_t fSSDHisto;
+
   AliITSQASPDChecker *fSPDChecker;  // SPD Checker
   AliITSQASDDChecker *fSDDChecker;  // SDD Checker
   AliITSQASSDChecker *fSSDChecker;  // SSD Checker
index 3db65f9..ffe4621 100644 (file)
@@ -130,35 +130,46 @@ void AliITSQADataMakerRec::EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, TObjArr
 {
   // launch the QA checking
 
+  AliInfo(Form("End of Dedetctor Cycle called for %s\n",AliQAv1::GetTaskName(task).Data() ));
   for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) {
-    //SetEventSpecie(specie) ; 
-    //AliQAv1::Instance()->SetEventSpecie(specie);
-    if(AliQAv1::Instance()->IsEventSpecieSet(specie)){
-    AliDebug(AliQAv1::GetQADebugLevel(),"AliITSDM instantiates checker with Run(AliQAv1::kITS, task, list[specie])\n"); 
-    if(fSubDetector == 0 || fSubDetector == 1) fSPDDataMaker->EndOfDetectorCycle(task, list[/*GetEventSpecie()*/specie]);
-    if(fSubDetector == 0 || fSubDetector == 2) fSDDDataMaker->EndOfDetectorCycle(task, list[/*GetEventSpecie()*/specie]);
-    if(fSubDetector == 0 || fSubDetector == 3) fSSDDataMaker->EndOfDetectorCycle(task, list[/*GetEventSpecie()*/specie]);
-  
-  
-    AliQAChecker *qac = AliQAChecker::Instance();
-    AliITSQAChecker *qacb = (AliITSQAChecker *) qac->GetDetQAChecker(0);
-    Int_t subdet=GetSubDet();
-    qacb->SetSubDet(subdet);
-    if(subdet== 0 ){
-      qacb->SetTaskOffset(fSPDDataMaker->GetOffset(task), fSDDDataMaker->GetOffset(task), fSSDDataMaker->GetOffset(task)); //Setting the offset for the QAChecker list
-    }
-    else
-      if(subdet!=0){
-       Int_t offset=GetDetTaskOffset(subdet, task);
-       qacb->SetDetTaskOffset(subdet,offset);
-      }
 
-    qac->Run( AliQAv1::kITS , task, list);
-    }
-    
-  }
+       if(AliQAv1::Instance()->IsEventSpecieSet(specie)){
+         Int_t idnumber=list[specie]->GetUniqueID();
+         //printf("specie %s \t id number == %d\n",AliRecoParam::GetEventSpecieName(specie),idnumber);
+         if(idnumber==40||idnumber==0)
+           {
+             //AliInfo(Form("No check for %s\n",AliQAv1::GetTaskName(task).Data() ))
+               continue;
+           } //skip kDigitsR and not filled TobjArray specie
+         else{
+           AliDebug(AliQAv1::GetQADebugLevel(),"AliITSDM instantiates checker with Run(AliQAv1::kITS, task, list[specie])\n"); 
+           if(fSubDetector == 0 || fSubDetector == 1) fSPDDataMaker->EndOfDetectorCycle(task, list[/*GetEventSpecie()*/specie]);
+           if(fSubDetector == 0 || fSubDetector == 2) fSDDDataMaker->EndOfDetectorCycle(task, list[/*GetEventSpecie()*/specie]);
+           if(fSubDetector == 0 || fSubDetector == 3) fSSDDataMaker->EndOfDetectorCycle(task, list[/*GetEventSpecie()*/specie]);
+           
+           
+           AliQAChecker *qac = AliQAChecker::Instance();
+           AliITSQAChecker *qacb = (AliITSQAChecker *) qac->GetDetQAChecker(0);
+           Int_t subdet=GetSubDet();
+           qacb->SetSubDet(subdet);
+         
+           if(subdet== 0 ){
+             qacb->SetTaskOffset(fSPDDataMaker->GetOffset(task,specie), fSDDDataMaker->GetOffset(task,specie), fSSDDataMaker->GetOffset(task,specie)); //Setting the offset for the QAChecker list
+             qacb->SetHisto(fSPDDataMaker->GetTaskHisto(task), fSDDDataMaker->GetTaskHisto(task), fSSDDataMaker->GetTaskHisto(task));
+           }
+           else
+             if(subdet!=0){
+               Int_t offset=GetDetTaskOffset(subdet, task,specie);
+               qacb->SetDetTaskOffset(subdet,offset);
+               Int_t histo=GetDetTaskHisto(subdet, task);
+               qacb->SetDetHisto(subdet,histo);
+             }
+           
+           qac->Run( AliQAv1::kITS , task, list);
+           
+         }//end else unique id
+       }//end else event specie
+  }//end for
 }
 
 //____________________________________________________________________________ 
@@ -174,6 +185,7 @@ void AliITSQADataMakerRec::InitRaws()
   //if(fRawsQAList[AliRecoParam::AConvert(fEventSpecie)]->GetEntries()) return;
        
 
+
   if(fSubDetector == 0 || fSubDetector == 1) {
     AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQADM:: SPD InitRaws\n");
     fSPDDataMaker->InitRaws();
@@ -190,6 +202,8 @@ void AliITSQADataMakerRec::InitRaws()
     fSSDDataMaker->SetOffset(AliQAv1::kRAWS, fRawsQAList[AliRecoParam::AConvert(fEventSpecie)]->GetEntries(),AliRecoParam::AConvert(fEventSpecie));
     fSSDDataMaker->InitRaws();
   }
+  fRawsQAList[AliRecoParam::AConvert(fEventSpecie)]->SetUniqueID(10);
+
 }
 
 //____________________________________________________________________________
@@ -215,10 +229,10 @@ void AliITSQADataMakerRec::MakeRaws(AliRawReader* rawReader)
 //____________________________________________________________________________ 
 void AliITSQADataMakerRec::InitDigits()
 {
-  
+
   // Initialization for DIGITS
   if(fSubDetector == 0 || fSubDetector == 1) {
-    AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQADM:: SPD InitDigitss\n");
+    AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQADM:: SPD InitDigits\n");
 
     fSPDDataMaker->InitDigits();
   }
@@ -234,6 +248,7 @@ void AliITSQADataMakerRec::InitDigits()
 
     fSSDDataMaker->InitDigits();
   }
+  fDigitsQAList[AliRecoParam::AConvert(fEventSpecie)]->SetUniqueID(40);
 }
 
 //____________________________________________________________________________ 
@@ -277,7 +292,7 @@ void AliITSQADataMakerRec::InitRecPoints()
                fSSDDataMaker->InitRecPoints();
        }
 
-
+  fRecPointsQAList[AliRecoParam::AConvert(fEventSpecie)]->SetUniqueID(20);
        if(fSubDetector == 0){
          Int_t offset = fRecPointsQAList [AliRecoParam::AConvert(fEventSpecie)]->GetEntries();
          const Bool_t expert   = kTRUE ; 
@@ -291,9 +306,9 @@ void AliITSQADataMakerRec::InitRecPoints()
            hPhiEta[iLay]=new TH2F(name,title,30,-1.5,1.5,200,0.,2*TMath::Pi());
            hPhiEta[iLay]->GetXaxis()->SetTitle("Pseudorapidity");
            hPhiEta[iLay]->GetYaxis()->SetTitle("#varphi [rad]");
-           Add2RecPointsList((new TH2F(*hPhiEta[iLay])), iLay + offset, !expert, image);
+           Add2RecPointsList(hPhiEta[iLay], iLay + offset, !expert, image);
            
-           delete hPhiEta[iLay];
+           //delete hPhiEta[iLay];
          }
          
        }
@@ -546,7 +561,7 @@ void AliITSQADataMakerRec::InitESDs()
   hESDSkippedLayers->SetMinimum(0);
   Add2ESDsList(hESDSkippedLayers, 23, expertHistogram);
 
-
+  fESDsQAList[AliRecoParam::AConvert(fEventSpecie)]->SetUniqueID(30);
   return;
 }
 
@@ -655,31 +670,31 @@ void AliITSQADataMakerRec::MakeESDs(AliESDEvent *esd)
 }
 
 //_________________________________________________________________
-Int_t AliITSQADataMakerRec::GetDetTaskOffset(Int_t subdet,AliQAv1::TASKINDEX_t task)
+Int_t AliITSQADataMakerRec::GetDetTaskOffset(Int_t subdet,AliQAv1::TASKINDEX_t task, Int_t specie)
 {
+
+  Int_t offset=0;
   switch(subdet)
     {
-
-      Int_t offset;
     case 1:
-      offset=fSPDDataMaker->GetOffset(task);
-      return offset;
+      offset=fSPDDataMaker->GetOffset(task,specie);
+      //return offset;
       break;
     case 2:
-      offset=fSDDDataMaker->GetOffset(task);
-      return offset;
+      offset=fSDDDataMaker->GetOffset(task,specie);
+      //return offset;
       break;
     case 3:
-      offset=fSSDDataMaker->GetOffset(task);
-      return offset;
+      offset=fSSDDataMaker->GetOffset(task,specie);
+      //return offset;
       break;
     default:
       AliWarning("No specific subdetector (SPD, SDD, SSD) selected!! Offset set to zero \n");
       offset=0;
-      return offset;
+      //return offset;
       break;
     }
-  //return offset;
+  return offset;
 }
 
 //____________________________________________________________________
@@ -690,3 +705,32 @@ Bool_t AliITSQADataMakerRec::AreEqual(Double_t a1,Double_t a2)
   return TMath::Abs(a1-a2)<=kEpsilon*TMath::Abs(a1);      
 }
 
+//_________________________________________________________________
+Int_t AliITSQADataMakerRec::GetDetTaskHisto(Int_t subdet,AliQAv1::TASKINDEX_t task)
+{
+
+
+  Int_t histo=0;
+  switch(subdet)
+    {
+    case 1:
+      histo=fSPDDataMaker->GetTaskHisto(task);
+      //return histo;
+      break;
+    case 2:
+      histo=fSDDDataMaker->GetTaskHisto(task);
+      //return histo;
+      break;
+    case 3:
+      histo=fSSDDataMaker->GetTaskHisto(task);
+      //return histo;
+      break;
+    default:
+      AliWarning("No specific subdetector (SPD, SDD, SSD) selected!! Offset set to zero \n");
+      histo=0;
+      //return histo;
+      break;
+    }
+  //return offset;
+  return histo;
+}
index 35a130b..4c43702 100644 (file)
@@ -56,7 +56,8 @@ public:
 
   virtual ~AliITSQADataMakerRec(); // dtor
  Short_t GetSubDet(){return fSubDetector;};
- Int_t GetDetTaskOffset(Int_t subdet,AliQAv1::TASKINDEX_t task);
+ Int_t GetDetTaskOffset(Int_t subdet,AliQAv1::TASKINDEX_t task,Int_t specie=0);
+ Int_t GetDetTaskHisto(Int_t subdet,AliQAv1::TASKINDEX_t task);
  TH2F *GetITSGlobalHisto(Int_t layer);
  Bool_t AreEqual(Double_t a1, Double_t a2);
 
index 4a9ec1a..faef0a8 100644 (file)
@@ -54,7 +54,7 @@ fSSDDataMaker(NULL)
        AliError("Error: fSubDetector number out of range; return\n");
   }
 
-  // Initialization for RAW data 
+  // Initialization for each subdetector 
   if(fSubDetector == 0 || fSubDetector == 1) {
     AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQADM::Create SPD DataMakerSim\n");
        fSPDDataMaker = new AliITSQASPDDataMakerSim(this);
@@ -114,37 +114,57 @@ void AliITSQADataMakerSim::StartOfDetectorCycle()
 //____________________________________________________________________________ 
 void AliITSQADataMakerSim::EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, TObjArray** list)
 {
+
+  AliInfo(Form("End of Dedetctor Cycle called for %s\n",AliQAv1::GetTaskName(task).Data() ));
+
   // launch the QA checking
   for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) {
-    if (! IsValidEventSpecie(specie, list) )
+    if (! IsValidEventSpecie(specie, list) ){
       continue ; 
-    AliDebug(AliQAv1::GetQADebugLevel(),"AliITSDM instantiates checker with Run(AliQAv1::kITS, task, list)\n"); 
-    if(fSubDetector == 0 || fSubDetector == 1) fSPDDataMaker->EndOfDetectorCycle(task, list[specie]);
-    if(fSubDetector == 0 || fSubDetector == 2) fSDDDataMaker->EndOfDetectorCycle(task, list[specie]);
-    if(fSubDetector == 0 || fSubDetector == 3) fSSDDataMaker->EndOfDetectorCycle(task, list[specie]);
-  
-  
-    AliQAChecker *qac = AliQAChecker::Instance();
-    AliITSQAChecker *qacb = (AliITSQAChecker *) qac->GetDetQAChecker(0);
-    Int_t subdet=GetSubDet();
-    qacb->SetSubDet(subdet);
-
-    if(subdet== 0 ){
-      qacb->SetTaskOffset(fSPDDataMaker->GetOffset(task),fSDDDataMaker->GetOffset(task),fSSDDataMaker->GetOffset(task)); //Setting the offset for the QAChecker list           
     }
-    else
-      if(subdet!=0){
-       Int_t offset=GetDetTaskOffset(subdet, task);
-       qacb->SetDetTaskOffset(subdet,offset);
-      }
-    qac->Run( AliQAv1::kITS , task, list); 
-  }
+    else{
+      Int_t idnumber=list[specie]->GetUniqueID();
+      //printf("specie %s \t id number == %d\n",AliRecoParam::GetEventSpecieName(specie),idnumber);
+      if(idnumber==0)
+       {
+         //AliInfo(Form("No check for %s\n",AliQAv1::GetTaskName(task).Data() ))
+           continue;
+       } //skip kDigitsR and not filled TobjArray specie
+      else{
+       AliDebug(AliQAv1::GetQADebugLevel(),"AliITSDM instantiates checker with Run(AliQAv1::kITS, task, list)\n"); 
+       if(fSubDetector == 0 || fSubDetector == 1) fSPDDataMaker->EndOfDetectorCycle(task, list[specie]);
+       if(fSubDetector == 0 || fSubDetector == 2) fSDDDataMaker->EndOfDetectorCycle(task, list[specie]);
+       if(fSubDetector == 0 || fSubDetector == 3) fSSDDataMaker->EndOfDetectorCycle(task, list[specie]);
+       
+       
+       AliQAChecker *qac = AliQAChecker::Instance();
+       AliITSQAChecker *qacb = (AliITSQAChecker *) qac->GetDetQAChecker(0);
+       Int_t subdet=GetSubDet();
+       qacb->SetSubDet(subdet);
+       
+       if(subdet== 0 ){
+         qacb->SetTaskOffset(fSPDDataMaker->GetOffset(task,specie),fSDDDataMaker->GetOffset(task,specie),fSSDDataMaker->GetOffset(task,specie)); //Setting the offset for the QAChecker list
+       qacb->SetHisto(fSPDDataMaker->GetTaskHisto(task), fSDDDataMaker->GetTaskHisto(task), fSSDDataMaker->GetTaskHisto(task));        
+       }
+       else
+         if(subdet!=0){
+           Int_t offset=GetDetTaskOffset(subdet, task);
+           qacb->SetDetTaskOffset(subdet,offset);
+           Int_t histo=GetDetTaskHisto(subdet, task);
+           qacb->SetDetHisto(subdet,histo);
+         }
+       qac->Run( AliQAv1::kITS , task, list);
+      }//end else unique id 
+    }//end else event specie
+  }//end for
 }
 
 //____________________________________________________________________________ 
 void AliITSQADataMakerSim::InitDigits()
 {  
-  // Initialization for RAW data 
+
+  fDigitsQAList[AliRecoParam::AConvert(fEventSpecie)]->SetUniqueID(60);
+  // Initialization for Digits data 
        if(fSubDetector == 0 || fSubDetector == 1) {
          AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQADM:: SPD InitDigits\n");
 
@@ -194,6 +214,7 @@ void AliITSQADataMakerSim::MakeDigits(TTree * digits)
 //____________________________________________________________________________ 
 void AliITSQADataMakerSim::InitSDigits()
 {
+  fSDigitsQAList[AliRecoParam::AConvert(fEventSpecie)]->SetUniqueID(70);
   // Initialization for RECPOINTS
   if(fSubDetector == 0 || fSubDetector == 1) {
     AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQADM:: SPD InitSDigits\n");
@@ -247,6 +268,7 @@ void AliITSQADataMakerSim::MakeSDigits(TTree * sdigits)
 //____________________________________________________________________________ 
 void AliITSQADataMakerSim::InitHits()
 {
+  fHitsQAList[AliRecoParam::AConvert(fEventSpecie)]->SetUniqueID(50);
   // Initialization for hits
   if(fSubDetector == 0 || fSubDetector == 1) {
     AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQADM:: SPD InitHits\n");
@@ -322,3 +344,31 @@ Int_t AliITSQADataMakerSim::GetDetTaskOffset(Int_t subdet,AliQAv1::TASKINDEX_t t
     }
   //return offset;
 }
+
+//_________________________________________________________________
+Int_t AliITSQADataMakerSim::GetDetTaskHisto(Int_t subdet,AliQAv1::TASKINDEX_t task)
+{
+  switch(subdet)
+    {
+
+      Int_t histo;
+    case 1:
+      histo=fSPDDataMaker->GetOffset(task);
+      return histo;
+      break;
+    case 2:
+      histo=fSDDDataMaker->GetOffset(task);
+      return histo;
+      break;
+    case 3:
+      histo=fSSDDataMaker->GetOffset(task);
+      return histo;
+      break;
+    default:
+      AliWarning("No specific subdetector (SPD, SDD, SSD) selected!! Offset set to zero \n");
+      histo=0;
+      return histo;
+      break;
+    }
+  //return offset;
+}
index 761fb2c..7a0dc98 100644 (file)
@@ -45,7 +45,7 @@ public:
   Short_t GetSubDet(){return fSubDetector;};
   Int_t GetDetTaskOffset(Int_t subdet,AliQAv1::TASKINDEX_t task);
   virtual Int_t GetEventSpecie() const { return AliRecoParam::AConvert(fEventSpecie); }
-
+  Int_t GetDetTaskHisto(Int_t subdet,AliQAv1::TASKINDEX_t task);
 private:
 
   Short_t fSubDetector;                    // subDetector: 0 (ALL), 1 (SPD), 2 (SDD), 3 (SSD)
index 0df6e40..933e741 100644 (file)
 // --- ROOT system ---
 #include "TH1.h"
 #include <TCanvas.h>
+#include <TH1D.h>
+#include <TH2.h>
+#include <TF1.h>
+
+
 
 // --- AliRoot header files ---
 #include "AliITSQASDDChecker.h"
@@ -33,7 +38,8 @@
 #include "AliQAManager.h"
 #include "AliQACheckerBase.h"
 #include "TSystem.h"
-
+#include "AliITSCalibrationSDD.h"
+#include "AliITSgeomTGeo.h"
 
 ClassImp(AliITSQASDDChecker)
 //__________________________________________________________________
@@ -45,88 +51,282 @@ AliITSQASDDChecker& AliITSQASDDChecker::operator = (const AliITSQASDDChecker& qa
   return *this;
 }
 
+AliITSQASDDChecker::~AliITSQASDDChecker() 
+{
+  if(fStepBitSDD) 
+    {
+      delete[] fStepBitSDD ;
+      fStepBitSDD = NULL;
+    }
+  if(fLowSDDValue)
+    {
+      delete[]fLowSDDValue;
+      fLowSDDValue=NULL;
+    }
+  if(fHighSDDValue)
+    { 
+      delete[]fHighSDDValue;
+      fHighSDDValue=NULL;
+    }
+  if(fCalibration)
+    {
+      delete fCalibration;
+      fCalibration=NULL;
+    }
+} // dtor
+
 //__________________________________________________________________
-Double_t AliITSQASDDChecker::Check(AliQAv1::ALITASK_t index, TObjArray * list) 
+Double_t AliITSQASDDChecker::Check(AliQAv1::ALITASK_t index, TObjArray * list/*, AliDetectorRecoParam *recoparam*/) 
 {  
+  AliInfo(Form("AliITSQASDDChecker called with offset: %d\n", fSubDetOffset) );
+
   AliDebug(1,Form("AliITSQASDDChecker called with offset: %d\n", fSubDetOffset));
-  /* char * detOCDBDir = Form("ITS/%s/%s", AliQAv1::GetRefOCDBDirName(), AliQAv1::GetRefDataDirName()) ; 
-  AliCDBEntry *QARefObj = AliQAManager::QAManager()->Get(detOCDBDir);
-  if( !QARefObj){
-    AliError("Calibration object retrieval failed! SDD will not be processed");
-    return 1.;
-  }
-  */
-  Double_t test = 0.0;
-  Int_t offset = 0;
-
-  if(index==AliQAv1::kRAW){  //analizing RAWS
-    if (list->GetEntries() == 0){
-      test = 1. ; // nothing to check
-    }
-    else {
-      TIter next(list) ;
-      TH1 * hdata ;
-      for(offset =0;offset < fSubDetOffset; offset++){
-        hdata = dynamic_cast<TH1 *>(next());  
-      }
 
-      while ( (hdata = dynamic_cast<TH1 *>(next())) ){
-       if (hdata) {
-         if(offset == fSubDetOffset){ //ModPattern check
-           if ( hdata->Integral() == 0 ) {
-             AliWarning(Form("Spectrum %s is empty", hdata->GetName())) ; 
-             return 0.5 ;
-           }
-           test = hdata->Chi2Test(hdata,"UU,p");
-         }  // ModPattern check
-       }
-       else{
-         AliError("Data type cannot be processed") ;
-       }
-       offset++;
-      }  //SDD histo
+  Double_t test = 0.;
+  TH1 *hdata=NULL;
+  Double_t entries=0.;
+  Double_t entries2[2];
+  for(Int_t i=0;i<2;i++)entries2[i]=0.;
+  switch(index)
+    {
 
-      while ( (hdata = dynamic_cast<TH1 *>(next()))) {
-       offset++;
+    case AliQAv1::kRAW:
+      AliInfo(Form("Check on %s\n",AliQAv1::GetAliTaskName(index)));
+      if(!fCalibration){
+       AliCDBEntry *calibSDD = AliCDBManager::Instance()->Get("ITS/Calib/CalibSDD");
+       Bool_t cacheStatus = AliCDBManager::Instance()->GetCacheFlag();
+       if(!calibSDD)
+         {
+           AliError("Calibration object retrieval failed! SDD will not be processed");
+           fCalibration = NULL;
+           test= fHighSDDValue[AliQAv1::kWARNING];
+         }
+       fCalibration = (TObjArray *)calibSDD->GetObject();
+       
+       if(!cacheStatus)calibSDD->SetObject(NULL);
+       calibSDD->SetOwner(kTRUE);
+       if(!cacheStatus)
+         {
+           delete calibSDD;
+         }
       }
-    } //else entries !=0
-  AliInfo(Form("Test Result for RAWS = %f", test)) ;
-  } // if(index==0)
-
-  
-  if( index==AliQAv1::kREC){ //analizing RECP
-    //printf("analizing recp, offset %d \n",fSubDetOffset);
-    if (list->GetEntries() == 0){
-      test = 1. ; // nothing to check
-    }
-    else {
-      TIter next(list) ;
-      TH1 * hdata ;
-      for(offset =0;offset < fSubDetOffset; offset++){
-       hdata = dynamic_cast<TH1 *>(next());    // magari TIter++ ?? 
-       //printf("Skipping histo %s, offset %d \n",hdata->GetName(),fSubDetOffset);
-      }
-        
-      while ( (hdata = dynamic_cast<TH1 *>(next())) ){
-       /*if (hdata) { // offset=9 ModPatternRP
-         //printf("Treating histo %s, offset %d \n",hdata->GetName(),fSubDetOffset);
-         if( offset == 9 && hdata->GetEntries()>0)test = 0.1;    
+      AliInfo("Calib SDD Created\n ");
+      
+      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;
+      }//end if getentries
+      else{
+       TIter next(list);
+       Int_t offset = 0;
+       for(offset =0;offset < fSubDetOffset; offset++){hdata = dynamic_cast<TH1*>(next());}//end for
+       Int_t emptymodules[2];
+       Int_t filledmodules[2];
+       Int_t emptyladders[2];
+       Int_t filledladders[2];
+       for(Int_t i=0;i<2;i++){
+         emptymodules[i]=0;
+         filledmodules[i]=0;
+         emptyladders[i]=0;
+         filledladders[i]=0;
        }
+       TH1 *hmodule=NULL;
+       TH2 *hlayer[2];
+       for(Int_t i=0;i<2;i++)hlayer[i]=NULL;    
+       while( hdata = dynamic_cast<TH1* >(next()) ){
+         if (hdata){
+           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
+             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         
+           }//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
+             else{
+               Int_t layer=0;
+               if(hname.Contains("3"))layer=0;
+               else  if(hname.Contains("4"))layer=1;
+               hlayer[layer]=dynamic_cast<TH2*>(hdata); 
+               hlayer[layer]->RebinX(2);
+               int modmay=hlayer[layer]->GetNbinsY();
+               TH1D* hproj= hlayer[layer]->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[layer]++;}
+                 else if(ladcontent!=0){filledladders[layer]++;} 
+               }//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;     
+             }//end else entries !=0         
+           }//end if layer 3
+         }//end if hdata       
+       }//end while
+       if(entries==0.&&entries2[0]==0.&&entries2[1]==0.) break;
        else{
-         AliError("Data type cannot be processed") ;
+         if(hmodule||(hlayer[0]&&hlayer[1])){
+           Int_t excluded=0;
+           Int_t active=0;
+           Int_t exactive=0;//excluded but taking data
+           //AliITSCalibrationSDD *cal;
+           for(Int_t imod=0;imod<fgknSDDmodules;imod++){
+             Int_t lay=0;
+             Int_t lad=0;
+             Int_t det=0;
+             Int_t module=0;
+             module=imod+fgkmodoffset;
+             AliITSCalibrationSDD * cal=(AliITSCalibrationSDD*)fCalibration->At(imod);
+             if(cal==0) { delete cal; continue;}
+             AliITSgeomTGeo::GetModuleId(module,lay,lad,det);
+             if (cal->IsBad()){
+               excluded++;
+               Double_t content=0.;
+               Double_t contentlayer[2];
+               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.)
+                 {
+                   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]++;
+               //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
+               {
+                 Double_t contentgood=0.;
+                 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]++;}
+               }
+             
+             //delete cal;
+             //cal=NULL;
+           }//end for
+           for(Int_t i=0;i<2;i++){AliInfo(Form(" %s :Layer %i \tempty modules %i \t filled modules %i\n",hlayer[i]->GetName(), i+3,emptymodules[i], filledmodules[i]));}//end else layers
+           if(exactive==0){
+             AliInfo(Form("All the active modules (%i) are in acquisition. The number of excluded modules are %i \n",active,excluded));
+             test=fHighSDDValue[AliQAv1::kINFO];}
+           if(exactive!=0){
+             AliWarning(Form("%i modules excluded from the acquisition took data. Active modules%i \n ",exactive,active));
+             test=fHighSDDValue[AliQAv1::kWARNING];
+           }
+           if(excluded==exactive){
+             AliWarning(Form("All the modules exluded from the acquisition (%d) took data!  Active modules %i\n",excluded,active));
+             test=fHighSDDValue[AliQAv1::kWARNING];
+           }
+           if(active==0){
+             AliWarning(Form("No modules took data: excluded %i \t exactive %i \n", excluded, exactive)); 
+             test=fHighSDDValue[AliQAv1::kFATAL];
+           }
+         } 
        }
-       offset++;*/
-      }
-    } // GetEntries loop
-  AliInfo(Form("Test Result for RECP = %f", test)) ; 
-
-  } // if(index==1) loop
-
+      }//end getentries !=0
+      //delete calSDD;
+      
+      
+      
+      //delete calibSDD;
+      //delete calSDD;
+   
+      break;
+    case AliQAv1::kNULLTASK:
+      AliInfo(Form("No Check on %s\n",AliQAv1::GetAliTaskName(index))); 
+      test=1.;
+      break;
+    case AliQAv1::kSIM:
+      AliInfo(Form("Check on %s\n",AliQAv1::GetAliTaskName(index))); 
+      test=1.;
+      break;
+    case AliQAv1::kREC:
+      AliInfo(Form("Check on %s\n",AliQAv1::GetAliTaskName(index))); 
+      test=1.;
+      break;
+    case AliQAv1::kANA:
+      AliInfo(Form("Check on %s\n",AliQAv1::GetAliTaskName(index)));
+      test=1.; 
+      break;
+    case AliQAv1::kESD:
+      AliInfo(Form("Check on %s\n",AliQAv1::GetAliTaskName(index)));
+      test=1.; 
+      break;
+    case AliQAv1::kNTASK:
+      AliInfo(Form("No Check on %s\n",AliQAv1::GetAliTaskName(index))); 
+      test=1.;
+      break;
+      
+    }//end switch
+  delete hdata;
   return test; 
 }
  
 //__________________________________________________________________
-void AliITSQASDDChecker::SetTaskOffset(Int_t TaskOffset)
+void AliITSQASDDChecker::SetTaskOffset(Int_t taskoffset)
+{
+  fSubDetOffset = taskoffset;
+}
+
+
+//__________________________________________________________________
+void AliITSQASDDChecker::SetStepBit(Double_t *steprange)
+{
+
+  fStepBitSDD = new Double_t[AliQAv1::kNBIT];
+  for(Int_t bit=0;bit<AliQAv1::kNBIT;bit++)
+    {
+      fStepBitSDD[bit]=steprange[bit];
+    }
+}
+
+//__________________________________________________________________
+void  AliITSQASDDChecker::SetSDDLimits(Float_t *lowvalue, Float_t * highvalue)
 {
-  fSubDetOffset = TaskOffset;
+
+  fLowSDDValue = new Float_t[AliQAv1::kNBIT];
+  fHighSDDValue= new Float_t[AliQAv1::kNBIT];
+
+  for(Int_t bit=0;bit<AliQAv1::kNBIT;bit++)
+    {
+      fLowSDDValue[bit]=lowvalue[bit];
+      fHighSDDValue[bit]= highvalue[bit];
+    }
+
 }
+
+
index 3e2a3da..df15ca2 100644 (file)
@@ -22,21 +22,31 @@ class TH2F ;
 #include "AliQAv1.h"
 #include "AliQACheckerBase.h"
 #include "AliITSQAChecker.h"
+#include "AliITSCalibrationSDD.h"
 class AliITSLoader ; 
 
 class AliITSQASDDChecker: public TObject {
 
 public:
-  AliITSQASDDChecker():fSubDetOffset(0) {;}          // ctor
+  AliITSQASDDChecker():fSubDetOffset(0),fStepBitSDD(NULL),fLowSDDValue(NULL),fHighSDDValue(NULL),fCalibration(NULL) {;}          // ctor
   AliITSQASDDChecker& operator = (const AliITSQASDDChecker& qac) ; //operator =
-  virtual ~AliITSQASDDChecker() {;} // dtor
-  Double_t Check(AliQAv1::ALITASK_t index, TObjArray * list);
-  void SetTaskOffset(Int_t TaskOffset);
-
+  virtual ~AliITSQASDDChecker(); /*{if(fStepBitSDD) delete[] fStepBitSDD ;if(fLowSDDValue)delete[]fLowSDDValue;if(fHighSDDValue) delete[]fHighSDDValue;if(fCalibration)delete fCalibration;} */// dtor
+  virtual Double_t Check(AliQAv1::ALITASK_t index, TObjArray * list);
+  virtual void SetTaskOffset(Int_t taskoffset);
+  virtual void SetStepBit(Double_t *steprange);
+  virtual Double_t *GetStepBit(){return fStepBitSDD;};
+  virtual void SetSDDLimits(Float_t *lowvalue, Float_t * highvalue);
 private:
-  AliITSQASDDChecker(const AliITSQASDDChecker& /*qac*/):TObject(),fSubDetOffset(0) {;} // cpy ctor   
+  AliITSQASDDChecker(const AliITSQASDDChecker& qac):TObject(),fSubDetOffset(qac.fSubDetOffset),fStepBitSDD(qac.fStepBitSDD),fLowSDDValue(qac.fLowSDDValue),fHighSDDValue(qac.fHighSDDValue),fCalibration(qac.fCalibration) {;} // cpy ctor   
   Int_t fSubDetOffset;            // checking operation starting point
-  ClassDef(AliITSQASDDChecker,1)  // description 
+  Double_t *fStepBitSDD;
+  Float_t *fLowSDDValue;
+  Float_t *fHighSDDValue;
+  TObjArray *fCalibration;
+
+  static const Int_t fgknSDDmodules = 260; // number of SDD modules
+  static const Int_t fgkmodoffset = 240;   // number of SPD modules
+  ClassDef(AliITSQASDDChecker,2)  // description 
 
 };
 
index c8ab7f8..be0b67f 100644 (file)
@@ -243,9 +243,7 @@ Int_t AliITSQASDDDataMakerRec::InitRaws()
          TProfile2D *fModuleChargeMapFSE = new TProfile2D(hname[0],hname[1],256/fTimeBinSize,-0.5,255.5,256,-0.5,255.5);
          fModuleChargeMapFSE->GetXaxis()->SetTitle("Time Bin");
          fModuleChargeMapFSE->GetYaxis()->SetTitle("Anode");
-          rv = fAliITSQADataMakerRec->Add2RawsList((new TProfile2D(*fModuleChargeMapFSE)),indexlast1 + index1 + fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image, !saveCorr);
-         delete fModuleChargeMapFSE;
-         
+          rv = fAliITSQADataMakerRec->Add2RawsList(fModuleChargeMapFSE,indexlast1 + index1 + fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image, !saveCorr);        
          fSDDhRawsTask++;
          index1++;      
        }
@@ -259,9 +257,8 @@ Int_t AliITSQASDDDataMakerRec::InitRaws()
          TProfile2D *fModuleChargeMap = new TProfile2D(hname[0],hname[1],256/fTimeBinSize,-0.5,255.5,256,-0.5,255.5);
          fModuleChargeMap->GetXaxis()->SetTitle("Time Bin");
          fModuleChargeMap->GetYaxis()->SetTitle("Anode");
-          rv = fAliITSQADataMakerRec->Add2RawsList((new TProfile2D(*fModuleChargeMap)),indexlast1 + index1 + fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image, !saveCorr);
-         delete fModuleChargeMap;
-         
+          rv = fAliITSQADataMakerRec->Add2RawsList(fModuleChargeMap,indexlast1 + index1 + fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image, !saveCorr);
+  
          fSDDhRawsTask++;
          index1++;      
        }
@@ -375,7 +372,6 @@ Int_t AliITSQASDDDataMakerRec::MakeRaws(AliRawReader* rawReader)
       fAliITSQADataMakerRec->GetRawsData(2+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(det+0.5*iside-0.5,lad);}  
  
     if(fkOnline) {
-
       fAliITSQADataMakerRec->GetRawsData(3+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill((stream->GetCarlosId())+0.5*iside -0.5,iddl);
 
       activeModule = moduleSDD;
@@ -508,10 +504,11 @@ Int_t AliITSQASDDDataMakerRec::InitRecPoints()
   Int_t rv = 0 ; 
 //  fGenRecPointsOffset = (fAliITSQADataMakerRec->fRecPointsQAList[AliRecoParam::kDefault])->GetEntries();
 
-  Int_t nOnline=1;
+  Int_t  nOnline=1;
   Int_t  nOnline2=1;
   Int_t  nOnline3=1; 
   Int_t  nOnline4=1;
+  Int_t nOnline5=1;
   if(fkOnline)
     {
       nOnline=4;
@@ -525,62 +522,62 @@ Int_t AliITSQASDDDataMakerRec::InitRecPoints()
   TH1F *h0 = new TH1F("SDDLay3TotCh","Layer 3 total charge",1000/nOnline,-0.5, 499.5); //position number 0
   h0->GetXaxis()->SetTitle("ADC value");
   h0->GetYaxis()->SetTitle("Entries");
-  rv = fAliITSQADataMakerRec->Add2RecPointsList(h0, 0 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, image);
+  rv = fAliITSQADataMakerRec->Add2RecPointsList(h0, 0 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, image);//NON expert image
   fSDDhRecPointsTask++;
  
   TH1F *h1 = new TH1F("SDDLay4TotCh","Layer 4 total charge",1000/nOnline,-0.5, 499.5);//position number 1
   h1->GetXaxis()->SetTitle("ADC value");
   h1->GetYaxis()->SetTitle("Entries");
-  rv = fAliITSQADataMakerRec->Add2RecPointsList(h1, 1 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, image);
+  rv = fAliITSQADataMakerRec->Add2RecPointsList(h1, 1 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, image);//NON expert image
   fSDDhRecPointsTask++;
 
   char hisnam[50];
   TH2F *h2 = new TH2F("SDDGlobalCoordDistribYX","YX Global Coord Distrib",5600/nOnline2,-28,28,5600/nOnline2,-28,28);//position number 2
   h2->GetYaxis()->SetTitle("Y[cm]");
   h2->GetXaxis()->SetTitle("X[cm]");
-  rv = fAliITSQADataMakerRec->Add2RecPointsList(h2,2+fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, !image);
+  rv = fAliITSQADataMakerRec->Add2RecPointsList(h2,2+fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, image);// NON expert image
   fSDDhRecPointsTask++;
 
   TH2F *h3 = new TH2F("SDDGlobalCoordDistribRZ","RZ Global Coord Distrib",6400/nOnline3,-32,32,1400/nOnline4,12,26);//position number 3
   h3->GetYaxis()->SetTitle("R[cm]");
   h3->GetXaxis()->SetTitle("Z[cm]");
-  rv = fAliITSQADataMakerRec->Add2RecPointsList(h3,3+fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, !image);
+  rv = fAliITSQADataMakerRec->Add2RecPointsList(h3,3+fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, image);// NON expert image
   fSDDhRecPointsTask++;
   
   TH2F *h4 = new TH2F("SDDGlobalCoordDistribL3PHIZ","#varphi Z Global Coord Distrib L3",6400/nOnline3,-32,32,360/nOnline,-TMath::Pi(),TMath::Pi());//position number 4
   h4->GetYaxis()->SetTitle("#phi[rad]");
   h4->GetXaxis()->SetTitle("Z[cm]");
-  rv = fAliITSQADataMakerRec->Add2RecPointsList(h4,4+fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, image);
+  rv = fAliITSQADataMakerRec->Add2RecPointsList(h4,4+fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, image);//NON expert image
   fSDDhRecPointsTask++;
 
   TH2F *h5 = new TH2F("SDDGlobalCoordDistribL4PHIZ","#varphi Z Global Coord Distrib L4",6400/nOnline3,-32,32,360/nOnline,-TMath::Pi(),TMath::Pi());//position number 5
   h5->GetYaxis()->SetTitle("#phi[rad]");
   h5->GetXaxis()->SetTitle("Z[cm]");
-  rv = fAliITSQADataMakerRec->Add2RecPointsList(h5,5+fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, image);
+  rv = fAliITSQADataMakerRec->Add2RecPointsList(h5,5+fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, image);//NON expert image
   fSDDhRecPointsTask++;
   
   TH1F *h6 = new TH1F("SDDModPatternRP","Modules pattern RP",fgknSDDmodules,239.5,499.5); //position number 6
   h6->GetXaxis()->SetTitle("Module number"); //spd offset = 240
   h6->GetYaxis()->SetTitle("Entries");
-  rv = fAliITSQADataMakerRec->Add2RecPointsList(h6,6 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image);
+  rv = fAliITSQADataMakerRec->Add2RecPointsList(h6,6 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image);// expert NO image
   fSDDhRecPointsTask++;
 
   TH1F *h7 = new TH1F("SDDLadPatternL3RP","Ladder pattern L3 RP",14,0.5,14.5);  //position number 7
   h7->GetXaxis()->SetTitle("Ladder #, Layer 3");
   h7->GetYaxis()->SetTitle("Entries");
-  rv = fAliITSQADataMakerRec->Add2RecPointsList(h7,7 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image);
+  rv = fAliITSQADataMakerRec->Add2RecPointsList(h7,7 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image);// expert NO image
   fSDDhRecPointsTask++;
 
   TH1F *h8 = new TH1F("SDDLadPatternL4RP","Ladder pattern L4 RP",22,0.5,22.5); //position number 8
   h8->GetXaxis()->SetTitle("Ladder #, Layer 4");
   h8->GetYaxis()->SetTitle("Entries");
-  rv = fAliITSQADataMakerRec->Add2RecPointsList(h8,8 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image);
+  rv = fAliITSQADataMakerRec->Add2RecPointsList(h8,8 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image);//  expert  NO image
   fSDDhRecPointsTask++;
 
   TH2F *h9 = new TH2F("SDDLocalCoordDistrib","Local Coord Distrib",1000/nOnline,-4,4,1000/nOnline,-4,4);//position number 9
   h9->GetXaxis()->SetTitle("X local coord, drift, cm");
   h9->GetYaxis()->SetTitle("Z local coord, anode, cm");
-  rv = fAliITSQADataMakerRec->Add2RecPointsList(h9,9 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image);
+  rv = fAliITSQADataMakerRec->Add2RecPointsList(h9,9 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image);//  expert  NO image
   fSDDhRecPointsTask++;
   
   //AliInfo("Create SDD recpoints histos\n");
@@ -589,14 +586,14 @@ Int_t AliITSQASDDDataMakerRec::InitRecPoints()
   h10->GetXaxis()->SetTitle("r[cm]");
   h10->GetXaxis()->CenterTitle();
   h10->GetYaxis()->SetTitle("Entries");
-  rv = fAliITSQADataMakerRec->Add2RecPointsList(h10,10 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image);
+  rv = fAliITSQADataMakerRec->Add2RecPointsList(h10,10 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image);// expert NO image
   fSDDhRecPointsTask++;
   
   TH1F *h11 = new TH1F("SDDrdistrib_Layer4" ,"SDD r distribution Layer4" ,100,22.,26.);// and position number 11 (L4)
   h11->GetXaxis()->SetTitle("r[cm]");
   h11->GetXaxis()->CenterTitle();
   h11->GetYaxis()->SetTitle("Entries");
-  rv = fAliITSQADataMakerRec->Add2RecPointsList(h11,11 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image);
+  rv = fAliITSQADataMakerRec->Add2RecPointsList(h11,11 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image);// expert NO image
   fSDDhRecPointsTask++;
   
   for(Int_t iLay=0; iLay<=1; iLay++){
@@ -605,17 +602,17 @@ Int_t AliITSQASDDDataMakerRec::InitRecPoints()
     h12->GetXaxis()->SetTitle("#varphi[rad]");
     h12->GetXaxis()->CenterTitle();
     h12->GetYaxis()->SetTitle("Entries");
-    rv = fAliITSQADataMakerRec->Add2RecPointsList(h12,iLay+12+fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image);
+    rv = fAliITSQADataMakerRec->Add2RecPointsList(h12,iLay+12+fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image);// expert NO image
     fSDDhRecPointsTask++;
   }
   
   for(Int_t iLay=0; iLay<=1; iLay++){
     sprintf(hisnam,"SDDdrifttime_Layer%d",iLay+3);
-    TH1F *h14 = new TH1F(hisnam,hisnam,200,-0.5,9999.5);//position number 14 (L3) and position number 15 (L4)
-    h14->GetXaxis()->SetTitle("#varphi[rad]");
+    TH1F *h14 = new TH1F(hisnam,hisnam,200/nOnline5,-0.5,9999.5);//position number 14 (L3) and position number 15 (L4)
+    h14->GetXaxis()->SetTitle("drift time[#mus]");
     h14->GetXaxis()->CenterTitle();
     h14->GetYaxis()->SetTitle("Entries");
-    rv = fAliITSQADataMakerRec->Add2RecPointsList(h14,iLay+14+fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, image);
+    rv = fAliITSQADataMakerRec->Add2RecPointsList(h14,iLay+14+fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, image);// NON expert  image
     fSDDhRecPointsTask++;
   }
   
@@ -624,13 +621,13 @@ Int_t AliITSQASDDDataMakerRec::InitRecPoints()
       TH2F *h16 = new TH2F("SDDGlobalCoordDistribYXFSE","YX Global Coord Distrib FSE",5600/nOnline2,-28,28,5600/nOnline2,-28,28);//position number 16
       h16->GetYaxis()->SetTitle("Y[cm]");
       h16->GetXaxis()->SetTitle("X[cm]");
-      rv = fAliITSQADataMakerRec->Add2RecPointsList(h16,16+fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image);
+      rv = fAliITSQADataMakerRec->Add2RecPointsList(h16,16+fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image);// expert NO image
       fSDDhRecPointsTask++;
       
       TH2F *h17 = new TH2F("SDDGlobalCoordDistribRZFSE","RZ Global Coord Distrib FSE",Int_t(6400/nOnline3),-32,32,1400/nOnline4,12,26);//position number 17
       h17->GetYaxis()->SetTitle("R[cm]");
       h17->GetXaxis()->SetTitle("Z[cm]");
-      rv = fAliITSQADataMakerRec->Add2RecPointsList(h17,17+fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image);
+      rv = fAliITSQADataMakerRec->Add2RecPointsList(h17,17+fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image);// expert NO image
       fSDDhRecPointsTask++;
       
     }//online
@@ -671,20 +668,25 @@ Int_t AliITSQASDDDataMakerRec::MakeRecPoints(TTree * clustersTree)
     branchRecP->GetEvent(module);
     npoints += recpoints->GetEntries();
     //AliInfo(Form("modnumb %d, npoints %d, total points %d\n",module, recpoints->GetEntries(),npoints));
-    AliITSgeomTGeo::GetModuleId(module, lay, lad, det);
+    //AliITSgeomTGeo::GetModuleId(module, lay, lad, det);
     //AliInfo(Form("modnumb %d, lay %d, lad %d, det %d \n",module, lay, lad, det));
     
     //AliInfo(Form("modnumb %d, entries %d\n",module, recpoints->GetEntries()));
     for(Int_t j=0;j<recpoints->GetEntries();j++){
       //AliInfo(Form("modnumb %d, entry %d \n",module, j));
-      AliITSRecPoint *recp = (AliITSRecPoint*)recpoints->At(j);    
-      fAliITSQADataMakerRec->GetRecPointsData(6 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(module);//modpatternrp
+      AliITSRecPoint *recp = (AliITSRecPoint*)recpoints->At(j); 
+      Int_t index = recp->GetDetectorIndex();
+      lay=recp->GetLayer();
+      Int_t modnumb=index+AliITSgeomTGeo::GetModuleIndex(lay+1,1,1);
+      //printf("modnumb  %i\n",modnumb);  
+      AliITSgeomTGeo::GetModuleId(modnumb, lay, lad, det);  
+      fAliITSQADataMakerRec->GetRecPointsData(6 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(modnumb);//modpatternrp
       recp->GetGlobalXYZ(cluglo);
       Float_t rad=TMath::Sqrt(cluglo[0]*cluglo[0]+cluglo[1]*cluglo[1]); 
       Float_t phi=TMath::ATan2(cluglo[1],cluglo[0]);
       Float_t drifttime=recp->GetDriftTime();
       fAliITSQADataMakerRec->GetRecPointsData(9 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(recp->GetDetLocalX(),recp->GetDetLocalZ());//local distribution
-      fAliITSQADataMakerRec->GetRecPointsData(2 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(cluglo[0],cluglo[1]);//global distribution YX
+      if(lay==3||lay==4)fAliITSQADataMakerRec->GetRecPointsData(2 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(cluglo[0],cluglo[1]);//global distribution YX
       fAliITSQADataMakerRec->GetRecPointsData(3 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(cluglo[2],rad);//global distribution rz
       if(fkOnline) {
        fAliITSQADataMakerRec->GetRecPointsData(16 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(cluglo[0],cluglo[1]);//global distribution YX FSE
@@ -713,20 +715,20 @@ Int_t AliITSQASDDDataMakerRec::MakeRecPoints(TTree * clustersTree)
 
 //_______________________________________________________________
 
-Int_t AliITSQASDDDataMakerRec::GetOffset(AliQAv1::TASKINDEX_t task)
+Int_t AliITSQASDDDataMakerRec::GetOffset(AliQAv1::TASKINDEX_t task, Int_t specie)
 {
   Int_t offset=0;
   if( task == AliQAv1::kRAWS )
     {
-      offset=fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()];  
+      offset=fGenRawsOffset[specie];  
     }
   else if(task == AliQAv1::kDIGITSR )
     {
-      offset=fGenDigitsOffset[fAliITSQADataMakerRec->GetEventSpecie()];
+      offset=fGenDigitsOffset[specie];
     }
   else if( task == AliQAv1::kRECPOINTS )
     {
-      offset=fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()];   
+      offset=fGenRecPointsOffset[specie];   
     }
   return offset;
 }
@@ -779,16 +781,16 @@ void AliITSQASDDDataMakerRec::AnalyseBNG()
 // get file time for Previous test
        AliInfo("AnalyseBNG\n");
        Int_t bngtimeBasPrevious; 
-       FILE *fpinPreviousBas = fopen( "SDDbasHistos.time", "r" );
-       if(fpinPreviousBas) {
-         fscanf(fpinPreviousBas,"%d",&bngtimeBasPrevious);
-         fclose (fpinPreviousBas);
+       FILE *filepinPreviousBas = fopen( "SDDbasHistos.time", "r" );
+       if(filepinPreviousBas) {
+         fscanf(filepinPreviousBas,"%d",&bngtimeBasPrevious);
+         fclose (filepinPreviousBas);
        } else 
           bngtimeBasPrevious = 0;
         Int_t bngtimeBasCurrent = 0; 
         gSystem->Exec("perl -e '@d=localtime ((stat(shift))[9]); printf \"%02d%02d%02d%02d%02d\n\", $d[5]-100,$d[4]+1,$d[3],$d[2],$d[1]'  SDDbasHistos.root > SDDbasHistos.time");
-        FILE *fpinBas = fopen( "SDDbasHistos.time", "r" );
-        fscanf(fpinBas,"%d",&bngtimeBasCurrent);
+        FILE *filepinBas = fopen( "SDDbasHistos.time", "r" );
+        fscanf(filepinBas,"%d",&bngtimeBasCurrent);
        if(bngtimeBasCurrent>bngtimeBasPrevious )AliInfo(Form("bngtimeBasCurrent %d, bngtimeBasPrevious %d\n",bngtimeBasCurrent,bngtimeBasPrevious));
        
        Bool_t kAnalyseBas = kTRUE;
@@ -810,20 +812,20 @@ void AliITSQASDDDataMakerRec::AnalyseBNG()
                        AliInfo("file SDDbasHistos.root not found \n");
                }
        }
-       fclose (fpinBas);
-//     delete fpinBas;
+       fclose (filepinBas);
+//     delete filepinBas;
 
        Int_t bngtimeGainPrevious; 
-       FILE *fpinPrevious = fopen( "SDDgainHistos.time", "r" );
-       if(fpinPrevious) {
-         fscanf(fpinPrevious,"%d",&bngtimeGainPrevious);
-         fclose (fpinPrevious);
+       FILE *filepinPrevious = fopen( "SDDgainHistos.time", "r" );
+       if(filepinPrevious) {
+         fscanf(filepinPrevious,"%d",&bngtimeGainPrevious);
+         fclose (filepinPrevious);
        } else 
          bngtimeGainPrevious = 0;
         Int_t bngtimeGainCurrent = 0; 
         gSystem->Exec("perl -e '@d=localtime ((stat(shift))[9]); printf \"%02d%02d%02d%02d%02d\n\", $d[5]-100,$d[4]+1,$d[3],$d[2],$d[1]'  SDDgainHistos.root > SDDgainHistos.time");
-        FILE *fpin = fopen( "SDDgainHistos.time", "r" );
-        fscanf(fpin,"%d",&bngtimeGainCurrent);
+        FILE *filepin = fopen( "SDDgainHistos.time", "r" );
+        fscanf(filepin,"%d",&bngtimeGainCurrent);
         if(bngtimeGainCurrent>bngtimeGainPrevious )AliInfo(Form("bngtimeGainCurrent %d, bngtimeGainPrevious %d\n",bngtimeGainCurrent,bngtimeGainPrevious));
        
        Bool_t kAnalyse = kTRUE;
@@ -841,8 +843,8 @@ void AliITSQASDDDataMakerRec::AnalyseBNG()
                        AliInfo("file SDDgainHistos.root not found \n");
                }
        }
-       fclose (fpin);
-//     delete fpin;
+       fclose (filepin);
+//     delete filepin;
 
 }
 
@@ -854,16 +856,16 @@ void AliITSQASDDDataMakerRec::AnalyseINJ()
 
        AliInfo("AnalyseINJ\n");
        Int_t injtimePrevious; 
-       FILE *fpinPrevious = fopen( "SDDinjectHistos.time", "r" );
-       if(fpinPrevious) {
-          fscanf(fpinPrevious,"%d",&injtimePrevious);
-         fclose (fpinPrevious);
+       FILE *filepinPrevious = fopen( "SDDinjectHistos.time", "r" );
+       if(filepinPrevious) {
+          fscanf(filepinPrevious,"%d",&injtimePrevious);
+         fclose (filepinPrevious);
        } else 
          injtimePrevious = 0;
        Int_t injtimeCurrent = 0; 
         gSystem->Exec("perl -e '@d=localtime ((stat(shift))[9]); printf \"%02d%02d%02d%02d%02d\n\", $d[5]-100,$d[4]+1,$d[3],$d[2],$d[1]'  SDDinjectHistos.root > SDDinjectHistos.time");
-        FILE *fpin = fopen( "SDDinjectHistos.time", "r" );
-       fscanf(fpin,"%d",&injtimeCurrent);
+        FILE *filepin = fopen( "SDDinjectHistos.time", "r" );
+       fscanf(filepin,"%d",&injtimeCurrent);
                if(injtimeCurrent>injtimePrevious )AliInfo(Form("injtimeCurrent %d, injtimePrevious %d\n",injtimeCurrent,injtimePrevious));
        
        Bool_t kAnalyse = kTRUE;
@@ -882,8 +884,8 @@ void AliITSQASDDDataMakerRec::AnalyseINJ()
                        AliInfo("file(s) SDDinjectHistos.root not found \n");
                }
        }
-       fclose (fpin);
-//     delete fpin;
+       fclose (filepin);
+//     delete filepin;
 }
 
 //_______________________________________________________________
@@ -970,12 +972,12 @@ void AliITSQASDDDataMakerRec::AnalyseHistos(Int_t type)
 
        Double_t Current[fgknSDDmodules][fgknSide][fgknAnode];  
        char *hnamePrevious = new char[50];
-       TString *fnamePrevious=NULL;
+       TString *filenamePrevious=NULL;
 
-               if(type < 5) fnamePrevious = new TString("SDDbasHistosPrevious.root");
-               else if(type == 5) fnamePrevious = new TString("SDDgainHistosPrevious.root");
-               else if(type == 6) fnamePrevious = new TString("SDDinjectHistosPrevious.root");
-               TFile *gainFilePrevious = new TFile(fnamePrevious->Data());
+               if(type < 5) filenamePrevious = new TString("SDDbasHistosPrevious.root");
+               else if(type == 5) filenamePrevious = new TString("SDDgainHistosPrevious.root");
+               else if(type == 6) filenamePrevious = new TString("SDDinjectHistosPrevious.root");
+               TFile *gainFilePrevious = new TFile(filenamePrevious->Data());
                if(!gainFilePrevious->IsZombie()) {
 
                  for(Int_t ddl =0; ddl<fDDLModuleMap->GetNDDLs(); ddl++){
@@ -1002,7 +1004,7 @@ void AliITSQASDDDataMakerRec::AnalyseHistos(Int_t type)
                  gainFilePrevious->Close();
                  delete gainFilePrevious;
                }
-               delete fnamePrevious;
+               delete filenamePrevious;
 
        Float_t xmin = 0.;
        Float_t xmax = 0;
@@ -1049,12 +1051,12 @@ void AliITSQASDDDataMakerRec::AnalyseHistos(Int_t type)
 
        Float_t binw = (xmax-xmin)/nbins;
 
-       TString *fnamePrevious2=NULL;
+       TString *filenamePrevious2=NULL;
 
-               if(type < 5) fnamePrevious2 = new TString("SDDbasHistosPrevious.root");
-               else if(type == 5) fnamePrevious2 = new TString("SDDgainHistosPrevious.root");
-               else if(type == 6) fnamePrevious2 = new TString("SDDinjectHistosPrevious.root");
-               TFile *gainFile = new TFile(fnamePrevious2->Data());
+               if(type < 5) filenamePrevious2 = new TString("SDDbasHistosPrevious.root");
+               else if(type == 5) filenamePrevious2 = new TString("SDDgainHistosPrevious.root");
+               else if(type == 6) filenamePrevious2 = new TString("SDDinjectHistosPrevious.root");
+               TFile *gainFile = new TFile(filenamePrevious2->Data());
                if(!gainFile->IsZombie()) {
 
                  for(Int_t ddl =0; ddl<fDDLModuleMap->GetNDDLs(); ddl++){
@@ -1083,7 +1085,7 @@ void AliITSQASDDDataMakerRec::AnalyseHistos(Int_t type)
                  gainFile->Close();
                  delete gainFile;
                }
-               delete fnamePrevious2;
+               delete filenamePrevious2;
 
        TF1 ff("ff", "gaus", xmin+0.1, xmax-0.1);
        hDist->Fit("ff","NWR");
@@ -1134,16 +1136,37 @@ void AliITSQASDDDataMakerRec::AnalyseHistos(Int_t type)
                gainHistoryFile = new TFile("SDDinjectHistory.root","UPDATE");
        hDist->Write();
        hDistDiff->Write();
+
        //AliInfo("SDDgainHistory.root file opened\n");
        if(!gainHistoryFile->IsZombie()) {
-               if(type == 1) hDistHistoryPrevious = (TH1F *) gainHistoryFile->Get("hBaselineHistory");
-               else if(type == 2) hDistHistoryPrevious = (TH1F *) gainHistoryFile->Get("hNoiseUncHistory");
-               else if(type == 3) hDistHistoryPrevious = (TH1F *) gainHistoryFile->Get("hNoiseCMNHistory");
-               else if(type == 4) hDistHistoryPrevious = (TH1F *) gainHistoryFile->Get("hNoiseCorHistory");
-               else if(type == 5) hDistHistoryPrevious = (TH1F *) gainHistoryFile->Get("hGainHistory");
-               else if(type == 6) hDistHistoryPrevious = (TH1F *) gainHistoryFile->Get("hDriftSpeedHistory");
+         if(type == 1) {
+           hDistHistoryPrevious = (TH1F *) gainHistoryFile->Get("hBaselineHistory"); 
+         }
+         else if(type == 2){ 
+           hDistHistoryPrevious = (TH1F *) gainHistoryFile->Get("hNoiseUncHistory");
+         }
+         else if(type == 3) {
+           hDistHistoryPrevious = (TH1F *) gainHistoryFile->Get("hNoiseCMNHistory");
+         }
+         else if(type == 4) {
+           hDistHistoryPrevious = (TH1F *) gainHistoryFile->Get("hNoiseCorHistory");
+         }
+         else if(type == 5) {
+           hDistHistoryPrevious = (TH1F *) gainHistoryFile->Get("hGainHistory");
+         }
+         else if(type == 6){
+           hDistHistoryPrevious = (TH1F *) gainHistoryFile->Get("hDriftSpeedHistory");
+         }
+         Char_t newname[30];
+         if(hDistHistoryPrevious){
+           sprintf(newname,"%sPrev",hDistHistoryPrevious->GetName());
+           hDistHistoryPrevious->SetName(newname);
+           sprintf(newname,"%sPrev",hDistHistoryPrevious->GetTitle());
+           hDistHistoryPrevious->SetTitle(newname);
+         }
                //AliInfo(Form("hDistHistoryPrevious %x\n",hDistHistoryPrevious));
-       
+
+
                if(!hDistHistoryPrevious) {
                        if(type == 1) hDistHistoryCurrent = new TH1F("hBaselineHistory","Average Baseline History",2,0,2);
                        else if(type == 2) hDistHistoryCurrent = new TH1F("hNoiseUncHistory","Average Uncorrected Noise History",2,0,2);
@@ -1176,15 +1199,17 @@ void AliITSQASDDDataMakerRec::AnalyseHistos(Int_t type)
                        hDistHistoryCurrent->SetBinContent(hDistHistoryPrevious->GetNbinsX(),average);
                        hDistHistoryCurrent->SetBinError(hDistHistoryPrevious->GetNbinsX(),sigma);
                }
+
        }
        hDistHistoryCurrent->Write();
        gainHistoryFile->Close();
        delete gainHistoryFile;
-//     delete hname;
+       //delete hname;
        delete hDist;
        delete hDistDiff;
-//        if(hDistHistoryCurrent) delete hDistHistoryCurrent;
-//     if(hDistHistoryPrevious) delete hDistHistoryPrevious;
+
+        //if(hDistHistoryCurrent) delete hDistHistoryCurrent;
+       //if(hDistHistoryPrevious) delete hDistHistoryPrevious;
 }
 
 //_______________________________________________________________
index a61b5a8..0a6394c 100644 (file)
@@ -36,7 +36,7 @@ public:
   virtual void CreateTheMap();
 
   virtual ~AliITSQASDDDataMakerRec(); // dtor
-  Int_t GetOffset(AliQAv1::TASKINDEX_t task);
+  Int_t GetOffset(AliQAv1::TASKINDEX_t task,Int_t specie=0);
   void  SetOffset(AliQAv1::TASKINDEX_t task, Int_t offset, Int_t specie = 0);
   Int_t GetTaskHisto(AliQAv1::TASKINDEX_t task);
 
index 82ec550..0d3ac89 100644 (file)
@@ -330,17 +330,17 @@ Int_t AliITSQASDDDataMakerSim::MakeHits(TTree * hits)
 \r
 //_______________________________________________________________\r
 \r
-Int_t AliITSQASDDDataMakerSim::GetOffset(AliQAv1::TASKINDEX_t task){\r
+Int_t AliITSQASDDDataMakerSim::GetOffset(AliQAv1::TASKINDEX_t task, Int_t specie){\r
   // Returns histogram offset according to the specified task\r
   Int_t offset=0;\r
   if( task == AliQAv1::kHITS){\r
-    offset=fGenOffsetH[fAliITSQADataMakerSim->GetEventSpecie()];  \r
+    offset=fGenOffsetH[specie];  \r
   }\r
   else if( task == AliQAv1::kSDIGITS) {\r
-    offset=fGenOffsetS[fAliITSQADataMakerSim->GetEventSpecie()];   \r
+    offset=fGenOffsetS[specie];   \r
   }\r
   else if( task == AliQAv1::kDIGITS) {\r
-    offset=fGenOffsetD[fAliITSQADataMakerSim->GetEventSpecie()];   \r
+    offset=fGenOffsetD[specie];   \r
   }\r
   else {\r
     AliInfo("No task has been selected. TaskHisto set to zero.\n");\r
index eef99d0..0883b94 100644 (file)
@@ -40,7 +40,7 @@ public:
   virtual Int_t MakeDigits(TTree * digits);\r
   virtual Int_t MakeSDigits(TTree * sdigits);\r
   virtual Int_t MakeHits(TTree * hits);\r
-  Int_t GetOffset(AliQAv1::TASKINDEX_t task);\r
+  Int_t GetOffset(AliQAv1::TASKINDEX_t task, Int_t specie = 0);\r
   void  SetOffset(AliQAv1::TASKINDEX_t task, Int_t offset,Int_t specie = 0);\r
   Int_t GetTaskHisto(AliQAv1::TASKINDEX_t task);\r
 \r
index 388400c..ffc224f 100644 (file)
@@ -45,6 +45,8 @@ Double_t AliITSQASPDChecker::Check(AliQAv1::ALITASK_t /*index*/, TObjArray * lis
 {
   AliDebug(2, Form("AliITSQASPDChecker called with offset: %d\n", fSubDetOffset));
 
+  AliInfo(Form("AliITSQASPDChecker called with offset: %d\n", fSubDetOffset));
+
   Double_t test = 0.0;
   Int_t count = 0;
 
@@ -120,3 +122,30 @@ void AliITSQASPDChecker::SetTaskOffset(Int_t TaskOffset)
 {
   fSubDetOffset = TaskOffset;
 }
+
+//__________________________________________________________________
+void AliITSQASPDChecker::SetStepBit(Double_t *steprange)
+{
+
+  fStepBitSPD = new Double_t[AliQAv1::kNBIT];
+  for(Int_t bit=0;bit<AliQAv1::kNBIT;bit++)
+    {
+      fStepBitSPD[bit]=steprange[bit];
+    }
+}
+
+
+//__________________________________________________________________
+void  AliITSQASPDChecker::SetSPDLimits(Float_t *lowvalue, Float_t * highvalue)
+{
+
+  fLowSPDValue = new Float_t[AliQAv1::kNBIT];
+  fHighSPDValue= new Float_t[AliQAv1::kNBIT];
+
+  for(Int_t bit=0;bit<AliQAv1::kNBIT;bit++)
+    {
+      fLowSPDValue[bit]=lowvalue[bit];
+      fHighSPDValue[bit]= highvalue[bit];
+    }
+
+}
index e5a5484..8721906 100644 (file)
@@ -27,16 +27,24 @@ class AliITSLoader ;
 class AliITSQASPDChecker: public TObject {
 
 public:
-  AliITSQASPDChecker():fSubDetOffset(0) {;}          // ctor
+  AliITSQASPDChecker():fSubDetOffset(0),fStepBitSPD(NULL),fLowSPDValue(NULL),fHighSPDValue(NULL) {;}          // ctor
   AliITSQASPDChecker& operator = (const AliITSQASPDChecker& qac) ; //operator =
-  virtual ~AliITSQASPDChecker() {;} // dtor
+  virtual ~AliITSQASPDChecker() {if(fStepBitSPD) delete[] fStepBitSPD ;if(fLowSPDValue)delete[]fLowSPDValue;if(fHighSPDValue) delete[]fHighSPDValue;} // dtor
   Double_t Check(AliQAv1::ALITASK_t index, TObjArray * list);
   void SetTaskOffset(Int_t TaskOffset);
+
+  void SetStepBit(Double_t *steprange);
+  Double_t *GetStepBit(){return fStepBitSPD;};
+  void SetSPDLimits(Float_t *lowvalue, Float_t * highvalue);
 private:
   
-  AliITSQASPDChecker(const AliITSQASPDChecker& /*qac*/):TObject(),fSubDetOffset(0){;}  // cpy ctor   
+  AliITSQASPDChecker(const AliITSQASPDChecker& qac):TObject(),fSubDetOffset(qac.fSubDetOffset),fStepBitSPD(qac.fStepBitSPD),fLowSPDValue(qac.fLowSPDValue),fHighSPDValue(qac.fHighSPDValue){;}  // cpy ctor   
   Int_t fSubDetOffset;            // checking operation starting point
-  ClassDef(AliITSQASPDChecker,1)  // description 
+  Double_t *fStepBitSPD;
+  Float_t *fLowSPDValue;
+  Float_t *fHighSPDValue;
+
+  ClassDef(AliITSQASPDChecker,2)  // description 
 
 };
 
index b245f3e..0c162e2 100644 (file)
@@ -631,17 +631,17 @@ Int_t AliITSQASPDDataMakerRec::MakeRecPoints(TTree * clusterTree)
 
 //_______________________________________________________________
 
-Int_t AliITSQASPDDataMakerRec::GetOffset(AliQAv1::TASKINDEX_t task) {
+Int_t AliITSQASPDDataMakerRec::GetOffset(AliQAv1::TASKINDEX_t task,Int_t specie) {
   // Returns offset number according to the specified task
   Int_t offset=0;
   if( task == AliQAv1::kRAWS ) {
-    offset=fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()];
+    offset=fGenRawsOffset[specie];
   }
   else if( task == AliQAv1::kDIGITSR ) {
-    offset=fGenDigitsOffset[fAliITSQADataMakerRec->GetEventSpecie()];
+    offset=fGenDigitsOffset[specie];
   }
   else if( task == AliQAv1::kRECPOINTS ) {
-    offset=fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()];
+    offset=fGenRecPointsOffset[specie];
   }
 
   return offset;
index 833572b..cd6ea43 100644 (file)
@@ -38,7 +38,7 @@ public:
   virtual void  StartOfDetectorCycle();
   virtual void  EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, TObjArray * list);
   virtual ~AliITSQASPDDataMakerRec();   // dtor
-  Int_t GetOffset(AliQAv1::TASKINDEX_t task);
+  Int_t GetOffset(AliQAv1::TASKINDEX_t task,Int_t specie=0);
   void  SetOffset(AliQAv1::TASKINDEX_t task, Int_t offset, Int_t specie = 0);
   Int_t GetTaskHisto(AliQAv1::TASKINDEX_t task);
 
index 3e6f48c..5d55eb5 100644 (file)
@@ -368,17 +368,17 @@ Int_t AliITSQASPDDataMakerSim::MakeHits(TTree *hits)
 
 //_______________________________________________________________
 
-Int_t AliITSQASPDDataMakerSim::GetOffset(AliQAv1::TASKINDEX_t task){
+Int_t AliITSQASPDDataMakerSim::GetOffset(AliQAv1::TASKINDEX_t task,Int_t specie){
   // Returns histogram offset according to the specified task
   Int_t offset=0;
   if( task == AliQAv1::kHITS){
-    offset=fGenOffsetH[fAliITSQADataMakerSim->GetEventSpecie()];
+    offset=fGenOffsetH[specie];
   }
   else if( task == AliQAv1::kSDIGITS) {
-    offset=fGenOffsetS[fAliITSQADataMakerSim->GetEventSpecie()];
+    offset=fGenOffsetS[specie];
   }
   else if( task == AliQAv1::kDIGITS) {
-    offset=fGenOffsetD[fAliITSQADataMakerSim->GetEventSpecie()];
+    offset=fGenOffsetD[specie];
   }
   else {
     AliInfo("No task has been selected. TaskHisto set to zero.\n");
index 7cfeee9..84b848a 100644 (file)
@@ -40,7 +40,7 @@ public:
   virtual Int_t MakeDigits(TTree * digits);
   virtual Int_t MakeSDigits(TTree * sdigits);
   virtual Int_t MakeHits(TTree * hits);
-  Int_t GetOffset(AliQAv1::TASKINDEX_t task);
+  Int_t GetOffset(AliQAv1::TASKINDEX_t task, Int_t specie = 0);
   void  SetOffset(AliQAv1::TASKINDEX_t task, Int_t offset,Int_t specie = 0);
   Int_t GetTaskHisto(AliQAv1::TASKINDEX_t task);
   //Int_t GetOffsetH() { return fGenOffsetH; }
index 8b25f8f..91ebd7f 100644 (file)
@@ -181,6 +181,8 @@ void AliITSQASSDChecker::CheckRecPoints(TH1* /*histo*/) {
 //__________________________________________________________________
 Double_t AliITSQASSDChecker::Check(AliQAv1::ALITASK_t /*index*/, TObjArray * list) {  
   AliDebug(AliQAv1::GetQADebugLevel(),Form("AliITSQASSDChecker called with offset: %d\n", fSubDetOffset));
+
+  AliInfo(Form("AliITSQASSDChecker called with offset: %d\n", fSubDetOffset) );
   //cout<<"(AliITSQASSDChecker::Check): List name "<<list->GetName()<<endl;
   Double_t test = 0.0  ;
   Int_t count = 0 ;
@@ -245,3 +247,29 @@ void AliITSQASSDChecker::SetTaskOffset(Int_t TaskOffset)
 {
   fSubDetOffset = TaskOffset;
 }
+
+//__________________________________________________________________
+void AliITSQASSDChecker::SetStepBit(Double_t *steprange)
+{
+
+  fStepBitSSD = new Double_t[AliQAv1::kNBIT];
+  for(Int_t bit=0;bit<AliQAv1::kNBIT;bit++)
+    {
+      fStepBitSSD[bit]=steprange[bit];
+    }
+}
+
+//__________________________________________________________________
+void  AliITSQASSDChecker::SetSSDLimits(Float_t *lowvalue, Float_t * highvalue)
+{
+
+  fLowSSDValue = new Float_t[AliQAv1::kNBIT];
+  fHighSSDValue= new Float_t[AliQAv1::kNBIT];
+
+  for(Int_t bit=0;bit<AliQAv1::kNBIT;bit++)
+    {
+      fLowSSDValue[bit]=lowvalue[bit];
+      fHighSSDValue[bit]= highvalue[bit];
+    }
+
+}
index 0680821..0d59792 100644 (file)
@@ -27,21 +27,28 @@ class AliITSLoader ;
 class AliITSQASSDChecker: public TObject {
 
 public:
-  AliITSQASSDChecker():fSubDetOffset(0) {;}          // ctor
+  AliITSQASSDChecker():fSubDetOffset(0),fStepBitSSD(NULL),fLowSSDValue(NULL),fHighSSDValue(NULL) {;}          // ctor
   AliITSQASSDChecker& operator = (const AliITSQASSDChecker& qac) ; //operator =
-  virtual ~AliITSQASSDChecker() {;} // dtor
+  virtual ~AliITSQASSDChecker() {if(fStepBitSSD) delete[] fStepBitSSD ;if(fLowSSDValue)delete[]fLowSSDValue;if(fHighSSDValue) delete[]fHighSSDValue; } // dtor
   Double_t Check(AliQAv1::ALITASK_t /*index*/, TObjArray * /*list*/);
 
+  void SetStepBit(Double_t *steprange);
+  Double_t *GetStepBit(){return fStepBitSSD;};
+
   void CheckRaws(TH1 *);
   void CheckRecPoints(TH1 *);
   void SetTaskOffset(Int_t TaskOffset);
+  void SetSSDLimits(Float_t *lowvalue, Float_t * highvalue);
 
 
 private:
   
-  AliITSQASSDChecker(const AliITSQASSDChecker& /*qac*/):TObject(),fSubDetOffset(0) {;} // cpy ctor   
+  AliITSQASSDChecker(const AliITSQASSDChecker& qac):TObject(),fSubDetOffset(qac.fSubDetOffset),fStepBitSSD(qac.fStepBitSSD),fLowSSDValue(qac.fLowSSDValue),fHighSSDValue(qac.fHighSSDValue) {;} // cpy ctor   
   Int_t fSubDetOffset;            // checking operation starting point
-  ClassDef(AliITSQASSDChecker,1)  // description 
+  Double_t *fStepBitSSD;
+  Float_t *fLowSSDValue;
+  Float_t *fHighSSDValue;
+  ClassDef(AliITSQASSDChecker,2)  // description 
 
 };
 
index 8c8112c..742af29 100644 (file)
@@ -429,13 +429,13 @@ Int_t AliITSQASSDDataMakerRec::InitRaws() {
                                    "SSD Data Size;(SSD data size) [KB];Events",
                                    1000,0,500);
   rv = fAliITSQADataMakerRec->Add2RawsList(fHistSSDDataSize, 
-       fGenRawsOffset[specie]+fSSDRawsOffset, expert, !image, !saveCorr);
+                                          fGenRawsOffset[specie]+fSSDRawsOffset, expert, !image, !saveCorr);
   fSSDRawsOffset += 1;
   TH1D *fHistSSDDataSizePercentage = new TH1D("fHistSSDDataSizePercentage",
                                              "SSD Data Size Percentage;SSD data size [%];Events",
                                              1000,0,100);
   rv = fAliITSQADataMakerRec->Add2RawsList(fHistSSDDataSizePercentage, 
-       fGenRawsOffset[specie]+fSSDRawsOffset, expert, !image, !saveCorr);
+                                          fGenRawsOffset[specie]+fSSDRawsOffset, expert, !image, !saveCorr);
   fSSDRawsOffset += 1;
   TH1D *fHistSSDDDLId = new TH1D("fHistSSDDDLId",
                                 "SSD DDL Id;DDL id;Events",16,511.5,527.5);
@@ -443,9 +443,11 @@ Int_t AliITSQASSDDataMakerRec::InitRaws() {
                                           fGenRawsOffset[specie]+fSSDRawsOffset, expert, !image, !saveCorr);
   fSSDRawsOffset += 1;
   TH1D *fHistSSDDataSizePerDDL = new TH1D("fHistSSDDataSizePerDDL",
-                                         "SSD Data Size Per DDL;DDL id;<SSD data size> [KB]",16,511.5,527.5);
+                                         "SSD Data Size Per DDL;DDL id;<SSD data size> [KB]",
+                                         16,511.5,527.5);
   rv = fAliITSQADataMakerRec->Add2RawsList(fHistSSDDataSizePerDDL, 
                                           fGenRawsOffset[specie]+fSSDRawsOffset, !expert, image, !saveCorr);
+
   fSSDRawsOffset += 1;
   TH1D *fHistSSDDataSizeDDL[fgkNumOfDDLs];
   for(Int_t i = 1; i < fgkNumOfDDLs+1; i++) {
@@ -467,8 +469,7 @@ Int_t AliITSQASSDDataMakerRec::InitRaws() {
                                          "SSD Data Size Per LDC;LDC id;<SSD data size> [KB]",
                                          8,169.5,177.5);
   rv = fAliITSQADataMakerRec->Add2RawsList(fHistSSDDataSizePerLDC, 
-                                          fGenRawsOffset[specie]+fSSDRawsOffset, !expert, image, !saveCorr);
-  fSSDRawsOffset += 1;
+                                          fGenRawsOffset[specie]+fSSDRawsOffset, !expert, image, !saveCorr);  fSSDRawsOffset += 1;
   TH1D *fHistSSDDataSizeLDC[fgkNumOfLDCs];
   for(Int_t i = 1; i < fgkNumOfLDCs+1; i++) {
     gName = "fHistSSDDataSizeLDC"; 
@@ -1621,17 +1622,17 @@ Int_t AliITSQASSDDataMakerRec::MakeRecPoints(TTree *clustersTree)
 }
 
 //____________________________________________________________________________ 
-Int_t AliITSQASSDDataMakerRec::GetOffset(AliQAv1::TASKINDEX_t task) {
+Int_t AliITSQASSDDataMakerRec::GetOffset(AliQAv1::TASKINDEX_t task,Int_t specie) {
   // Returns offset number according to the specified task 
   Int_t offset=0;
   if( task == AliQAv1::kRAWS ) {
-    offset=fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()];  
+    offset=fGenRawsOffset[specie];  
   }
   else if( task == AliQAv1::kDIGITSR ) {
-    offset=fGenDigitsOffset[fAliITSQADataMakerRec->GetEventSpecie()];   
+    offset=fGenDigitsOffset[specie];   
   }
   else if( task == AliQAv1::kRECPOINTS ) {
-    offset=fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()];   
+    offset=fGenRecPointsOffset[specie];   
   }
 
   return offset;
index 1ef2f65..39811d3 100644 (file)
@@ -41,7 +41,7 @@ public:
   virtual void EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, TObjArray * /*list*/);
   virtual ~AliITSQASSDDataMakerRec(); // dtor
 
-  Int_t GetOffset(AliQAv1::TASKINDEX_t task);
+  Int_t GetOffset(AliQAv1::TASKINDEX_t task,Int_t specie=0);
   void  SetOffset(AliQAv1::TASKINDEX_t task, Int_t offset, Int_t specie = 0);
   Int_t GetTaskHisto(AliQAv1::TASKINDEX_t task);
   void  ResetRawsMonitoredObjects();
index 33ecda9..3b03524 100644 (file)
@@ -316,17 +316,17 @@ Int_t AliITSQASSDDataMakerSim::MakeHits(TTree *hits) {
 }
 
 //____________________________________________________________________________ 
-Int_t AliITSQASSDDataMakerSim::GetOffset(AliQAv1::TASKINDEX_t task){
+Int_t AliITSQASSDDataMakerSim::GetOffset(AliQAv1::TASKINDEX_t task,Int_t specie){
   // Returns histogram offset according to the specified task
   Int_t offset=0;
   if( task == AliQAv1::kHITS){
-    offset=fGenOffsetH[fAliITSQADataMakerSim->GetEventSpecie()];  
+    offset=fGenOffsetH[specie];  
   }
   else if( task == AliQAv1::kSDIGITS) {
-    offset=fGenOffsetS[fAliITSQADataMakerSim->GetEventSpecie()];   
+    offset=fGenOffsetS[specie];   
   }
   else if( task == AliQAv1::kDIGITS) {
-    offset=fGenOffsetD[fAliITSQADataMakerSim->GetEventSpecie()];   
+    offset=fGenOffsetD[specie];   
   }
   else {
     AliInfo("No task has been selected. TaskHisto set to zero.\n");
index c5f2413..cf8c6a7 100644 (file)
@@ -38,7 +38,7 @@ public:
   virtual Int_t MakeDigits(TTree * digits);
   virtual Int_t MakeSDigits(TTree * sdigits);
   virtual Int_t MakeHits(TTree * hits);
-  Int_t GetOffset(AliQAv1::TASKINDEX_t task);
+  Int_t GetOffset(AliQAv1::TASKINDEX_t task,Int_t specie=0);
   void  SetOffset(AliQAv1::TASKINDEX_t task, Int_t offset,Int_t specie = 0);
   Int_t GetTaskHisto(AliQAv1::TASKINDEX_t task);