]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Changes to avoid multiple initializations (Melinda)
authormasera <masera@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sun, 21 Mar 2010 21:56:26 +0000 (21:56 +0000)
committermasera <masera@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sun, 21 Mar 2010 21:56:26 +0000 (21:56 +0000)
ITS/AliITSQADataMakerRec.cxx
ITS/AliITSQADataMakerRec.h
ITS/AliITSQASDDDataMakerRec.cxx

index b6e67cae03238204b5efe6a97febdfd8f7db6895..8f6c31cff51a92cd60a5c2fe3b169449fee77c56 100644 (file)
@@ -39,6 +39,7 @@
 #include "AliQAv1.h"
 #include "AliQAChecker.h"
 #include "AliITSQAChecker.h"
+#include "AliQAManager.h"
 #include "AliITSRecPoint.h"
 #include "AliITSRecPointContainer.h"
 #include "AliRawReader.h"
@@ -58,6 +59,7 @@ fSubDetector(subDet),
 fLDC(ldc),
 fRunNumber(0),
 fEventNumber(0),
+  fSelectedTaskIndex(AliQAv1::kNULLTASKINDEX),
 fSPDDataMaker(NULL),
 fSDDDataMaker(NULL),
 fSSDDataMaker(NULL)
@@ -99,6 +101,7 @@ fSubDetector(qadm.fSubDetector),
 fLDC(qadm.fLDC),
 fRunNumber(qadm.fRunNumber),
 fEventNumber(qadm.fEventNumber),
+fSelectedTaskIndex(qadm.fSelectedTaskIndex),
 fSPDDataMaker(NULL),
 fSDDDataMaker(NULL),
 fSSDDataMaker(NULL)
@@ -128,6 +131,14 @@ void AliITSQADataMakerRec::StartOfDetectorCycle()
   if(fSubDetector == 0 || fSubDetector == 3) fSSDDataMaker->StartOfDetectorCycle();
 }
 
+//____________________________________________________________________________
+void AliITSQADataMakerRec::StartOfCycle(AliQAv1::TASKINDEX_t task, Int_t run, const Bool_t sameCycle) 
+{ 
+  // Start a cycle of QA data acquistion
+  fSelectedTaskIndex=task;
+  AliQADataMakerRec::StartOfCycle(task,run,sameCycle);
+}
+
 //____________________________________________________________________________ 
 void AliITSQADataMakerRec::EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, TObjArray** list)
 {
@@ -139,11 +150,10 @@ void AliITSQADataMakerRec::EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, TObjArr
        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)
-           {
+         if(idnumber==40||idnumber==0){
              //AliInfo(Form("No check for %s\n",AliQAv1::GetTaskName(task).Data() ))
-               continue;
-           } //skip kDigitsR and not filled TobjArray specie
+           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]);
@@ -176,14 +186,14 @@ void AliITSQADataMakerRec::EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, TObjArr
 }
 
 //____________________________________________________________________________ 
-void AliITSQADataMakerRec::EndOfDetectorCycle(const char * /*fgDataName*/)
-{
+//void AliITSQADataMakerRec::EndOfDetectorCycle(const char * /*fgDataName*/)
+//{
   //eventually used for different  AliQAChecker::Instance()->Run
-}
+//}
 
 //____________________________________________________________________________ 
-void AliITSQADataMakerRec::InitRaws()
-{  
+void AliITSQADataMakerRec::InitRaws() {
+  // Initialization of RAW data histograms  
 
   //if(fRawsQAList[AliRecoParam::AConvert(fEventSpecie)]->GetEntries()) return;
        
@@ -761,6 +771,10 @@ void AliITSQADataMakerRec::ResetDetector(AliQAv1::TASKINDEX_t task)
        } else if ( task == AliQAv1::kESDS ) {
                list = fESDsQAList ; 
        }
+  else{
+    AliWarning("The selected task is not a REC task\n");
+    return;
+  }
     //list was not initialized, skip
   if (!list) 
     return ; 
@@ -796,3 +810,17 @@ AliITSDDLModuleMapSDD *AliITSQADataMakerRec::GetDDLSDDModuleMap()
     return NULL;
   }
 }
+
+//____________________________________________________________________
+
+Bool_t AliITSQADataMakerRec::ListExists(AliQAv1::TASKINDEX_t task) const
+{
+  //Check the existence of a list for a given task
+  Bool_t havethelist=kFALSE;
+  if( ( task == AliQAv1::kRAWS && fRawsQAList ) ||
+      ( task == AliQAv1::kRECPOINTS && fRecPointsQAList ) ||
+      ( task == AliQAv1::kDIGITSR && fDigitsQAList ) ||
+      ( task == AliQAv1::kESDS && fESDsQAList ) ) havethelist=kTRUE;
+  return havethelist;
+
+}
index e556721206fb4e78e1186fd29ebcd93464b5efe0..9638c4c647edb65ea278df0c82705fee6f941340 100644 (file)
 //  A. Dainese Jun 2008 
 
 #include "AliQADataMakerRec.h"
+
 #include "AliDetectorRecoParam.h"
 #include "AliReconstructor.h"
 #include "AliITSDDLModuleMapSDD.h"
+#include "AliQAManager.h"
 
 class AliITSQASPDDataMakerRec;
 class AliITSQASDDDataMakerRec;
@@ -43,8 +45,10 @@ public:
   AliITSQADataMakerRec& operator = (const AliITSQADataMakerRec& qac);
   virtual Int_t GetEventSpecie() const { return AliRecoParam::AConvert(fEventSpecie); }
   virtual void StartOfDetectorCycle();
+  virtual void StartOfCycle(AliQAv1::TASKINDEX_t task, Int_t run, const Bool_t sameCycle = kFALSE) ;
+  virtual void StartOfCycle(Int_t run){AliQADataMakerRec::StartOfCycle(run);}
   virtual void EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, TObjArray ** list);
-  virtual void EndOfDetectorCycle(const char *fgDataName);
+  //  virtual void EndOfDetectorCycle(const char *fgDataName);
   virtual void InitRaws();
   virtual void InitDigits();
   virtual void InitRecPoints();
@@ -55,6 +59,8 @@ public:
   virtual void MakeRecPoints(TTree *clustersTree);
   virtual void MakeESDs(AliESDEvent *esd);
   virtual void FillRecPoint(AliITSRecPoint rcp);
+  virtual Bool_t ListExists(AliQAv1::TASKINDEX_t task) const;
+  AliQAv1::TASKINDEX_t GetTaskIndexSelected() const {return fSelectedTaskIndex;}
 
   virtual void ResetDetector(AliQAv1::TASKINDEX_t task);
 
@@ -78,13 +84,14 @@ private:
   Short_t fSubDetector;                    // subDetector: 0 (ALL), 1 (SPD), 2 (SDD), 3 (SSD)
   Short_t fLDC;                                   // number of LDC: 0 (one LDC for the whole subdetector)
   Int_t fRunNumber;                        //run number
-  Int_t fEventNumber;                        //Event number (online mode)
+  Int_t fEventNumber;                      //Event number (online mode)
+  AliQAv1::TASKINDEX_t fSelectedTaskIndex; //Current TaskIndex
 
   AliITSQASPDDataMakerRec *fSPDDataMaker;  // SPD Data Maker 
   AliITSQASDDDataMakerRec *fSDDDataMaker;  // SDD Data Maker 
   AliITSQASSDDataMakerRec *fSSDDataMaker;  // SSD Data Maker 
 
-  ClassDef(AliITSQADataMakerRec,7)         // description 
+  ClassDef(AliITSQADataMakerRec,8)         // description 
 
 };
 
index 4a92ecf91b33346718f429b3173073f4858aeebb..e4d8c636742c997400b37a20d84e352c7bd5bac0 100644 (file)
@@ -146,22 +146,31 @@ AliITSQASDDDataMakerRec& AliITSQASDDDataMakerRec::operator = (const AliITSQASDDD
 //____________________________________________________________________________ 
 void AliITSQASDDDataMakerRec::StartOfDetectorCycle()
 {
-
+  AliDebug(AliQAv1::GetQADebugLevel(),Form("Start of SDD Cycle with event specie %s for task %s\n",AliRecoParam::GetEventSpecieName(fAliITSQADataMakerRec->GetEventSpecie()),AliQAv1::GetTaskName(fAliITSQADataMakerRec->GetTaskIndexSelected()).Data()));
   if(!fCalibration) {CreateTheCalibration();}
 
-  //Detector specific actions at start of cycle
-  AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQADM::Start of SDD Cycle\n");
-  if(fAliITSQADataMakerRec->GetRawsData(0)!=NULL){
-    fAliITSQADataMakerRec->GetRawsData(3+ fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Reset();
-    fAliITSQADataMakerRec->GetRawsData(4+ fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Reset();
-    fAliITSQADataMakerRec->GetRawsData(5+ fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Reset();
-  }
+  if(fAliITSQADataMakerRec->GetEventSpecie()==0) return;//not the kDefault EventSpecie
+    //Detector specific actions at start of cycle
+    if(fAliITSQADataMakerRec->GetTaskIndexSelected()==AliQAv1::kRAWS){
+      AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQADM::Start of SDD Cycle\n");
+      if(fAliITSQADataMakerRec->ListExists(AliQAv1::kRAWS)==kFALSE)return;
 
-  if(fAliITSQADataMakerRec->GetRecPointsData(0)!=NULL){
-    fAliITSQADataMakerRec->GetRecPointsData(9+  fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Reset();
-    fAliITSQADataMakerRec->GetRecPointsData(10+ fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Reset();
-    fAliITSQADataMakerRec->GetRecPointsData(11+ fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Reset();
-  }
+       AliDebug(AliQAv1::GetQADebugLevel(),Form("Reset of Raw Data normalized histograms with eventspecie %s ",AliRecoParam::GetEventSpecieName(fAliITSQADataMakerRec->GetEventSpecie())));
+
+       fAliITSQADataMakerRec->GetRawsData(3+ fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Reset();
+       fAliITSQADataMakerRec->GetRawsData(4+ fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Reset();
+       fAliITSQADataMakerRec->GetRawsData(5+ fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Reset();
+      
+    }
+    if(fAliITSQADataMakerRec->GetTaskIndexSelected()==AliQAv1::kRECPOINTS){
+      if(fAliITSQADataMakerRec->ListExists(AliQAv1::kRECPOINTS)==kFALSE)return;
+
+       AliDebug(AliQAv1::GetQADebugLevel(),Form("Reset of RecPoints normalized histograms with eventspecie %s ",AliRecoParam::GetEventSpecieName(fAliITSQADataMakerRec->GetEventSpecie())));
+
+       fAliITSQADataMakerRec->GetRecPointsData(9+  fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Reset();
+       fAliITSQADataMakerRec->GetRecPointsData(10+ fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Reset();
+       fAliITSQADataMakerRec->GetRecPointsData(11+ fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Reset();
+      }
 }
 
 //____________________________________________________________________________ 
@@ -659,7 +668,7 @@ Int_t AliITSQASDDDataMakerRec::InitRecPoints()
     sprintf(hisnam,"SDDdrifttime_Layer%d",iLay+3);
     TH1F *h17 = new TH1F(hisnam,hisnam,90/nOnline5,-0.5,4499.5);//position number 17 (L3) and position number 18 (L4)
     h17->SetBit(TH1::kCanRebin);
-    h17->GetXaxis()->SetTitle("drift time[#mus]");
+    h17->GetXaxis()->SetTitle("drift time[ns]");
     h17->GetXaxis()->CenterTitle();
     h17->GetYaxis()->SetTitle("Entries");
     rv = fAliITSQADataMakerRec->Add2RecPointsList(h17,iLay+17+fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, image);// NON expert  image