From 5e232cd6bd171f6eb8ccb376ab01524703e74563 Mon Sep 17 00:00:00 2001 From: cvetan Date: Mon, 18 May 2009 14:18:52 +0000 Subject: [PATCH] Another round of fixes in order to use the event specie in the QA. The procedure is the following: 1. The QA data maker gets the event specie as defined by AliRecoParam class. 2. If the detector's reco-param object has different event specie the previous value is overwritten and QA uses the specie defined by the detector. If the event specie from AliRecoParam and the detector's event specie are both set to default, the QA will not fill any histograms. Therefore the detectors should properly implement and put in OCDB at least one reco-param object (there should be also one and only one default object) with event specie set to low-mult, high-mul, cosmic or calibration specie. The changes were prepared and tested by Yves. --- ITS/AliITSQADataMakerSim.cxx | 2 +- STEER/AliDetectorRecoParam.cxx | 2 +- STEER/AliDetectorRecoParam.h | 2 +- STEER/AliQAChecker.cxx | 2 +- STEER/AliQADataMaker.cxx | 11 +++++ STEER/AliQAManager.cxx | 46 ++++++++++----------- STEER/AliRecoParam.cxx | 71 ++++++++++++++++++++++++++------ STEER/AliRecoParam.h | 4 +- T0/AliT0QADataMakerRec.cxx | 2 +- TPC/AliTPCQADataMakerRec.cxx | 4 +- VZERO/AliVZEROQADataMakerRec.cxx | 2 +- 11 files changed, 103 insertions(+), 45 deletions(-) diff --git a/ITS/AliITSQADataMakerSim.cxx b/ITS/AliITSQADataMakerSim.cxx index c26722fa1a8..8c30dab2ab4 100644 --- a/ITS/AliITSQADataMakerSim.cxx +++ b/ITS/AliITSQADataMakerSim.cxx @@ -116,7 +116,7 @@ void AliITSQADataMakerSim::EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, TObjArr { // launch the QA checking for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) { - SetEventSpecie(specie) ; + SetEventSpecie(AliRecoParam::ConvertIndex(specie)) ; 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]); diff --git a/STEER/AliDetectorRecoParam.cxx b/STEER/AliDetectorRecoParam.cxx index a64fe79e87c..f872a78d745 100644 --- a/STEER/AliDetectorRecoParam.cxx +++ b/STEER/AliDetectorRecoParam.cxx @@ -37,7 +37,7 @@ ClassImp(AliDetectorRecoParam) AliDetectorRecoParam::AliDetectorRecoParam(): TNamed(), - fEventSpecie(0) +fEventSpecie(AliRecoParam::kDefault) { // // default constructor diff --git a/STEER/AliDetectorRecoParam.h b/STEER/AliDetectorRecoParam.h index 67df07a527a..f7d16ef8a70 100644 --- a/STEER/AliDetectorRecoParam.h +++ b/STEER/AliDetectorRecoParam.h @@ -23,7 +23,7 @@ class AliDetectorRecoParam : public TNamed void Print(Option_t */*option*/) const {Dump();} Int_t GetEventSpecie() const { return fEventSpecie; } - void SetEventSpecie(Int_t specie) { fEventSpecie = specie; } + void SetEventSpecie(AliRecoParam::EventSpecie_t specie) { fEventSpecie = specie; } void SetAsDefault() { fEventSpecie |= AliRecoParam::kDefault; } Bool_t IsDefault() const { return (fEventSpecie & AliRecoParam::kDefault); } diff --git a/STEER/AliQAChecker.cxx b/STEER/AliQAChecker.cxx index af5acd1c754..9cd16ed0af8 100644 --- a/STEER/AliQAChecker.cxx +++ b/STEER/AliQAChecker.cxx @@ -377,7 +377,7 @@ Bool_t AliQAChecker::Run(const char * fileName) AliInfo("QA performed for following detectors:") ; for ( Int_t det = 0; det < AliQAv1::kNDET; det++) { if (fFoundDetectors.Contains(AliQAv1::GetDetName(det))) { - printf("%s, ",AliQAv1::GetDetName(det)) ; + AliInfoClass(Form("%s, ",AliQAv1::GetDetName(det))) ; fFoundDetectors.ReplaceAll(AliQAv1::GetDetName(det), "") ; } } diff --git a/STEER/AliQADataMaker.cxx b/STEER/AliQADataMaker.cxx index 889cf13320f..a54acbc5a69 100644 --- a/STEER/AliQADataMaker.cxx +++ b/STEER/AliQADataMaker.cxx @@ -49,6 +49,8 @@ #include "AliQAChecker.h" #include "AliESDEvent.h" #include "AliRawReader.h" +#include "AliDetectorRecoParam.h" + ClassImp(AliQADataMaker) @@ -170,6 +172,15 @@ TObject * AliQADataMaker::GetData(TObjArray ** list, const Int_t index) AliError("Data list is NULL !!") ; return NULL ; } + + SetEventSpecie(fEventSpecie) ; + if ( GetRecoParam() ) { + if ( AliRecoParam::Convert(GetRecoParam()->GetEventSpecie()) != AliRecoParam::kDefault) { + SetEventSpecie(GetRecoParam()->GetEventSpecie()) ; + } else { + AliError(Form("Event Specie from RecoParam of %s is = %d\n", GetName(), fEventSpecie)); + } + } if (list[AliRecoParam::AConvert(fEventSpecie)]) { if ( index > 10000 ) { AliError("Max number of authorized QA objects is 10000") ; diff --git a/STEER/AliQAManager.cxx b/STEER/AliQAManager.cxx index a017c1a404f..60902ea5a53 100644 --- a/STEER/AliQAManager.cxx +++ b/STEER/AliQAManager.cxx @@ -407,10 +407,10 @@ AliQADataMaker * AliQAManager::GetQADataMaker(const Int_t iDet) // get the quality assurance data maker for a detector if (fQADataMaker[iDet]) { + fQADataMaker[iDet]->SetEventSpecie(fEventSpecie) ; if ( fQADataMaker[iDet]->GetRecoParam() ) - fQADataMaker[iDet]->SetEventSpecie(fQADataMaker[iDet]->GetRecoParam()->GetEventSpecie()) ; - else - fQADataMaker[iDet]->SetEventSpecie(fEventSpecie) ; + if ( AliRecoParam::Convert(fQADataMaker[iDet]->GetRecoParam()->GetEventSpecie()) != AliRecoParam::kDefault) + fQADataMaker[iDet]->SetEventSpecie(fQADataMaker[iDet]->GetRecoParam()->GetEventSpecie()) ; return fQADataMaker[iDet] ; } @@ -421,10 +421,10 @@ AliQADataMaker * AliQAManager::GetQADataMaker(const Int_t iDet) qadm->SetName(AliQAv1::GetDetName(iDet)); qadm->SetUniqueID(iDet); fQADataMaker[iDet] = qadm; + qadm->SetEventSpecie(fEventSpecie) ; if ( qadm->GetRecoParam() ) - qadm->SetEventSpecie(qadm->GetRecoParam()->GetEventSpecie()) ; - else - qadm->SetEventSpecie(fEventSpecie) ; + if ( AliRecoParam::Convert(qadm->GetRecoParam()->GetEventSpecie()) != AliRecoParam::kDefault) + qadm->SetEventSpecie(qadm->GetRecoParam()->GetEventSpecie()) ; return qadm; } @@ -433,10 +433,10 @@ AliQADataMaker * AliQAManager::GetQADataMaker(const Int_t iDet) qadm->SetName(AliQAv1::GetDetName(iDet)); qadm->SetUniqueID(iDet); fQADataMaker[iDet] = qadm; + qadm->SetEventSpecie(fEventSpecie) ; if ( qadm->GetRecoParam() ) - qadm->SetEventSpecie(qadm->GetRecoParam()->GetEventSpecie()) ; - else - qadm->SetEventSpecie(fEventSpecie) ; + if ( AliRecoParam::Convert(qadm->GetRecoParam()->GetEventSpecie()) != AliRecoParam::kDefault) + qadm->SetEventSpecie(qadm->GetRecoParam()->GetEventSpecie()) ; return qadm; } @@ -471,10 +471,10 @@ AliQADataMaker * AliQAManager::GetQADataMaker(const Int_t iDet) qadm->SetName(AliQAv1::GetDetName(iDet)); qadm->SetUniqueID(iDet); fQADataMaker[iDet] = qadm ; + qadm->SetEventSpecie(fEventSpecie) ; if ( qadm->GetRecoParam() ) - qadm->SetEventSpecie(qadm->GetRecoParam()->GetEventSpecie()) ; - else - qadm->SetEventSpecie(fEventSpecie) ; + if ( AliRecoParam::Convert(qadm->GetRecoParam()->GetEventSpecie()) != AliRecoParam::kDefault) + qadm->SetEventSpecie(qadm->GetRecoParam()->GetEventSpecie()) ; } return qadm ; @@ -750,9 +750,7 @@ Bool_t AliQAManager::MergeXML(const char * collectionFile, const char * subFile, return kFALSE ; // Open the file collection - printf("*** Create Collection ***\n"); - printf("*** Wk-Dir = |%s| \n",gSystem->WorkingDirectory()); - printf("*** Coll = |%s| \n",collectionFile); + AliInfoClass(Form("*** Create Collection ***\n*** Wk-Dir = |%s| \n*** Coll = |%s| \n",gSystem->WorkingDirectory(), collectionFile)); TGridCollection * collection = (TGridCollection*)gROOT->ProcessLine(Form("TAlienCollection::Open(\"%s\")",collectionFile)); TGridResult* result = collection->GetGridResult("", 0, 0); @@ -1173,10 +1171,10 @@ void AliQAManager::RunOneEvent(AliRawReader * rawReader) qadm->EndOfCycle() ; } AliCodeTimerStart(Form("running RAW quality assurance data maker for %s", AliQAv1::GetDetName(iDet))); + qadm->SetEventSpecie(fEventSpecie) ; if ( qadm->GetRecoParam() ) - qadm->SetEventSpecie(qadm->GetRecoParam()->GetEventSpecie()) ; - else - qadm->SetEventSpecie(fEventSpecie) ; + if ( AliRecoParam::Convert(qadm->GetRecoParam()->GetEventSpecie()) != AliRecoParam::kDefault) + qadm->SetEventSpecie(qadm->GetRecoParam()->GetEventSpecie()) ; qadm->Exec(AliQAv1::kRAWS, rawReader) ; AliCodeTimerStop(Form("running RAW quality assurance data maker for %s", AliQAv1::GetDetName(iDet))); } @@ -1196,10 +1194,10 @@ void AliQAManager::RunOneEvent(AliESDEvent *& esd) AliQADataMaker *qadm = GetQADataMaker(iDet); if (!qadm) continue; + qadm->SetEventSpecie(fEventSpecie) ; if ( qadm->GetRecoParam() ) - qadm->SetEventSpecie(qadm->GetRecoParam()->GetEventSpecie()) ; - else - qadm->SetEventSpecie(fEventSpecie) ; + if ( AliRecoParam::Convert(qadm->GetRecoParam()->GetEventSpecie()) != AliRecoParam::kDefault) + qadm->SetEventSpecie(qadm->GetRecoParam()->GetEventSpecie()) ; if ( qadm->IsCycleDone() ) { qadm->EndOfCycle() ; } @@ -1219,10 +1217,10 @@ void AliQAManager::RunOneEventInOneDetector(Int_t det, TTree * tree) if (IsSelected(AliQAv1::GetDetName(det))) { AliQADataMaker *qadm = GetQADataMaker(det); if (qadm) { + qadm->SetEventSpecie(fEventSpecie) ; if ( qadm->GetRecoParam() ) - qadm->SetEventSpecie(qadm->GetRecoParam()->GetEventSpecie()) ; - else - qadm->SetEventSpecie(fEventSpecie) ; + if ( AliRecoParam::Convert(qadm->GetRecoParam()->GetEventSpecie()) != AliRecoParam::kDefault) + qadm->SetEventSpecie(qadm->GetRecoParam()->GetEventSpecie()) ; if ( qadm->IsCycleDone() ) { qadm->EndOfCycle() ; } diff --git a/STEER/AliRecoParam.cxx b/STEER/AliRecoParam.cxx index 1425c390b3d..c86f2cb9672 100644 --- a/STEER/AliRecoParam.cxx +++ b/STEER/AliRecoParam.cxx @@ -25,6 +25,7 @@ // // /////////////////////////////////////////////////////////////////////////////// +#include "TClass.h" #include "TObjArray.h" #include "TMath.h" #include "AliDetectorRecoParam.h" @@ -33,6 +34,7 @@ #include "AliRecoParam.h" #include "AliRunInfo.h" #include "AliEventInfo.h" +#include "AliLog.h" ClassImp(AliRecoParam) @@ -98,29 +100,74 @@ AliRecoParam::~AliRecoParam(){ Int_t AliRecoParam::AConvert(EventSpecie_t es) { //Converts EventSpecie_t into int - return static_cast(TMath::Log2(es)) ; - + Int_t rv = -1 ; + switch (es) { + case kDefault: + rv = 0 ; + break; + case kLowMult: + rv = 1 ; + break; + case kHighMult: + rv = 2 ; + break; + case kCosmic: + rv = 3 ; + break; + case kCalib: + rv = 4 ; + break; + default: + break; + } + if (rv >= 0) + return rv ; + else + AliFatalClass(Form("Wrong event specie conversion %d", es)) ; } AliRecoParam::EventSpecie_t AliRecoParam::Convert(Int_t ies) { //Converts int into EventSpecie_t - AliRecoParam::EventSpecie_t es = AliRecoParam::kDefault ; - - Int_t i = (Int_t)TMath::Power(2, ies) ; - - if ( i == AliRecoParam::kLowMult) + AliRecoParam::EventSpecie_t es = kDefault ; + if ( ies >> 1) es = kLowMult ; - else if ( i == AliRecoParam::kHighMult) + if ( ies >> 2) es = kHighMult ; - else if ( i == AliRecoParam::kCosmic) + if ( ies >> 3) es = kCosmic ; - else if ( i == AliRecoParam::kCalib) - es = kCalib ; - + if ( ies >> 4) + es = kCalib ; + return es ; } +AliRecoParam::EventSpecie_t AliRecoParam::ConvertIndex(Int_t index) +{ + //Converts index of lists into eventspecie + EventSpecie_t es = kDefault ; + switch (index) { + case 0: + es = kDefault ; + break; + case 1: + es = kLowMult ; + break; + case 2: + es = kHighMult ; + break; + case 3: + es = kCosmic ; + break; + case 4: + es = kCalib ; + break; + default: + break; + } + return es ; +} + void AliRecoParam::Print(Option_t *option) const { // // Print reconstruction setup diff --git a/STEER/AliRecoParam.h b/STEER/AliRecoParam.h index 64c81d85217..a468909d0cd 100644 --- a/STEER/AliRecoParam.h +++ b/STEER/AliRecoParam.h @@ -37,7 +37,9 @@ class AliRecoParam : public TObject kCalib = 16}; static Int_t AConvert(EventSpecie_t es) ; - static EventSpecie_t Convert(Int_t es) ; + static EventSpecie_t Convert(Int_t ies) ; + static EventSpecie_t ConvertIndex(Int_t index) ; + virtual void Print(Option_t *option="") const; const TObjArray *GetDetRecoParamArray(Int_t iDet) const { return fDetRecoParams[iDet]; } void SetEventSpecie(const AliRunInfo*runInfo, const AliEventInfo &evInfo); diff --git a/T0/AliT0QADataMakerRec.cxx b/T0/AliT0QADataMakerRec.cxx index d2be8b170d5..ca435f4a4fe 100644 --- a/T0/AliT0QADataMakerRec.cxx +++ b/T0/AliT0QADataMakerRec.cxx @@ -87,7 +87,7 @@ void AliT0QADataMakerRec::EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, TObjArra // do the QA checking AliQAChecker::Instance()->Run(AliQAv1::kT0, task, list) ; for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) { - SetEventSpecie(specie) ; + SetEventSpecie(AliRecoParam::ConvertIndex(specie)) ; if ( task == AliQAv1::kRAWS ) { const Char_t *triggers[6] = {"mean", "vertex","ORA","ORC","central","semi-central"}; for (Int_t itr=0; itr<6; itr++) { diff --git a/TPC/AliTPCQADataMakerRec.cxx b/TPC/AliTPCQADataMakerRec.cxx index 2bc3bd8977e..c2f295d519a 100644 --- a/TPC/AliTPCQADataMakerRec.cxx +++ b/TPC/AliTPCQADataMakerRec.cxx @@ -141,7 +141,7 @@ void AliTPCQADataMakerRec::EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, TObjArr fTPCdataQA[specie]->Analyse(); // 31/1-08 Analyse is now protected against // RAW data files with no TPC data - SetEventSpecie(specie) ; + SetEventSpecie(AliRecoParam::ConvertIndex(specie)) ; TH1F * histRawsOccupancy = (TH1F*)GetRawsData(kOccupancy) ; TH1F * histRawsOccupancyVsSector = (TH1F*)GetRawsData(kOccupancyVsSector) ; TH1F * histRawsNClustersPerEventVsSector = (TH1F*)GetRawsData(kNClustersPerEventVsSector) ; @@ -273,7 +273,7 @@ void AliTPCQADataMakerRec::InitRaws() const Bool_t image = kTRUE ; for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) { - fTPCdataQA[specie] = new AliTPCdataQA(AliRecoParam::Convert(specie)); + fTPCdataQA[specie] = new AliTPCdataQA(AliRecoParam::ConvertIndex(specie)); LoadMaps(); // Load Altro maps fTPCdataQA[specie]->SetAltroMapping(fMapping); // set Altro mapping fTPCdataQA[specie]->SetRangeTime(100, 920); // set time bin interval diff --git a/VZERO/AliVZEROQADataMakerRec.cxx b/VZERO/AliVZEROQADataMakerRec.cxx index d4b67308b94..fe8e485165d 100644 --- a/VZERO/AliVZEROQADataMakerRec.cxx +++ b/VZERO/AliVZEROQADataMakerRec.cxx @@ -126,7 +126,7 @@ void AliVZEROQADataMakerRec::EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, TObjA AliQAChecker::Instance()->Run(AliQAv1::kVZERO, task, list) ; for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) { - SetEventSpecie(specie) ; + SetEventSpecie(AliRecoParam::ConvertIndex(specie)) ; if(task == AliQAv1::kRAWS){ int nMaxBin = GetRawsData(kPedestalTimeInt0)->GetNbinsY(); if(fCurrentCycle%nMaxBin==0) { -- 2.39.3