From 1e7991d88ca173160f6fcbd5a01432cfbb1b07c2 Mon Sep 17 00:00:00 2001 From: masera Date: Sun, 21 Mar 2010 21:56:26 +0000 Subject: [PATCH] Changes to avoid multiple initializations (Melinda) --- ITS/AliITSQADataMakerRec.cxx | 46 ++++++++++++++++++++++++++------- ITS/AliITSQADataMakerRec.h | 13 +++++++--- ITS/AliITSQASDDDataMakerRec.cxx | 37 ++++++++++++++++---------- 3 files changed, 70 insertions(+), 26 deletions(-) diff --git a/ITS/AliITSQADataMakerRec.cxx b/ITS/AliITSQADataMakerRec.cxx index b6e67cae032..8f6c31cff51 100644 --- a/ITS/AliITSQADataMakerRec.cxx +++ b/ITS/AliITSQADataMakerRec.cxx @@ -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; + +} diff --git a/ITS/AliITSQADataMakerRec.h b/ITS/AliITSQADataMakerRec.h index e556721206f..9638c4c647e 100644 --- a/ITS/AliITSQADataMakerRec.h +++ b/ITS/AliITSQADataMakerRec.h @@ -19,9 +19,11 @@ // 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 }; diff --git a/ITS/AliITSQASDDDataMakerRec.cxx b/ITS/AliITSQASDDDataMakerRec.cxx index 4a92ecf91b3..e4d8c636742 100644 --- a/ITS/AliITSQASDDDataMakerRec.cxx +++ b/ITS/AliITSQASDDDataMakerRec.cxx @@ -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 -- 2.43.0