From 57acd2d2f484e474d764cf49c17bf8a0af5bdd5e Mon Sep 17 00:00:00 2001 From: hristov Date: Sat, 27 Dec 2008 10:27:54 +0000 Subject: [PATCH] Introducing event specie in QA (Yves) --- ACORDE/AliACORDEQAChecker.cxx | 76 ++- ACORDE/AliACORDEQAChecker.h | 7 +- ACORDE/AliACORDEQADataMakerRec.cxx | 2 +- ACORDE/AliACORDEQADataMakerRec.h | 2 +- ACORDE/AliACORDEQADataMakerSim.cxx | 6 +- ACORDE/AliACORDEQADataMakerSim.h | 2 +- EMCAL/AliEMCALQADataMakerRec.cxx | 2 +- EMCAL/AliEMCALQADataMakerRec.h | 2 +- EMCAL/AliEMCALQADataMakerSim.cxx | 2 +- EMCAL/AliEMCALQADataMakerSim.h | 2 +- FMD/AliFMDQADataMakerRec.cxx | 2 +- FMD/AliFMDQADataMakerRec.h | 2 +- FMD/AliFMDQADataMakerSim.cxx | 2 +- FMD/AliFMDQADataMakerSim.h | 2 +- HMPID/AliHMPIDQAChecker.cxx | 47 +- HMPID/AliHMPIDQAChecker.h | 7 +- HMPID/AliHMPIDQADataMakerRec.cxx | 10 +- HMPID/AliHMPIDQADataMakerRec.h | 2 +- HMPID/AliHMPIDQADataMakerSim.cxx | 2 +- HMPID/AliHMPIDQADataMakerSim.h | 2 +- ITS/AliITSQAChecker.cxx | 301 +++++---- ITS/AliITSQAChecker.h | 6 +- ITS/AliITSQADataMakerRec.cxx | 14 +- ITS/AliITSQADataMakerRec.h | 2 +- ITS/AliITSQADataMakerSim.cxx | 14 +- ITS/AliITSQADataMakerSim.h | 2 +- ITS/AliITSQASDDDataMakerRec.cxx | 4 +- ITS/AliITSQASDDDataMakerSim.cxx | 6 +- ITS/AliITSQASPDDataMakerRec.cxx | 4 +- ITS/AliITSQASPDDataMakerSim.cxx | 6 +- ITS/AliITSQASSDDataMakerRec.cxx | 11 +- ITS/AliITSQASSDDataMakerSim.cxx | 10 +- MUON/AliMUONQAChecker.cxx | 206 +++--- MUON/AliMUONQAChecker.h | 14 +- MUON/AliMUONQADataMakerRec.cxx | 125 ++-- MUON/AliMUONQADataMakerRec.h | 2 +- MUON/AliMUONQADataMakerSim.cxx | 2 +- MUON/AliMUONQADataMakerSim.h | 2 +- PHOS/AliPHOSQADataMakerRec.cxx | 31 +- PHOS/AliPHOSQADataMakerRec.h | 2 +- PHOS/AliPHOSQADataMakerSim.cxx | 21 +- PHOS/AliPHOSQADataMakerSim.h | 6 +- PMD/AliPMDQADataMakerRec.cxx | 2 +- PMD/AliPMDQADataMakerRec.h | 2 +- PMD/AliPMDQADataMakerSim.cxx | 2 +- PMD/AliPMDQADataMakerSim.h | 2 +- STEER/AliCorrQAChecker.cxx | 20 +- STEER/AliCorrQAChecker.h | 6 +- STEER/AliCorrQADataMakerRec.cxx | 35 +- STEER/AliCorrQADataMakerRec.h | 4 +- STEER/AliGlobalQADataMaker.cxx | 2 +- STEER/AliGlobalQADataMaker.h | 2 +- STEER/AliQA.cxx | 302 +++++---- STEER/AliQA.h | 65 +- STEER/AliQAChecker.cxx | 189 ++++-- STEER/AliQAChecker.h | 22 +- STEER/AliQACheckerBase.cxx | 275 ++++---- STEER/AliQACheckerBase.h | 34 +- STEER/AliQADataMaker.cxx | 84 ++- STEER/AliQADataMaker.h | 35 +- STEER/AliQADataMakerRec.cxx | 134 ++-- STEER/AliQADataMakerRec.h | 26 +- STEER/AliQADataMakerSim.cxx | 107 ++-- STEER/AliQADataMakerSim.h | 12 +- STEER/AliQADataMakerSteer.cxx | 95 ++- STEER/AliQADataMakerSteer.h | 17 +- STEER/AliRecoParam.cxx | 86 ++- STEER/AliRecoParam.h | 9 +- STEER/AliReconstruction.cxx | 108 ++-- STEER/AliSimulation.cxx | 27 +- STEER/AliSimulation.h | 19 +- STEER/AliTracker.cxx | 25 +- STEER/AliTracker.h | 12 +- STEER/CMake_libSTEER.txt | 3 - STEER/CMake_libSTEERBase.txt | 3 + STEER/STEERBaseLinkDef.h | 5 + STEER/STEERLinkDef.h | 5 - STEER/libSTEER.pkg | 3 - STEER/libSTEERBase.pkg | 4 +- T0/AliT0QAChecker.cxx | 289 +++++---- T0/AliT0QAChecker.h | 8 +- T0/AliT0QADataMakerRec.cxx | 53 +- T0/AliT0QADataMakerRec.h | 2 +- T0/AliT0QADataMakerSim.cxx | 2 +- T0/AliT0QADataMakerSim.h | 2 +- TOF/AliTOFQAChecker.cxx | 65 +- TOF/AliTOFQAChecker.h | 7 +- TOF/AliTOFQADataMakerRec.cxx | 2 +- TOF/AliTOFQADataMakerRec.h | 2 +- TOF/AliTOFQADataMakerSim.cxx | 2 +- TOF/AliTOFQADataMakerSim.h | 2 +- TPC/AliTPCQADataMakerRec.cxx | 343 +++++----- TPC/AliTPCQADataMakerRec.h | 26 +- TPC/AliTPCQADataMakerSim.cxx | 140 ++--- TPC/AliTPCQADataMakerSim.h | 13 +- TPC/AliTPCdataQA.cxx | 33 +- TPC/AliTPCdataQA.h | 2 + TRD/AliTRDQAChecker.h | 8 +- TRD/AliTRDQADataMakerRec.cxx | 218 +++---- TRD/AliTRDQADataMakerRec.h | 2 +- TRD/AliTRDQADataMakerSim.cxx | 2 +- TRD/AliTRDQADataMakerSim.h | 2 +- VZERO/AliVZEROQAChecker.cxx | 84 ++- VZERO/AliVZEROQAChecker.h | 9 +- VZERO/AliVZEROQADataMakerRec.cxx | 62 +- VZERO/AliVZEROQADataMakerRec.h | 2 +- VZERO/AliVZEROQADataMakerSim.cxx | 2 +- VZERO/AliVZEROQADataMakerSim.h | 2 +- ZDC/AliZDCQAChecker.cxx | 972 ++++++++++++++--------------- ZDC/AliZDCQAChecker.h | 7 +- ZDC/AliZDCQADataMakerRec.cxx | 2 +- ZDC/AliZDCQADataMakerRec.h | 2 +- ZDC/AliZDCQADataMakerSim.cxx | 2 +- ZDC/AliZDCQADataMakerSim.h | 2 +- test/QA/Config.C | 92 +-- test/QA/rec.C | 2 +- test/QA/sim.C | 3 +- 117 files changed, 2844 insertions(+), 2381 deletions(-) diff --git a/ACORDE/AliACORDEQAChecker.cxx b/ACORDE/AliACORDEQAChecker.cxx index a3e80f94167..5c5aef7c82f 100755 --- a/ACORDE/AliACORDEQAChecker.cxx +++ b/ACORDE/AliACORDEQAChecker.cxx @@ -39,52 +39,60 @@ ClassImp(AliACORDEQAChecker) -//__________________________________________________________________ +//____________________________________________________________________________ +Double_t * AliACORDEQAChecker::Check(AliQA::ALITASK_t /*index*/) +{ + Double_t * rv = new Double_t[AliRecoParam::kNSpecies] ; + for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) + rv[specie] = 0.0 ; + return rv ; +} -Double_t AliACORDEQAChecker::Check(AliQA::ALITASK_t /*index*/, TObjArray * list) +//__________________________________________________________________ +Double_t * AliACORDEQAChecker::Check(AliQA::ALITASK_t /*index*/, TObjArray ** list) { // Super-basic check on the QA histograms on the input list: // look whether they are empty! - Double_t test = 0.0 ; - Int_t count = 0 ; - - if (list->GetEntries() == 0){ - test = 1. ; // nothing to check + Double_t * test = new Double_t[AliRecoParam::kNSpecies] ; + Int_t * count = new Int_t[AliRecoParam::kNSpecies] ; + for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) { + test[specie] = 0.0 ; + count[specie] = 0 ; } - else { - TIter next(list) ; - TH1 * hdata ; - count = 0 ; - while ( (hdata = dynamic_cast(next())) ) { - if (hdata) { - Double_t rv = 0.; - if(hdata->GetEntries()>0)rv=1; - AliInfo(Form("%s -> %f", hdata->GetName(), rv)) ; - count++ ; - test += rv ; - } - else{ - AliError("Data type cannot be processed") ; - } - + + for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) { + if (list[specie]->GetEntries() == 0){ + test[specie] = 1. ; // nothing to check } - if (count != 0) { - if (test==0) { - AliWarning("Histograms are there, but they are all empty: setting flag to kWARNING"); - test = 0.5; //upper limit value to set kWARNING flag for a task + else { + TIter next(list[specie]) ; + TH1 * hdata ; + while ( (hdata = dynamic_cast(next())) ) { + if (hdata) { + Double_t rv = 0.0 ; + if(hdata->GetEntries()>0)rv=1; + AliInfo(Form("%s -> %f", hdata->GetName(), rv)) ; + count[specie]++ ; + test[specie] += rv ; + } + else{ + AliError("Data type cannot be processed") ; + } } - else { - test /= count ; + if (count[specie] != 0) { + if (test[specie]==0) { + AliWarning("Histograms are there, but they are all empty: setting flag to kWARNING"); + test[specie] = 0.5; //upper limit value to set kWARNING flag for a task + } + else { + test[specie] /= count[specie] ; + } } } + AliInfo(Form("Test Result = %f", test[specie])) ; } - - AliInfo(Form("Test Result = %f", test)) ; return test ; - - - } diff --git a/ACORDE/AliACORDEQAChecker.h b/ACORDE/AliACORDEQAChecker.h index f58f2c44ebf..5127820510d 100755 --- a/ACORDE/AliACORDEQAChecker.h +++ b/ACORDE/AliACORDEQAChecker.h @@ -30,11 +30,8 @@ public: AliACORDEQAChecker(const AliACORDEQAChecker& qac) : AliQACheckerBase(qac.GetName(), qac.GetTitle()) {;} // constructor virtual ~AliACORDEQAChecker() {;} // destructor - virtual Double_t Check(AliQA::ALITASK_t /*index*/, TObjArray * list) ; - virtual Double_t Check(AliQA::ALITASK_t /*index*/) {return 0.;} ; - virtual Double_t Check() {return 0.;} ; - virtual Double_t Check(TObjArray*) {return 0.;} ; - virtual Double_t Check(AliQA::ALITASK_t, TNtupleD*) {return -1.;} ; + virtual Double_t * Check(AliQA::ALITASK_t index) ; + virtual Double_t * Check(AliQA::ALITASK_t index, TObjArray ** list) ; // Double_t CheckEntries(TObjArray * list) const ;/*--> to be implemented*/ diff --git a/ACORDE/AliACORDEQADataMakerRec.cxx b/ACORDE/AliACORDEQADataMakerRec.cxx index e343862ac80..acd8d9aed1c 100755 --- a/ACORDE/AliACORDEQADataMakerRec.cxx +++ b/ACORDE/AliACORDEQADataMakerRec.cxx @@ -66,7 +66,7 @@ AliACORDEQADataMakerRec& AliACORDEQADataMakerRec::operator = (const AliACORDEQAD return *this; } //____________________________________________________________________________ -void AliACORDEQADataMakerRec::EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray * list) +void AliACORDEQADataMakerRec::EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray ** list) { //Detector specific actions at end of cycle // do the QA checking diff --git a/ACORDE/AliACORDEQADataMakerRec.h b/ACORDE/AliACORDEQADataMakerRec.h index 9c7f6e5907e..109a1e36c14 100755 --- a/ACORDE/AliACORDEQADataMakerRec.h +++ b/ACORDE/AliACORDEQADataMakerRec.h @@ -42,7 +42,7 @@ private: virtual void InitESDs() ; //book ESD QA histo virtual void MakeRaws(AliRawReader* rawReader) ; virtual void MakeESDs(AliESDEvent * esd) ; //Fill hit QA histo - virtual void EndOfDetectorCycle(AliQA::TASKINDEX_t, TObjArray * list) ; + virtual void EndOfDetectorCycle(AliQA::TASKINDEX_t, TObjArray ** list) ; virtual void StartOfDetectorCycle() ; ClassDef(AliACORDEQADataMakerRec,1) // description diff --git a/ACORDE/AliACORDEQADataMakerSim.cxx b/ACORDE/AliACORDEQADataMakerSim.cxx index cf5f17ea3fc..9c156523275 100755 --- a/ACORDE/AliACORDEQADataMakerSim.cxx +++ b/ACORDE/AliACORDEQADataMakerSim.cxx @@ -68,11 +68,11 @@ AliACORDEQADataMakerSim& AliACORDEQADataMakerSim::operator = (const AliACORDEQAD return *this; } //____________________________________________________________________________ -void AliACORDEQADataMakerSim::EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray * list) +void AliACORDEQADataMakerSim::EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray ** list) { //Detector specific actions at end of cycle // do the QA checking - printf("ACORDE---->Detector specific actions at END of cycle\n................\n"); + AliInfo("ACORDE---->Detector specific actions at END of cycle\n................\n"); AliQAChecker::Instance()->Run(AliQA::kACORDE, task, list) ; } @@ -80,7 +80,7 @@ void AliACORDEQADataMakerSim::EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjAr void AliACORDEQADataMakerSim::StartOfDetectorCycle() { //Detector specific actions at start of cycle - printf("ACORDE---->Detector specific actions at START of cycle\n................\n"); + AliInfo("ACORDE---->Detector specific actions at START of cycle\n................\n"); } //____________________________________________________________________________ void AliACORDEQADataMakerSim::InitHits() diff --git a/ACORDE/AliACORDEQADataMakerSim.h b/ACORDE/AliACORDEQADataMakerSim.h index a043fad9ccb..5b92771c1fb 100755 --- a/ACORDE/AliACORDEQADataMakerSim.h +++ b/ACORDE/AliACORDEQADataMakerSim.h @@ -43,7 +43,7 @@ private: virtual void MakeHits(TClonesArray *) {} //Dummy for the moment virtual void MakeDigits(TTree* digitsTree) ; //Fill Digit QA histo virtual void MakeDigits(TClonesArray *) {} //Dummy for the moment - virtual void EndOfDetectorCycle(AliQA::TASKINDEX_t, TObjArray * list) ; + virtual void EndOfDetectorCycle(AliQA::TASKINDEX_t, TObjArray ** list) ; virtual void StartOfDetectorCycle() ; ClassDef(AliACORDEQADataMakerSim,1) // description diff --git a/EMCAL/AliEMCALQADataMakerRec.cxx b/EMCAL/AliEMCALQADataMakerRec.cxx index 537cf94efc3..665a601c121 100644 --- a/EMCAL/AliEMCALQADataMakerRec.cxx +++ b/EMCAL/AliEMCALQADataMakerRec.cxx @@ -70,7 +70,7 @@ AliEMCALQADataMakerRec& AliEMCALQADataMakerRec::operator = (const AliEMCALQAData } //____________________________________________________________________________ -void AliEMCALQADataMakerRec::EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray * list) +void AliEMCALQADataMakerRec::EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray ** list) { //Detector specific actions at end of cycle // do the QA checking diff --git a/EMCAL/AliEMCALQADataMakerRec.h b/EMCAL/AliEMCALQADataMakerRec.h index 4523faf23dc..4170d11149f 100644 --- a/EMCAL/AliEMCALQADataMakerRec.h +++ b/EMCAL/AliEMCALQADataMakerRec.h @@ -44,7 +44,7 @@ public: virtual ~AliEMCALQADataMakerRec() {;} // dtor private: - virtual void EndOfDetectorCycle(AliQA::TASKINDEX_t, TObjArray * list) ; + virtual void EndOfDetectorCycle(AliQA::TASKINDEX_t, TObjArray ** list) ; virtual void InitESDs() ; virtual void InitRecPoints() ; virtual void InitRaws() ; diff --git a/EMCAL/AliEMCALQADataMakerSim.cxx b/EMCAL/AliEMCALQADataMakerSim.cxx index 680db649746..c0a973a5d6a 100644 --- a/EMCAL/AliEMCALQADataMakerSim.cxx +++ b/EMCAL/AliEMCALQADataMakerSim.cxx @@ -68,7 +68,7 @@ AliEMCALQADataMakerSim& AliEMCALQADataMakerSim::operator = (const AliEMCALQAData } //____________________________________________________________________________ -void AliEMCALQADataMakerSim::EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray * list) +void AliEMCALQADataMakerSim::EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray ** list) { //Detector specific actions at end of cycle // do the QA checking diff --git a/EMCAL/AliEMCALQADataMakerSim.h b/EMCAL/AliEMCALQADataMakerSim.h index 1edda3fa06e..ea808474e23 100644 --- a/EMCAL/AliEMCALQADataMakerSim.h +++ b/EMCAL/AliEMCALQADataMakerSim.h @@ -31,7 +31,7 @@ public: virtual ~AliEMCALQADataMakerSim() {;} // dtor private: - virtual void EndOfDetectorCycle(AliQA::TASKINDEX_t, TObjArray * list) ; + virtual void EndOfDetectorCycle(AliQA::TASKINDEX_t, TObjArray ** list) ; virtual void InitHits() ; virtual void InitDigits() ; virtual void InitSDigits() ; diff --git a/FMD/AliFMDQADataMakerRec.cxx b/FMD/AliFMDQADataMakerRec.cxx index 86f937377ca..ff36304b236 100644 --- a/FMD/AliFMDQADataMakerRec.cxx +++ b/FMD/AliFMDQADataMakerRec.cxx @@ -90,7 +90,7 @@ AliFMDQADataMakerRec::~AliFMDQADataMakerRec() void AliFMDQADataMakerRec::EndOfDetectorCycle(AliQA::TASKINDEX_t task, - TObjArray * list) + TObjArray ** list) { // Detector specific actions at end of cycle // do the QA checking diff --git a/FMD/AliFMDQADataMakerRec.h b/FMD/AliFMDQADataMakerRec.h index c2069880aa1..d15dc8956ff 100644 --- a/FMD/AliFMDQADataMakerRec.h +++ b/FMD/AliFMDQADataMakerRec.h @@ -26,7 +26,7 @@ public: AliFMDQADataMakerRec& operator = (const AliFMDQADataMakerRec& qadm) ; virtual ~AliFMDQADataMakerRec(); private: - virtual void EndOfDetectorCycle(AliQA::TASKINDEX_t, TObjArray * list); + virtual void EndOfDetectorCycle(AliQA::TASKINDEX_t, TObjArray ** list); virtual void InitESDs(); // virtual void InitDigits(); virtual void InitRecPoints(); diff --git a/FMD/AliFMDQADataMakerSim.cxx b/FMD/AliFMDQADataMakerSim.cxx index 928f65d52cc..df3f81cd4c0 100644 --- a/FMD/AliFMDQADataMakerSim.cxx +++ b/FMD/AliFMDQADataMakerSim.cxx @@ -86,7 +86,7 @@ AliFMDQADataMakerSim::~AliFMDQADataMakerSim() //_____________________________________________________________________ void AliFMDQADataMakerSim::EndOfDetectorCycle(AliQA::TASKINDEX_t task, - TObjArray * list) + TObjArray ** list) { //Detector specific actions at end of cycle // do the QA checking diff --git a/FMD/AliFMDQADataMakerSim.h b/FMD/AliFMDQADataMakerSim.h index 5cc65d2b849..20385718abd 100644 --- a/FMD/AliFMDQADataMakerSim.h +++ b/FMD/AliFMDQADataMakerSim.h @@ -29,7 +29,7 @@ class AliFMDQADataMakerSim: public AliQADataMakerSim { virtual ~AliFMDQADataMakerSim(); // dtor private: - virtual void EndOfDetectorCycle(AliQA::TASKINDEX_t, TObjArray * list); + virtual void EndOfDetectorCycle(AliQA::TASKINDEX_t, TObjArray ** list); virtual void InitHits(); virtual void InitDigits(); // virtual void InitRaws() ; diff --git a/HMPID/AliHMPIDQAChecker.cxx b/HMPID/AliHMPIDQAChecker.cxx index e7e2a463a50..6d834659a0b 100644 --- a/HMPID/AliHMPIDQAChecker.cxx +++ b/HMPID/AliHMPIDQAChecker.cxx @@ -43,34 +43,49 @@ ClassImp(AliHMPIDQAChecker) +//____________________________________________________________________________ +Double_t * AliHMPIDQAChecker::Check(AliQA::ALITASK_t /*index*/) +{ + Double_t * rv = new Double_t[AliRecoParam::kNSpecies] ; + for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) + rv[specie] = 0.0 ; + return rv ; +} + //_________________________________________________________________ -Double_t AliHMPIDQAChecker::Check(AliQA::ALITASK_t index, TObjArray * list) +Double_t * AliHMPIDQAChecker::Check(AliQA::ALITASK_t index, TObjArray ** list) { // // Main check function: Depending on the TASK, different checks are applied // At the moment: check for empty histograms and checks for RecPoints - AliDebug(1,Form("AliHMPIDChecker")); + Double_t * check = new Double_t[AliRecoParam::kNSpecies] ; + +//YS THIS IS NOT CORRECT + AliInfo(Form("Fix needed .....")); AliCDBEntry *QARefRec = AliCDBManager::Instance()->Get("HMPID/QARef/Rec"); if( !QARefRec){ - AliInfo("QA reference data NOT retrieved for Recostruction check. No HMPIDChecker ...exiting"); - return 1.; + AliInfo("QA reference data NOT retrieved for Reconstruction check. No HMPIDChecker ...exiting"); + return check; } +//YS THIS IS NOT CORRECT // checking for empy histograms - Double_t check =0; - if(CheckEntries(list) == 0) { - AliWarning("histograms are empty"); - check = 0.4;//-> Corresponds to kWARNING see AliQACheckerBase::Run - return check; - } - -// checking rec points - if(index == AliQA::kREC) check = CheckRecPoints(list,(TObjArray *)QARefRec->GetObject()); - -//default check response. It will be changed when reasonable checks will be considered - else check = 0.7 ; // /-> Corresponds to kINFO see AliQACheckerBase::Run + for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) { + check[specie] = 1.0; + if ( !AliQA::Instance()->IsEventSpecieSet(specie) ) + continue ; + if(CheckEntries(list[specie]) == 0) { + AliWarning("histograms are empty"); + check[specie] = 0.4;//-> Corresponds to kWARNING see AliQACheckerBase::Run + } + + // checking rec points + if(index == AliQA::kREC) check[specie] = CheckRecPoints(list[specie],(TObjArray *)QARefRec->GetObject()); + //default check response. It will be changed when reasonable checks will be considered + else check[specie] = 0.7 ; // /-> Corresponds to kINFO see AliQACheckerBase::Run + } return check; } diff --git a/HMPID/AliHMPIDQAChecker.h b/HMPID/AliHMPIDQAChecker.h index 0c20c5cdb9d..73182e187c2 100644 --- a/HMPID/AliHMPIDQAChecker.h +++ b/HMPID/AliHMPIDQAChecker.h @@ -30,11 +30,8 @@ public: AliHMPIDQAChecker(const AliHMPIDQAChecker& qac) : AliQACheckerBase(qac.GetName(), qac.GetTitle()) {;} // cpy ctor virtual ~AliHMPIDQAChecker() {;} // dtor - virtual Double_t Check(AliQA::ALITASK_t index, TObjArray * list) ; - virtual Double_t Check(AliQA::ALITASK_t /*index*/) {return 0.;} ; - virtual Double_t Check() {return 0.;} ; - virtual Double_t Check(TObjArray*) {return 0.;} ; - virtual Double_t Check(AliQA::ALITASK_t, TNtupleD *) { return 0. ;} + virtual Double_t * Check(AliQA::ALITASK_t /*index*/) ; + virtual Double_t * Check(AliQA::ALITASK_t index, TObjArray ** list) ; Double_t CheckEntries(TObjArray * list) const ; Double_t CheckRecPoints(TObjArray *listrec, TObjArray *listref) const ; diff --git a/HMPID/AliHMPIDQADataMakerRec.cxx b/HMPID/AliHMPIDQADataMakerRec.cxx index 50a0d19769d..63a64d8af5e 100644 --- a/HMPID/AliHMPIDQADataMakerRec.cxx +++ b/HMPID/AliHMPIDQADataMakerRec.cxx @@ -274,15 +274,17 @@ void AliHMPIDQADataMakerRec::StartOfDetectorCycle() } //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -void AliHMPIDQADataMakerRec::EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray *histos) +void AliHMPIDQADataMakerRec::EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray **histos) { //Detector specific actions at end of cycle // do the QA checking if(task==AliQA::kRAWS) { - for(Int_t iddl=0;iddl<14;iddl++) { - TH1F *h = (TH1F*)histos->At(14+iddl); //ddl histos scaled by the number of events - h->Scale(1./(Float_t)fEvtRaw); + for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) { + for(Int_t iddl=0;iddl<14;iddl++) { + TH1F *h = (TH1F*)histos[specie]->At(14+iddl); //ddl histos scaled by the number of events + h->Scale(1./(Float_t)fEvtRaw); + } } } diff --git a/HMPID/AliHMPIDQADataMakerRec.h b/HMPID/AliHMPIDQADataMakerRec.h index d5a616342ce..0f4fdad19d2 100644 --- a/HMPID/AliHMPIDQADataMakerRec.h +++ b/HMPID/AliHMPIDQADataMakerRec.h @@ -37,7 +37,7 @@ private: virtual void MakeRaws(AliRawReader* rawReader); virtual void MakeESDs(AliESDEvent * esd) ; //Fill hit QA histo virtual void StartOfDetectorCycle() ; - virtual void EndOfDetectorCycle(AliQA::TASKINDEX_t, TObjArray * obj) ; + virtual void EndOfDetectorCycle(AliQA::TASKINDEX_t, TObjArray ** obj) ; Int_t fEvtRaw; //internal event counter for raw ClassDef(AliHMPIDQADataMakerRec,1) // description diff --git a/HMPID/AliHMPIDQADataMakerSim.cxx b/HMPID/AliHMPIDQADataMakerSim.cxx index ef4cbff2194..ac1e1b5f8aa 100644 --- a/HMPID/AliHMPIDQADataMakerSim.cxx +++ b/HMPID/AliHMPIDQADataMakerSim.cxx @@ -239,7 +239,7 @@ void AliHMPIDQADataMakerSim::StartOfDetectorCycle() } -void AliHMPIDQADataMakerSim::EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray *obj) +void AliHMPIDQADataMakerSim::EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray **obj) { //Detector specific actions at end of cycle // do the QA checking diff --git a/HMPID/AliHMPIDQADataMakerSim.h b/HMPID/AliHMPIDQADataMakerSim.h index 737583499b6..ca1c5814e4c 100644 --- a/HMPID/AliHMPIDQADataMakerSim.h +++ b/HMPID/AliHMPIDQADataMakerSim.h @@ -35,7 +35,7 @@ public: private: - virtual void EndOfDetectorCycle(AliQA::TASKINDEX_t, TObjArray * obj) ; + virtual void EndOfDetectorCycle(AliQA::TASKINDEX_t, TObjArray ** obj) ; virtual void InitHits() ; //book hit QA histo virtual void InitDigits() ; //book Digit QA histo virtual void InitSDigits() ; //book SDigits QA histo diff --git a/ITS/AliITSQAChecker.cxx b/ITS/AliITSQAChecker.cxx index c5dc71df732..2b11813dff3 100644 --- a/ITS/AliITSQAChecker.cxx +++ b/ITS/AliITSQAChecker.cxx @@ -84,149 +84,161 @@ AliITSQAChecker& AliITSQAChecker::operator=(const AliITSQAChecker& qac){ } //____________________________________________________________________________ -Double_t AliITSQAChecker::Check(AliQA::ALITASK_t index, TObjArray * list) +Double_t * AliITSQAChecker::Check(AliQA::ALITASK_t /*index*/) +{ + Double_t * rv = new Double_t[AliRecoParam::kNSpecies] ; + for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) + rv[specie] = 0.5 ; + return rv ; +} + +//____________________________________________________________________________ +Double_t * AliITSQAChecker::Check(AliQA::ALITASK_t index, TObjArray ** list) { // Super-basic check on the QA histograms on the input list: // look whether they are empty! if(index == AliQA::kESD){ - AliDebug(1,"Checker for ESD"); - Int_t tested = 0; - Int_t empty = 0; - Double_t rv = 0.; - // The following flags are set to kTRUE if the corresponding - // QA histograms exceed a given quality threshold - Bool_t cluMapSA = kFALSE; - Bool_t cluMapMI = kFALSE; - Bool_t cluMI = kFALSE; - Bool_t cluSA = kFALSE; - Bool_t verSPDZ = kFALSE; - if (list->GetEntries() == 0) { - rv = 0.; // nothing to check - } - else { - TIter next1(list); - TH1 * hdata; - Int_t nskipped=0; - Bool_t skipped[6]={kFALSE,kFALSE,kFALSE,kFALSE,kFALSE,kFALSE}; - // look for layers that we wanted to skip - while ( (hdata = dynamic_cast(next1())) ) { - if(!hdata) continue; - TString hname = hdata->GetName(); - if(!hname.Contains("hESDSkippedLayers")) continue; - for(Int_t k=1; k<7; k++) { - if(hdata->GetBinContent(k)>0) { - nskipped++; - skipped[k-1]=kTRUE; - } - } + Double_t * rv = new Double_t[AliRecoParam::kNSpecies] ; + for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) { + rv[specie] = 0.0 ; + if ( !AliQA::Instance()->IsEventSpecieSet(specie) ) + continue ; + AliDebug(1,"Checker for ESD"); + Int_t tested = 0; + Int_t empty = 0; + // The following flags are set to kTRUE if the corresponding + // QA histograms exceed a given quality threshold + Bool_t cluMapSA = kFALSE; + Bool_t cluMapMI = kFALSE; + Bool_t cluMI = kFALSE; + Bool_t cluSA = kFALSE; + Bool_t verSPDZ = kFALSE; + if (list[specie]->GetEntries() == 0) { + rv[specie] = 0.; // nothing to check } - TIter next(list); - while ( (hdata = dynamic_cast(next())) ) { - if(hdata){ - TString hname = hdata->GetName(); - Double_t entries = hdata->GetEntries(); - ++tested; - if(!(entries>0.))++empty; - AliDebug(1,Form("ESD hist name %s - entries %12.1g",hname.Data(),entries)); + else { + TIter next1(list[specie]); + TH1 * hdata; + Int_t nskipped=0; + Bool_t skipped[6]={kFALSE,kFALSE,kFALSE,kFALSE,kFALSE,kFALSE}; + // look for layers that we wanted to skip + while ( (hdata = dynamic_cast(next1())) ) { + if(!hdata) continue; + TString hname = hdata->GetName(); + if(!hname.Contains("hESDSkippedLayers")) continue; + for(Int_t k=1; k<7; k++) { + if(hdata->GetBinContent(k)>0) { + nskipped++; + skipped[k-1]=kTRUE; + } + } + } + TIter next(list[specie]); + while ( (hdata = dynamic_cast(next())) ) { + if(hdata){ + TString hname = hdata->GetName(); + Double_t entries = hdata->GetEntries(); + ++tested; + if(!(entries>0.))++empty; + AliDebug(1,Form("ESD hist name %s - entries %12.1g",hname.Data(),entries)); + if(hname.Contains("hESDClusterMapSA") && entries>0.){ + cluMapSA = kTRUE; + AliDebug(1,Form("Processing histogram %s",hname.Data())); + // Check if there are layers with anomalously low + // contributing points to SA reconstructed tracks + for(Int_t k=1;k<7;k++){ + // check if the layer was skipped + if(skipped[k-1]) continue; + if(hdata->GetBinContent(k)<0.5*(entries/6.)){ + cluMapSA = kFALSE; + AliInfo(Form("SA tracks have few points on layer %d - look at histogram hESDClustersSA",k)); + } + } + } - if(hname.Contains("hESDClusterMapSA") && entries>0.){ - cluMapSA = kTRUE; - AliDebug(1,Form("Processing histogram %s",hname.Data())); - // Check if there are layers with anomalously low - // contributing points to SA reconstructed tracks - for(Int_t k=1;k<7;k++){ - // check if the layer was skipped - if(skipped[k-1]) continue; - if(hdata->GetBinContent(k)<0.5*(entries/6.)){ - cluMapSA = kFALSE; - AliInfo(Form("SA tracks have few points on layer %d - look at histogram hESDClustersSA",k)); - } - } - } + else if(hname.Contains("hESDClusterMapMI") && entries>0.){ + // Check if there are layers with anomalously low + // contributing points to MI reconstructed tracks + AliDebug(1,Form("Processing histogram %s",hname.Data())); + cluMapMI = kTRUE; + for(Int_t k=1;k<7;k++){ + // check if the layer was skipped + if(skipped[k-1]) continue; + if(hdata->GetBinContent(k)<0.5*(entries/6.)){ + cluMapMI = kFALSE; + AliInfo(Form("MI tracks have few points on layer %d - look at histogram hESDClustersMI",k)); + } + } + } - else if(hname.Contains("hESDClusterMapMI") && entries>0.){ - // Check if there are layers with anomalously low - // contributing points to MI reconstructed tracks - AliDebug(1,Form("Processing histogram %s",hname.Data())); - cluMapMI = kTRUE; - for(Int_t k=1;k<7;k++){ - // check if the layer was skipped - if(skipped[k-1]) continue; - if(hdata->GetBinContent(k)<0.5*(entries/6.)){ - cluMapMI = kFALSE; - AliInfo(Form("MI tracks have few points on layer %d - look at histogram hESDClustersMI",k)); - } - } - } + else if(hname.Contains("hESDClustersMI") && entries>0.){ + // Check if 6 clusters MI tracks are the majority + AliDebug(1,Form("Processing histogram %s",hname.Data())); + cluMI = kTRUE; + Double_t maxlaytracks = hdata->GetBinContent(7-nskipped); + for(Int_t k=2; k<7-nskipped; k++){ + if(hdata->GetBinContent(k)>maxlaytracks){ + cluMI = kFALSE; + AliInfo(Form("MI Tracks with %d clusters are more than tracks with %d clusters. Look at histogram hESDClustersMI",k-1,6-nskipped)); + } + } + } - else if(hname.Contains("hESDClustersMI") && entries>0.){ - // Check if 6 clusters MI tracks are the majority - AliDebug(1,Form("Processing histogram %s",hname.Data())); - cluMI = kTRUE; - Double_t maxlaytracks = hdata->GetBinContent(7-nskipped); - for(Int_t k=2; k<7-nskipped; k++){ - if(hdata->GetBinContent(k)>maxlaytracks){ - cluMI = kFALSE; - AliInfo(Form("MI Tracks with %d clusters are more than tracks with %d clusters. Look at histogram hESDClustersMI",k-1,6-nskipped)); - } - } - } + else if(hname.Contains("hESDClustersSA") && entries>0.){ + // Check if 6 clusters SA tracks are the majority + AliDebug(1,Form("Processing histogram %s",hname.Data())); + cluSA = kTRUE; + Double_t maxlaytracks = hdata->GetBinContent(7-nskipped); + for(Int_t k=2; k<7-nskipped; k++){ + if(hdata->GetBinContent(k)>maxlaytracks){ + cluSA = kFALSE; + AliInfo(Form("SA Tracks with %d clusters are more than tracks with %d clusters. Look at histogram hESDClustersSA",k-1,6-nskipped)); + } + } + } - else if(hname.Contains("hESDClustersSA") && entries>0.){ - // Check if 6 clusters SA tracks are the majority - AliDebug(1,Form("Processing histogram %s",hname.Data())); - cluSA = kTRUE; - Double_t maxlaytracks = hdata->GetBinContent(7-nskipped); - for(Int_t k=2; k<7-nskipped; k++){ - if(hdata->GetBinContent(k)>maxlaytracks){ - cluSA = kFALSE; - AliInfo(Form("SA Tracks with %d clusters are more than tracks with %d clusters. Look at histogram hESDClustersSA",k-1,6-nskipped)); - } - } - } + else if(hname.Contains("hSPDVertexZ") && entries>0.){ + // Check if average Z vertex coordinate is -5 < z < 5 cm + AliDebug(1,Form("Processing histogram %s",hname.Data())); + verSPDZ = kTRUE; + if(hdata->GetMean()<-5. && hdata->GetMean()>5.){ + verSPDZ = kFALSE; + AliInfo(Form("Average z vertex coordinate is at z= %10.4g cm",hdata->GetMean())); + } + } + } - else if(hname.Contains("hSPDVertexZ") && entries>0.){ - // Check if average Z vertex coordinate is -5 < z < 5 cm - AliDebug(1,Form("Processing histogram %s",hname.Data())); - verSPDZ = kTRUE; - if(hdata->GetMean()<-5. && hdata->GetMean()>5.){ - verSPDZ = kFALSE; - AliInfo(Form("Average z vertex coordinate is at z= %10.4g cm",hdata->GetMean())); - } - } - - } - else{ - AliError("ESD Checker - invalid data type"); - } + else{ + AliError("ESD Checker - invalid data type"); + } - rv = 0.; - if(tested>0){ - if(tested == empty){ - rv = 0.1; - AliWarning("All ESD histograms are empty"); - } - else { - rv = 0.1+0.4*(static_cast(tested-empty)/static_cast(tested)); - if(cluMapSA)rv+=0.1; - if(cluMapMI)rv+=0.1; - if(cluMI)rv+=0.1; - if(cluSA)rv+=0.1; - if(verSPDZ)rv+=0.1; - } - } - - } - } - AliInfo(Form("ESD - Tested %d histograms, Return value %f \n",tested,rv)); - return rv; + rv[specie] = 0.; + if(tested>0){ + if(tested == empty){ + rv[specie] = 0.1; + AliWarning("All ESD histograms are empty"); + } + else { + rv[specie] = 0.1+0.4*(static_cast(tested-empty)/static_cast(tested)); + if(cluMapSA)rv[specie]+=0.1; + if(cluMapMI)rv[specie]+=0.1; + if(cluMI)rv[specie]+=0.1; + if(cluSA)rv[specie]+=0.1; + if(verSPDZ)rv[specie]+=0.1; + } + } + } + } + AliInfo(Form("ESD - Tested %d histograms, Return value %f \n",tested,rv[specie])); + } + return rv ; } // end of ESD QA - + + Double_t * retval = new Double_t[AliRecoParam::kNSpecies] ; //____________________________________________________________________________ Double_t spdCheck, sddCheck, ssdCheck; - Double_t retval = 1.; //pixel if(fDet == 0 || fDet == 1) { AliDebug(1,"AliITSQAChecker::Create SPD Checker\n"); @@ -234,8 +246,13 @@ Double_t AliITSQAChecker::Check(AliQA::ALITASK_t index, TObjArray * list) fSPDChecker = new AliITSQASPDChecker(); } fSPDChecker->SetTaskOffset(fSPDOffset); - spdCheck = fSPDChecker->Check(index, list); - if(spdCheckIsEventSpecieSet(specie) ) { + spdCheck = fSPDChecker->Check(index, list[specie]); + if(spdCheckSetTaskOffset(fSDDOffset); - sddCheck = fSDDChecker->Check(index, list); - if(sddCheckIsEventSpecieSet(specie) ) { + sddCheck = fSDDChecker->Check(index, list[specie]); + if(sddCheckGetEntries())); + AliInfo(Form("Number of monitored objects SSD: %d", list[AliRecoParam::kDefault]->GetEntries())); } fSSDChecker->SetTaskOffset(fSSDOffset); - ssdCheck = fSSDChecker->Check(index, list); - if(ssdCheckIsEventSpecieSet(specie) ) { + ssdCheck = fSSDChecker->Check(index, list[specie]); + if(ssdCheckEndOfDetectorCycle(task, list); - if(fSubDetector == 0 || fSubDetector == 2) fSDDDataMaker->EndOfDetectorCycle(task, list); - if(fSubDetector == 0 || fSubDetector == 3) fSSDDataMaker->EndOfDetectorCycle(task, list); + + for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) { + SetEventSpecie(specie) ; + AliDebug(1,"AliITSDM instantiates checker with Run(AliQA::kITS, task, list[specie])\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); diff --git a/ITS/AliITSQADataMakerRec.h b/ITS/AliITSQADataMakerRec.h index a78b7b871db..fe25b7da653 100644 --- a/ITS/AliITSQADataMakerRec.h +++ b/ITS/AliITSQADataMakerRec.h @@ -36,7 +36,7 @@ public: AliITSQADataMakerRec(const AliITSQADataMakerRec& qadm); AliITSQADataMakerRec& operator = (const AliITSQADataMakerRec& qac); virtual void StartOfDetectorCycle(); - virtual void EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray * list); + virtual void EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray ** list); virtual void EndOfDetectorCycle(const char *fgDataName); virtual void InitRaws(); virtual void InitRecPoints(); diff --git a/ITS/AliITSQADataMakerSim.cxx b/ITS/AliITSQADataMakerSim.cxx index 49e146d4a19..737fffb44b6 100644 --- a/ITS/AliITSQADataMakerSim.cxx +++ b/ITS/AliITSQADataMakerSim.cxx @@ -25,6 +25,7 @@ // --- ROOT system --- #include +#include // --- Standard library --- // --- AliRoot header files --- @@ -111,13 +112,16 @@ void AliITSQADataMakerSim::StartOfDetectorCycle() } //____________________________________________________________________________ -void AliITSQADataMakerSim::EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray* list) +void AliITSQADataMakerSim::EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray** list) { // launch the QA checking - AliDebug(1,"AliITSDM instantiates checker with Run(AliQA::kITS, task, list)\n"); - if(fSubDetector == 0 || fSubDetector == 1) fSPDDataMaker->EndOfDetectorCycle(task, list); - if(fSubDetector == 0 || fSubDetector == 2) fSDDDataMaker->EndOfDetectorCycle(task, list); - if(fSubDetector == 0 || fSubDetector == 3) fSSDDataMaker->EndOfDetectorCycle(task, list); + for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) { + SetEventSpecie(specie) ; + AliDebug(1,"AliITSDM instantiates checker with Run(AliQA::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); diff --git a/ITS/AliITSQADataMakerSim.h b/ITS/AliITSQADataMakerSim.h index f7ed977a93d..a2448d0d90d 100644 --- a/ITS/AliITSQADataMakerSim.h +++ b/ITS/AliITSQADataMakerSim.h @@ -31,7 +31,7 @@ public: AliITSQADataMakerSim(const AliITSQADataMakerSim& qadm); AliITSQADataMakerSim& operator = (const AliITSQADataMakerSim& qac); virtual void StartOfDetectorCycle(); - virtual void EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray * list); + virtual void EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray ** list); virtual void InitDigits(); virtual void InitSDigits(); virtual void InitHits(); diff --git a/ITS/AliITSQASDDDataMakerRec.cxx b/ITS/AliITSQASDDDataMakerRec.cxx index fe14bc010dd..6ee9494305b 100644 --- a/ITS/AliITSQASDDDataMakerRec.cxx +++ b/ITS/AliITSQASDDDataMakerRec.cxx @@ -137,7 +137,7 @@ void AliITSQASDDDataMakerRec::EndOfDetectorCycle(AliQA::TASKINDEX_t /*task*/, TO void AliITSQASDDDataMakerRec::InitRaws() { // Initialization for RAW data - SDD - - fGenRawsOffset = (fAliITSQADataMakerRec->fRawsQAList)->GetEntries(); + fGenRawsOffset = (fAliITSQADataMakerRec->fRawsQAList[AliRecoParam::kDefault])->GetEntries(); AliCDBEntry *ddlMapSDD = AliCDBManager::Instance()->Get("ITS/Calib/DDLMapSDD"); Bool_t cacheStatus = AliCDBManager::Instance()->GetCacheFlag(); if(!ddlMapSDD) @@ -394,7 +394,7 @@ void AliITSQASDDDataMakerRec::InitRecPoints() { // Initialization for RECPOINTS - SDD - - fGenRecPointsOffset = (fAliITSQADataMakerRec->fRecPointsQAList)->GetEntries(); + fGenRecPointsOffset = (fAliITSQADataMakerRec->fRecPointsQAList[AliRecoParam::kDefault])->GetEntries(); Int_t nOnline=1; Int_t nOnline2=1; diff --git a/ITS/AliITSQASDDDataMakerSim.cxx b/ITS/AliITSQASDDDataMakerSim.cxx index dd55e08a30d..cd2e25d777c 100644 --- a/ITS/AliITSQASDDDataMakerSim.cxx +++ b/ITS/AliITSQASDDDataMakerSim.cxx @@ -105,7 +105,7 @@ void AliITSQASDDDataMakerSim::EndOfDetectorCycle(AliQA::TASKINDEX_t /*task*/, TO void AliITSQASDDDataMakerSim::InitDigits() { // Initialization for DIGIT data - SDD - - fGenOffsetD = (fAliITSQADataMakerSim->fDigitsQAList)->GetEntries(); + fGenOffsetD = (fAliITSQADataMakerSim->fDigitsQAList[AliRecoParam::kDefault])->GetEntries(); //fSDDhTask must be incremented by one unit every time a histogram is ADDED to the QA List TH1F* h0=new TH1F("SDD DIGITS Module Pattern","SDD DIGITS Module Pattern",260,239.5,499.5); //hmod h0->GetXaxis()->SetTitle("SDD Module Number"); @@ -159,7 +159,7 @@ void AliITSQASDDDataMakerSim::MakeDigits(TTree * digits) void AliITSQASDDDataMakerSim::InitSDigits() { // Initialization for SDIGIT data - SDD - - fGenOffsetS = (fAliITSQADataMakerSim->fSDigitsQAList)->GetEntries(); + fGenOffsetS = (fAliITSQADataMakerSim->fSDigitsQAList[AliRecoParam::kDefault])->GetEntries(); //fSDDhTask must be incremented by one unit every time a histogram is ADDED to the QA List TH1F* h0=new TH1F("SDD SDIGITS Module Pattern","SDIGITS SDD Module Pattern",260,239.5,499.5); //hmod h0->GetXaxis()->SetTitle("SDD Module Number"); @@ -231,7 +231,7 @@ void AliITSQASDDDataMakerSim::InitHits() { // Initialization for HITS data - SDD - - fGenOffsetH = (fAliITSQADataMakerSim->fHitsQAList)->GetEntries(); + fGenOffsetH = (fAliITSQADataMakerSim->fHitsQAList[AliRecoParam::kDefault])->GetEntries(); //fSDDhTask must be incremented by one unit every time a histogram is ADDED to the QA List //printf("AliITSQASDDDataMakerSim::InitHits called \n"); TH1F *h0=new TH1F("SDD HITS Module Pattern","SDD HITS Module Pattern",260,239.5,499.5); diff --git a/ITS/AliITSQASPDDataMakerRec.cxx b/ITS/AliITSQASPDDataMakerRec.cxx index ef5d263899a..605aec66fdd 100644 --- a/ITS/AliITSQASPDDataMakerRec.cxx +++ b/ITS/AliITSQASPDDataMakerRec.cxx @@ -110,7 +110,7 @@ void AliITSQASPDDataMakerRec::EndOfDetectorCycle(AliQA::TASKINDEX_t /*task*/, TO void AliITSQASPDDataMakerRec::InitRaws() { // Initialization for RAW data - SPD - - fGenRawsOffset = (fAliITSQADataMakerRec->fRawsQAList)->GetEntries(); + fGenRawsOffset = (fAliITSQADataMakerRec->fRawsQAList[AliRecoParam::kDefault])->GetEntries(); AliInfo("Book Offline Histograms for SPD\n "); Char_t name[50]; @@ -234,7 +234,7 @@ void AliITSQASPDDataMakerRec::MakeRaws(AliRawReader* rawReader) void AliITSQASPDDataMakerRec::InitRecPoints() { // Initialization for RECPOINTS - SPD - - fGenRecPointsOffset = (fAliITSQADataMakerRec->fRecPointsQAList)->GetEntries(); + fGenRecPointsOffset = (fAliITSQADataMakerRec->fRecPointsQAList[AliRecoParam::kDefault])->GetEntries(); TH1F* hlayer= new TH1F("SPDLayPattern_SPD","Layer map - SPD",6,0.,6.); hlayer->GetXaxis()->SetTitle("Layer number"); hlayer->GetYaxis()->SetTitle("Entries"); diff --git a/ITS/AliITSQASPDDataMakerSim.cxx b/ITS/AliITSQASPDDataMakerSim.cxx index 84b14136456..221cf7f96ad 100644 --- a/ITS/AliITSQASPDDataMakerSim.cxx +++ b/ITS/AliITSQASPDDataMakerSim.cxx @@ -104,7 +104,7 @@ void AliITSQASPDDataMakerSim::EndOfDetectorCycle(AliQA::TASKINDEX_t /*task*/, TO void AliITSQASPDDataMakerSim::InitDigits() { // Initialization for DIGIT data - SPD - - fGenOffsetD = (fAliITSQADataMakerSim->fDigitsQAList)->GetEntries(); + fGenOffsetD = (fAliITSQADataMakerSim->fDigitsQAList[AliRecoParam::kDefault])->GetEntries(); //fSPDhDTask must be incremented by one unit every time a histogram is ADDED to the QA List Char_t name[50]; @@ -202,7 +202,7 @@ void AliITSQASPDDataMakerSim::MakeDigits(TTree *digits) void AliITSQASPDDataMakerSim::InitSDigits() { // Initialization for SDIGIT data - SPD - - fGenOffsetS = (fAliITSQADataMakerSim->fSDigitsQAList)->GetEntries(); + fGenOffsetS = (fAliITSQADataMakerSim->fSDigitsQAList[AliRecoParam::kDefault])->GetEntries(); //printf("--W-- AliITSQASPDDataMakerSim::InitSDigits() fGenOffset= %d \n",fGenOffset); //fSPDhSTask must be incremented by one unit every time a histogram is ADDED to the QA List @@ -257,7 +257,7 @@ void AliITSQASPDDataMakerSim::MakeSDigits(TTree *sdigits) void AliITSQASPDDataMakerSim::InitHits() { // Initialization for HITS data - SPD - - fGenOffsetH = (fAliITSQADataMakerSim->fHitsQAList)->GetEntries(); + fGenOffsetH = (fAliITSQADataMakerSim->fHitsQAList[AliRecoParam::kDefault])->GetEntries(); //printf("--W-- AliITSQASPDDataMakerSim::InitHits() fGenOffset= %d \n",fGenOffset); //fSPDhHTask must be incremented by one unit every time a histogram is ADDED to the QA List Char_t name[50]; diff --git a/ITS/AliITSQASSDDataMakerRec.cxx b/ITS/AliITSQASSDDataMakerRec.cxx index 19ac7ad201f..3c21e44926b 100644 --- a/ITS/AliITSQASSDDataMakerRec.cxx +++ b/ITS/AliITSQASSDDataMakerRec.cxx @@ -281,14 +281,13 @@ void AliITSQASSDDataMakerRec::EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjAr fSSDEventPerCycle = 0; - AliQAChecker::Instance()->Run( AliQA::kITS , task, list); + // AliQAChecker::Instance()->Run( AliQA::kITS , task, list); } //____________________________________________________________________________ void AliITSQASSDDataMakerRec::InitRaws() { // Initialization for RAW data - SSD - - // fGenOffset = (fAliITSQADataMakerRec->fRawsQAList)->GetEntries(); - fGenRawsOffset = (fAliITSQADataMakerRec->fRawsQAList)->GetEntries(); + fGenRawsOffset = (fAliITSQADataMakerRec->fRawsQAList[AliRecoParam::kDefault])->GetEntries(); if(fkOnline) { AliInfo("Book Online Histograms for SSD\n"); @@ -883,10 +882,8 @@ void AliITSQASSDDataMakerRec::MonitorOCDBObjects() { void AliITSQASSDDataMakerRec::InitRecPoints() { // Initialization for RECPOINTS - SSD - - //printf("*-*-*-*-*-*-*---*-*-*-------*-*-*-*-*-*-***************AliITSQASSDataMakerRec::InitRecpoints called \n"); - // fGenOffset = (fAliITSQADataMakerRec->fRecPointsQAList)->GetEntries(); - fGenRecPointsOffset = (fAliITSQADataMakerRec->fRecPointsQAList)->GetEntries(); - //printf("**-------*-*-*-*-*-*-***************AliITSQASSDataMakerRec::MakeRecpoints offset %d \t %d \n",fGenOffset,fGenRecPointsOffset); + fGenRecPointsOffset = (fAliITSQADataMakerRec->fRecPointsQAList[AliRecoParam::kDefault])->GetEntries(); + //AliInfo(Form("**-------*-*-*-*-*-*-***************AliITSQASSDataMakerRec::MakeRecpoints offset %d \t %d \n",fGenOffset,fGenRecPointsOffset)); Int_t nModuleOffset = 500; Int_t nITSTotalModules = AliITSgeomTGeo::GetNModules(); diff --git a/ITS/AliITSQASSDDataMakerSim.cxx b/ITS/AliITSQASSDDataMakerSim.cxx index 704b9bb14ac..f7a810b77e9 100644 --- a/ITS/AliITSQASSDDataMakerSim.cxx +++ b/ITS/AliITSQASSDDataMakerSim.cxx @@ -94,17 +94,17 @@ void AliITSQASSDDataMakerSim::StartOfDetectorCycle() { } //____________________________________________________________________________ -void AliITSQASSDDataMakerSim::EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray* list) { +void AliITSQASSDDataMakerSim::EndOfDetectorCycle(AliQA::TASKINDEX_t /*task*/, TObjArray* /*list*/) { // launch the QA checking AliDebug(1,"AliITSDM instantiates checker with Run(AliQA::kITS, task, list)\n"); - AliQAChecker::Instance()->Run( AliQA::kITS , task, list); +// AliQAChecker::Instance()->Run( AliQA::kITS , task, list); } //____________________________________________________________________________ void AliITSQASSDDataMakerSim::InitDigits() { // Initialization for DIGIT data - SSD - - fGenOffsetD = (fAliITSQADataMakerSim->fDigitsQAList)->GetEntries(); + fGenOffsetD = (fAliITSQADataMakerSim->fDigitsQAList[AliRecoParam::kDefault])->GetEntries(); // custom code here TH1F *fHistSSDModule = new TH1F("fHistSSDDigitsModule", @@ -149,7 +149,7 @@ void AliITSQASSDDataMakerSim::MakeDigits(TTree *digits) { //____________________________________________________________________________ void AliITSQASSDDataMakerSim::InitSDigits() { // Initialization for SDIGIT data - SSD - - fGenOffsetS = (fAliITSQADataMakerSim->fSDigitsQAList)->GetEntries(); + fGenOffsetS = (fAliITSQADataMakerSim->fSDigitsQAList[AliRecoParam::kDefault])->GetEntries(); // custom code here TH1F *fHistSSDModule = new TH1F("fHistSSDSDigitsModule", @@ -191,7 +191,7 @@ void AliITSQASSDDataMakerSim::MakeSDigits(TTree *sdigits) { //____________________________________________________________________________ void AliITSQASSDDataMakerSim::InitHits() { // Initialization for HITS data - SSD - - fGenOffsetH = (fAliITSQADataMakerSim->fHitsQAList)->GetEntries(); + fGenOffsetH = (fAliITSQADataMakerSim->fHitsQAList[AliRecoParam::kDefault])->GetEntries(); // custom code here TH1F *fHistSSDModule = new TH1F("fHistSSDHitsModule", diff --git a/MUON/AliMUONQAChecker.cxx b/MUON/AliMUONQAChecker.cxx index eab1210d173..947096d3385 100644 --- a/MUON/AliMUONQAChecker.cxx +++ b/MUON/AliMUONQAChecker.cxx @@ -61,19 +61,19 @@ AliMUONQAChecker::AliMUONQAChecker(const AliMUONQAChecker& qac) : } //______________________________________________________________________________ -Double_t +Double_t * AliMUONQAChecker::Check(AliQA::ALITASK_t /*index*/) { /// Check data AliError(Form("This method is not implemented. Should it be ? fDataSubDir = %p (%s)", fDataSubDir, ( fDataSubDir ? fDataSubDir->GetPath() : ""))); - return 0.0; + return NULL; } //______________________________________________________________________________ -Double_t -AliMUONQAChecker::Check(AliQA::ALITASK_t index, TObjArray * list) +Double_t * +AliMUONQAChecker::Check(AliQA::ALITASK_t index, TObjArray ** list) { /// Check objects in list @@ -93,7 +93,7 @@ AliMUONQAChecker::Check(AliQA::ALITASK_t index, TObjArray * list) } AliWarning(Form("Checker for task %d not implement for the moment",index)); - return 0.0; + return NULL; } //______________________________________________________________________________ @@ -110,19 +110,24 @@ AliMUONQAChecker::GetHisto(TObjArray* list, const char* hname) const } //______________________________________________________________________________ -Double_t -AliMUONQAChecker::CheckRecPoints(TObjArray * list) +Double_t * +AliMUONQAChecker::CheckRecPoints(TObjArray ** list) { /// Check rec points /// Very binary check for the moment. - TH1* h = GetHisto(list,"hTrackerNumberOfClustersPerDE"); + Double_t * rv = new Double_t[AliRecoParam::kNSpecies] ; + for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) + rv[specie] = 1.0 ; - if ( !h ) return 0.75; // only a warning if histo not found, in order not to kill anything because QA failed... + for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) { + TH1* h = GetHisto(list[specie],"hTrackerNumberOfClustersPerDE"); - if ( h->GetMean() == 0.0 ) return MarkHisto(*h,0.0); + if ( !h ) rv[specie] = 0.75; // only a warning if histo not found, in order not to kill anything because QA failed... - return 1.0; + else if ( h->GetMean() == 0.0 ) rv[specie] = MarkHisto(*h,0.0); + } + return rv; } //______________________________________________________________________________ @@ -140,115 +145,142 @@ AliMUONQAChecker::MarkHisto(TH1& histo, Double_t value) const } //______________________________________________________________________________ -Double_t -AliMUONQAChecker::CheckESD(TObjArray * list) +Double_t * +AliMUONQAChecker::CheckESD(TObjArray ** list) { /// Check ESD - TH1* h = GetHisto(list,"hESDnTracks"); + Double_t * rv = new Double_t[AliRecoParam::kNSpecies] ; + for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) + rv[specie] = 1.0 ; - if (!h) return 0.75; + for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) { + + TH1* h = GetHisto(list[specie],"hESDnTracks"); - if ( h->GetMean() == 0.0 ) return MarkHisto(*h,0.0); // no track -> fatal + if (!h) rv[specie] = 0.75; - h = GetHisto(list,"hESDMatchTrig"); + else if ( h->GetMean() == 0.0 ) rv[specie] = MarkHisto(*h,0.0); // no track -> fatal - if (!h) return 0.75; + h = GetHisto(list[specie],"hESDMatchTrig"); - if (h->GetMean() == 0.0 ) return MarkHisto(*h,0.25); // no trigger matching -> error + if (!h) rv[specie] = 0.75; - return 1.0; + else if (h->GetMean() == 0.0 ) rv[specie] = MarkHisto(*h,0.25); // no trigger matching -> error + } + return rv; } //______________________________________________________________________________ -Double_t -AliMUONQAChecker::CheckRaws(TObjArray * list) +Double_t * +AliMUONQAChecker::CheckRaws(TObjArray ** list) { /// Check raws - TIter next(list); - TObject* object; - AliMUONVTrackerData* data(0x0); + Double_t * rv = new Double_t[AliRecoParam::kNSpecies] ; + for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) + rv[specie] = 1.0 ; + + for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) { + TIter next(list[specie]); + TObject* object; + AliMUONVTrackerData* data(0x0); - while ( (object=next()) && !data ) - { - if (object->InheritsFrom("AliMUONVTrackerData")) - { - data = static_cast(object); - } - } + while ( (object=next()) && !data ) + { + if (object->InheritsFrom("AliMUONVTrackerData")) + { + data = static_cast(object); + } + } - if ( !data ) - { - AliError("Did not find TrackerData in the list !"); - return 0.0; - } + if ( !data ) + { + AliError("Did not find TrackerData in the list !"); + return NULL; + } - AliMpManuIterator it; - Int_t detElemId; - Int_t manuId; - Int_t n50(0); // number of manus with occupancy above 0.5 - Int_t n75(0); // number of manus with occupancy above 0.75 - Int_t n(0); // number of manus with some occupancy + AliMpManuIterator it; + Int_t detElemId; + Int_t manuId; + Int_t n50(0); // number of manus with occupancy above 0.5 + Int_t n75(0); // number of manus with occupancy above 0.75 + Int_t n(0); // number of manus with some occupancy - while ( it.Next(detElemId,manuId) ) - { - Float_t occ = data->Manu(detElemId,manuId,2); - if (occ > 0 ) ++n; - if (occ >= 0.5 ) ++n50; - if (occ >= 0.75 ) ++n75; - } + while ( it.Next(detElemId,manuId) ) + { + Float_t occ = data->Manu(detElemId,manuId,2); + if (occ > 0 ) ++n; + if (occ >= 0.5 ) ++n50; + if (occ >= 0.75 ) ++n75; + } - AliInfo(Form("n %d n50 %d n75 %d",n,n50,n75)); + AliInfo(Form("n %d n50 %d n75 %d",n,n50,n75)); - if ( n == 0 ) - { - AliError("Oups. Got zero occupancy in all manus ?!"); - return 0.0; - } + if ( n == 0 ) + { + AliError("Oups. Got zero occupancy in all manus ?!"); + rv[specie] = 0.0; + } - if ( n75 ) - { - AliError(Form("Got %d manus with occupancy above 0.75",n75)); - return 0.1; - } + if ( n75 ) + { + AliError(Form("Got %d manus with occupancy above 0.75",n75)); + rv[specie] = 0.1; + } - if ( n50 ) - { - AliWarning(Form("Got %d manus with occupancy above 0.5",n50)); - return 0.9; + if ( n50 ) + { + AliWarning(Form("Got %d manus with occupancy above 0.5",n50)); + rv[specie] = 0.9; + } } + return rv; +} - return 1.0; +//______________________________________________________________________________ +void AliMUONQAChecker::Init(const AliQA::DETECTORINDEX_t det) +{ + // intialises QA and QA checker settings + AliQA::Instance(det) ; + Float_t * hiValue = new Float_t[AliQA::kNBIT] ; + Float_t * lowValue = new Float_t[AliQA::kNBIT] ; + lowValue[AliQA::kINFO] = 0.999 ; + hiValue[AliQA::kINFO] = 1.0 ; + hiValue[AliQA::kWARNING] = 0.99 ; + lowValue[AliQA::kWARNING] = 0.5 ; + lowValue[AliQA::kERROR] = 0.0 ; + hiValue[AliQA::kERROR] = 0.5 ; + lowValue[AliQA::kFATAL] = -1.0 ; + hiValue[AliQA::kFATAL] = 0.0 ; + SetHiLo(hiValue, lowValue) ; } //______________________________________________________________________________ void -AliMUONQAChecker::SetQA(AliQA::ALITASK_t index, const Double_t value) const +AliMUONQAChecker::SetQA(AliQA::ALITASK_t index, const Double_t * value) const { /// sets the QA according the return value of the Check AliQA * qa = AliQA::Instance(index); - qa->UnSet(AliQA::kFATAL); - qa->UnSet(AliQA::kWARNING); - qa->UnSet(AliQA::kERROR); - qa->UnSet(AliQA::kINFO); - - if ( value == 1.0 ) - { - qa->Set(AliQA::kINFO); - } - else if ( value == 0.0 ) - { - qa->Set(AliQA::kFATAL); - } - else if ( value > 0.5 ) - { - qa->Set(AliQA::kWARNING); - } - else - { - qa->Set(AliQA::kERROR); + for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) { + qa->UnSet(AliQA::kFATAL, specie); + qa->UnSet(AliQA::kWARNING, specie); + qa->UnSet(AliQA::kERROR, specie); + qa->UnSet(AliQA::kINFO, specie); + + if ( ! value ) { // No checker is implemented, set all QA to Fatal + qa->Set(AliQA::kFATAL, specie) ; + } else { + if ( value[specie] >= fLowTestValue[AliQA::kFATAL] && value[specie] < fUpTestValue[AliQA::kFATAL] ) + qa->Set(AliQA::kFATAL, specie) ; + else if ( value[specie] > fLowTestValue[AliQA::kERROR] && value[specie] <= fUpTestValue[AliQA::kERROR] ) + qa->Set(AliQA::kERROR, specie) ; + else if ( value[specie] > fLowTestValue[AliQA::kWARNING] && value[specie] <= fUpTestValue[AliQA::kWARNING] ) + qa->Set(AliQA::kWARNING, specie) ; + else if ( value[specie] > fLowTestValue[AliQA::kINFO] && value[specie] <= fUpTestValue[AliQA::kINFO] ) + qa->Set(AliQA::kINFO, specie) ; + } } } diff --git a/MUON/AliMUONQAChecker.h b/MUON/AliMUONQAChecker.h index 95dfe2a2313..8309314c6f8 100644 --- a/MUON/AliMUONQAChecker.h +++ b/MUON/AliMUONQAChecker.h @@ -24,17 +24,19 @@ public: AliMUONQAChecker(const AliMUONQAChecker& qac); virtual ~AliMUONQAChecker(); + virtual void Init(const AliQA::DETECTORINDEX_t det) ; + protected: using AliQACheckerBase::Check; - virtual Double_t Check(AliQA::ALITASK_t index) ; - virtual Double_t Check(AliQA::ALITASK_t index, TObjArray * list) ; - virtual void SetQA(AliQA::ALITASK_t index, const Double_t value) const ; + virtual Double_t * Check(AliQA::ALITASK_t index) ; + virtual Double_t * Check(AliQA::ALITASK_t index, TObjArray ** list) ; + virtual void SetQA(AliQA::ALITASK_t index, const Double_t * value) const ; - Double_t CheckRaws(TObjArray* list); - Double_t CheckRecPoints(TObjArray* list); - Double_t CheckESD(TObjArray* list); + Double_t * CheckRaws(TObjArray** list); + Double_t * CheckRecPoints(TObjArray** list); + Double_t * CheckESD(TObjArray** list); TH1* GetHisto(TObjArray* list, const char* hname) const; Double_t MarkHisto(TH1& histo, Double_t value) const; diff --git a/MUON/AliMUONQADataMakerRec.cxx b/MUON/AliMUONQADataMakerRec.cxx index f0a9be548ee..700963187f0 100644 --- a/MUON/AliMUONQADataMakerRec.cxx +++ b/MUON/AliMUONQADataMakerRec.cxx @@ -170,7 +170,7 @@ AliMUONQADataMakerRec::~AliMUONQADataMakerRec() } //____________________________________________________________________________ -void AliMUONQADataMakerRec::EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray* list) +void AliMUONQADataMakerRec::EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray** list) { ///Detector specific actions at end of cycle @@ -179,84 +179,85 @@ void AliMUONQADataMakerRec::EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArra // Display trigger histos in a more user friendly way DisplayTriggerInfo(task); - if ( task == AliQA::kRAWS && fTrackerDataMaker ) - { - TIter next(list); - TObject* o; - Bool_t alreadyThere(kFALSE); - while ( ( o = next() ) && !alreadyThere ) - { - TString classname(o->ClassName()); - if ( classname.Contains("TrackerData") ) alreadyThere = kTRUE; - } - if (!alreadyThere && fTrackerDataMaker) - { - AliInfo("Adding fTrackerDataMaker to the list of qa objects"); - list->AddAt(fTrackerDataMaker->Data(),(Int_t)kTrackerData); - } - if ( fTrackerDataMaker ) - { - TH1* hbp = GetRawsData(kTrackerBusPatchOccupancy); - hbp->Reset(); - TIter nextBP(AliMpDDLStore::Instance()->CreateBusPatchIterator()); - AliMpBusPatch* bp(0x0); - AliMUONVTrackerData* data = fTrackerDataMaker->Data(); - Int_t occDim = 2; - - while ( ( bp = static_cast(nextBP())) ) + for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) { + SetEventSpecie(specie) ; + if ( task == AliQA::kRAWS && fTrackerDataMaker ) { - Int_t busPatchId = bp->GetId(); - Int_t bin = hbp->FindBin(busPatchId); - hbp->SetBinContent(bin,data->BusPatch(busPatchId,occDim)); + TIter next(list[specie]); + TObject* o; + Bool_t alreadyThere(kFALSE); + while ( ( o = next() ) && !alreadyThere ) + { + TString classname(o->ClassName()); + if ( classname.Contains("TrackerData") ) alreadyThere = kTRUE; + } + if (!alreadyThere && fTrackerDataMaker) + { + AliInfo("Adding fTrackerDataMaker to the list of qa objects"); + list[specie]->AddAt(fTrackerDataMaker->Data(),(Int_t)kTrackerData); + } + if ( fTrackerDataMaker ) + { + TH1* hbp = GetRawsData(kTrackerBusPatchOccupancy); + hbp->Reset(); + TIter nextBP(AliMpDDLStore::Instance()->CreateBusPatchIterator()); + AliMpBusPatch* bp(0x0); + AliMUONVTrackerData* data = fTrackerDataMaker->Data(); + Int_t occDim = 2; + + while ( ( bp = static_cast(nextBP())) ) + { + Int_t busPatchId = bp->GetId(); + Int_t bin = hbp->FindBin(busPatchId); + hbp->SetBinContent(bin,data->BusPatch(busPatchId,occDim)); + } + } } - } - } - if ( task == AliQA::kESDS ) { - // Normalize ESD histos - TH1* h; - Int_t bin; - AliMpDEIterator it; - it.First(); - while ( !it.IsDone()) { + if ( task == AliQA::kESDS ) { + // Normalize ESD histos + TH1* h; + Int_t bin; + AliMpDEIterator it; + it.First(); + while ( !it.IsDone()) { - Int_t detElemId = it.CurrentDEId(); + Int_t detElemId = it.CurrentDEId(); - if ( AliMpDEManager::GetStationType(detElemId) != AliMp::kStationTrigger ) { + if ( AliMpDEManager::GetStationType(detElemId) != AliMp::kStationTrigger ) { - h = GetESDsData(kESDnClustersPerDE); - Double_t nClusters = h->GetBinContent(h->GetXaxis()->FindFixBin((Double_t)detElemId)); + h = GetESDsData(kESDnClustersPerDE); + Double_t nClusters = h->GetBinContent(h->GetXaxis()->FindFixBin((Double_t)detElemId)); if (nClusters > 0) { - h = GetESDsData(kESDClusterChargePerDE); - bin = h->GetXaxis()->FindFixBin((Double_t)detElemId); + h = GetESDsData(kESDClusterChargePerDE); + bin = h->GetXaxis()->FindFixBin((Double_t)detElemId); h->SetBinContent(bin, h->GetBinContent(bin)/nClusters); - h = GetESDsData(kESDClusterMultPerDE); - bin = h->GetXaxis()->FindFixBin((Double_t)detElemId); + h = GetESDsData(kESDClusterMultPerDE); + bin = h->GetXaxis()->FindFixBin((Double_t)detElemId); h->SetBinContent(bin, h->GetBinContent(bin)/nClusters); - h = GetESDsData(kESDResidualXPerDEMean); - bin = h->GetXaxis()->FindFixBin((Double_t)detElemId); - Double_t meanResX = h->GetBinContent(bin)/nClusters; + h = GetESDsData(kESDResidualXPerDEMean); + bin = h->GetXaxis()->FindFixBin((Double_t)detElemId); + Double_t meanResX = h->GetBinContent(bin)/nClusters; h->SetBinContent(bin, meanResX); - h = GetESDsData(kESDResidualYPerDEMean); - bin = h->GetXaxis()->FindFixBin((Double_t)detElemId); - Double_t meanResY = h->GetBinContent(bin)/nClusters; + h = GetESDsData(kESDResidualYPerDEMean); + bin = h->GetXaxis()->FindFixBin((Double_t)detElemId); + Double_t meanResY = h->GetBinContent(bin)/nClusters; h->SetBinContent(bin, meanResY); - h = GetESDsData(kESDResidualXPerDESigma); - bin = h->GetXaxis()->FindFixBin((Double_t)detElemId); - if (nClusters > 1) h->SetBinContent(bin, TMath::Sqrt(h->GetBinContent(bin)/nClusters - meanResX*meanResX)); - else h->SetBinContent(bin, 0.); - - h = GetESDsData(kESDResidualYPerDESigma); - bin = h->GetXaxis()->FindFixBin((Double_t)detElemId); - if (nClusters > 1) h->SetBinContent(bin, TMath::Sqrt(h->GetBinContent(bin)/nClusters - meanResY*meanResY)); - else h->SetBinContent(bin, 0.); + h = GetESDsData(kESDResidualXPerDESigma); + bin = h->GetXaxis()->FindFixBin((Double_t)detElemId); + if (nClusters > 1) h->SetBinContent(bin, TMath::Sqrt(h->GetBinContent(bin)/nClusters - meanResX*meanResX)); + else h->SetBinContent(bin, 0.); + h = GetESDsData(kESDResidualYPerDESigma); + bin = h->GetXaxis()->FindFixBin((Double_t)detElemId); + if (nClusters > 1) h->SetBinContent(bin, TMath::Sqrt(h->GetBinContent(bin)/nClusters - meanResY*meanResY)); + else h->SetBinContent(bin, 0.); } } @@ -270,7 +271,7 @@ void AliMUONQADataMakerRec::EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArra GetESDsData(kESDnClustersPerDE)->Scale(1./nTracks); } } - + } // do the QA checking AliQAChecker::Instance()->Run(AliQA::kMUON, task, list) ; } diff --git a/MUON/AliMUONQADataMakerRec.h b/MUON/AliMUONQADataMakerRec.h index 96084b1a659..081786f4c85 100644 --- a/MUON/AliMUONQADataMakerRec.h +++ b/MUON/AliMUONQADataMakerRec.h @@ -99,7 +99,7 @@ protected: virtual void DefaultEndOfDetectorCycle(AliQA::TASKINDEX_t) {} - virtual void EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray* list); + virtual void EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray** list); private: diff --git a/MUON/AliMUONQADataMakerSim.cxx b/MUON/AliMUONQADataMakerSim.cxx index e3efcaa4357..1ac72b9cdc8 100644 --- a/MUON/AliMUONQADataMakerSim.cxx +++ b/MUON/AliMUONQADataMakerSim.cxx @@ -195,7 +195,7 @@ void AliMUONQADataMakerSim::MakeDigits(TTree* digitsTree) } //____________________________________________________________________________ -void AliMUONQADataMakerSim::EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray* list) +void AliMUONQADataMakerSim::EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray** list) { ///Detector specific actions at end of cycle // do the QA checking diff --git a/MUON/AliMUONQADataMakerSim.h b/MUON/AliMUONQADataMakerSim.h index f5cffebf746..b4925d6354d 100644 --- a/MUON/AliMUONQADataMakerSim.h +++ b/MUON/AliMUONQADataMakerSim.h @@ -50,7 +50,7 @@ private: /// make SDigits QA from Tree virtual void MakeDigits(TTree* digitsTree); - virtual void EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray* list); + virtual void EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray** list); AliMUONVHitStore* fHitStore; //!< pointer to hit store AliMUONVDigitStore* fDigitStore; //!< pointer to digit store diff --git a/PHOS/AliPHOSQADataMakerRec.cxx b/PHOS/AliPHOSQADataMakerRec.cxx index 1ff31a96a6b..f5dccef77c3 100644 --- a/PHOS/AliPHOSQADataMakerRec.cxx +++ b/PHOS/AliPHOSQADataMakerRec.cxx @@ -75,19 +75,24 @@ AliPHOSQADataMakerRec& AliPHOSQADataMakerRec::operator = (const AliPHOSQADataMak } //____________________________________________________________________________ -void AliPHOSQADataMakerRec::EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray * list) +void AliPHOSQADataMakerRec::EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray ** list) { //Detector specific actions at end of cycle - if(GetRawsData(kHGqualMod1) && GetRawsData(kHGmod1)) - GetRawsData(kHGqualMod1)->Divide( GetRawsData(kHGmod1) ) ; - if(GetRawsData(kHGqualMod2) && GetRawsData(kHGmod2)) - GetRawsData(kHGqualMod2)->Divide( GetRawsData(kHGmod2) ) ; - if(GetRawsData(kHGqualMod3) && GetRawsData(kHGmod3)) - GetRawsData(kHGqualMod3)->Divide( GetRawsData(kHGmod3) ) ; - if(GetRawsData(kHGqualMod4) && GetRawsData(kHGmod4)) - GetRawsData(kHGqualMod4)->Divide( GetRawsData(kHGmod4) ) ; - if(GetRawsData(kHGqualMod5) && GetRawsData(kHGmod5)) - GetRawsData(kHGqualMod5)->Divide( GetRawsData(kHGmod5) ) ; + for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) { + if ( !AliQA::Instance()->IsEventSpecieSet(specie) ) + continue ; + SetEventSpecie(specie) ; + if(GetRawsData(kHGqualMod1) && GetRawsData(kHGmod1)) + GetRawsData(kHGqualMod1)->Divide( GetRawsData(kHGmod1) ) ; + if(GetRawsData(kHGqualMod2) && GetRawsData(kHGmod2)) + GetRawsData(kHGqualMod2)->Divide( GetRawsData(kHGmod2) ) ; + if(GetRawsData(kHGqualMod3) && GetRawsData(kHGmod3)) + GetRawsData(kHGqualMod3)->Divide( GetRawsData(kHGmod3) ) ; + if(GetRawsData(kHGqualMod4) && GetRawsData(kHGmod4)) + GetRawsData(kHGqualMod4)->Divide( GetRawsData(kHGmod4) ) ; + if(GetRawsData(kHGqualMod5) && GetRawsData(kHGmod5)) + GetRawsData(kHGqualMod5)->Divide( GetRawsData(kHGmod5) ) ; + } // do the QA checking AliQAChecker::Instance()->Run(AliQA::kPHOS, task, list) ; } @@ -121,8 +126,7 @@ void AliPHOSQADataMakerRec::InitESDs() void AliPHOSQADataMakerRec::InitRecPoints() { // create Reconstructed Points histograms in RecPoints subdir - Bool_t expert = kTRUE ; - + Bool_t expert = kTRUE ; TH2I * h0 = new TH2I("hRpPHOSxyMod1","RecPoints Rows x Columns for PHOS module 1", 64, -72., 72., 56, -63., 63.) ; Add2RecPointsList(h0,kRPmod1, expert) ; TH2I * h1 = new TH2I("hRpPHOSxyMod2","RecPoints Rows x Columns for PHOS module 2", 64, -72., 72., 56, -63., 63.) ; @@ -327,6 +331,7 @@ void AliPHOSQADataMakerRec::MakeRaws(AliRawReader* rawReader) } } delete decoder; + GetRawsData(kEtotLG)->Fill(lgEtot) ; TParameter * p = dynamic_cast*>(GetParameterList()->FindObject(Form("%s_%s_%s", GetName(), AliQA::GetTaskName(AliQA::kRAWS).Data(), GetRawsData(kEtotLG)->GetName()))) ; p->SetVal(lgEtot) ; diff --git a/PHOS/AliPHOSQADataMakerRec.h b/PHOS/AliPHOSQADataMakerRec.h index cf620072c48..46ffef14009 100644 --- a/PHOS/AliPHOSQADataMakerRec.h +++ b/PHOS/AliPHOSQADataMakerRec.h @@ -51,7 +51,7 @@ public: private: const AliPHOSRecoParam* GetRecoParam() const { return dynamic_cast(fRecoParam); } - virtual void EndOfDetectorCycle(AliQA::TASKINDEX_t, TObjArray * list) ; + virtual void EndOfDetectorCycle(AliQA::TASKINDEX_t, TObjArray ** list) ; virtual void InitESDs() ; virtual void InitRecPoints() ; virtual void InitRaws() ; diff --git a/PHOS/AliPHOSQADataMakerSim.cxx b/PHOS/AliPHOSQADataMakerSim.cxx index 0935a92eb5e..613df7760ee 100644 --- a/PHOS/AliPHOSQADataMakerSim.cxx +++ b/PHOS/AliPHOSQADataMakerSim.cxx @@ -72,7 +72,7 @@ AliPHOSQADataMakerSim& AliPHOSQADataMakerSim::operator = (const AliPHOSQADataMak } //____________________________________________________________________________ -void AliPHOSQADataMakerSim::EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray * list) +void AliPHOSQADataMakerSim::EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray ** list) { //Detector specific actions at end of cycle // do the QA checking @@ -86,10 +86,11 @@ void AliPHOSQADataMakerSim::InitHits() Bool_t expert = kTRUE ; TH1F * h0 = new TH1F("hPhosHits", "Hits energy distribution in PHOS", 100, 0., 100.) ; h0->Sumw2() ; - Add2HitsList(h0, 0, !expert) ; + Add2HitsList(h0, kHits, !expert) ; TH1I * h1 = new TH1I("hPhosHitsMul", "Hits multiplicity distribution in PHOS", 500, 0., 10000) ; h1->Sumw2() ; - Add2HitsList(h1, 1, !expert) ; + Add2HitsList(h1, kHitsMul, !expert) ; + } //____________________________________________________________________________ @@ -99,10 +100,10 @@ void AliPHOSQADataMakerSim::InitDigits() Bool_t expert = kTRUE ; TH1I * h0 = new TH1I("hPhosDigits", "Digits amplitude distribution in PHOS", 500, 0, 1000) ; h0->Sumw2() ; - Add2DigitsList(h0, 0, !expert) ; + Add2DigitsList(h0, kDigits, !expert) ; TH1I * h1 = new TH1I("hPhosDigitsMul", "Digits multiplicity distribution in PHOS", 2000, 0, 10000) ; h1->Sumw2() ; - Add2DigitsList(h1, 1, !expert) ; + Add2DigitsList(h1, kDigitsMul, !expert) ; } //____________________________________________________________________________ @@ -112,10 +113,10 @@ void AliPHOSQADataMakerSim::InitSDigits() Bool_t expert = kTRUE ; TH1F * h0 = new TH1F("hPhosSDigits", "SDigits energy distribution in PHOS", 500, 0., 1000.) ; h0->Sumw2() ; - Add2SDigitsList(h0, 0, !expert) ; + Add2SDigitsList(h0, kSDigits, !expert) ; TH1I * h1 = new TH1I("hPhosSDigitsMul", "SDigits multiplicity distribution in PHOS", 500, 0, 1000) ; h1->Sumw2() ; - Add2SDigitsList(h1, 1, !expert) ; + Add2SDigitsList(h1, kSDigitsMul, !expert) ; } //____________________________________________________________________________ @@ -126,7 +127,7 @@ void AliPHOSQADataMakerSim::MakeHits() TIter next(fHits) ; AliPHOSHit * hit ; while ( (hit = dynamic_cast(next())) ) { - GetHitsData(0)->Fill( hit->GetEnergy()) ; + GetHitsData(kHits)->Fill( hit->GetEnergy()) ; } } @@ -160,7 +161,7 @@ void AliPHOSQADataMakerSim::MakeDigits(TClonesArray * digits) TIter next(digits) ; AliPHOSDigit * digit ; while ( (digit = dynamic_cast(next())) ) { - GetDigitsData(0)->Fill( digit->GetEnergy()) ; + GetDigitsData(kDigits)->Fill( digit->GetEnergy()) ; } } @@ -189,7 +190,7 @@ void AliPHOSQADataMakerSim::MakeSDigits(TClonesArray * sdigits) TIter next(sdigits) ; AliPHOSDigit * sdigit ; while ( (sdigit = dynamic_cast(next())) ) { - GetSDigitsData(0)->Fill( sdigit->GetEnergy()) ; + GetSDigitsData(kSDigits)->Fill( sdigit->GetEnergy()) ; } } diff --git a/PHOS/AliPHOSQADataMakerSim.h b/PHOS/AliPHOSQADataMakerSim.h index 744b100a27c..854a9eb95e6 100644 --- a/PHOS/AliPHOSQADataMakerSim.h +++ b/PHOS/AliPHOSQADataMakerSim.h @@ -26,13 +26,17 @@ class TObjArray ; class AliPHOSQADataMakerSim: public AliQADataMakerSim { public: + enum HHitType_t {kHits=0, kHitsMul} ; + enum HDigitType_t {kDigits=0, kDigitsMul} ; + enum HSDigitType_t {kSDigits=0, kSDigitsMul} ; + AliPHOSQADataMakerSim() ; // ctor AliPHOSQADataMakerSim(const AliPHOSQADataMakerSim& qadm) ; AliPHOSQADataMakerSim& operator = (const AliPHOSQADataMakerSim& qadm) ; virtual ~AliPHOSQADataMakerSim() {;} // dtor private: - virtual void EndOfDetectorCycle(AliQA::TASKINDEX_t, TObjArray * list) ; + virtual void EndOfDetectorCycle(AliQA::TASKINDEX_t, TObjArray ** list) ; virtual void InitHits() ; virtual void InitDigits() ; virtual void InitSDigits() ; diff --git a/PMD/AliPMDQADataMakerRec.cxx b/PMD/AliPMDQADataMakerRec.cxx index 05c44f7fba0..7cedd07ebd1 100644 --- a/PMD/AliPMDQADataMakerRec.cxx +++ b/PMD/AliPMDQADataMakerRec.cxx @@ -580,7 +580,7 @@ void AliPMDQADataMakerRec::StartOfDetectorCycle() } //____________________________________________________________________________ -void AliPMDQADataMakerRec::EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray * list) +void AliPMDQADataMakerRec::EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray ** list) { //Detector specific actions at end of cycle // do the QA checking diff --git a/PMD/AliPMDQADataMakerRec.h b/PMD/AliPMDQADataMakerRec.h index e06aa8d6a78..aae8b3b97df 100644 --- a/PMD/AliPMDQADataMakerRec.h +++ b/PMD/AliPMDQADataMakerRec.h @@ -38,7 +38,7 @@ class AliPMDQADataMakerRec: public AliQADataMakerRec { virtual void MakeRecPoints(TTree * recpoTree) ; virtual void MakeESDs(AliESDEvent * esd) ; virtual void StartOfDetectorCycle() ; - virtual void EndOfDetectorCycle(AliQA::TASKINDEX_t, TObjArray * list) ; + virtual void EndOfDetectorCycle(AliQA::TASKINDEX_t, TObjArray ** list) ; ClassDef(AliPMDQADataMakerRec,1) // description diff --git a/PMD/AliPMDQADataMakerSim.cxx b/PMD/AliPMDQADataMakerSim.cxx index 2fd2a87ae7b..ab08b03fc1c 100644 --- a/PMD/AliPMDQADataMakerSim.cxx +++ b/PMD/AliPMDQADataMakerSim.cxx @@ -333,7 +333,7 @@ void AliPMDQADataMakerSim::StartOfDetectorCycle() } //____________________________________________________________________________ -void AliPMDQADataMakerSim::EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray * list) +void AliPMDQADataMakerSim::EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray ** list) { //Detector specific actions at end of cycle // do the QA checking diff --git a/PMD/AliPMDQADataMakerSim.h b/PMD/AliPMDQADataMakerSim.h index 6f085e64558..273400721e6 100644 --- a/PMD/AliPMDQADataMakerSim.h +++ b/PMD/AliPMDQADataMakerSim.h @@ -41,7 +41,7 @@ private: virtual void MakeDigits(TClonesArray * digits) ; virtual void MakeDigits(TTree * digitTree) ; virtual void StartOfDetectorCycle() ; - virtual void EndOfDetectorCycle(AliQA::TASKINDEX_t, TObjArray * list) ; + virtual void EndOfDetectorCycle(AliQA::TASKINDEX_t, TObjArray ** list) ; ClassDef(AliPMDQADataMakerSim,1) // description diff --git a/STEER/AliCorrQAChecker.cxx b/STEER/AliCorrQAChecker.cxx index 6010b864ea7..dda4f9f873d 100644 --- a/STEER/AliCorrQAChecker.cxx +++ b/STEER/AliCorrQAChecker.cxx @@ -42,23 +42,31 @@ ClassImp(AliCorrQAChecker) //__________________________________________________________________ -Double_t AliCorrQAChecker::Check(AliQA::ALITASK_t index, TNtupleD * nData) +Double_t * AliCorrQAChecker::Check(AliQA::ALITASK_t index, TNtupleD ** nData) { // check the QA of correlated data stored in a ntuple + + Double_t * test = new Double_t[AliRecoParam::kNSpecies] ; + for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) + test[specie] = 0. ; + if ( index != AliQA::kRAW ) { AliWarning("Checker not implemented") ; - return 1.0 ; + for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) + test[specie] = 1. ; + return test ; } - Double_t test = 0.0 ; // if (!fRefSubDir) { // test = 1. ; // no reference data // } else { if ( ! nData ) { AliError(Form("nRawCorr not found in %s", fDataSubDir->GetName())) ; } else { - TObjArray * bList = nData->GetListOfBranches() ; - for (Int_t b = 0 ; b < bList->GetEntries() ; b++) { - AliInfo(Form("Ntuple parameter name %d : %s", b, bList->At(b)->GetName())) ; + for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) { + TObjArray * bList = nData[specie]->GetListOfBranches() ; + for (Int_t b = 0 ; b < bList->GetEntries() ; b++) { + AliInfo(Form("Ntuple %s parameter name %d : %s", nData[specie]->GetName(), b, bList->At(b)->GetName())) ; + } } } // } diff --git a/STEER/AliCorrQAChecker.h b/STEER/AliCorrQAChecker.h index 2a7966fc38c..d1cb14f14c6 100644 --- a/STEER/AliCorrQAChecker.h +++ b/STEER/AliCorrQAChecker.h @@ -31,9 +31,9 @@ public: AliCorrQAChecker(const AliCorrQAChecker& qac) : AliQACheckerBase(qac.GetName(), qac.GetTitle()) {;} // cpy ctor virtual ~AliCorrQAChecker() {;} // dtor - virtual Double_t Check(AliQA::ALITASK_t index) { return AliQACheckerBase::Check(index) ;} - virtual Double_t Check(AliQA::ALITASK_t index, TObjArray * obj) { return AliQACheckerBase::Check(index, obj) ;} - virtual Double_t Check(AliQA::ALITASK_t index, TNtupleD * nData) ; + virtual Double_t * Check(AliQA::ALITASK_t index) { return AliQACheckerBase::Check(index) ;} + virtual Double_t * Check(AliQA::ALITASK_t index, TObjArray ** obj) { return AliQACheckerBase::Check(index, obj) ;} + Double_t * Check(AliQA::ALITASK_t index, TNtupleD ** nData) ; private: diff --git a/STEER/AliCorrQADataMakerRec.cxx b/STEER/AliCorrQADataMakerRec.cxx index 2a5d16af793..e3c46e6e9ed 100644 --- a/STEER/AliCorrQADataMakerRec.cxx +++ b/STEER/AliCorrQADataMakerRec.cxx @@ -30,6 +30,7 @@ #include #include #include +#include // --- Standard library --- @@ -47,7 +48,9 @@ AliQADataMakerRec(AliQA::GetDetName(AliQA::kCORR), "Corr Quality Assurance Data fqadm(qadm) { // ctor - + fCorrNt = new TNtupleD *[AliRecoParam::kNSpecies] ; + for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) + fCorrNt[specie] = NULL ; } //____________________________________________________________________________ @@ -64,19 +67,32 @@ AliCorrQADataMakerRec::AliCorrQADataMakerRec(const AliCorrQADataMakerRec& qadm) //__________________________________________________________________ AliCorrQADataMakerRec& AliCorrQADataMakerRec::operator = (const AliCorrQADataMakerRec& qadm ) { - // Equal operator. + // assign operator. this->~AliCorrQADataMakerRec(); new(this) AliCorrQADataMakerRec(qadm); return *this; } - + +//____________________________________________________________________________ +AliCorrQADataMakerRec::~AliCorrQADataMakerRec() +{ + // dtor only destroy the ntuple + if ( fCorrNt ) { + for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) { + if ( fCorrNt[specie] != NULL ) + delete fCorrNt[specie] ; + } + delete[] fCorrNt ; + } +} + //____________________________________________________________________________ -void AliCorrQADataMakerRec::EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray * /*list*/) +void AliCorrQADataMakerRec::EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray ** /*list*/) { //Detector specific actions at end of cycle // do the QA checking if (task == AliQA::kRAWS) { - AliQAChecker::Instance()->Run(AliQA::kCORR, task, fObject) ; + AliQAChecker::Instance()->Run(AliQA::kCORR, task, fCorrNt) ; } } @@ -100,7 +116,7 @@ void AliCorrQADataMakerRec::InitRecPoints() void AliCorrQADataMakerRec::InitRaws() { // createa ntuple taking all the parameters declared by detectors - if (fObject) + if (fCorrNt) return ; delete fRawsQAList ; // not needed for the time being fRawsQAList = NULL ; @@ -124,7 +140,10 @@ void AliCorrQADataMakerRec::InitRaws() if (fMaxRawVar == 0) { AliWarning("NTUPLE not created") ; } else { - fObject = new TNtupleD(AliQA::GetQACorrName(), "Raws data correlation among detectors", varlist.Data()) ; + for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) { + char * name = Form("%s_%s", AliQA::GetQACorrName(), AliRecoParam::GetEventSpecieName(specie)) ; + fCorrNt[specie] = new TNtupleD(name, "Raws data correlation among detectors", varlist.Data()) ; + } } } @@ -156,7 +175,7 @@ void AliCorrQADataMakerRec::MakeRaws(AliRawReader *) varvalue[index++] = p->GetVal() ; } } - (dynamic_cast(fObject))->Fill(varvalue); + (dynamic_cast(fCorrNt[(Int_t)TMath::Log2(fEventSpecie)]))->Fill(varvalue); delete [] varvalue; } } diff --git a/STEER/AliCorrQADataMakerRec.h b/STEER/AliCorrQADataMakerRec.h index 23ddc823c05..69349ebef7e 100644 --- a/STEER/AliCorrQADataMakerRec.h +++ b/STEER/AliCorrQADataMakerRec.h @@ -29,11 +29,11 @@ public: AliCorrQADataMakerRec(AliQADataMaker **) ; // ctor AliCorrQADataMakerRec(const AliCorrQADataMakerRec& qadm) ; AliCorrQADataMakerRec& operator = (const AliCorrQADataMakerRec& qadm) ; - virtual ~AliCorrQADataMakerRec() {;} // dtor + virtual ~AliCorrQADataMakerRec() ; // dtor private: - virtual void EndOfDetectorCycle(AliQA::TASKINDEX_t, TObjArray * list) ; + virtual void EndOfDetectorCycle(AliQA::TASKINDEX_t, TObjArray ** list) ; virtual void InitESDs() ; virtual void InitRecPoints() ; virtual void InitRaws() ; diff --git a/STEER/AliGlobalQADataMaker.cxx b/STEER/AliGlobalQADataMaker.cxx index bf6457b699c..da923f5cd27 100644 --- a/STEER/AliGlobalQADataMaker.cxx +++ b/STEER/AliGlobalQADataMaker.cxx @@ -18,7 +18,7 @@ ClassImp(AliGlobalQADataMaker) //____________________________________________________________________________ -void AliGlobalQADataMaker::EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray * list) +void AliGlobalQADataMaker::EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray ** list) { //Detector specific actions at end of cycle // do the QA checking diff --git a/STEER/AliGlobalQADataMaker.h b/STEER/AliGlobalQADataMaker.h index 4a07a965162..7254d961410 100644 --- a/STEER/AliGlobalQADataMaker.h +++ b/STEER/AliGlobalQADataMaker.h @@ -28,7 +28,7 @@ public: AliQADataMakerRec(qadm) {;} private: - void EndOfDetectorCycle(AliQA::TASKINDEX_t, TObjArray * list) ; + void EndOfDetectorCycle(AliQA::TASKINDEX_t, TObjArray ** list) ; void InitRaws(); void InitRecPoints(); diff --git a/STEER/AliQA.cxx b/STEER/AliQA.cxx index 8f9f2115e46..bc91179d692 100644 --- a/STEER/AliQA.cxx +++ b/STEER/AliQA.cxx @@ -48,7 +48,7 @@ ClassImp(AliQA) AliQA * AliQA::fgQA = 0x0 ; TFile * AliQA::fgQADataFile = 0x0 ; -TString AliQA::fgQADataFileName = "QA" ; // will transform into Det.QA.run.cycle.root +TString AliQA::fgQADataFileName = "QA" ; // will transform into Det.QA.run.root TFile * AliQA::fgQARefFile = 0x0 ; TString AliQA::fgQARefDirName = "" ; TString AliQA::fgQARefFileName = "QA.root" ; @@ -58,14 +58,6 @@ TString AliQA::fgQAResultFileName = "QA.root" ; TString AliQA::fgDetNames[] = {"ITS", "TPC", "TRD", "TOF", "PHOS", "HMPID", "EMCAL", "MUON", "FMD", "ZDC", "PMD", "T0", "VZERO", "ACORDE", "HLT", "Global", "CORR"} ; TString AliQA::fgGRPPath = "GRP/GRP/Data" ; -TString AliQA::fgRTNames[] = {"UNKNOWN", "AUTO_TEST", "CALIBRATION", "CALIBRATION_PULSER", "CHANNEL_DELAY_TUNING", "COSMIC", - "COSMICS", "DAQ_FO_UNIF_SCAN", "DAQ_GEN_DAC_SCAN", "DAQ_MEAN_TH_SCAN", "DAQ_MIN_TH_SCAN", - "DAQ_NOISY_PIX_SCAN", "DAQ_PIX_DELAY_SCAN", "DAQ_UNIFORMITY_SCAN", "DCS_FO_UNIF_SCAN", - "DCS_MEAN_TH_SCAN", "DCS_MIN_TH_SCAN", "DCS_PIX_DELAY_SCAN", "DCS_UNIFORMITY_SCAN", - "DDL_TEST", "GAIN", "PEDESTAL", "INJECTOR", "LASER", "MONTECARLO", "NOISE", "NOISY_PIX_SCAN", - "PHYSICS", "PULSER", "STANDALONE", "STANDALONE_BC", "STANDALONE_CENTRAL", "STANDALONE_COSMIC", - "STANDALONE_EMD", "STANDALONE_LASER", "STANDALONE_MB", "STANDALONE_PEDESTAL", - "STANDALONE_SEMICENTRAL", "STANDALONE_PULSER" } ; TString AliQA::fgTaskNames[] = {"Raws", "Hits", "SDigits", "Digits", "RecPoints", "TrackSegments", "RecParticles", "ESDs"} ; const TString AliQA::fkgLabLocalFile = "file://" ; const TString AliQA::fkgLabLocalOCDB = "local://" ; @@ -73,7 +65,7 @@ const TString AliQA::fkgLabAliEnOCDB = "alien://" ; const TString AliQA::fkgRefFileName = "QA.root" ; const TString AliQA::fkgQAName = "QA" ; const TString AliQA::fkgQACorrNtName = "CorrQA" ; -const TString AliQA::fkgRefOCDBDirName = "Ref" ; +const TString AliQA::fkgRefOCDBDirName = "QA" ; TString AliQA::fkgRefDataDirName = "" ; const TString AliQA::fkgQARefOCDBDefault = "alien://folder=/alice/QA/20" ; const TString AliQA::fkgExpert = "Expert" ; @@ -84,25 +76,34 @@ const UInt_t AliQA::fkgQABit = 17 ; AliQA::AliQA() : TNamed("", ""), fNdet(kNDET), - fQA(new ULong_t[fNdet]), + fNEventSpecie(AliRecoParam::kNSpecies), + fQA(new ULong_t*[fNdet]), fDet(kNULLDET), - fTask(kNULLTASK) - + fTask(kNULLTASK), + fEventSpecie(AliRecoParam::kDefault), + fEventSpecies(new Bool_t[fNEventSpecie]) { // default constructor - // beware singleton: not to be used - - for (Int_t index = 0 ; index < fNdet ; index++) - fQA[index] = 0 ; + Int_t det ; + for (det = 0 ; det < fNdet ; det++) { + fQA[det] = new ULong_t[fNEventSpecie] ; + for (Int_t es = 0 ; es < fNEventSpecie ; es++) + fQA[det][es] = 0 ; + } + for (Int_t es = 0 ; es < fNEventSpecie ; es++) + fEventSpecies[es] = kFALSE ; } //____________________________________________________________________________ AliQA::AliQA(const AliQA& qa) : TNamed(qa), fNdet(qa.fNdet), + fNEventSpecie(qa.fNEventSpecie), fQA(qa.fQA), fDet(qa.fDet), - fTask(qa.fTask) + fTask(qa.fTask), + fEventSpecie(qa.fEventSpecie), + fEventSpecies(qa.fEventSpecies) { // cpy ctor } @@ -110,55 +111,80 @@ AliQA::AliQA(const AliQA& qa) : //_____________________________________________________________________________ AliQA& AliQA::operator = (const AliQA& qa) { -// assignment operator - if(&qa == this) return *this; + // assignment operator + if(&qa == this) return *this; - fNdet = qa.fNdet; - for (Int_t index = 0 ; index < fNdet ; index++) - fQA[index] = qa.fQA[index]; - return *this; + fNdet = qa.fNdet; + fNEventSpecie = qa.fNEventSpecie; + for (Int_t det = 0 ; det < fNdet ; det++) + for (Int_t es = 0 ; es < fNEventSpecie ; es++) + fQA[det][es] = qa.fQA[det][es]; + + fNEventSpecie = qa.fNEventSpecie ; + for (Int_t es = 0 ; es < fNEventSpecie ; es++) + fEventSpecies[es] = qa. fEventSpecies[es] ; + + return *this; } //_______________________________________________________________ AliQA::AliQA(const DETECTORINDEX_t det) : TNamed("QA", "Quality Assurance status"), fNdet(kNDET), - fQA(new ULong_t[fNdet]), + fNEventSpecie(AliRecoParam::kNSpecies), + fQA(new ULong_t*[fNdet]), fDet(det), - fTask(kNULLTASK) + fTask(kNULLTASK), + fEventSpecie(AliRecoParam::kDefault), + fEventSpecies(new Bool_t[fNEventSpecie]) { // constructor to be used if (! CheckRange(det) ) { fDet = kNULLDET ; return ; } - Int_t index ; - for (index = 0; index < fNdet; index++) - fQA[index] = 0 ; + Int_t idet ; + for (idet = 0; idet < fNdet; idet++) { + fQA[det] = new ULong_t[fNEventSpecie] ; + for (Int_t es = 0 ; es < fNEventSpecie ; es++) + fQA[idet][es] = 0 ; + } + for (Int_t es = 0 ; es < fNEventSpecie ; es++) + fEventSpecies[es] = kFALSE ; } //_______________________________________________________________ AliQA::AliQA(const ALITASK_t tsk) : TNamed("QA", "Quality Assurance status"), fNdet(kNDET), - fQA(new ULong_t[fNdet]), + fNEventSpecie(AliRecoParam::kNSpecies), + fQA(new ULong_t*[fNdet]), fDet(kNULLDET), - fTask(tsk) + fTask(tsk), + fEventSpecie(AliRecoParam::kDefault), + fEventSpecies(new Bool_t[fNEventSpecie]) { // constructor to be used in the AliRoot module (SIM, REC, ESD or ANA) if (! CheckRange(tsk) ) { fTask = kNULLTASK ; return ; } - Int_t index ; - for (index = 0; index < fNdet; index++) - fQA[index] = 0 ; + Int_t det ; + for (det = 0; det < fNdet; det++) { + fQA[det] = new ULong_t[fNEventSpecie] ; + for (Int_t es = 0 ; es < fNEventSpecie ; es++) + fQA[det][es] = 0 ; + } + for (Int_t es = 0 ; es < fNEventSpecie ; es++) + fEventSpecies[es] = kFALSE ; } //____________________________________________________________________________ AliQA::~AliQA() { // dtor + for (Int_t idet = 0; idet < fNdet; idet++) + delete fQA[idet] ; delete[] fQA ; } @@ -184,7 +210,7 @@ Bool_t AliQA::CheckFatal() const Bool_t rv = kFALSE ; Int_t index ; for (index = 0; index < kNDET ; index++) - rv = rv || IsSet(DETECTORINDEX_t(index), fTask, kFATAL) ; + rv = rv || IsSet(DETECTORINDEX_t(index), fTask, fEventSpecie, kFATAL) ; return rv ; } @@ -220,7 +246,32 @@ Bool_t AliQA::CheckRange(QABIT_t bit) const return rv ; } - +//_______________________________________________________________ +Bool_t AliQA::CheckRange(AliRecoParam::EventSpecie_t es) const +{ + // check if bit is in given bit range: 0-kNBit + Bool_t rv = kFALSE ; + switch (es) { + case AliRecoParam::kDefault: + rv = kTRUE ; + break ; + case AliRecoParam::kLowMult: + rv = kTRUE ; + break ; + case AliRecoParam::kHighMult: + rv = kTRUE ; + break ; + case AliRecoParam::kCosmic: + rv = kTRUE ; + break ; + case AliRecoParam::kCalib: + rv = kTRUE ; + break ; + } + if (!rv) + AliFatal(Form("Event Specie %d is not valid", es)) ; + return rv ; +} //_______________________________________________________________ const char * AliQA::GetAliTaskName(ALITASK_t tsk) @@ -375,25 +426,6 @@ TFile * AliQA::GetQAResultFile() return fgQAResultFile ; } -//_______________________________________________________________ -const TString AliQA::GetRunTypeName(RUNTYPE_t rt) -{ - TString rv("Invalid Run Type") ; - if ( rt == kNULLTYPE ) { - rv = "Known RUN_TYPE are: \n" ; - for (Int_t index = 0 ; index < kNTYPE; index++) { - rv += Form("%2d -- %s\n", index, fgRTNames[index].Data()) ; - } - printf("%s", rv.Data()) ; - return "" ; - } - else { - if ( rt > kNULLTYPE && rt < kNTYPE ) - rv = fgRTNames[rt] ; - } - return rv ; -} - //_______________________________________________________________ AliQA::TASKINDEX_t AliQA::GetTaskIndex(const char * name) { @@ -410,31 +442,43 @@ AliQA::TASKINDEX_t AliQA::GetTaskIndex(const char * name) } //_______________________________________________________________ -Bool_t AliQA::IsSet(DETECTORINDEX_t det, ALITASK_t tsk, QABIT_t bit) const +Bool_t AliQA::IsSet(DETECTORINDEX_t det, ALITASK_t tsk, Int_t ies, QABIT_t bit) const +{ + // Checks is the requested bit is set + + const AliRecoParam::EventSpecie_t es = AliRecoParam::Convert(ies) ; + return IsSet(det, tsk, es, bit) ; + +} + +//_______________________________________________________________ +Bool_t AliQA::IsSet(DETECTORINDEX_t det, ALITASK_t tsk, AliRecoParam::EventSpecie_t es, QABIT_t bit) const { // Checks is the requested bit is set CheckRange(det) ; CheckRange(tsk) ; CheckRange(bit) ; + CheckRange(es) ; ULong_t offset = Offset(tsk) ; - ULong_t status = GetStatus(det) ; + ULong_t status = GetStatus(det, es) ; offset+= bit ; status = (status & 1 << offset) != 0 ; return status ; } //_______________________________________________________________ -Bool_t AliQA::IsSetAny(DETECTORINDEX_t det, ALITASK_t tsk) const +Bool_t AliQA::IsSetAny(DETECTORINDEX_t det, ALITASK_t tsk, AliRecoParam::EventSpecie_t es) const { // Checks is the requested bit is set CheckRange(det) ; CheckRange(tsk) ; + CheckRange(es) ; ULong_t offset = Offset(tsk) ; - ULong_t status = GetStatus(det) ; + ULong_t status = GetStatus(det, es) ; ULong_t st = 0 ; for ( Int_t bit = 0 ; bit < kNBIT ; bit++) { offset+= bit ; @@ -446,13 +490,14 @@ Bool_t AliQA::IsSetAny(DETECTORINDEX_t det, ALITASK_t tsk) const return kTRUE ; } //_______________________________________________________________ -Bool_t AliQA::IsSetAny(DETECTORINDEX_t det) const +Bool_t AliQA::IsSetAny(DETECTORINDEX_t det, AliRecoParam::EventSpecie_t es) const { // Checks is the requested bit is set CheckRange(det) ; + CheckRange(es) ; - ULong_t status = GetStatus(det) ; + ULong_t status = GetStatus(det, es) ; ULong_t st = 0 ; for ( Int_t tsk = 0 ; tsk < kNTASK ; tsk++) { ULong_t offset = Offset(ALITASK_t(tsk)) ; @@ -470,9 +515,14 @@ Bool_t AliQA::IsSetAny(DETECTORINDEX_t det) const //_______________________________________________________________ AliQA * AliQA::Instance() { - // Get an instance of the singleton. - // Object must have been instantiated with Instance(ALITASK) first + // Get an instance of the singleton. The only authorized way to call the ctor + if ( ! fgQA) { + TFile * f = GetQAResultFile() ; + fgQA = dynamic_cast(f->Get("QA")) ; + if ( ! fgQA ) + fgQA = new AliQA() ; + } return fgQA ; } @@ -494,7 +544,7 @@ AliQA * AliQA::Instance(const DETECTORINDEX_t det) //_______________________________________________________________ AliQA * AliQA::Instance(const ALITASK_t tsk) { - // get an instance of the singleton. + // Get an instance of the singleton. The only authorized way to call the ctor if ( ! fgQA) switch (tsk) { @@ -554,8 +604,10 @@ void AliQA::Merge(TCollection * list) { TIter next(list) ; AliQA * qa ; while ( (qa = (AliQA*)next() ) ) { - qa->IsSet(DETECTORINDEX_t(det), ALITASK_t(task), QABIT_t(bit)) ; - Set(QABIT_t(bit)) ; + for (Int_t es = 0 ; es < fNEventSpecie ; es++) { + if (qa->IsSet(DETECTORINDEX_t(det), ALITASK_t(task), es, QABIT_t(bit))) + Set(QABIT_t(bit), es) ; + } } // qa list } // bit } // task @@ -596,11 +648,26 @@ ULong_t AliQA::Offset(ALITASK_t tsk) const } //_______________________________________________________________ -void AliQA::Set(QABIT_t bit) +void AliQA::ResetStatus(DETECTORINDEX_t det) +{ + // reset the status of det for all event specie + for (Int_t es = 0 ; es < fNEventSpecie ; es++) + fQA[det][es] = 0 ; +} + +//_______________________________________________________________ +void AliQA::Set(QABIT_t bit, Int_t ies) { - // Set the status bit of the current detector in the current module + // Set the status bit of the current detector in the current module and for the current event specie + Set(bit, AliRecoParam::Convert(ies)) ; +} + +//_______________________________________________________________ +void AliQA::Set(QABIT_t bit, AliRecoParam::EventSpecie_t es) +{ + // Set the status bit of the current detector in the current module and for the current event specie - SetStatusBit(fDet, fTask, bit) ; + SetStatusBit(fDet, fTask, es, bit) ; } //_____________________________________________________________________________ @@ -625,27 +692,6 @@ void AliQA::SetQARefStorage(const char * name) printf("AliQA::SetQARefDir: QA references are in %s\n", tmp.Data() ) ; } -//_____________________________________________________________________________ -void AliQA::SetQARefDataDirName(const char * name) -{ - // Set the lower level directory name where reference data are found - TString test(name) ; - RUNTYPE_t rt = kNULLTYPE ; - for (Int_t index = 0; index < kNTYPE; index++) { - if (test.CompareTo(fgRTNames[index]) == 0) { - rt = (RUNTYPE_t) index ; - break ; - } - } - - if (rt == kNULLTYPE) { - printf("AliQA::SetQARefDataDirName: %s is an unknown RUN TYPE name\n", name) ; - return ; - } - - SetQARefDataDirName(rt) ; -} - //_____________________________________________________________________________ void AliQA::SetQAResultDirName(const char * name) { @@ -659,39 +705,69 @@ void AliQA::SetQAResultDirName(const char * name) } //_______________________________________________________________ -void AliQA::SetStatusBit(DETECTORINDEX_t det, ALITASK_t tsk, QABIT_t bit) +void AliQA::SetStatusBit(DETECTORINDEX_t det, ALITASK_t tsk, AliRecoParam::EventSpecie_t es, QABIT_t bit) { // Set the status bit for a given detector and a given task CheckRange(det) ; CheckRange(tsk) ; CheckRange(bit) ; + CheckRange(es) ; ULong_t offset = Offset(tsk) ; - ULong_t status = GetStatus(det) ; + ULong_t status = GetStatus(det, es) ; offset+= bit ; status = status | 1 << offset ; - SetStatus(det, status) ; + SetStatus(det, es, status) ; +} + +//_______________________________________________________________ +void AliQA::Show() const +{ + // dispplay the QA status word + + for (Int_t ies = 0 ; ies < fNEventSpecie ; ies++) { + const Bool_t what = IsEventSpecieSet(ies) ; + if ( what ) + ShowStatus(fDet, fTask, AliRecoParam::Convert(ies)) ; + } +} + +//_______________________________________________________________ +void AliQA::Show(DETECTORINDEX_t det) const +{ + // dispplay the QA status word + + for (Int_t ies = 0 ; ies < fNEventSpecie ; ies++) { + const Bool_t what = IsEventSpecieSet(ies) ; + if ( what ) + ShowStatus(fDet, kNULLTASK, AliRecoParam::Convert(ies)) ; + } } //_______________________________________________________________ -void AliQA::ShowAll() const +void AliQA::ShowAll() const { // dispplay the QA status word Int_t index ; for (index = 0 ; index < kNDET ; index++) { for (Int_t tsk = kRAW ; tsk < kNTASK ; tsk++) { - ShowStatus(DETECTORINDEX_t(index), ALITASK_t(tsk)) ; - } + for (Int_t ies = 0 ; ies < fNEventSpecie ; ies++) { + const Bool_t what = IsEventSpecieSet(ies) ; + if ( what ) + ShowStatus(DETECTORINDEX_t(index), ALITASK_t(tsk), AliRecoParam::Convert(ies)) ; + } + } } } //_______________________________________________________________ -void AliQA::ShowStatus(DETECTORINDEX_t det, ALITASK_t tsk) const +void AliQA::ShowStatus(DETECTORINDEX_t det, ALITASK_t tsk, AliRecoParam::EventSpecie_t es) const { // Prints the full QA status of a given detector CheckRange(det) ; - ULong_t status = GetStatus(det) ; + CheckRange(es) ; + ULong_t status = GetStatus(det, es) ; ULong_t tskStatus[kNTASK] ; tskStatus[kRAW] = status & 0x0000f ; tskStatus[kSIM] = status & 0x000f0 ; @@ -699,52 +775,60 @@ void AliQA::ShowStatus(DETECTORINDEX_t det, ALITASK_t tsk) const tskStatus[kESD] = status & 0x0f000 ; tskStatus[kANA] = status & 0xf0000 ; - AliInfo(Form("====> QA Status for %8s raw =0x%x, sim=0x%x, rec=0x%x, esd=0x%x, ana=0x%x", GetDetName(det).Data(), + AliInfo(Form("====> QA Status for %8s %8s raw =0x%x, sim=0x%x, rec=0x%x, esd=0x%x, ana=0x%x", GetDetName(det).Data(), AliRecoParam::GetEventSpecieName(es), tskStatus[kRAW], tskStatus[kSIM], tskStatus[kREC], tskStatus[kESD], tskStatus[kANA] )) ; if (tsk == kNULLTASK) { for (Int_t itsk = kRAW ; itsk < kNTASK ; itsk++) { - ShowASCIIStatus(det, ALITASK_t(itsk), tskStatus[itsk]) ; + ShowASCIIStatus(es, det, ALITASK_t(itsk), tskStatus[itsk]) ; } } else { - ShowASCIIStatus(det, tsk, tskStatus[tsk]) ; + ShowASCIIStatus(es, det, tsk, tskStatus[tsk]) ; } } //_______________________________________________________________ -void AliQA::ShowASCIIStatus(DETECTORINDEX_t det, ALITASK_t tsk, const ULong_t status) const +void AliQA::ShowASCIIStatus(AliRecoParam::EventSpecie_t es, DETECTORINDEX_t det, ALITASK_t tsk, const ULong_t status) const { // print the QA status in human readable format TString text; for (Int_t bit = kINFO ; bit < kNBIT ; bit++) { - if (IsSet(det, tsk, QABIT_t(bit))) { + if (IsSet(det, tsk, es, QABIT_t(bit))) { text = GetBitName(QABIT_t(bit)) ; text += " " ; } } if (! text.IsNull()) - printf(" %8s %4s 0x%4lx, Problem signalled: %8s \n", GetDetName(det).Data(), GetAliTaskName(tsk), status, text.Data()) ; + printf(" %8s %8s %4s 0x%4lx, Problem signalled: %8s \n", AliRecoParam::GetEventSpecieName(es), GetDetName(det).Data(), GetAliTaskName(tsk), status, text.Data()) ; +} + +//_______________________________________________________________ +void AliQA::UnSet(QABIT_t bit, Int_t ies) +{ + // UnSet the status bit of the current detector in the current module + UnSet(bit, AliRecoParam::Convert(ies)) ; } //_______________________________________________________________ -void AliQA::UnSet(QABIT_t bit) +void AliQA::UnSet(QABIT_t bit, AliRecoParam::EventSpecie_t es) { // UnSet the status bit of the current detector in the current module - UnSetStatusBit(fDet, fTask, bit) ; + UnSetStatusBit(fDet, fTask, es, bit) ; } //_______________________________________________________________ -void AliQA::UnSetStatusBit(DETECTORINDEX_t det, ALITASK_t tsk, QABIT_t bit) +void AliQA::UnSetStatusBit(DETECTORINDEX_t det, ALITASK_t tsk, AliRecoParam::EventSpecie_t es, QABIT_t bit) { // UnSet the status bit for a given detector and a given task CheckRange(det) ; CheckRange(tsk) ; CheckRange(bit) ; + CheckRange(es) ; ULong_t offset = Offset(tsk) ; - ULong_t status = GetStatus(det) ; + ULong_t status = GetStatus(det, es) ; offset+= bit ; status = status & 0 << offset ; - SetStatus(det, status) ; + SetStatus(det, es, status) ; } diff --git a/STEER/AliQA.h b/STEER/AliQA.h index d1cda92ee77..d39cb9ffb32 100644 --- a/STEER/AliQA.h +++ b/STEER/AliQA.h @@ -10,9 +10,11 @@ // #include +#include class TFile ; #include "AliLog.h" +#include "AliRecoParam.h" class AliQA : public TNamed { public: @@ -24,14 +26,6 @@ public: kNULLTASK=-1, kRAW, kSIM, kREC, kESD, kANA, kNTASK }; enum QABIT_t { kNULLBit=-1, kINFO, kWARNING, kERROR, kFATAL, kNBIT }; - enum RUNTYPE_t { - kNULLTYPE=-1, kUNKOWN, kAUTO_TEST, kCALIBRATION, kCALIBRATION_PULSER, kCHANNEL_DELAY_TUNING, kCOSMIC, kCOSMICS, kDAQ_FO_UNIF_SCAN, - kDAQ_GEN_DAC_SCAN, kDAQ_MEAN_TH_SCAN, kDAQ_MIN_TH_SCAN, kDAQ_NOISY_PIX_SCAN, kDAQ_PIX_DELAY_SCAN, kDAQ_UNIFORMITY_SCAN, - kDCS_FO_UNIF_SCAN, kDCS_MEAN_TH_SCAN, kDCS_MIN_TH_SCAN, kDCS_PIX_DELAY_SCAN, kDCS_UNIFORMITY_SCAN, kDDL_TEST, kGAIN, - kPEDESTAL, kINJECTOR, kLASER, kMONTECARLO, kNOISE, kNOISY_PIX_SCAN, kPHYSICS, kPULSER, kSTANDALONE, kSTANDALONE_BC, - kSTANDALONE_CENTRAL, kSTANDALONE_COSMIC, kSTANDALONE_EMD, kSTANDALONE_LASER, kSTANDALONE_MB, kSTANDALONE_PEDESTAL, - kSTANDALONE_SEMICENTRAL, kSTANDALONE_PULSER, kNTYPE}; - enum TASKINDEX_t { kNULLTASKINDEX=-1, kRAWS, kHITS, kSDIGITS, kDIGITS, kRECPOINTS, kTRACKSEGMENTS, kRECPARTICLES, kESDS, kNTASKINDEX }; @@ -47,7 +41,7 @@ public: static AliQA * Instance(const DETECTORINDEX_t det) ; static AliQA * Instance(const ALITASK_t tsk) ; static AliQA * Instance(const TASKINDEX_t tsk) ; - Bool_t CheckFatal() const ; + Bool_t CheckFatal() const ; static void Close() ; static const char * GetAliTaskName(ALITASK_t tsk) ; static const TString GetExpert() { return fkgExpert ; } @@ -55,7 +49,7 @@ public: static const TString GetLabLocalFile() { return fkgLabLocalFile ; } static const TString GetLabLocalOCDB() { return fkgLabLocalOCDB ; } static const TString GetLabAliEnOCDB() { return fkgLabAliEnOCDB ; } - static DETECTORINDEX_t GetDetIndex(const char * name) ; + static DETECTORINDEX_t GetDetIndex(const char * name) ; static const TString GetDetName(DETECTORINDEX_t det) { return fgDetNames[det] ; } static const char * GetDetName(Int_t det) ; static const TString GetGRPPath() { return fgGRPPath ; } @@ -74,46 +68,54 @@ public: static const char * GetQARefStorage() { return fgQARefDirName.Data() ; } static const char * GetRefOCDBDirName() { return fkgRefOCDBDirName.Data() ; } static const char * GetRefDataDirName() { return fkgRefDataDirName.Data() ; } - static const TString GetRunTypeName(RUNTYPE_t rt = kNULLTYPE) ; - static TASKINDEX_t GetTaskIndex(const char * name) ; + static TASKINDEX_t GetTaskIndex(const char * name) ; static TString GetTaskName(UInt_t tsk) { return fgTaskNames[tsk] ; } - Bool_t IsSet(DETECTORINDEX_t det, ALITASK_t tsk, QABIT_t bit) const ; - Bool_t IsSetAny(DETECTORINDEX_t det, ALITASK_t tsk) const ; - Bool_t IsSetAny(DETECTORINDEX_t det) const ; + Bool_t IsEventSpecieSet(AliRecoParam::EventSpecie_t es) const { return fEventSpecies[(Int_t)TMath::Log2(es)] ; } + Bool_t IsEventSpecieSet(Int_t es) const { return fEventSpecies[es] ; } + Bool_t IsSet(DETECTORINDEX_t det, ALITASK_t tsk, AliRecoParam::EventSpecie_t es, QABIT_t bit) const ; + Bool_t IsSet(DETECTORINDEX_t det, ALITASK_t tsk, Int_t es, QABIT_t bit) const ; + Bool_t IsSetAny(DETECTORINDEX_t det, ALITASK_t tsk, AliRecoParam::EventSpecie_t es) const ; + Bool_t IsSetAny(DETECTORINDEX_t det, AliRecoParam::EventSpecie_t es) const ; void Merge(TCollection * list) ; - void Set(QABIT_t bit) ; + void Set(QABIT_t bit, AliRecoParam::EventSpecie_t es) ; + void Set(QABIT_t bit, Int_t es) ; + void SetEventSpecie(AliRecoParam::EventSpecie_t es) { fEventSpecies[(Int_t)TMath::Log2(es)] = kTRUE ; } static void SetQAResultDirName(const char * name) ; static void SetQARefStorage(const char * name) ; - static void SetQARefDataDirName(RUNTYPE_t rt) { fkgRefDataDirName = GetRunTypeName(rt) ; } - static void SetQARefDataDirName(const char * name) ; - void Show() const { ShowStatus(fDet, fTask) ; } - void Show(DETECTORINDEX_t det) const { ShowStatus(det) ; } + static void SetQARefDataDirName(AliRecoParam::EventSpecie_t es) { fkgRefDataDirName = AliRecoParam::GetEventSpecieName(es) ; } + static void SetQARefDataDirName(Int_t es) { fkgRefDataDirName = AliRecoParam::GetEventSpecieName(es) ; } + void Show() const ; + void Show(DETECTORINDEX_t det) const ; void ShowAll() const ; - void ShowStatus(DETECTORINDEX_t det, ALITASK_t tsk=kNULLTASK) const ; - void UnSet(QABIT_t bit) ; + void ShowStatus(DETECTORINDEX_t det, ALITASK_t tsk=kNULLTASK, AliRecoParam::EventSpecie_t es=AliRecoParam::kDefault) const ; + void UnSet(QABIT_t bit, AliRecoParam::EventSpecie_t es) ; + void UnSet(QABIT_t bit, Int_t es) ; private: Bool_t CheckRange(DETECTORINDEX_t det) const ; Bool_t CheckRange(ALITASK_t tsk) const ; Bool_t CheckRange(QABIT_t bit) const ; + Bool_t CheckRange(AliRecoParam::EventSpecie_t es) const ; const char * GetBitName(QABIT_t bit) const ; - ULong_t GetStatus(DETECTORINDEX_t det) const { return fQA[det] ;} + ULong_t GetStatus(DETECTORINDEX_t det, AliRecoParam::EventSpecie_t es) const { return fQA[det][(Int_t)TMath::Log2(es)] ;} void Finish() const ; ULong_t Offset(ALITASK_t tsk) const ; - void ShowASCIIStatus(DETECTORINDEX_t det, ALITASK_t tsk, ULong_t status) const ; - void ResetStatus(DETECTORINDEX_t det) { fQA[det] = 0 ; } + void ShowASCIIStatus(AliRecoParam::EventSpecie_t es, DETECTORINDEX_t det, ALITASK_t tsk, ULong_t status) const ; + void ResetStatus(DETECTORINDEX_t det) ; void Set(DETECTORINDEX_t det) { fDet = det ;} void Set(ALITASK_t tsk) { fTask = tsk ; AliDebug(1, Form("Ready to set QA status in %s", GetAliTaskName(tsk) )) ; } - void SetStatus(DETECTORINDEX_t det, ULong_t status) { fQA[det] = status ; } - void SetStatusBit(DETECTORINDEX_t det, ALITASK_t tsk, QABIT_t bit) ; - void UnSetStatusBit(DETECTORINDEX_t det, ALITASK_t tsk, QABIT_t bit) ; + void SetStatus(DETECTORINDEX_t det, AliRecoParam::EventSpecie_t es, ULong_t status) { fQA[det][(Int_t)TMath::Log2(es)] = status ; } + void SetStatusBit(DETECTORINDEX_t det, ALITASK_t tsk, AliRecoParam::EventSpecie_t es, QABIT_t bit) ; + void UnSetStatusBit(DETECTORINDEX_t det, ALITASK_t tsk, AliRecoParam::EventSpecie_t es, QABIT_t bit) ; static AliQA * fgQA ; // pointer to the instance of the singleton Int_t fNdet ; // number of detectors - ULong_t * fQA ; //[fNdet] the status word 4 bits for SIM, REC, ESD, ANA each - DETECTORINDEX_t fDet ; //! the current detector (ITS, TPC, ....) - ALITASK_t fTask ; //! the current environment (SIM, REC, ESD, ANA) + Int_t fNEventSpecie ; // number of Event Specie (see AliRecoParam) + ULong_t ** fQA ; //[fNdet][fNEventSpecie] the status word 4 bits for SIM, REC, ESD, ANA each + DETECTORINDEX_t fDet ; //! the current detector (ITS, TPC, ....) + ALITASK_t fTask ; //! the current environment (SIM, REC, ESD, ANA) + AliRecoParam::EventSpecie_t fEventSpecie ; //! the current event specie static TString fgDetNames[] ; //! list of detector names static TString fgGRPPath ; //! path of the GRP object in OCDB static TFile * fgQADataFile ; //! the output file where the quality assurance maker store their results @@ -138,6 +140,7 @@ private: static const TString fkgRefOCDBDirName ; //! name of Reference directory name in OCDB static TString fkgRefDataDirName ; //! name of Reference directory name in OCDB for data static const TString fkgQARefOCDBDefault ; //! default storage for QA in OCDB + Bool_t * fEventSpecies ; //[fNEventSpecie] list of event species encountered in a run ClassDef(AliQA,1) //ALICE Quality Assurance Object }; diff --git a/STEER/AliQAChecker.cxx b/STEER/AliQAChecker.cxx index 21035a801d5..4e90eb42e02 100644 --- a/STEER/AliQAChecker.cxx +++ b/STEER/AliQAChecker.cxx @@ -55,7 +55,8 @@ AliQAChecker::AliQAChecker(const char* name, const char* title) : fRunInfo(0x0), fRunInfoOwner(kFALSE), fRefFile(0x0), - fFoundDetectors(".") + fFoundDetectors("."), + fEventSpecie(AliRecoParam::kDefault) { // ctor: initialise checkers and open the data file for (Int_t det = 0 ; det < AliQA::kNDET ; det++) @@ -69,7 +70,8 @@ AliQAChecker::AliQAChecker(const AliQAChecker& qac) : fRunInfo(qac.fRunInfo), fRunInfoOwner(kFALSE), fRefFile(qac.fRefFile), - fFoundDetectors(qac.fFoundDetectors) + fFoundDetectors(qac.fFoundDetectors), + fEventSpecie(qac.fEventSpecie) { // copy constructor @@ -144,16 +146,15 @@ AliQAChecker::~AliQAChecker() } //_____________________________________________________________________________ -void AliQAChecker::GetRefSubDir(const char * det, const char * task, TDirectory *& dirFile, TObjArray *& dirOCDB) +void AliQAChecker::GetRefSubDir(const char * det, const char * task, TDirectory *& dirFile, TObjArray **& dirOCDB) { // Opens and returns the file with the reference data dirFile = NULL ; - dirOCDB = NULL ; TString refStorage(AliQA::GetQARefStorage()) ; - //refStorage += AliQA::GetQARefFileName() ; if (refStorage.Contains(AliQA::GetLabLocalFile())) { refStorage.ReplaceAll(AliQA::GetLabLocalFile(), "") ; + refStorage += AliQA::GetQARefFileName() ; if ( fRefFile ) if ( fRefFile->IsOpen() ) fRefFile->Close() ; @@ -172,23 +173,30 @@ void AliQAChecker::GetRefSubDir(const char * det, const char * task, TDirectory } } else if (refStorage.Contains(AliQA::GetLabLocalOCDB()) || refStorage.Contains(AliQA::GetLabAliEnOCDB())) { AliCDBManager* man = AliCDBManager::Instance() ; - if ( strcmp(AliQA::GetRefDataDirName(), "") == 0 ) { // the name of the last level of the directory is not set (RUNTYPE) - // Get it from RunInfo - if (!fRunInfo) // not yet set, get the info from GRP - LoadRunInfoFromGRP() ; - AliQA::SetQARefDataDirName(fRunInfo->GetRunType()) ; - } - if ( ! man->GetLock() ) { - man->SetDefaultStorage(AliQA::GetQARefStorage()) ; - man->SetSpecificStorage("*", AliQA::GetQARefStorage()) ; - } - char * detOCDBDir = Form("%s/%s/%s", det, AliQA::GetRefOCDBDirName(), AliQA::GetRefDataDirName()) ; - AliInfo(Form("Reference QA data are taken from %s", detOCDBDir)) ; - AliCDBEntry * entry = man->Get(detOCDBDir, man->GetRun()) ; - if (entry) { - TList * listDetQAD = dynamic_cast(entry->GetObject()) ; - if ( listDetQAD ) - dirOCDB = dynamic_cast(listDetQAD->FindObject(task)) ; + for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) { + if ( !AliQA::Instance()->IsEventSpecieSet(specie) ) + continue ; + //if ( strcmp(AliQA::GetRefDataDirName(), "") == 0 ) { // the name of the last level of the directory is not set (EventSpecie) + // Get it from RunInfo + //if (!fRunInfo) // not yet set, get the info from GRP + // LoadRunInfoFromGRP() ; + AliQA::SetQARefDataDirName(specie) ; + //} + if ( ! man->GetLock() ) { + man->SetDefaultStorage(AliQA::GetQARefStorage()) ; + man->SetSpecificStorage("*", AliQA::GetQARefStorage()) ; + } + char * detOCDBDir = Form("%s/%s/%s", det, AliQA::GetRefOCDBDirName(), AliQA::GetRefDataDirName()) ; + AliCDBEntry * entry = man->Get(detOCDBDir, man->GetRun()) ; + if (entry) { + dirOCDB = new TObjArray*[AliRecoParam::kNSpecies] ; + TList * listDetQAD = dynamic_cast(entry->GetObject()) ; + TIter next(listDetQAD) ; + TObjArray * ar ; + while ( ar = (TObjArray*)next() ) + if ( listDetQAD ) + dirOCDB[specie] = dynamic_cast(listDetQAD->FindObject(Form("%s/%s", task, AliRecoParam::GetEventSpecieName(specie)))) ; + } } } } @@ -265,16 +273,42 @@ void AliQAChecker::LoadRunInfoFromGRP() fRunInfo = new AliRunInfo(lhcState, beamType, beamEnergy, runType, activeDetectors); fRunInfoOwner = kTRUE ; + + // set the event specie + fEventSpecie = AliRecoParam::kDefault ; + if (strcmp(runType,"PHYSICS")) { + // Not a physics run, the event specie is set to kCalib + fEventSpecie = AliRecoParam::kCalib ; + return; + } + if (strcmp(lhcState,"STABLE_BEAMS") == 0) { + // Heavy ion run (any beam tha is not pp, the event specie is set to kHighMult + fEventSpecie = AliRecoParam::kHighMult ; + if ((strcmp(beamType,"p-p") == 0) || + (strcmp(beamType,"p-") == 0) || + (strcmp(beamType,"-p") == 0) || + (strcmp(beamType,"P-P") == 0) || + (strcmp(beamType,"P-") == 0) || + (strcmp(beamType,"-P") == 0)) { + // Proton run, the event specie is set to kLowMult + fEventSpecie = AliRecoParam::kLowMult ; + } + else if (strcmp(beamType,"-") == 0) { + // No beams, we assume cosmic data + fEventSpecie = AliRecoParam::kCosmic ; + } + else if (strcmp(beamType,"UNKNOWN") == 0) { + // No LHC beam information is available, we use the default event specie + fEventSpecie = AliRecoParam::kDefault ; + } + } } //_____________________________________________________________________________ Bool_t AliQAChecker::Run(const char * fileName) { // run the Quality Assurance Checker for all tasks Hits, SDigits, Digits, recpoints, tracksegments, recparticles and ESDs - // starting from data in file - - Bool_t rv = kFALSE ; - + // starting from data in file TStopwatch stopwatch; stopwatch.Start(); @@ -291,9 +325,9 @@ Bool_t AliQAChecker::Run(const char * fileName) for ( det = 0; det < AliQA::kNDET ; det++) { detName = AliQA::GetDetName(det) ; if (detNameQA.Contains(detName)) { - fFoundDetectors+=detName ; - fFoundDetectors+="." ; - break ; + fFoundDetectors+=detName ; + fFoundDetectors+="." ; + break ; } } TDirectory * detDir = AliQA::GetQADataFile(fileName)->GetDirectory(detKey->GetName()) ; @@ -308,34 +342,32 @@ Bool_t AliQAChecker::Run(const char * fileName) taskDir->cd() ; AliQACheckerBase * qac = GetDetQAChecker(det) ; if (qac) - AliInfo(Form("QA checker found for %s", detName.Data())) ; + AliInfo(Form("QA checker found for %s", detName.Data())) ; if (!qac) - AliFatal(Form("QA checker not found for %s", detName.Data())) ; + AliFatal(Form("QA checker not found for %s", detName.Data())) ; AliQA::ALITASK_t index = AliQA::kNULLTASK ; if ( taskName == AliQA::GetTaskName(AliQA::kHITS) ) - index = AliQA::kSIM ; + index = AliQA::kSIM ; if ( taskName == AliQA::GetTaskName(AliQA::kSDIGITS) ) - index = AliQA::kSIM ; + index = AliQA::kSIM ; if ( taskName == AliQA::GetTaskName(AliQA::kDIGITS) ) - index = AliQA::kSIM ; + index = AliQA::kSIM ; if ( taskName == AliQA::GetTaskName(AliQA::kRECPOINTS) ) - index = AliQA::kREC ; + index = AliQA::kREC ; if ( taskName == AliQA::GetTaskName(AliQA::kTRACKSEGMENTS) ) - index = AliQA::kREC ; + index = AliQA::kREC ; if ( taskName == AliQA::GetTaskName(AliQA::kRECPARTICLES) ) - index = AliQA::kREC ; + index = AliQA::kREC ; if ( taskName == AliQA::GetTaskName(AliQA::kESDS) ) - index = AliQA::kESD ; + index = AliQA::kESD ; qac->Init(AliQA::DETECTORINDEX_t(det)) ; - - TDirectory * refDir = NULL ; - TObjArray * refOCDBDir = NULL ; - GetRefSubDir(detNameQA.Data(), taskName.Data(), refDir, refOCDBDir) ; - if ( refDir || refOCDBDir) { + + TDirectory * refDir = NULL ; + TObjArray ** refOCDBDir = NULL ; + GetRefSubDir(detNameQA.Data(), taskName.Data(), refDir, refOCDBDir) ; qac->SetRefandData(refDir, refOCDBDir, taskDir) ; qac->Run(index) ; - } - } + } } AliInfo("QA performed for following detectors:") ; for ( Int_t det = 0; det < AliQA::kNDET; det++) { @@ -345,14 +377,11 @@ Bool_t AliQAChecker::Run(const char * fileName) } } printf("\n") ; - rv = kTRUE ; - - return rv ; - + return kTRUE ; } //_____________________________________________________________________________ -Bool_t AliQAChecker::Run(AliQA::DETECTORINDEX_t det, AliQA::TASKINDEX_t task, TObject * obj) +Bool_t AliQAChecker::Run(AliQA::DETECTORINDEX_t det, AliQA::TASKINDEX_t task, TObjArray ** list) { // run the Quality Assurance Checker for detector det, for task task starting from data in list @@ -380,21 +409,49 @@ Bool_t AliQAChecker::Run(AliQA::DETECTORINDEX_t det, AliQA::TASKINDEX_t task, TO else if ( task == AliQA::kESDS ) index = AliQA::kESD ; - TDirectory * refDir = NULL ; - TObjArray * refOCDBDir = NULL ; - qac->Init(det) ; - GetRefSubDir(AliQA::GetDetName(det), AliQA::GetTaskName(task), refDir, refOCDBDir) ; - if ( refDir || refOCDBDir) // references found - qac->SetRefandData(refDir, refOCDBDir) ; - - TString className(obj->ClassName()) ; - if (className.Contains(TObjArray::Class()->GetName())) { - qac->Run(index, static_cast(obj)) ; - } else if (className.Contains(TNtupleD::Class()->GetName())) { - qac->Run(index, static_cast(obj)) ; - } else { - AliError(Form("%s class not implemented", className.Data())) ; - return kFALSE ; - } + TDirectory * refDir = NULL ; + TObjArray ** refOCDBDir = NULL ; + qac->Init(det) ; + GetRefSubDir(AliQA::GetDetName(det), AliQA::GetTaskName(task), refDir, refOCDBDir) ; + qac->SetRefandData(refDir, refOCDBDir) ; + qac->Run(index, list) ; return kTRUE ; } + +//_____________________________________________________________________________ +Bool_t AliQAChecker::Run(AliQA::DETECTORINDEX_t det, AliQA::TASKINDEX_t task, TNtupleD ** list) +{ + // run the Quality Assurance Checker for detector det, for task task starting from data in list + + AliQACheckerBase * qac = GetDetQAChecker(det) ; + if (qac) + AliDebug(1, Form("QA checker found for %s", AliQA::GetDetName(det).Data())) ; + if (!qac) + AliError(Form("QA checker not found for %s", AliQA::GetDetName(det).Data())) ; + + AliQA::ALITASK_t index = AliQA::kNULLTASK ; + if ( task == AliQA::kRAWS ) + index = AliQA::kRAW ; + else if ( task == AliQA::kHITS ) + index = AliQA::kSIM ; + else if ( task == AliQA::kSDIGITS ) + index = AliQA::kSIM ; + else if ( task == AliQA::kDIGITS ) + index = AliQA::kSIM ; + else if ( task == AliQA::kRECPOINTS ) + index = AliQA::kREC ; + else if ( task == AliQA::kTRACKSEGMENTS ) + index = AliQA::kREC ; + else if ( task == AliQA::kRECPARTICLES ) + index = AliQA::kREC ; + else if ( task == AliQA::kESDS ) + index = AliQA::kESD ; + + TDirectory * refDir = NULL ; + TObjArray ** refOCDBDir = NULL ; + qac->Init(det) ; + GetRefSubDir(AliQA::GetDetName(det), AliQA::GetTaskName(task), refDir, refOCDBDir) ; + qac->SetRefandData(refDir, refOCDBDir) ; + qac->Run(index, list) ; + return kTRUE ; +} diff --git a/STEER/AliQAChecker.h b/STEER/AliQAChecker.h index 01d03e542a2..11fddce85fc 100644 --- a/STEER/AliQAChecker.h +++ b/STEER/AliQAChecker.h @@ -16,8 +16,10 @@ #include #include +class TNtupleD ; #include "AliQA.h" +#include "AliRecoParam.h" class AliCDBEntry ; class AliRunInfo ; class AliQACheckerBase ; @@ -32,27 +34,29 @@ public: static AliQAChecker * Instance() ; AliQACheckerBase * GetDetQAChecker(Int_t det) ; - void GetRefSubDir(const char * det, const char * task, TDirectory *& dirFile, TObjArray *& dirOCDB) ; + void GetRefSubDir(const char * det, const char * task, TDirectory *& dirFile, TObjArray **& dirOCDB) ; // static TFile * GetQAResultFile() ; // static const char * GetQAResultFileName() { return fgQAResultFileName.Data() ; } // void SetQAResultDirName(const char * name) ; // void SetRefDirName(const char * name) ; virtual Bool_t Run(const char * fileName = NULL) ; - virtual Bool_t Run(AliQA::DETECTORINDEX_t det, AliQA::TASKINDEX_t task, TObject * obj = NULL); + virtual Bool_t Run(AliQA::DETECTORINDEX_t det, AliQA::TASKINDEX_t task, TObjArray ** list); + virtual Bool_t Run(AliQA::DETECTORINDEX_t det, AliQA::TASKINDEX_t task, TNtupleD ** list); void SetRunInfo(AliRunInfo * ei) {fRunInfo = ei;} private: void LoadRunInfoFromGRP() ; - static AliQAChecker *fgQAChecker ; // pointer to the instance of the singleton - TFile * fDataFile ; //! Data file to check - AliRunInfo * fRunInfo ; //! Event info object - Bool_t fRunInfoOwner; //! owns fRunInfo or not - TFile * fRefFile ; //! Reference Data file - TString fFoundDetectors ; //! detectors for which the Quality assurance could be done - AliQACheckerBase * fCheckers[AliQA::kNDET] ; //! list of detectors checkers + static AliQAChecker * fgQAChecker ; // pointer to the instance of the singleton + TFile * fDataFile ; //! Data file to check + AliRunInfo * fRunInfo ; //! Event info object + Bool_t fRunInfoOwner; //! owns fRunInfo or not + TFile * fRefFile ; //! Reference Data file + TString fFoundDetectors ; //! detectors for which the Quality assurance could be done + AliQACheckerBase * fCheckers[AliQA::kNDET] ; //! list of detectors checkers + AliRecoParam::EventSpecie_t fEventSpecie ; //! event specie deduced from the GRP data ClassDef(AliQAChecker, 1) // class for running generation, simulation and digitization }; #endif diff --git a/STEER/AliQACheckerBase.cxx b/STEER/AliQACheckerBase.cxx index f644bb92564..07a23c8a303 100644 --- a/STEER/AliQACheckerBase.cxx +++ b/STEER/AliQACheckerBase.cxx @@ -49,9 +49,28 @@ AliQACheckerBase::AliQACheckerBase(const char * name, const char * title) : TNamed(name, title), fDataSubDir(0x0), fRefSubDir(0x0), - fRefOCDBSubDir(0x0) + fRefOCDBSubDir(0x0), + fLowTestValue(0x0), + fUpTestValue(0x0) { // ctor + fLowTestValue = new Float_t[AliQA::kNBIT] ; + fUpTestValue = new Float_t[AliQA::kNBIT] ; + fLowTestValue[AliQA::kINFO] = 0.5 ; + fUpTestValue[AliQA::kINFO] = 1.0 ; + fLowTestValue[AliQA::kWARNING] = 0.002 ; + fUpTestValue[AliQA::kWARNING] = 0.5 ; + fLowTestValue[AliQA::kERROR] = 0.0 ; + fUpTestValue[AliQA::kERROR] = 0.002 ; + fLowTestValue[AliQA::kFATAL] = -1.0 ; + fUpTestValue[AliQA::kFATAL] = 0.0 ; + + AliInfo("Default setting is:") ; + printf( " INFO -> %1.5f < value < %1.5f \n", fLowTestValue[AliQA::kINFO], fUpTestValue[AliQA::kINFO]) ; + printf( " WARNING -> %1.5f < value <= %1.5f \n", fLowTestValue[AliQA::kWARNING], fUpTestValue[AliQA::kWARNING]) ; + printf( " ERROR -> %1.5f < value <= %1.5f \n", fLowTestValue[AliQA::kERROR], fUpTestValue[AliQA::kERROR]) ; + printf( " FATAL -> %1.5f <= value < %1.5f \n", fLowTestValue[AliQA::kFATAL], fUpTestValue[AliQA::kFATAL]) ; + } //____________________________________________________________________________ @@ -59,9 +78,15 @@ AliQACheckerBase::AliQACheckerBase(const AliQACheckerBase& qac) : TNamed(qac.GetName(), qac.GetTitle()), fDataSubDir(qac.fDataSubDir), fRefSubDir(qac.fRefSubDir), - fRefOCDBSubDir(qac.fRefOCDBSubDir) + fRefOCDBSubDir(qac.fRefOCDBSubDir), + fLowTestValue(qac.fLowTestValue), + fUpTestValue(qac.fLowTestValue) { //copy ctor + for (Int_t index = 0 ; index < AliQA::kNBIT ; index++) { + fLowTestValue[index] = qac.fLowTestValue[index] ; + fUpTestValue[index] = qac.fUpTestValue[index] ; + } } @@ -74,99 +99,116 @@ AliQACheckerBase& AliQACheckerBase::operator = (const AliQACheckerBase& qadm ) return *this; } +//____________________________________________________________________________ +AliQACheckerBase::~AliQACheckerBase() +{ + delete [] fLowTestValue ; + delete [] fUpTestValue ; +} + //____________________________________________________________________________ -Double_t AliQACheckerBase::Check(AliQA::ALITASK_t /*index*/) +Double_t * AliQACheckerBase::Check(AliQA::ALITASK_t /*index*/) { // Performs a basic checking // Compares all the histograms stored in the directory // With reference histograms either in a file of in OCDB - Double_t test = 0.0 ; - Int_t count = 0 ; - - if (!fDataSubDir) - test = 1. ; // nothing to check - else - if (!fRefSubDir && !fRefOCDBSubDir) - test = -1 ; // no reference data - else { - TList * keyList = fDataSubDir->GetListOfKeys() ; - TIter next(keyList) ; - TKey * key ; - count = 0 ; - while ( (key = static_cast(next())) ) { - TObject * odata = fRefSubDir->Get(key->GetName()) ; - if ( odata->IsA()->InheritsFrom("TH1") ) { - TH1 * hdata = static_cast(odata) ; - TH1 * href = NULL ; - if (fRefSubDir) - href = static_cast(fRefSubDir->Get(key->GetName())) ; - else if (fRefOCDBSubDir) { - href = static_cast(fRefOCDBSubDir->FindObject(key->GetName())) ; - } - if (!href) - test = -1 ; // no reference data ; - else { - Double_t rv = DiffK(hdata, href) ; - AliInfo(Form("%s ->Test = %f", hdata->GetName(), rv)) ; - test += rv ; - count++ ; - } - } else - AliError(Form("%s Is a Classname that cannot be processed", key->GetClassName())) ; - } - } - - if (count != 0) - test /= count ; - - return test ; + Double_t * test = new Double_t[AliRecoParam::kNSpecies] ; + Int_t count[AliRecoParam::kNSpecies] = { 0 }; + + for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) { + test[specie] = 1.0 ; + if ( !AliQA::Instance()->IsEventSpecieSet(specie) ) + continue ; + if (!fDataSubDir) { + test[specie] = 0. ; // nothing to check + } else if (!fRefSubDir && !fRefOCDBSubDir) { + test[specie] = -1 ; // no reference data + } else { + TList * keyList = fDataSubDir->GetListOfKeys() ; + TIter next(keyList) ; + TKey * key ; + count[specie] = 0 ; + while ( (key = static_cast(next())) ) { + TObject * odata = fRefSubDir->Get(key->GetName()) ; + if ( odata->IsA()->InheritsFrom("TH1") ) { + TH1 * hdata = static_cast(odata) ; + TH1 * href = NULL ; + if (fRefSubDir) + href = static_cast(fRefSubDir->Get(key->GetName())) ; + else if (fRefOCDBSubDir[specie]) { + href = static_cast(fRefOCDBSubDir[specie]->FindObject(key->GetName())) ; + } + if (!href) + test[specie] = -1 ; // no reference data ; + else { + Double_t rv = DiffK(hdata, href) ; + AliInfo(Form("%s ->Test = %f", hdata->GetName(), rv)) ; + test[specie] += rv ; + count[specie]++ ; + } + } else + AliError(Form("%s Is a Classname that cannot be processed", key->GetClassName())) ; + } + if (count[specie] != 0) + test[specie] /= count[specie] ; + } + } + return test ; } //____________________________________________________________________________ -Double_t AliQACheckerBase::Check(AliQA::ALITASK_t /*index*/, TObjArray * list) +Double_t * AliQACheckerBase::Check(AliQA::ALITASK_t /*index*/, TObjArray ** list) { // Performs a basic checking // Compares all the histograms in the list - Double_t test = 0.0 ; - Int_t count = 0 ; - - if (list->GetEntries() == 0) - test = 1. ; // nothing to check - else { - if (!fRefSubDir) - test = -1 ; // no reference data - else { - TIter next(list) ; - TH1 * hdata ; - count = 0 ; - while ( (hdata = dynamic_cast(next())) ) { - if ( hdata) { - TH1 * href = NULL ; - if (fRefSubDir) - href = static_cast(fRefSubDir->Get(hdata->GetName())) ; - else if (fRefOCDBSubDir) - href = static_cast(fRefOCDBSubDir->FindObject(hdata->GetName())) ; - if (!href) - test = -1 ; // no reference data ; - else { - Double_t rv = DiffK(hdata, href) ; - AliInfo(Form("%s ->Test = %f", hdata->GetName(), rv)) ; - test += rv ; - count++ ; - } - } - else - AliError("Data type cannot be processed") ; - } - } - } - if (count != 0) - test /= count ; + Double_t * test = new Double_t[AliRecoParam::kNSpecies] ; + Int_t count[AliRecoParam::kNSpecies] = { 0 }; + + for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) { + test[specie] = 1.0 ; + if ( !AliQA::Instance()->IsEventSpecieSet(specie) ) + continue ; + if (list[specie]->GetEntries() == 0) + test[specie] = 0. ; // nothing to check + else { + if (!fRefSubDir && !fRefOCDBSubDir) + test[specie] = -1 ; // no reference data + else { + TIter next(list[specie]) ; + TH1 * hdata ; + count[specie] = 0 ; + while ( (hdata = dynamic_cast(next())) ) { + if ( hdata) { + if ( hdata->TestBit(AliQA::GetExpertBit()) ) // does not perform the test for expert data + continue ; + TH1 * href = NULL ; + if (fRefSubDir) + href = static_cast(fRefSubDir->Get(hdata->GetName())) ; + else if (fRefOCDBSubDir[specie]) + href = static_cast(fRefOCDBSubDir[specie]->FindObject(hdata->GetName())) ; + if (!href) + test[specie] = -1 ; // no reference data ; + else { + Double_t rv = DiffK(hdata, href) ; + AliInfo(Form("%s ->Test = %f", hdata->GetName(), rv)) ; + test[specie] += rv ; + count[specie]++ ; + } + } + else + AliError("Data type cannot be processed") ; + } + if (count[specie] != 0) + test[specie] /= count[specie] ; + } + } + } return test ; } + //____________________________________________________________________________ Double_t AliQACheckerBase::DiffC(const TH1 * href, const TH1 * hin) const { @@ -191,36 +233,22 @@ Double_t AliQACheckerBase::DiffK(const TH1 * href, const TH1 * hin) const return hin->KolmogorovTest(href) ; } -//____________________________________________________________________________ -void AliQACheckerBase::Init(const AliQA::DETECTORINDEX_t det) -{ - AliQA::Instance(det) ; -} - - //____________________________________________________________________________ -void AliQACheckerBase::Run(AliQA::ALITASK_t index, TObject * obj) +void AliQACheckerBase::Run(AliQA::ALITASK_t index, TObjArray ** list) { AliDebug(1, Form("Processing %s", AliQA::GetAliTaskName(index))) ; - Double_t rv = -1 ; - if ( !obj ) { + Double_t * rv = NULL ; + if ( !list) rv = Check(index) ; - } else { - TString className(obj->IsA()->GetName()) ; - if (className.Contains("TObjArray")) { - rv = Check(index, static_cast(obj)) ; - } else if (className.Contains("TNtupleD")) { - rv = Check(index, static_cast(obj)) ; - } else { - AliError(Form("%s class not implemented", className.Data())) ; - } - } - + else + rv = Check(index, list) ; SetQA(index, rv) ; AliDebug(1, Form("Test result of %s", AliQA::GetAliTaskName(index))) ; + if (rv) + delete [] rv ; Finish() ; } @@ -236,18 +264,43 @@ void AliQACheckerBase::Finish() const } //____________________________________________________________________________ -void AliQACheckerBase::SetQA(AliQA::ALITASK_t index, Double_t value) const +void AliQACheckerBase::SetHiLo(Float_t * hiValue, Float_t * lowValue) { - // sets the QA according the return value of the Check + AliInfo("Previous setting was:") ; + printf( " INFO -> %1.5f < value < %1.5f \n", fLowTestValue[AliQA::kINFO], fUpTestValue[AliQA::kINFO]) ; + printf( " WARNING -> %1.5f < value <= %1.5f \n", fLowTestValue[AliQA::kWARNING], fUpTestValue[AliQA::kWARNING]) ; + printf( " ERROR -> %1.5f < value <= %1.5f \n", fLowTestValue[AliQA::kERROR], fUpTestValue[AliQA::kERROR]) ; + printf( " FATAL -> %1.5f <= value < %1.5f \n", fLowTestValue[AliQA::kFATAL], fUpTestValue[AliQA::kFATAL]) ; + + for (Int_t index = 0 ; index < AliQA::kNBIT ; index++) { + fLowTestValue[index] = lowValue[index] ; + fUpTestValue[index] = hiValue[index] ; + } + AliInfo("Current setting is:") ; + printf( " INFO -> %1.5f < value < %1.5f \n", fLowTestValue[AliQA::kINFO], fUpTestValue[AliQA::kINFO]) ; + printf( " WARNING -> %1.5f < value <= %1.5f \n", fLowTestValue[AliQA::kWARNING], fUpTestValue[AliQA::kWARNING]) ; + printf( " ERROR -> %1.5f < value <= %1.5f \n", fLowTestValue[AliQA::kERROR], fUpTestValue[AliQA::kERROR]) ; + printf( " FATAL -> %1.5f <= value < %1.5f \n", fLowTestValue[AliQA::kFATAL], fUpTestValue[AliQA::kFATAL]) ; +} - AliQA * qa = AliQA::Instance(index) ; +//____________________________________________________________________________ +void AliQACheckerBase::SetQA(AliQA::ALITASK_t index, Double_t * value) const +{ + // sets the QA according the return value of the Check - if ( value <= 0.) - qa->Set(AliQA::kFATAL) ; - else if ( value > 0 && value <= 0.0002 ) - qa->Set(AliQA::kERROR) ; - else if ( value > 0.0002 && value <= 0.5 ) - qa->Set(AliQA::kWARNING) ; - else if ( value > 0.5 && value < 1 ) - qa->Set(AliQA::kINFO) ; + AliQA * qa = AliQA::Instance(index) ; + for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) { + if ( value == NULL ) { // No checker is implemented, set all QA to Fatal + qa->Set(AliQA::kFATAL, specie) ; + } else { + if ( value[specie] >= fLowTestValue[AliQA::kFATAL] && value[specie] < fUpTestValue[AliQA::kFATAL] ) + qa->Set(AliQA::kFATAL, specie) ; + else if ( value[specie] > fLowTestValue[AliQA::kERROR] && value[specie] <= fUpTestValue[AliQA::kERROR] ) + qa->Set(AliQA::kERROR, specie) ; + else if ( value[specie] > fLowTestValue[AliQA::kWARNING] && value[specie] <= fUpTestValue[AliQA::kWARNING] ) + qa->Set(AliQA::kWARNING, specie) ; + else if ( value[specie] > fLowTestValue[AliQA::kINFO] && value[specie] <= fUpTestValue[AliQA::kINFO] ) + qa->Set(AliQA::kINFO, specie) ; + } + } } diff --git a/STEER/AliQACheckerBase.h b/STEER/AliQACheckerBase.h index 4010b90d8b1..74686ea0a65 100644 --- a/STEER/AliQACheckerBase.h +++ b/STEER/AliQACheckerBase.h @@ -32,24 +32,28 @@ public: AliQACheckerBase(const char * name = "", const char * title = "") ; // ctor AliQACheckerBase(const AliQACheckerBase& qac) ; AliQACheckerBase& operator = (const AliQACheckerBase& qac) ; - virtual ~AliQACheckerBase() {;} // dtor + virtual ~AliQACheckerBase() ; // dtor - void Init(const AliQA::DETECTORINDEX_t det) ; - void Run(AliQA::ALITASK_t tsk, TObject * obj = NULL); - void SetRefandData(TDirectory * ref, TObjArray * refOCDB, TDirectory * data=NULL) { fRefSubDir = ref ; fRefOCDBSubDir = refOCDB, fDataSubDir = data ; } + virtual void Init(const AliQA::DETECTORINDEX_t det) { AliQA::Instance(det) ; } + void Run(AliQA::ALITASK_t tsk, TObjArray ** list = NULL); + void Run(AliQA::ALITASK_t /*tsk*/, TNtupleD ** /*nt*/) {;} + void SetHiLo(Float_t * hiValue, Float_t * lowValue) ; + void SetRefandData(TDirectory * ref, TObjArray ** refOCDB, TDirectory * data=NULL) { fRefSubDir = ref ; fRefOCDBSubDir = refOCDB, fDataSubDir = data ; } protected: - virtual Double_t Check(AliQA::ALITASK_t index) ; - virtual Double_t Check(AliQA::ALITASK_t, TObjArray *) ; - virtual Double_t Check(AliQA::ALITASK_t, TNtupleD *) { return -1.0 ;} - Double_t DiffC(const TH1 * href, const TH1 * hin) const ; - Double_t DiffK(const TH1 * href, const TH1 * hin) const ; - void Finish() const ; - virtual void SetQA(AliQA::ALITASK_t index, Double_t value) const ; - - TDirectory * fDataSubDir ; //! directory for the current task directory in the current detector directory in the data file - TDirectory * fRefSubDir ; //! directory for the current task directory in the current detector directory in the reference file - TObjArray * fRefOCDBSubDir ; //! Entry in OCDB for the current detector + virtual Double_t * Check(AliQA::ALITASK_t index) ; + virtual Double_t * Check(AliQA::ALITASK_t, TObjArray **) ; + + Double_t DiffC(const TH1 * href, const TH1 * hin) const ; + Double_t DiffK(const TH1 * href, const TH1 * hin) const ; + void Finish() const ; + virtual void SetQA(AliQA::ALITASK_t index, Double_t * value) const ; + + TDirectory * fDataSubDir ; //! directory for the current task directory in the current detector directory in the data file + TDirectory * fRefSubDir ; //! directory for the current task directory in the current detector directory in the reference file + TObjArray ** fRefOCDBSubDir ; //! Entry in OCDB for the current detector + Float_t * fLowTestValue ; // array of lower bounds for INFO, WARNING, ERROR, FATAL + Float_t * fUpTestValue ; // array of upper bounds for INFO, WARNING, ERROR, FATAL ClassDef(AliQACheckerBase,1) // description diff --git a/STEER/AliQADataMaker.cxx b/STEER/AliQADataMaker.cxx index bbd3da17549..e5bebb90734 100644 --- a/STEER/AliQADataMaker.cxx +++ b/STEER/AliQADataMaker.cxx @@ -30,6 +30,16 @@ #include #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include // --- Standard library --- @@ -52,11 +62,14 @@ AliQADataMaker::AliQADataMaker(const char * name, const char * title) : fCycle(9999999), fCycleCounter(0), fWriteExpert(kFALSE), - fParameterList(0x0), - fRun(0) + fParameterList(new TList*[AliRecoParam::kNSpecies]), + fRun(0), + fEventSpecie(AliRecoParam::kDefault) { // ctor fDetectorDirName = GetName() ; + for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) + fParameterList[specie] = NULL ; } //____________________________________________________________________________ @@ -70,41 +83,54 @@ AliQADataMaker::AliQADataMaker(const AliQADataMaker& qadm) : fCycleCounter(qadm.fCycleCounter), fWriteExpert(qadm.fWriteExpert), fParameterList(qadm.fParameterList), - fRun(qadm.fRun) + fRun(qadm.fRun), + fEventSpecie(qadm.fEventSpecie) { //copy ctor fDetectorDirName = GetName() ; } //____________________________________________________________________________ -Int_t AliQADataMaker::Add2List(TH1 * hist, const Int_t index, TObjArray * list, const Bool_t expert, const Bool_t saveForCorr) +Int_t AliQADataMaker::Add2List(TH1 * hist, const Int_t index, TObjArray ** list, const Bool_t expert, const Bool_t saveForCorr) { // Set histograms memory resident and add to the list // Maximm allowed is 10000 - TString className(hist->ClassName()) ; - if( ! className.BeginsWith("T") ) { - AliError(Form("QA data Object must be a generic ROOT object and not %s", className.Data())) ; -// return -1 ; - } - if ( index > 10000 ) { + + Int_t rv = -1 ; + TClass * classType = hist->Class() ; + TString className(classType->GetName()) ; + if( ! className.BeginsWith("T") && ! classType->InheritsFrom("TH1") ) { + AliError(Form("QA data Object must be a generic ROOT object and derive fom TH1 and not %s", className.Data())) ; + } else if ( index > 10000 ) { AliError("Max number of authorized QA objects is 10000") ; - return -1 ; - } else { - hist->SetDirectory(0) ; - + } else { if (expert) hist->SetBit(AliQA::GetExpertBit()) ; - - list->AddAtAndExpand(hist, index) ; - char * name = Form("%s_%s", list->GetName(), hist->GetName()) ; - TParameter * p = new TParameter(name, 9999.9999) ; - if(saveForCorr) { - if ( ! fParameterList ) - fParameterList = new TList() ; - fParameterList->Add(p) ; + TH1 * histClone[AliRecoParam::kNSpecies] ; + for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) { + histClone[specie] = CloneMe(hist, specie) ; + histClone[specie]->SetDirectory(0) ; + list[specie]->AddAtAndExpand(histClone[specie], index) ; + if(saveForCorr) { + char * name = Form("%s_%s", list[AliRecoParam::kDefault]->GetName(), hist->GetName()) ; + TParameter * p = new TParameter(name, 9999.9999) ; + if ( fParameterList[specie] == NULL ) + fParameterList[specie] = new TList() ; + fParameterList[specie]->Add(p) ; + } } - return list->GetLast() ; + rv = list[AliRecoParam::kDefault]->GetLast() ; } + delete hist ; + return rv ; +} + +//____________________________________________________________________________ +TH1 * AliQADataMaker::CloneMe(TH1 * hist, Int_t specie) const +{ + // clones a histogram + char * name = Form("%s_%s", AliRecoParam::GetEventSpecieName(specie), hist->GetName()) ; + return dynamic_cast(hist->Clone(name)) ; } //____________________________________________________________________________ @@ -114,7 +140,8 @@ void AliQADataMaker::DefaultEndOfDetectorCycle(AliQA::TASKINDEX_t task) // sets the QA result to Fatal AliQA::Instance(AliQA::GetDetIndex(GetName())) ; AliQA * qa = AliQA::Instance(task) ; - qa->Set(AliQA::kFATAL) ; + for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) + qa->Set(AliQA::kFATAL, specie) ; AliQA::GetQAResultFile()->cd() ; qa->Write(AliQA::GetQAName(), kWriteDelete) ; AliQA::GetQAResultFile()->Close() ; @@ -129,17 +156,18 @@ void AliQADataMaker::Finish() const } //____________________________________________________________________________ -TObject * AliQADataMaker::GetData(TObjArray * list, const Int_t index) +TObject * AliQADataMaker::GetData(TObjArray ** list, const Int_t index) { // Returns the QA object at index. Limit is 100. - if (list) { + if (list[AliRecoParam::AConvert(fEventSpecie)]) { if ( index > 10000 ) { AliError("Max number of authorized QA objects is 10000") ; return NULL ; } else { - return list->At(index) ; + Int_t esindex = AliRecoParam::AConvert(fEventSpecie) ; + return list[esindex]->At(index) ; } - } else { + } else { AliError("Data list is NULL !!") ; return NULL ; } diff --git a/STEER/AliQADataMaker.h b/STEER/AliQADataMaker.h index 56b9974f0dc..57a6336ce9f 100644 --- a/STEER/AliQADataMaker.h +++ b/STEER/AliQADataMaker.h @@ -31,6 +31,7 @@ class AliDetectorRecoParam; // --- AliRoot header files --- #include "AliQA.h" +#include "AliRecoParam.h" class AliQADataMaker: public TNamed { @@ -46,9 +47,9 @@ public: virtual Int_t Add2RecPointsList(TH1 * hist, const Int_t index, const Bool_t expert = kFALSE) = 0 ; virtual Int_t Add2RawsList(TH1 * hist, const Int_t index, const Bool_t expert = kFALSE, const Bool_t saveForCorr = kFALSE) = 0 ; virtual Int_t Add2SDigitsList(TH1 * hist, const Int_t index, const Bool_t expert = kFALSE) = 0 ; - virtual void Exec(AliQA::TASKINDEX_t, TObject * data) = 0 ; - virtual void EndOfCycle() = 0 ; - virtual void EndOfCycle(AliQA::TASKINDEX_t) = 0 ; + virtual void Exec(AliQA::TASKINDEX_t, TObject * data) = 0 ; + virtual void EndOfCycle() = 0 ; + virtual void EndOfCycle(AliQA::TASKINDEX_t ) = 0 ; void Finish() const ; virtual TH1 * GetDigitsData(const Int_t index) = 0 ; virtual TH1 * GetESDsData(const Int_t index) = 0 ; @@ -57,27 +58,29 @@ public: virtual TH1 * GetRawsData(const Int_t index) = 0 ; virtual TH1 * GetSDigitsData(const Int_t index) = 0 ; const char * GetDetectorDirName() const { return fDetectorDirName.Data() ; } - TList * GetParameterList() const { return fParameterList ; } - Int_t Increment() { return ++fCycleCounter ; } - virtual TObjArray * Init(AliQA::TASKINDEX_t, Int_t cycles = -1) = 0 ; - virtual void Init(AliQA::TASKINDEX_t, TObjArray * list, Int_t run, Int_t cycles = -1) = 0 ; - Bool_t IsCycleDone() const { return fCycleCounter > fCycle ? kTRUE : kFALSE ; } + TList * GetParameterList() const { return fParameterList[AliRecoParam::AConvert(fEventSpecie)] ; } + Int_t Increment() { return ++fCycleCounter ; } + virtual TObjArray** Init(AliQA::TASKINDEX_t, Int_t cycles = -1) = 0 ; + virtual void Init(AliQA::TASKINDEX_t, TObjArray ** list, Int_t run, Int_t cycles = -1) = 0 ; + Bool_t IsCycleDone() const { return fCycleCounter > fCycle ? kTRUE : kFALSE ; } void Reset() { fCycleCounter = 0 ; } void SetCycle(Int_t nevts) { fCycle = nevts ; } void SetWriteExpert() { fWriteExpert = kTRUE ; } - virtual void StartOfCycle(Int_t run = -1) = 0 ; + virtual void StartOfCycle(Int_t run = -1) = 0 ; virtual void StartOfCycle(AliQA::TASKINDEX_t, Int_t run, const Bool_t sameCycle = kFALSE) = 0 ; void UnSetWriteExpert() { fWriteExpert = kFALSE ; } Bool_t WriteExpert() { return fWriteExpert ; } - - virtual void SetRecoParam(const AliDetectorRecoParam */*param*/) { return; } + void SetEventSpecie(AliRecoParam::EventSpecie_t es) { fEventSpecie = es ; } + void SetEventSpecie(Int_t es) { fEventSpecie = AliRecoParam::Convert(es) ; } + virtual void SetRecoParam(const AliDetectorRecoParam */*param*/) {AliInfo("To be implemented by AliQADataMakerRec, not needed yet in Sim") ; } protected: - Int_t Add2List(TH1 * hist, const Int_t index, TObjArray * list, const Bool_t expert = kFALSE, const Bool_t saveForCorr = kFALSE) ; + Int_t Add2List(TH1 * hist, const Int_t index, TObjArray ** list, const Bool_t expert = kFALSE, const Bool_t saveForCorr = kFALSE) ; + TH1 * CloneMe(TH1 * hist, Int_t specie) const ; virtual void DefaultEndOfDetectorCycle(AliQA::TASKINDEX_t task ) ; - virtual void EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray * obj ) = 0 ; - TObject * GetData(TObjArray * list, const Int_t index) ; + virtual void EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray ** list ) = 0 ; + TObject * GetData(TObjArray ** list, const Int_t index) ; virtual void InitDigits() = 0 ; virtual void InitESDs() = 0 ; virtual void InitHits() = 0 ; @@ -107,9 +110,9 @@ protected: Int_t fCycle ; //! length (# events) of the QA data acquisition cycle Int_t fCycleCounter ; //! cycle counter Bool_t fWriteExpert ; //! flag to write or not the expert QA data - TList * fParameterList ; //! list of QA data parameters + TList ** fParameterList ; //! list of QA data parameters Int_t fRun ; //! run number - + AliRecoParam::EventSpecie_t fEventSpecie ; //! event specie, see AliRecoParam private: AliQADataMaker& operator = (const AliQADataMaker& /*qadm*/); // Not implemented diff --git a/STEER/AliQADataMakerRec.cxx b/STEER/AliQADataMakerRec.cxx index 93e2981214c..0a0dafbe502 100644 --- a/STEER/AliQADataMakerRec.cxx +++ b/STEER/AliQADataMakerRec.cxx @@ -26,6 +26,7 @@ // --- ROOT system --- #include #include +#include // --- Standard library --- @@ -43,7 +44,7 @@ AliQADataMakerRec::AliQADataMakerRec(const char * name, const char * title) : fESDsQAList(NULL), fRawsQAList(NULL), fRecPointsQAList(NULL), - fObject(NULL), + fCorrNt(NULL), fRecoParam(NULL) { // ctor @@ -56,7 +57,7 @@ AliQADataMakerRec::AliQADataMakerRec(const AliQADataMakerRec& qadm) : fESDsQAList(qadm.fESDsQAList), fRawsQAList(qadm.fRawsQAList), fRecPointsQAList(qadm.fRecPointsQAList), - fObject(qadm.fObject), + fCorrNt(qadm.fCorrNt), fRecoParam(qadm.fRecoParam) { //copy ctor @@ -70,19 +71,31 @@ AliQADataMakerRec::~AliQADataMakerRec() { //dtor: delete the TObjArray and thei content if ( fESDsQAList ) { - if ( fESDsQAList->IsOwner() ) - fESDsQAList->Delete() ; - delete fESDsQAList ; + for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) { + if ( fESDsQAList[specie] ) { + if ( fESDsQAList[specie]->IsOwner() ) + fESDsQAList[specie]->Delete() ; + } + } + delete[] fESDsQAList ; } if ( fRawsQAList ) { - if ( fRawsQAList->IsOwner() ) - fRawsQAList->Delete() ; - delete fRawsQAList ; - } + for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) { + if ( fRawsQAList[specie] ) { + if ( fRawsQAList[specie]->IsOwner() ) + fRawsQAList[specie]->Delete() ; + } + } + delete[] fRawsQAList ; + } if ( fRecPointsQAList ) { - if ( fRecPointsQAList->IsOwner() ) - fRecPointsQAList->Delete() ; - delete fRecPointsQAList ; + for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) { + if ( fRecPointsQAList[specie] ) { + if ( fRecPointsQAList[specie]->IsOwner() ) + fRecPointsQAList[specie]->Delete() ; + } + } + delete[] fRecPointsQAList ; } } @@ -110,7 +123,7 @@ void AliQADataMakerRec::EndOfCycle(AliQA::TASKINDEX_t task) { // Finishes a cycle of QA - TObjArray * list = NULL ; + TObjArray ** list = NULL ; if ( task == AliQA::kRAWS ) list = fRawsQAList ; @@ -120,7 +133,7 @@ void AliQADataMakerRec::EndOfCycle(AliQA::TASKINDEX_t task) list = fESDsQAList ; - if ( ! list && ! fObject ) + if ( ! list && ! fCorrNt ) return ; //DefaultEndOfDetectorCycle(task) ; EndOfDetectorCycle(task, list) ; @@ -129,30 +142,38 @@ void AliQADataMakerRec::EndOfCycle(AliQA::TASKINDEX_t task) subDir = fDetectorDir->GetDirectory(AliQA::GetTaskName(task)) ; if ( subDir ) { subDir->cd() ; - if (list) { - TIter next(list) ; - TObject * obj ; - while( (obj = next()) ) { - if (!obj->TestBit(AliQA::GetExpertBit())) - obj->Write() ; - } - if (WriteExpert()) { - TDirectory * expertDir = subDir->GetDirectory(AliQA::GetExpert()) ; - if ( expertDir ) { // Write only if requested - expertDir->cd() ; - next.Reset() ; + for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) { + TDirectory * eventSpecieDir = subDir->GetDirectory(AliRecoParam::GetEventSpecieName(specie)) ; + if (eventSpecieDir) { + eventSpecieDir->cd() ; + if (list[specie]) { + TIter next(list[specie]) ; + TObject * obj ; while( (obj = next()) ) { if (!obj->TestBit(AliQA::GetExpertBit())) - continue ; - obj->Write() ; - } + obj->Write() ; + } + if (WriteExpert()) { + TDirectory * expertDir = eventSpecieDir->GetDirectory(AliQA::GetExpert()) ; + if ( expertDir ) { // Write only if requested + expertDir->cd() ; + next.Reset() ; + while( (obj = next()) ) { + if (!obj->TestBit(AliQA::GetExpertBit())) + continue ; + obj->Write() ; + } + } + } + } + if ( !fCorrNt ) + continue ; + if (fCorrNt[specie] && AliQA::GetDetIndex(GetName()) == AliQA::kCORR) { + eventSpecieDir->cd() ; + fCorrNt[specie]->Write() ; } } } - if (fObject && AliQA::GetDetIndex(GetName()) == AliQA::kCORR) { - subDir->cd() ; - fObject->Write() ; - } fOutput->Save() ; } } @@ -188,43 +209,51 @@ void AliQADataMakerRec::Exec(AliQA::TASKINDEX_t task, TObject * data) } //____________________________________________________________________________ -TObjArray * AliQADataMakerRec::Init(AliQA::TASKINDEX_t task, Int_t cycles) +TObjArray ** AliQADataMakerRec::Init(AliQA::TASKINDEX_t task, Int_t cycles) { // general intialisation - - TObjArray * rv = NULL ; + + TObjArray ** rv = NULL ; if (cycles > 0) SetCycle(cycles) ; if ( task == AliQA::kRAWS ) { if (! fRawsQAList ) { - fRawsQAList = new TObjArray(100) ; - fRawsQAList->SetName(Form("%s_%s", GetName(), AliQA::GetTaskName(task).Data())) ; + fRawsQAList = new TObjArray *[AliRecoParam::kNSpecies] ; + for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) { + fRawsQAList[specie] = new TObjArray(100) ; + fRawsQAList[specie]->SetName(Form("%s_%s_%s", GetName(), AliQA::GetTaskName(task).Data(), AliRecoParam::GetEventSpecieName(specie))) ; + } InitRaws() ; } rv = fRawsQAList ; } else if ( task == AliQA::kRECPOINTS ) { if ( ! fRecPointsQAList ) { - fRecPointsQAList = new TObjArray(100) ; - fRecPointsQAList->SetName(Form("%s_%s", GetName(), AliQA::GetTaskName(task).Data())) ; - InitRecPoints() ; + fRecPointsQAList = new TObjArray *[AliRecoParam::kNSpecies] ; + for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) { + fRecPointsQAList[specie] = new TObjArray(100) ; + fRecPointsQAList[specie]->SetName(Form("%s_%s_%s", GetName(), AliQA::GetTaskName(task).Data(), AliRecoParam::GetEventSpecieName(specie))) ; + } + InitRecPoints() ; } rv = fRecPointsQAList ; } else if ( task == AliQA::kESDS ) { if ( ! fESDsQAList ) { - fESDsQAList = new TObjArray(100) ; - fESDsQAList->SetName(Form("%s_%s", GetName(), AliQA::GetTaskName(task).Data())) ; + fESDsQAList = new TObjArray *[AliRecoParam::kNSpecies] ; + for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) { + fESDsQAList[specie] = new TObjArray(100) ; + fESDsQAList[specie]->SetName(Form("%s_%s", GetName(), AliQA::GetTaskName(task).Data(), AliRecoParam::GetEventSpecieName(specie))) ; + } InitESDs() ; } rv = fESDsQAList ; } - return rv ; } //____________________________________________________________________________ -void AliQADataMakerRec::Init(AliQA::TASKINDEX_t task, TObjArray * list, Int_t run, Int_t cycles) +void AliQADataMakerRec::Init(AliQA::TASKINDEX_t task, TObjArray ** list, Int_t run, Int_t cycles) { // Intialisation by passing the list of QA data booked elsewhere @@ -274,13 +303,14 @@ void AliQADataMakerRec::StartOfCycle(AliQA::TASKINDEX_t task, Int_t run, const B TDirectory * subDir = fDetectorDir->GetDirectory(AliQA::GetTaskName(task)) ; if (!subDir) subDir = fDetectorDir->mkdir(AliQA::GetTaskName(task)) ; - - TDirectory * expertDir = subDir->GetDirectory(AliQA::GetExpert()) ; - if (!expertDir) - expertDir = subDir->mkdir(AliQA::GetExpert()) ; - subDir->cd() ; - - + for ( Int_t specie = AliRecoParam::kDefault ; specie < AliRecoParam::kNSpecies ; specie++ ) { + TDirectory * eventSpecieDir = subDir->GetDirectory(AliRecoParam::GetEventSpecieName(specie)) ; + if (!eventSpecieDir) + eventSpecieDir = subDir->mkdir(AliRecoParam::GetEventSpecieName(specie)) ; + TDirectory * expertDir = eventSpecieDir->GetDirectory(AliQA::GetExpert()) ; + if (!expertDir) + expertDir = eventSpecieDir->mkdir(AliQA::GetExpert()) ; + } StartOfDetectorCycle() ; } diff --git a/STEER/AliQADataMakerRec.h b/STEER/AliQADataMakerRec.h index 925f555c062..e4a5659384a 100644 --- a/STEER/AliQADataMakerRec.h +++ b/STEER/AliQADataMakerRec.h @@ -14,7 +14,7 @@ // // --- ROOT system --- - +class TNtupleD ; // --- Standard library --- // --- AliRoot header files --- @@ -39,15 +39,15 @@ public: virtual void Exec(AliQA::TASKINDEX_t task, TObject * data) ; virtual void EndOfCycle() ; virtual void EndOfCycle(AliQA::TASKINDEX_t task) ; - virtual void EndOfDetectorCycle(AliQA::TASKINDEX_t, TObjArray * ) {AliInfo("To be implemented by detectors");} - virtual TH1 * GetDigitsData(const Int_t /*index*/) { return NULL ; } - virtual TH1 * GetESDsData(const Int_t index) { return dynamic_cast(GetData(fESDsQAList, index)) ; } - virtual TH1 * GetHitsData(const Int_t /*index*/) { return NULL ; } - virtual TH1 * GetRecPointsData(const Int_t index) { return dynamic_cast(GetData(fRecPointsQAList, index)) ; } - virtual TH1 * GetRawsData(const Int_t index) { return fRawsQAList ? dynamic_cast(GetData(fRawsQAList, index)) : NULL ; } + virtual void EndOfDetectorCycle(AliQA::TASKINDEX_t, TObjArray ** ) {AliInfo("To be implemented by detectors");} + virtual TH1 * GetDigitsData(const Int_t /*index*/) { return NULL ; } + virtual TH1 * GetESDsData(const Int_t index) { return dynamic_cast(GetData(fESDsQAList, index)) ; } + virtual TH1 * GetHitsData(const Int_t /*index*/) { return NULL ; } + virtual TH1 * GetRecPointsData(const Int_t index) { return dynamic_cast(GetData(fRecPointsQAList, index)) ; } + virtual TH1 * GetRawsData(const Int_t index) { return dynamic_cast(GetData(fRawsQAList, index)) ; } virtual TH1 * GetSDigitsData(const Int_t /*index*/) { return NULL ; } - virtual TObjArray * Init(AliQA::TASKINDEX_t task, Int_t cycles = -1) ; - virtual void Init(AliQA::TASKINDEX_t task, TObjArray * list, Int_t run, Int_t cycles = -1) ; + virtual TObjArray** Init(AliQA::TASKINDEX_t task, Int_t cycles = -1) ; + virtual void Init(AliQA::TASKINDEX_t task, TObjArray ** list, Int_t run, Int_t cycles = -1) ; virtual void StartOfCycle(Int_t run = -1) ; virtual void StartOfCycle(AliQA::TASKINDEX_t task, Int_t run, const Bool_t sameCycle = kFALSE) ; @@ -75,10 +75,10 @@ protected: virtual void MakeSDigits(TTree * ) {AliWarning("Call not valid") ; } virtual void StartOfDetectorCycle() {AliInfo("To be implemented by detectors");} - TObjArray * fESDsQAList ; //! list of the ESDs QA data objects - TObjArray * fRawsQAList ; //! list of the raws QA data objects - TObjArray * fRecPointsQAList ; //! list of the RecPoints QA data objects - TObject * fObject ; //! This is used by Corr only to hold its Ntuple. Allows to write something else than TH1 to QA data file + TObjArray * * fESDsQAList ; //! list of the ESDs QA data objects + TObjArray * * fRawsQAList ; //! list of the raws QA data objects + TObjArray * * fRecPointsQAList ; //! list of the RecPoints QA data objects + TNtupleD * * fCorrNt ; //! This is used by Corr only to hold its Ntuple. const AliDetectorRecoParam *fRecoParam; //! const pointer to the reco parameters to be used in the reco QA ClassDef(AliQADataMakerRec,2) // description diff --git a/STEER/AliQADataMakerSim.cxx b/STEER/AliQADataMakerSim.cxx index 128ef56b8c1..45b516e0689 100644 --- a/STEER/AliQADataMakerSim.cxx +++ b/STEER/AliQADataMakerSim.cxx @@ -63,19 +63,25 @@ AliQADataMakerSim::~AliQADataMakerSim() { //dtor: delete the TObjArray and thei content if ( fDigitsQAList ) { - if ( fDigitsQAList->IsOwner() ) - fDigitsQAList->Delete() ; - delete fDigitsQAList ; + for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) { + if ( fDigitsQAList[specie]->IsOwner() ) + fDigitsQAList[specie]->Delete() ; + } + delete[] fDigitsQAList ; } if ( fHitsQAList ) { - if ( fHitsQAList->IsOwner() ) - fHitsQAList->Delete() ; - delete fHitsQAList ; + for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) { + if ( fHitsQAList[specie]->IsOwner() ) + fHitsQAList[specie]->Delete() ; + } + delete[] fHitsQAList ; } if ( fSDigitsQAList ) { - if ( fSDigitsQAList->IsOwner() ) - fSDigitsQAList->Delete() ; - delete fSDigitsQAList ; + for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) { + if ( fSDigitsQAList[specie]->IsOwner() ) + fSDigitsQAList[specie]->Delete() ; + } + delete[] fSDigitsQAList ; } } @@ -102,7 +108,7 @@ void AliQADataMakerSim::EndOfCycle() void AliQADataMakerSim::EndOfCycle(AliQA::TASKINDEX_t task) { // Finishes a cycle of QA data acquistion - TObjArray * list = 0x0 ; + TObjArray ** list = NULL ; if ( task == AliQA::kHITS ) list = fHitsQAList ; @@ -119,26 +125,32 @@ void AliQADataMakerSim::EndOfCycle(AliQA::TASKINDEX_t task) subDir = fDetectorDir->GetDirectory(AliQA::GetTaskName(task)) ; if (subDir) { subDir->cd() ; - TIter next(list) ; - TH1 * obj ; - while ( (obj = dynamic_cast(next())) ) { - if (!obj->TestBit(AliQA::GetExpertBit())) - obj->Write() ; - } - if (WriteExpert()) { - TDirectory * expertDir = subDir->GetDirectory(AliQA::GetExpert()) ; - if ( expertDir ) { - expertDir->cd() ; - next.Reset() ; - while ( (obj = dynamic_cast(next())) ) { + for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) { + TDirectory * eventSpecieDir = subDir->GetDirectory(AliRecoParam::GetEventSpecieName(specie)) ; + if (eventSpecieDir) { + eventSpecieDir->cd() ; + TIter next(list[specie]) ; + TObject * obj ; + while ( (obj = next()) ) { if (!obj->TestBit(AliQA::GetExpertBit())) - continue ; - obj->Write() ; - } + obj->Write() ; + } + if (WriteExpert()) { + TDirectory * expertDir = eventSpecieDir->GetDirectory(AliQA::GetExpert()) ; + if ( expertDir ) { + expertDir->cd() ; + next.Reset() ; + while ( (obj = next()) ) { + if (!obj->TestBit(AliQA::GetExpertBit())) + continue ; + obj->Write() ; + } + } + } } } + fOutput->Save() ; } - fOutput->Save() ; ResetCycle() ; } @@ -190,31 +202,40 @@ void AliQADataMakerSim::Exec(AliQA::TASKINDEX_t task, TObject * data) } //____________________________________________________________________________ -TObjArray * AliQADataMakerSim::Init(AliQA::TASKINDEX_t task, Int_t cycles) +TObjArray ** AliQADataMakerSim::Init(AliQA::TASKINDEX_t task, Int_t cycles) { // general intialisation if (cycles > 0) SetCycle(cycles) ; - TObjArray * rv = NULL ; + TObjArray ** rv = NULL ; if ( task == AliQA::kHITS ) { if ( ! fHitsQAList ) { - fHitsQAList = new TObjArray(100) ; - fHitsQAList->SetName(Form("%s/%s", GetName(), AliQA::GetTaskName(task).Data())) ; + fHitsQAList = new TObjArray *[AliRecoParam::kNSpecies] ; + for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) { + fHitsQAList[specie] = new TObjArray(100) ; + fHitsQAList[specie]->SetName(Form("%s_%s_%s", GetName(), AliQA::GetTaskName(task).Data(), AliRecoParam::GetEventSpecieName(specie))) ; + } InitHits() ; } rv = fHitsQAList ; } else if ( task == AliQA::kSDIGITS ) { if ( ! fSDigitsQAList ) { - fSDigitsQAList = new TObjArray(100) ; - fSDigitsQAList->SetName(Form("%s/%s", GetName(), AliQA::GetTaskName(task).Data())) ; - InitSDigits() ; + fSDigitsQAList = new TObjArray *[AliRecoParam::kNSpecies] ; + for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) { + fSDigitsQAList[specie] = new TObjArray(100) ; + fSDigitsQAList[specie]->SetName(Form("%s_%s_%s", GetName(), AliQA::GetTaskName(task).Data(), AliRecoParam::GetEventSpecieName(specie))) ; + } + InitSDigits() ; } rv = fSDigitsQAList ; } else if ( task == AliQA::kDIGITS ) { if ( ! fDigitsQAList ) { - fDigitsQAList = new TObjArray(100) ; - fDigitsQAList->SetName(Form("%s/%s", GetName(), AliQA::GetTaskName(task).Data())) ; + fDigitsQAList = new TObjArray *[AliRecoParam::kNSpecies] ; + for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) { + fDigitsQAList[specie] = new TObjArray(100) ; + fDigitsQAList[specie]->SetName(Form("%s_%s_%s", GetName(), AliQA::GetTaskName(task).Data(), AliRecoParam::GetEventSpecieName(specie))) ; + } InitDigits() ; } rv = fDigitsQAList ; @@ -224,7 +245,7 @@ TObjArray * AliQADataMakerSim::Init(AliQA::TASKINDEX_t task, Int_t cycles) } //____________________________________________________________________________ -void AliQADataMakerSim::Init(AliQA::TASKINDEX_t task, TObjArray * list, Int_t run, Int_t cycles) +void AliQADataMakerSim::Init(AliQA::TASKINDEX_t task, TObjArray ** list, Int_t run, Int_t cycles) { // Intialisation by passing the list of QA data booked elsewhere @@ -276,11 +297,13 @@ void AliQADataMakerSim::StartOfCycle(AliQA::TASKINDEX_t task, Int_t run, const B if (!subDir) subDir = fDetectorDir->mkdir(AliQA::GetTaskName(task)) ; - TDirectory * expertDir = subDir->GetDirectory(AliQA::GetExpert()) ; - if (!expertDir) - expertDir = subDir->mkdir(AliQA::GetExpert()) ; - - subDir->cd() ; - + for ( Int_t index = AliRecoParam::kDefault ; index < AliRecoParam::kNSpecies ; index++ ) { + TDirectory * eventSpecieDir = subDir->GetDirectory(AliRecoParam::GetEventSpecieName(index)) ; + if (!eventSpecieDir) + eventSpecieDir = subDir->mkdir(AliRecoParam::GetEventSpecieName(index)) ; + TDirectory * expertDir = eventSpecieDir->GetDirectory(AliQA::GetExpert()) ; + if (!expertDir) + expertDir = eventSpecieDir->mkdir(AliQA::GetExpert()) ; + } StartOfDetectorCycle() ; } diff --git a/STEER/AliQADataMakerSim.h b/STEER/AliQADataMakerSim.h index 0abc60759d4..99bc0be53fb 100644 --- a/STEER/AliQADataMakerSim.h +++ b/STEER/AliQADataMakerSim.h @@ -37,15 +37,15 @@ public: virtual void Exec(AliQA::TASKINDEX_t task, TObject * data) ; virtual void EndOfCycle() ; virtual void EndOfCycle(AliQA::TASKINDEX_t task) ; - virtual void EndOfDetectorCycle(AliQA::TASKINDEX_t, TObjArray * ) {AliInfo("To be implemented by detectors");} + virtual void EndOfDetectorCycle(AliQA::TASKINDEX_t, TObjArray ** ) {AliInfo("To be implemented by detectors");} virtual TH1 * GetDigitsData(const Int_t index) { return dynamic_cast(GetData(fDigitsQAList, index)) ; } virtual TH1 * GetESDsData(const Int_t /*index*/) { return NULL ; } virtual TH1 * GetHitsData(const Int_t index) { return dynamic_cast(GetData(fHitsQAList, index)) ; } virtual TH1 * GetRecPointsData(const Int_t /*index*/) { return NULL ; } virtual TH1 * GetRawsData(const Int_t /*index*/) { return NULL ; } virtual TH1 * GetSDigitsData(const Int_t index) { return dynamic_cast(GetData(fSDigitsQAList, index)) ; } - virtual TObjArray * Init(AliQA::TASKINDEX_t task, Int_t cycles = -1) ; - virtual void Init(AliQA::TASKINDEX_t task, TObjArray * list, Int_t run, Int_t cycles = -1) ; + virtual TObjArray** Init(AliQA::TASKINDEX_t task, Int_t cycles = -1) ; + virtual void Init(AliQA::TASKINDEX_t task, TObjArray ** list, Int_t run, Int_t cycles = -1) ; virtual void StartOfCycle(Int_t run = -1) ; virtual void StartOfCycle(AliQA::TASKINDEX_t task, Int_t run, const Bool_t sameCycle = kFALSE) ; @@ -68,9 +68,9 @@ protected: virtual void MakeSDigits(TTree * ) {AliInfo("To be implemented by detectors");} virtual void StartOfDetectorCycle() {AliInfo("To be implemented by detectors");} - TObjArray * fDigitsQAList ; //! list of the digits QA data objects - TObjArray * fHitsQAList ; //! list of the hits QA data objects - TObjArray * fSDigitsQAList ; //! list of the sdigits QA data objects + TObjArray * * fDigitsQAList ; //! list of the digits QA data objects + TObjArray * * fHitsQAList ; //! list of the hits QA data objects + TObjArray * * fSDigitsQAList ; //! list of the sdigits QA data objects ClassDef(AliQADataMakerSim,1) // description diff --git a/STEER/AliQADataMakerSteer.cxx b/STEER/AliQADataMakerSteer.cxx index 0c5a1aaf54b..f928b7a4bfd 100644 --- a/STEER/AliQADataMakerSteer.cxx +++ b/STEER/AliQADataMakerSteer.cxx @@ -80,7 +80,8 @@ AliQADataMakerSteer::AliQADataMakerSteer(const Char_t * mode, const Char_t* gAli fRawReader(NULL), fRawReaderDelete(kTRUE), fRunLoader(NULL), - fTasks("") + fTasks(""), + fEventSpecie(AliRecoParam::kDefault) { // default ctor fMaxEvents = fNumberOfEvents ; @@ -89,7 +90,7 @@ AliQADataMakerSteer::AliQADataMakerSteer(const Char_t * mode, const Char_t* gAli fLoader[iDet] = NULL ; fQADataMaker[iDet] = NULL ; fQACycles[iDet] = 999999 ; - fQAWriteExpert[iDet] = kFALSE ; + fQAWriteExpert[iDet] = kTRUE ; } } } @@ -113,7 +114,8 @@ AliQADataMakerSteer::AliQADataMakerSteer(const AliQADataMakerSteer & qas) : fRawReader(NULL), fRawReaderDelete(kTRUE), fRunLoader(NULL), - fTasks(qas.fTasks) + fTasks(qas.fTasks), + fEventSpecie(qas.fEventSpecie) { // cpy ctor for (UInt_t iDet = 0; iDet < fgkNDetectors; iDet++) { @@ -181,7 +183,7 @@ Bool_t AliQADataMakerSteer::DoIt(const AliQA::TASKINDEX_t taskIndex) AliQADataMaker * qadm = GetQADataMaker(iDet) ; if (!qadm) continue; // This detector doesn't have any QA (for example, HLT) if ( qadm->IsCycleDone() ) { - qadm->EndOfCycle(taskIndex) ; + qadm->EndOfCycle(taskIndex) ; } TTree * data = NULL ; AliLoader* loader = GetLoader(qadm->GetUniqueID()); @@ -265,7 +267,8 @@ Bool_t AliQADataMakerSteer::Finish(const AliQA::TASKINDEX_t taskIndex) for (UInt_t iDet = 0; iDet < fgkNDetectors ; iDet++) { if (IsSelected(AliQA::GetDetName(iDet))) { AliQADataMaker * qadm = GetQADataMaker(iDet) ; - if (qadm) qadm->EndOfCycle(taskIndex) ; + if (qadm) + qadm->EndOfCycle(taskIndex) ; } } return kTRUE ; @@ -337,12 +340,14 @@ AliLoader * AliQADataMakerSteer::GetLoader(Int_t iDet) } //_____________________________________________________________________________ -AliQADataMaker * AliQADataMakerSteer::GetQADataMaker(const Int_t iDet) +AliQADataMaker * AliQADataMakerSteer::GetQADataMaker(const Int_t iDet) { // get the quality assurance data maker for a detector - if (fQADataMaker[iDet]) + if (fQADataMaker[iDet]) { + fQADataMaker[iDet]->SetEventSpecie(fEventSpecie) ; return fQADataMaker[iDet] ; + } AliQADataMaker * qadm = NULL ; @@ -351,6 +356,7 @@ AliQADataMaker * AliQADataMakerSteer::GetQADataMaker(const Int_t iDet) qadm->SetName(AliQA::GetDetName(iDet)); qadm->SetUniqueID(iDet); fQADataMaker[iDet] = qadm; + qadm->SetEventSpecie(fEventSpecie) ; return qadm; } @@ -359,6 +365,7 @@ AliQADataMaker * AliQADataMakerSteer::GetQADataMaker(const Int_t iDet) qadm->SetName(AliQA::GetDetName(iDet)); qadm->SetUniqueID(iDet); fQADataMaker[iDet] = qadm; + qadm->SetEventSpecie(fEventSpecie) ; return qadm; } @@ -393,9 +400,10 @@ AliQADataMaker * AliQADataMakerSteer::GetQADataMaker(const Int_t iDet) qadm->SetName(AliQA::GetDetName(iDet)); qadm->SetUniqueID(iDet); fQADataMaker[iDet] = qadm ; + qadm->SetEventSpecie(fEventSpecie) ; } - - return qadm ; + + return qadm ; } //_____________________________________________________________________________ @@ -523,15 +531,14 @@ Bool_t AliQADataMakerSteer::Init(const AliQA::TASKINDEX_t taskIndex, const char if ( ! AliGeomManager::GetGeometry() ) AliGeomManager::LoadGeometry() ; - InitQADataMaker(fRunNumber, fRecoParam, detArray) ; //, fCycleSame, kTRUE, detArray) ; + InitQADataMaker(fRunNumber, detArray) ; //, fCycleSame, kTRUE, detArray) ; return kTRUE ; } //_____________________________________________________________________________ -void AliQADataMakerSteer::InitQADataMaker(UInt_t run, const AliRecoParam & par, TObjArray * detArray) +void AliQADataMakerSteer::InitQADataMaker(UInt_t run, TObjArray * detArray) { // Initializes The QADataMaker for all active detectors and for all active tasks - for (UInt_t iDet = 0; iDet < fgkNDetectors ; iDet++) { if (IsSelected(AliQA::GetDetName(iDet))) { AliQADataMaker * qadm = GetQADataMaker(iDet) ; @@ -539,6 +546,8 @@ void AliQADataMakerSteer::InitQADataMaker(UInt_t run, const AliRecoParam & par, AliError(Form("AliQADataMaker not found for %s", AliQA::GetDetName(iDet))) ; fDetectorsW.ReplaceAll(AliQA::GetDetName(iDet), "") ; } else { + if (fQAWriteExpert[iDet]) + qadm->SetWriteExpert() ; AliDebug(1, Form("Data Maker found for %s", qadm->GetName())) ; // skip non active detectors if (detArray) { @@ -548,12 +557,11 @@ void AliQADataMakerSteer::InitQADataMaker(UInt_t run, const AliRecoParam & par, } if (fQAWriteExpert[iDet]) qadm->SetWriteExpert() ; // Set default reco params - qadm->SetRecoParam(par.GetDetRecoParam(iDet)); Bool_t sameCycle = kFALSE ; for (UInt_t taskIndex = 0; taskIndex < AliQA::kNTASKINDEX; taskIndex++) { if ( fTasks.Contains(Form("%d", taskIndex)) ) { - qadm->StartOfCycle(AliQA::GetTaskIndex(AliQA::GetTaskName(taskIndex)), run, sameCycle) ; qadm->Init(AliQA::GetTaskIndex(AliQA::GetTaskName(taskIndex)), GetQACycles(qadm->GetUniqueID())) ; + qadm->StartOfCycle(AliQA::GetTaskIndex(AliQA::GetTaskName(taskIndex)), run, sameCycle) ; sameCycle = kTRUE ; } } @@ -877,6 +885,7 @@ void AliQADataMakerSteer::RunOneEvent(AliRawReader * rawReader) qadm->EndOfCycle() ; } AliCodeTimerStart(Form("running RAW quality assurance data maker for %s", AliQA::GetDetName(iDet))); + qadm->SetEventSpecie(fEventSpecie) ; qadm->Exec(AliQA::kRAWS, rawReader) ; AliCodeTimerStop(Form("running RAW quality assurance data maker for %s", AliQA::GetDetName(iDet))); } @@ -927,7 +936,7 @@ void AliQADataMakerSteer::RunOneEventInOneDetector(Int_t det, TTree * tree) } //_____________________________________________________________________________ -Bool_t AliQADataMakerSteer::Save2OCDB(const Int_t runNumber, const char * year, const char * detectors) const +Bool_t AliQADataMakerSteer::Save2OCDB(const Int_t runNumber, AliRecoParam::EventSpecie_t es, const char * year, const char * detectors) const { // take the locasl QA data merge into a single file and save in OCDB Bool_t rv = kTRUE ; @@ -949,13 +958,13 @@ Bool_t AliQADataMakerSteer::Save2OCDB(const Int_t runNumber, const char * year, return kFALSE ; TString inputFileName(Form("Merged.%s.Data.%d.root", AliQA::GetQADataFileName(), runNumber)) ; inputFile = TFile::Open(inputFileName.Data()) ; - rv = SaveIt2OCDB(runNumber, inputFile, year) ; + rv = SaveIt2OCDB(runNumber, inputFile, year, es) ; } else { for (Int_t index = 0; index < AliQA::kNDET; index++) { if (sdet.Contains(AliQA::GetDetName(index))) { TString inputFileName(Form("%s.%s.%d.root", AliQA::GetDetName(index), AliQA::GetQADataFileName(), runNumber)) ; inputFile = TFile::Open(inputFileName.Data()) ; - rv *= SaveIt2OCDB(runNumber, inputFile, year) ; + rv *= SaveIt2OCDB(runNumber, inputFile, year, es) ; } } } @@ -963,7 +972,7 @@ Bool_t AliQADataMakerSteer::Save2OCDB(const Int_t runNumber, const char * year, } //_____________________________________________________________________________ -Bool_t AliQADataMakerSteer::SaveIt2OCDB(const Int_t runNumber, TFile * inputFile, const char * year) const +Bool_t AliQADataMakerSteer::SaveIt2OCDB(const Int_t runNumber, TFile * inputFile, const char * year, AliRecoParam::EventSpecie_t es) const { // reads the TH1 from file and adds it to appropriate list before saving to OCDB Bool_t rv = kTRUE ; @@ -991,30 +1000,50 @@ Bool_t AliQADataMakerSteer::SaveIt2OCDB(const Int_t runNumber, TFile * inputFile TDirectory * detDir = inputFile->GetDirectory(AliQA::GetDetName(detIndex)) ; if ( detDir ) { AliInfo(Form("Entering %s", detDir->GetName())) ; + AliQA::SetQARefDataDirName(es) ; TString detOCDBDir(Form("%s/%s/%s", AliQA::GetDetName(detIndex), AliQA::GetRefOCDBDirName(), AliQA::GetRefDataDirName())) ; - printf("SSSSSSSSSSSSSSSSSSSSS %s\n", detOCDBDir.Data()) ; AliCDBId idr(detOCDBDir.Data(), runNumber, AliCDBRunRange::Infinity()) ; TList * listDetQAD = new TList() ; TString listName(Form("%s QA data Reference", AliQA::GetDetName(detIndex))) ; - mdr.SetComment("HMPID QA stuff"); + mdr.SetComment(Form("%s QA stuff", AliQA::GetDetName(detIndex))); listDetQAD->SetName(listName) ; TList * taskList = detDir->GetListOfKeys() ; TIter nextTask(taskList) ; TKey * taskKey ; while ( (taskKey = dynamic_cast(nextTask())) ) { TDirectory * taskDir = detDir->GetDirectory(taskKey->GetName()) ; - AliInfo(Form("Saving %s", taskDir->GetName())) ; + TDirectory * esDir = taskDir->GetDirectory(AliRecoParam::GetEventSpecieName(es)) ; + AliInfo(Form("Saving %s", esDir->GetName())) ; TObjArray * listTaskQAD = new TObjArray(100) ; - listTaskQAD->SetName(taskKey->GetName()) ; + listTaskQAD->SetName(Form("%s/%s", taskKey->GetName(), AliRecoParam::GetEventSpecieName(es))) ; listDetQAD->Add(listTaskQAD) ; - TList * histList = taskDir->GetListOfKeys() ; + TList * histList = esDir->GetListOfKeys() ; TIter nextHist(histList) ; TKey * histKey ; while ( (histKey = dynamic_cast(nextHist())) ) { - TObject * odata = taskDir->Get(histKey->GetName()) ; + TObject * odata = esDir->Get(histKey->GetName()) ; if ( !odata ) { AliError(Form("%s in %s/%s returns a NULL pointer !!", histKey->GetName(), detDir->GetName(), taskDir->GetName())) ; } else { + if ( AliQA::GetExpert() == histKey->GetName() ) { + TDirectory * expertDir = esDir->GetDirectory(histKey->GetName()) ; + TList * expertHistList = expertDir->GetListOfKeys() ; + TIter nextExpertHist(expertHistList) ; + TKey * expertHistKey ; + while ( (expertHistKey = dynamic_cast(nextExpertHist())) ) { + TObject * expertOdata = expertDir->Get(expertHistKey->GetName()) ; + if ( !expertOdata ) { + AliError(Form("%s in %s/%s/Expert returns a NULL pointer !!", expertHistKey->GetName(), detDir->GetName(), taskDir->GetName())) ; + } else { + AliInfo(Form("Adding %s", expertHistKey->GetName())) ; + if ( expertOdata->IsA()->InheritsFrom("TH1") ) { + AliInfo(Form("Adding %s", expertHistKey->GetName())) ; + TH1 * hExpertdata = static_cast(expertOdata) ; + listTaskQAD->Add(hExpertdata) ; + } + } + } + } AliInfo(Form("Adding %s", histKey->GetName())) ; if ( odata->IsA()->InheritsFrom("TH1") ) { AliInfo(Form("Adding %s", histKey->GetName())) ; @@ -1031,17 +1060,19 @@ Bool_t AliQADataMakerSteer::SaveIt2OCDB(const Int_t runNumber, TFile * inputFile } //_____________________________________________________________________________ -void AliQADataMakerSteer::SetRecoParam(const char* detector, AliDetectorRecoParam *par) +void AliQADataMakerSteer::SetEventSpecie(AliRecoParam::EventSpecie_t es) +{ + // set the current event specie and inform AliQA that this event specie has been encountered + fEventSpecie = es ; + AliQA::Instance()->SetEventSpecie(es) ; +} + +//_____________________________________________________________________________ +void AliQADataMakerSteer::SetRecoParam(const Int_t det, const AliDetectorRecoParam *par) { // Set custom reconstruction parameters for a given detector // Single set of parameters for all the events - for (UInt_t iDet = 0; iDet < fgkNDetectors; iDet++) { - if(!strcmp(detector, AliQA::GetDetName(iDet))) { - par->SetAsDefault(); - fRecoParam.AddDetRecoParam(iDet,par); - break; - } - } + GetQADataMaker(det)->SetRecoParam(par) ; } diff --git a/STEER/AliQADataMakerSteer.h b/STEER/AliQADataMakerSteer.h index 46c3b31ffdf..d8586cf7a13 100644 --- a/STEER/AliQADataMakerSteer.h +++ b/STEER/AliQADataMakerSteer.h @@ -1,4 +1,4 @@ -#ifndef ALIQADATAMAKERSTEER_H + #ifndef ALIQADATAMAKERSTEER_H #define ALIQADATAMAKERSTEER_H /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * * See cxx source for full Copyright notice */ @@ -46,7 +46,7 @@ public: TObjArray * GetFromOCDB(AliQA::DETECTORINDEX_t det, AliQA::TASKINDEX_t task, const char * year) const ; AliQADataMaker * GetQADataMaker(const Int_t iDet) ; void Increment() ; - void InitQADataMaker(UInt_t run, const AliRecoParam & par, TObjArray * detArray=0x0) ; + void InitQADataMaker(UInt_t run, TObjArray * detArray=0x0) ; Bool_t Merge(const Int_t runNumber = -1 ) const ; void Reset(const Bool_t sameCycle = kFALSE) ; TString Run(const char * detectors, const AliQA::TASKINDEX_t taskIndex=AliQA::kNULLTASKINDEX, Bool_t const sameCycle = kFALSE, const char * fileName = NULL) ; @@ -55,29 +55,30 @@ public: void RunOneEvent(AliRawReader * rawReader) ; void RunOneEventInOneDetector(Int_t det, TTree * tree) ; void RunOneEvent(AliESDEvent *& esd) ; - Bool_t Save2OCDB(const Int_t runNumber, const char * year = "08", const char * detectors = "ALL") const ; + Bool_t Save2OCDB(const Int_t runNumber, AliRecoParam::EventSpecie_t es, const char * year = "08", const char * detectors = "ALL") const ; void SetActiveDetectors(TString aDet) { fDetectors = aDet ; } void SetCycleLength(const AliQA::DETECTORINDEX_t det, const Int_t cycle) { fQACycles[det] = cycle ; } void SetWriteExpert(const AliQA::DETECTORINDEX_t det) { fQAWriteExpert[det] = kTRUE ; } - void SetEventRange(UInt_t first, UInt_t last) { fFirstEvent = first ; fMaxEvents = last - first + 1 ; } + void SetEventRange(UInt_t first, UInt_t last) { fFirstEvent = first ; fMaxEvents = last - first + 1 ; } + void SetEventSpecie(AliRecoParam::EventSpecie_t es) ; void SetFirsEvent(UInt_t first) { fFirstEvent = first ; } void SetMaxEvents(UInt_t max) { fMaxEvents = max ; } void SetNewCycle() { fCycleSame = kTRUE ; } - void SetRecoParam(const char* detector, AliDetectorRecoParam *par) ; + void SetRecoParam(const Int_t det, const AliDetectorRecoParam *par) ; void SetRunLoader(AliRunLoader * rl) { fRunLoader = rl ; } void SetTasks(TString tasks) { fTasks = tasks ; } private: Bool_t DoIt(const AliQA::TASKINDEX_t taskIndex) ; AliLoader * GetLoader(Int_t iDet) ; - Int_t GetQACycles(const Int_t iDet) const { return fQACycles[iDet] ; } + Int_t GetQACycles(const Int_t iDet) const { return fQACycles[iDet] ; } Bool_t Init(const AliQA::TASKINDEX_t taskIndex, const char * fileName = NULL) ; Bool_t InitRunLoader() ; Bool_t IsSelected(const char * detName) ; Bool_t Finish(const AliQA::TASKINDEX_t taskIndex) ; Bool_t MergeData(const Int_t runNumber) const ; Bool_t MergeResults(const Int_t runNumber) const ; - Bool_t SaveIt2OCDB(const Int_t runNumber, TFile * inputFile, const char * year) const ; + Bool_t SaveIt2OCDB(const Int_t runNumber, TFile * inputFile, const char * year, AliRecoParam::EventSpecie_t es) const ; UInt_t fCurrentEvent ; //! event counter @@ -102,7 +103,7 @@ private: AliQADataMaker * fQADataMaker[fgkNDetectors]; //! array of QA data maker objects Int_t fQACycles[fgkNDetectors]; //! array of QA cycle length Bool_t fQAWriteExpert[fgkNDetectors]; //! array of QA cycle length - + AliRecoParam::EventSpecie_t fEventSpecie ; //! event specie, see AliRecoParam::EventSpecie_t ClassDef(AliQADataMakerSteer, 0) // class for running the QA makers }; diff --git a/STEER/AliRecoParam.cxx b/STEER/AliRecoParam.cxx index 77d06fd4fb4..1425c390b3d 100644 --- a/STEER/AliRecoParam.cxx +++ b/STEER/AliRecoParam.cxx @@ -26,6 +26,7 @@ /////////////////////////////////////////////////////////////////////////////// #include "TObjArray.h" +#include "TMath.h" #include "AliDetectorRecoParam.h" #include "AliLog.h" @@ -35,6 +36,8 @@ ClassImp(AliRecoParam) +TString AliRecoParam::fkgEventSpecieName[] = {"Default", "LowMultiplicity", "HighMultiplicity", "Cosmic", "Calibration", "Unknown"} ; + AliRecoParam::AliRecoParam(): TObject(), fEventSpecie(kDefault) @@ -92,6 +95,32 @@ AliRecoParam::~AliRecoParam(){ } } +Int_t AliRecoParam::AConvert(EventSpecie_t es) +{ + //Converts EventSpecie_t into int + return static_cast(TMath::Log2(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) + es = kLowMult ; + else if ( i == AliRecoParam::kHighMult) + es = kHighMult ; + else if ( i == AliRecoParam::kCosmic) + es = kCosmic ; + else if ( i == AliRecoParam::kCalib) + es = kCalib ; + + return es ; +} + void AliRecoParam::Print(Option_t *option) const { // // Print reconstruction setup @@ -127,13 +156,14 @@ void AliRecoParam::SetEventSpecie(const AliRunInfo *runInfo, const AliEventInfo if (strcmp(runInfo->GetLHCState(),"STABLE_BEAMS") == 0) { // In case of stable beams - if ((strcmp(runInfo->GetBeamType(),"A-A") == 0) || - (strcmp(runInfo->GetBeamType(),"A-") == 0) || - (strcmp(runInfo->GetBeamType(),"-A") == 0)) { - // Heavy ion run, the event specie is set to kHighMult +// if ((strcmp(runInfo->GetBeamType(),"A-A") == 0) || +// (strcmp(runInfo->GetBeamType(),"A-") == 0) || +// (strcmp(runInfo->GetBeamType(),"-A") == 0)) { + // Heavy ion run (any beam tha is not pp, the event specie is set to kHighMult fEventSpecie = kHighMult; - } - else if ((strcmp(runInfo->GetBeamType(),"p-p") == 0) || +// } +// else + if ((strcmp(runInfo->GetBeamType(),"p-p") == 0) || (strcmp(runInfo->GetBeamType(),"p-") == 0) || (strcmp(runInfo->GetBeamType(),"-p") == 0) || (strcmp(runInfo->GetBeamType(),"P-P") == 0) || @@ -280,22 +310,54 @@ const char* AliRecoParam::PrintEventSpecie() const // event specie switch (fEventSpecie) { case kDefault: - return "Default"; + return fkgEventSpecieName[0].Data() ; break; case kLowMult: - return "Low-multiplicity"; + return fkgEventSpecieName[1].Data() ; break; case kHighMult: - return "High-multiplicity"; + return fkgEventSpecieName[2].Data() ; break; case kCosmic: - return "Cosmic"; + return fkgEventSpecieName[3].Data() ; break; case kCalib: - return "Calibration"; + return fkgEventSpecieName[4].Data() ; break; default: - return "Unknown"; + return fkgEventSpecieName[5].Data() ; break; } } + +const char * AliRecoParam::GetEventSpecieName(EventSpecie_t es) +{ + switch (es) { + case kDefault: + return fkgEventSpecieName[0].Data() ; + break; + case kLowMult: + return fkgEventSpecieName[1].Data() ; + break; + case kHighMult: + return fkgEventSpecieName[2].Data() ; + break; + case kCosmic: + return fkgEventSpecieName[3].Data() ; + break; + case kCalib: + return fkgEventSpecieName[4].Data() ; + break; + default: + return fkgEventSpecieName[5].Data() ; + break; + } +} + +const char * AliRecoParam::GetEventSpecieName(Int_t esIndex) +{ + if ( esIndex >= 0 && esIndex < kNSpecies) + return fkgEventSpecieName[esIndex].Data() ; + else + return fkgEventSpecieName[kNSpecies].Data() ; +} diff --git a/STEER/AliRecoParam.h b/STEER/AliRecoParam.h index 12900702c15..64c81d85217 100644 --- a/STEER/AliRecoParam.h +++ b/STEER/AliRecoParam.h @@ -36,10 +36,14 @@ class AliRecoParam : public TObject kCosmic = 8, kCalib = 16}; + static Int_t AConvert(EventSpecie_t es) ; + static EventSpecie_t Convert(Int_t es) ; 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); EventSpecie_t GetEventSpecie() const { return fEventSpecie; } + static const char* GetEventSpecieName(EventSpecie_t es); + static const char* GetEventSpecieName(Int_t esIndex); const char* PrintEventSpecie() const; const AliDetectorRecoParam *GetDetRecoParam(Int_t iDet) const; void AddDetRecoParam(Int_t iDet, AliDetectorRecoParam* param); @@ -48,13 +52,14 @@ class AliRecoParam : public TObject AliRecoParam(const AliRecoParam&); AliRecoParam& operator=(const AliRecoParam&); + private: Int_t fDetRecoParamsIndex[kNSpecies][kNDetectors]; // index to fDetRecoParams arrays TObjArray *fDetRecoParams[kNDetectors]; // array with reconstruction-parameter objects for all detectors EventSpecie_t fEventSpecie; // current event specie - - ClassDef(AliRecoParam, 5) + static TString fkgEventSpecieName[] ; // the names of the event species + ClassDef(AliRecoParam, 6) }; diff --git a/STEER/AliReconstruction.cxx b/STEER/AliReconstruction.cxx index 9b80b954743..47c4d0fc08b 100644 --- a/STEER/AliReconstruction.cxx +++ b/STEER/AliReconstruction.cxx @@ -925,7 +925,7 @@ Bool_t AliReconstruction::InitGRP() { } fRunInfo = new AliRunInfo(lhcState, beamType, beamEnergy, runType, activeDetectors); - + printf("qqqqqqqqqqqqqqqqqqqqqqq %s %s %f %s %d\n", lhcState.Data(), beamType.Data(), beamEnergy, runType.Data(), activeDetectors); fRunInfo->Dump(); @@ -1404,14 +1404,12 @@ void AliReconstruction::SlaveBegin(TTree*) fQASteer->SetActiveDetectors(fQADetectors) ; for (Int_t det = 0 ; det < AliQA::kNDET ; det++) { fQASteer->SetCycleLength(AliQA::DETECTORINDEX_t(det), fQACycles[det]) ; - if (fQAWriteExpert[det]) - fQASteer->SetWriteExpert(AliQA::DETECTORINDEX_t(det)) ; + fQASteer->SetWriteExpert(AliQA::DETECTORINDEX_t(det)) ; } - if (!fRawReader && fQATasks.Contains(AliQA::kRAWS)) fQATasks.ReplaceAll(Form("%d",AliQA::kRAWS), "") ; fQASteer->SetTasks(fQATasks) ; - fQASteer->InitQADataMaker(AliCDBManager::Instance()->GetRun(), fRecoParam) ; + fQASteer->InitQADataMaker(AliCDBManager::Instance()->GetRun()) ; } if (fRunGlobalQA) { @@ -1421,7 +1419,7 @@ void AliReconstruction::SlaveBegin(TTree*) AliInfo(Form("Initializing the global QA data maker")); if (fQATasks.Contains(Form("%d", AliQA::kRECPOINTS))) { qadm->StartOfCycle(AliQA::kRECPOINTS, AliCDBManager::Instance()->GetRun(), sameCycle) ; - TObjArray *arr=qadm->Init(AliQA::kRECPOINTS); + TObjArray **arr=qadm->Init(AliQA::kRECPOINTS); AliTracker::SetResidualsArray(arr); sameCycle = kTRUE ; } @@ -1510,16 +1508,20 @@ Bool_t AliReconstruction::ProcessEvent(Int_t iEvent) if (!IsSelected(fgkDetectorName[iDet], detStr)) continue; AliReconstructor *reconstructor = GetReconstructor(iDet); if (reconstructor && fRecoParam.GetDetRecoParamArray(iDet)) { - const AliDetectorRecoParam *par = fRecoParam.GetDetRecoParam(iDet); - reconstructor->SetRecoParam(par); + const AliDetectorRecoParam *par = fRecoParam.GetDetRecoParam(iDet); + reconstructor->SetRecoParam(par); + if (fRunQA) { + fQASteer->SetRecoParam(iDet, par) ; + } } } } // QA on single raw - if (fRunQA) - fQASteer->RunOneEvent(fRawReader) ; - + if (fRunQA) { + fQASteer->SetEventSpecie(fRecoParam.GetEventSpecie()) ; + fQASteer->RunOneEvent(fRawReader) ; + } // local single event reconstruction if (!fRunLocalReconstruction.IsNull()) { TString detectors=fRunLocalReconstruction; @@ -1734,11 +1736,13 @@ Bool_t AliReconstruction::ProcessEvent(Int_t iEvent) // write ESD if (fCleanESD) CleanESD(fesd); - if (fRunQA) + if (fRunQA) { + fQASteer->SetEventSpecie(fRecoParam.GetEventSpecie()) ; fQASteer->RunOneEvent(fesd) ; - + } if (fRunGlobalQA) { AliQADataMaker *qadm = fQASteer->GetQADataMaker(AliQA::kGLOBAL); + qadm->SetEventSpecie(fRecoParam.GetEventSpecie()) ; if (qadm && fQATasks.Contains(Form("%d", AliQA::kESDS))) qadm->Exec(AliQA::kESDS, fesd); } @@ -1844,9 +1848,9 @@ void AliReconstruction::SlaveTerminate() } // End of cycle for the in-loop - if (fRunQA) { + if (fRunQA) fQASteer->EndOfCycle() ; - } + if (fRunGlobalQA) { AliQADataMaker *qadm = fQASteer->GetQADataMaker(AliQA::kGLOBAL); if (qadm) { @@ -1940,9 +1944,10 @@ Bool_t AliReconstruction::RunLocalEventReconstruction(const TString& detectors) } TString detQAStr(fQADetectors) ; - if (fRunQA) + if (fRunQA) { + fQASteer->SetEventSpecie(fRecoParam.GetEventSpecie()) ; fQASteer->RunOneEventInOneDetector(iDet, clustersTree) ; - + } loader->WriteRecPoints("OVERWRITE"); loader->UnloadRecPoints(); AliSysInfo::AddStamp(Form("LRec%s_%d",fgkDetectorName[iDet],eventNr), iDet,1,eventNr); @@ -2187,7 +2192,7 @@ Bool_t AliReconstruction::RunTracking(AliESDEvent*& esd) // run tracking if (iDet>1) // start filling residuals for the "outer" detectors - if (fRunGlobalQA) AliTracker::SetFillResiduals(kTRUE); + if (fRunGlobalQA) AliTracker::SetFillResiduals(fRecoParam.GetEventSpecie(), kTRUE); if (fTracker[iDet]->PropagateBack(esd) != 0) { AliError(Form("%s backward propagation failed", fgkDetectorName[iDet])); @@ -2207,7 +2212,7 @@ Bool_t AliReconstruction::RunTracking(AliESDEvent*& esd) AliSysInfo::AddStamp(Form("Tracking1%s_%d",fgkDetectorName[iDet],eventNr), iDet,3, eventNr); } //stop filling residuals for the "outer" detectors - if (fRunGlobalQA) AliTracker::SetFillResiduals(kFALSE); + if (fRunGlobalQA) AliTracker::SetFillResiduals(fRecoParam.GetEventSpecie(), kFALSE); // pass 3: TRD + TPC + ITS refit inwards @@ -2217,7 +2222,7 @@ Bool_t AliReconstruction::RunTracking(AliESDEvent*& esd) // run tracking if (iDet<2) // start filling residuals for TPC and ITS - if (fRunGlobalQA) AliTracker::SetFillResiduals(kTRUE); + if (fRunGlobalQA) AliTracker::SetFillResiduals(fRecoParam.GetEventSpecie(), kTRUE); if (fTracker[iDet]->RefitInward(esd) != 0) { AliError(Form("%s inward refit failed", fgkDetectorName[iDet])); @@ -2245,7 +2250,7 @@ Bool_t AliReconstruction::RunTracking(AliESDEvent*& esd) AliSysInfo::AddStamp(Form("RUnloadCluster%s_%d",fgkDetectorName[iDet],eventNr), iDet,5, eventNr); } // stop filling residuals for TPC and ITS - if (fRunGlobalQA) AliTracker::SetFillResiduals(kFALSE); + if (fRunGlobalQA) AliTracker::SetFillResiduals(fRecoParam.GetEventSpecie(), kFALSE); eventNr++; return kTRUE; @@ -2753,36 +2758,37 @@ void AliReconstruction::CheckQA() // check the QA of SIM for this run and remove the detectors // with status Fatal - TString newRunLocalReconstruction ; - TString newRunTracking ; - TString newFillESD ; - - for (Int_t iDet = 0; iDet < AliQA::kNDET; iDet++) { - TString detName(AliQA::GetDetName(iDet)) ; - AliQA * qa = AliQA::Instance(AliQA::DETECTORINDEX_t(iDet)) ; - if ( qa->IsSet(AliQA::DETECTORINDEX_t(iDet), AliQA::kSIM, AliQA::kFATAL)) { - AliInfo(Form("QA status for %s in Hits and/or SDIGITS and/or Digits was Fatal; No reconstruction performed", detName.Data())) ; - } else { - if ( fRunLocalReconstruction.Contains(AliQA::GetDetName(iDet)) || - fRunLocalReconstruction.Contains("ALL") ) { - newRunLocalReconstruction += detName ; - newRunLocalReconstruction += " " ; - } - if ( fRunTracking.Contains(AliQA::GetDetName(iDet)) || - fRunTracking.Contains("ALL") ) { - newRunTracking += detName ; - newRunTracking += " " ; - } - if ( fFillESD.Contains(AliQA::GetDetName(iDet)) || - fFillESD.Contains("ALL") ) { - newFillESD += detName ; - newFillESD += " " ; - } - } - } - fRunLocalReconstruction = newRunLocalReconstruction ; - fRunTracking = newRunTracking ; - fFillESD = newFillESD ; +// TString newRunLocalReconstruction ; +// TString newRunTracking ; +// TString newFillESD ; +// +// for (Int_t iDet = 0; iDet < AliQA::kNDET; iDet++) { +// TString detName(AliQA::GetDetName(iDet)) ; +// AliQA * qa = AliQA::Instance(AliQA::DETECTORINDEX_t(iDet)) ; +// if ( qa->IsSet(AliQA::DETECTORINDEX_t(iDet), AliQA::kSIM, specie, AliQA::kFATAL)) { +// AliInfo(Form("QA status for %s %s in Hits and/or SDIGITS and/or Digits was Fatal; No reconstruction performed", +// detName.Data(), AliRecoParam::GetEventSpecieName(es))) ; +// } else { +// if ( fRunLocalReconstruction.Contains(AliQA::GetDetName(iDet)) || +// fRunLocalReconstruction.Contains("ALL") ) { +// newRunLocalReconstruction += detName ; +// newRunLocalReconstruction += " " ; +// } +// if ( fRunTracking.Contains(AliQA::GetDetName(iDet)) || +// fRunTracking.Contains("ALL") ) { +// newRunTracking += detName ; +// newRunTracking += " " ; +// } +// if ( fFillESD.Contains(AliQA::GetDetName(iDet)) || +// fFillESD.Contains("ALL") ) { +// newFillESD += detName ; +// newFillESD += " " ; +// } +// } +// } +// fRunLocalReconstruction = newRunLocalReconstruction ; +// fRunTracking = newRunTracking ; +// fFillESD = newFillESD ; } //_____________________________________________________________________________ diff --git a/STEER/AliSimulation.cxx b/STEER/AliSimulation.cxx index 1061315165e..a3881924a26 100644 --- a/STEER/AliSimulation.cxx +++ b/STEER/AliSimulation.cxx @@ -187,6 +187,7 @@ AliSimulation::AliSimulation(const char* configFileName, fQATasks("ALL"), fQASteer(NULL), fRunQA(kTRUE), + fEventSpecie(AliRecoParam::kDefault), fRunHLT("default"), fWriteGRPEntry(kTRUE) { @@ -1748,11 +1749,10 @@ Bool_t AliSimulation::RunQA() TString detectorsw("") ; Bool_t rv = kTRUE ; + fQASteer->SetEventSpecie(fEventSpecie) ; detectorsw = fQASteer->Run(fQADetectors.Data()) ; if ( detectorsw.IsNull() ) rv = kFALSE ; - else - fQASteer->EndOfCycle(detectorsw) ; return rv ; } @@ -1799,6 +1799,9 @@ Bool_t AliSimulation::SetRunQA(TString detAndAction) fRunQA = kTRUE ; fQASteer->SetActiveDetectors(fQADetectors) ; fQASteer->SetTasks(fQATasks) ; + for (Int_t det = 0 ; det < AliQA::kNDET ; det++) + fQASteer->SetWriteExpert(AliQA::DETECTORINDEX_t(det)) ; + return kTRUE; } @@ -1842,7 +1845,6 @@ void AliSimulation::ProcessEnvironmentVars() } //--------------------------------------------------------------------- - void AliSimulation::WriteGRPEntry() { // Get the necessary information from galice (generator, trigger etc) and @@ -1869,14 +1871,23 @@ void AliSimulation::WriteGRPEntry() TString beamType = projectile + "-" + target; beamType.ReplaceAll(" ",""); if (!beamType.CompareTo("-")) { - - grpObj->SetBeamType("UNKNOWN"); + grpObj->SetBeamType("UNKNOWN"); } else { - grpObj->SetBeamType(beamType); + grpObj->SetBeamType(beamType); + // Heavy ion run, the event specie is set to kHighMult + fEventSpecie = AliRecoParam::kHighMult; + if ((strcmp(beamType,"p-p") == 0) || + (strcmp(beamType,"p-") == 0) || + (strcmp(beamType,"-p") == 0) || + (strcmp(beamType,"P-P") == 0) || + (strcmp(beamType,"P-") == 0) || + (strcmp(beamType,"-P") == 0)) { + // Proton run, the event specie is set to kLowMult + fEventSpecie = AliRecoParam::kLowMult; + } } - } - else { + } else { AliWarning("Unknown beam type and energy! Setting energy to 0"); grpObj->SetBeamEnergy(0); grpObj->SetBeamType("UNKNOWN"); diff --git a/STEER/AliSimulation.h b/STEER/AliSimulation.h index b92a3089fd0..9c420acbcd7 100644 --- a/STEER/AliSimulation.h +++ b/STEER/AliSimulation.h @@ -146,19 +146,19 @@ private: TObjArray fEventsPerFile; // number of events per file for given detectors and data types TObjArray* fBkgrdFileNames; // names of background files for merging - TObjArray* fAlignObjArray; // array with the alignment objects to be applied to the geometry + TObjArray* fAlignObjArray; // array with the alignment objects to be applied to the geometry Bool_t fUseBkgrdVertex; // use vertex from background in case of merging Bool_t fRegionOfInterest; // digitization in region of interest - TString fCDBUri; //! Uri of the default CDB storage - TObjArray fSpecCDBUri; //! Array with detector specific CDB storages - Int_t fRun; //! Run number, will be passed to CDB and gAlice!! - Int_t fSeed; //! Seed for random number generator - Bool_t fInitCDBCalled; //! flag to check if CDB storages are already initialized - Bool_t fInitRunNumberCalled; //! flag to check if run number is already initialized - Bool_t fSetRunNumberFromDataCalled; //! flag to check if run number is already loaded from run loader + TString fCDBUri; //! Uri of the default CDB storage + TObjArray fSpecCDBUri; //! Array with detector specific CDB storages + Int_t fRun; //! Run number, will be passed to CDB and gAlice!! + Int_t fSeed; //! Seed for random number generator + Bool_t fInitCDBCalled; //! flag to check if CDB storages are already initialized + Bool_t fInitRunNumberCalled; //! flag to check if run number is already initialized + Bool_t fSetRunNumberFromDataCalled; //! flag to check if run number is already loaded from run loader - Bool_t fEmbeddingFlag; // Flag for embedding + Bool_t fEmbeddingFlag; // Flag for embedding //QA stuff static const Int_t fgkNDetectors = 15 ; // number of detectors @@ -167,6 +167,7 @@ private: TString fQATasks ; // list of QA tasks to be performed AliQADataMakerSteer * fQASteer ; // steering object to run QA Bool_t fRunQA ; // Runs the QA at the end of simulation + AliRecoParam::EventSpecie_t fEventSpecie ; // type of event (see AliRecoParam::EventSpecie_t) //HLT TString fRunHLT; // HLT options, HLT is disabled if empty, default='default' diff --git a/STEER/AliTracker.cxx b/STEER/AliTracker.cxx index 355c539ef45..3681118c318 100644 --- a/STEER/AliTracker.cxx +++ b/STEER/AliTracker.cxx @@ -37,7 +37,8 @@ Bool_t AliTracker::fgUniformField=kTRUE; Double_t AliTracker::fgBz=kAlmost0Field; const AliMagF *AliTracker::fgkFieldMap=0; Bool_t AliTracker::fFillResiduals=kFALSE; -TObjArray *AliTracker::fResiduals=0; +TObjArray **AliTracker::fResiduals=NULL; +AliRecoParam::EventSpecie_t AliTracker::fEventSpecie=AliRecoParam::kDefault; ClassImp(AliTracker) @@ -48,7 +49,7 @@ AliTracker::AliTracker(): fZ(0), fSigmaX(0.005), fSigmaY(0.005), - fSigmaZ(0.010) + fSigmaZ(0.010) { //-------------------------------------------------------------------- // The default constructor. @@ -399,27 +400,27 @@ void AliTracker::FillResiduals(const AliExternalTrackParam *t, TH1F *h=0; AliGeomManager::ELayerID layer=AliGeomManager::VolUIDToLayer(id); - h=(TH1F*)fResiduals->At(2*layer-2); + h=(TH1F*)fResiduals[fEventSpecie]->At(2*layer-2); h->Fill(residuals[0]); - h=(TH1F*)fResiduals->At(2*layer-1); + h=(TH1F*)fResiduals[fEventSpecie]->At(2*layer-1); h->Fill(residuals[1]); if (layer==5) { if (p[1]<0) { // SSD1 absolute residuals - ((TH1F*)fResiduals->At(40))->Fill(t->GetY()-p[0]); //C side - ((TH1F*)fResiduals->At(41))->Fill(t->GetZ()-p[1]); + ((TH1F*)fResiduals[fEventSpecie]->At(40))->Fill(t->GetY()-p[0]); //C side + ((TH1F*)fResiduals[fEventSpecie]->At(41))->Fill(t->GetZ()-p[1]); } else { - ((TH1F*)fResiduals->At(42))->Fill(t->GetY()-p[0]); //A side - ((TH1F*)fResiduals->At(43))->Fill(t->GetZ()-p[1]); + ((TH1F*)fResiduals[fEventSpecie]->At(42))->Fill(t->GetY()-p[0]); //A side + ((TH1F*)fResiduals[fEventSpecie]->At(43))->Fill(t->GetZ()-p[1]); } } if (layer==6) { // SSD2 absolute residuals if (p[1]<0) { - ((TH1F*)fResiduals->At(44))->Fill(t->GetY()-p[0]); //C side - ((TH1F*)fResiduals->At(45))->Fill(t->GetZ()-p[1]); + ((TH1F*)fResiduals[fEventSpecie]->At(44))->Fill(t->GetY()-p[0]); //C side + ((TH1F*)fResiduals[fEventSpecie]->At(45))->Fill(t->GetZ()-p[1]); } else { - ((TH1F*)fResiduals->At(46))->Fill(t->GetY()-p[0]); //A side - ((TH1F*)fResiduals->At(47))->Fill(t->GetZ()-p[1]); + ((TH1F*)fResiduals[fEventSpecie]->At(46))->Fill(t->GetY()-p[0]); //A side + ((TH1F*)fResiduals[fEventSpecie]->At(47))->Fill(t->GetZ()-p[1]); } } diff --git a/STEER/AliTracker.h b/STEER/AliTracker.h index 384170579dc..8ee933ce872 100644 --- a/STEER/AliTracker.h +++ b/STEER/AliTracker.h @@ -12,6 +12,8 @@ //------------------------------------------------------------------------- #include #include +#include "AliRecoParam.h" + class TTree; class AliMagF; @@ -72,8 +74,8 @@ public: static void FillResiduals(const AliExternalTrackParam *t, Double_t *p, Double_t *cov, UShort_t id, Bool_t updated=kTRUE); - static void SetFillResiduals(Bool_t flag=kTRUE) { fFillResiduals=flag; } - static void SetResidualsArray(TObjArray *arr) { fResiduals=arr; } + static void SetFillResiduals(AliRecoParam::EventSpecie_t es, Bool_t flag=kTRUE) { fFillResiduals=flag; fEventSpecie = es ;} + static void SetResidualsArray(TObjArray **arr) { fResiduals=arr; } protected: AliTracker(const AliTracker &atr); @@ -85,7 +87,7 @@ private: static Double_t fgBz; // Nominal Bz (kG) static Bool_t fFillResiduals; // Fill residuals flag - static TObjArray *fResiduals; //! Array of histograms with residuals + static TObjArray **fResiduals; //! Array of histograms with residuals Double_t fX; //X-coordinate of the primary vertex Double_t fY; //Y-coordinate of the primary vertex @@ -94,7 +96,9 @@ private: Double_t fSigmaX; // error of the primary vertex position in X Double_t fSigmaY; // error of the primary vertex position in Y Double_t fSigmaZ; // error of the primary vertex position in Z - + + static AliRecoParam::EventSpecie_t fEventSpecie ; //! event specie, see AliRecoParam + ClassDef(AliTracker,4) //abstract tracker }; diff --git a/STEER/CMake_libSTEER.txt b/STEER/CMake_libSTEER.txt index f58cac5fdc1..a34addb6b8d 100644 --- a/STEER/CMake_libSTEER.txt +++ b/STEER/CMake_libSTEER.txt @@ -63,12 +63,9 @@ AliCorrQAChecker.cxx AliGlobalQAChecker.cxx AliQACheckerBase.cxx AliMillepede.cxx -AliRecoParam.cxx -AliDetectorRecoParam.cxx AliPlaneEff.cxx AliTriggerRunScalers.cxx AliGRPPreprocessor.cxx AliGRPRecoParam.cxx -AliRunInfo.cxx AliEventInfo.cxx AliRelAlignerKalman.cxx AliESDTagCreator.cxx AliGRPObject.cxx diff --git a/STEER/CMake_libSTEERBase.txt b/STEER/CMake_libSTEERBase.txt index 9a441cdda68..0eff6689d5e 100644 --- a/STEER/CMake_libSTEERBase.txt +++ b/STEER/CMake_libSTEERBase.txt @@ -25,6 +25,9 @@ set(SRCS AliPDG.cxx AliQA.cxx AliTimeStamp.cxx AliTriggerScalers.cxx AliTriggerScalersRecord.cxx + AliRunInfo.cxx AliEventInfo.cxx + AliRecoParam.cxx + AliDetectorRecoParam.cxx ) # fill list of header files from list of source files diff --git a/STEER/STEERBaseLinkDef.h b/STEER/STEERBaseLinkDef.h index dbf0fa0a80d..350c3c5ff29 100644 --- a/STEER/STEERBaseLinkDef.h +++ b/STEER/STEERBaseLinkDef.h @@ -64,4 +64,9 @@ #pragma link C++ class AliTriggerScalers+; #pragma link C++ class AliTriggerScalersRecord+; +#pragma link C++ class AliRunInfo+; +#pragma link C++ class AliEventInfo+; +#pragma link C++ class AliDetectorRecoParam+; +#pragma link C++ class AliRecoParam+; + #endif diff --git a/STEER/STEERLinkDef.h b/STEER/STEERLinkDef.h index 7f52290a25d..0fe17af0540 100644 --- a/STEER/STEERLinkDef.h +++ b/STEER/STEERLinkDef.h @@ -139,17 +139,12 @@ #pragma link C++ class AliQACheckerBase+; #pragma link C++ class AliMillepede+; -#pragma link C++ class AliDetectorRecoParam+; -#pragma link C++ class AliRecoParam+; #pragma link C++ class AliPlaneEff+; #pragma link C++ class AliTriggerRunScalers+; #pragma link C++ class AliGRPPreprocessor+; #pragma link C++ class AliGRPRecoParam+; -#pragma link C++ class AliRunInfo+; -#pragma link C++ class AliEventInfo+; - #pragma link C++ class AliRelAlignerKalman+; #pragma link C++ class AliESDTagCreator+; diff --git a/STEER/libSTEER.pkg b/STEER/libSTEER.pkg index dac181a5e1f..2a367dbe012 100644 --- a/STEER/libSTEER.pkg +++ b/STEER/libSTEER.pkg @@ -62,12 +62,9 @@ AliCorrQAChecker.cxx \ AliGlobalQAChecker.cxx \ AliQACheckerBase.cxx \ AliMillepede.cxx \ -AliRecoParam.cxx \ -AliDetectorRecoParam.cxx \ AliPlaneEff.cxx \ AliTriggerRunScalers.cxx AliGRPPreprocessor.cxx \ AliGRPRecoParam.cxx \ -AliRunInfo.cxx AliEventInfo.cxx \ AliRelAlignerKalman.cxx \ AliESDTagCreator.cxx \ AliGRPObject.cxx diff --git a/STEER/libSTEERBase.pkg b/STEER/libSTEERBase.pkg index ff1b79f3da3..8dbfd148843 100644 --- a/STEER/libSTEERBase.pkg +++ b/STEER/libSTEERBase.pkg @@ -23,7 +23,9 @@ SRCS = AliVParticle.cxx \ AliCodeTimer.cxx \ AliPDG.cxx \ AliQA.cxx \ - AliTimeStamp.cxx AliTriggerScalers.cxx AliTriggerScalersRecord.cxx + AliTimeStamp.cxx AliTriggerScalers.cxx AliTriggerScalersRecord.cxx \ + AliRunInfo.cxx AliEventInfo.cxx \ + AliRecoParam.cxx AliDetectorRecoParam.cxx HDRS:= $(SRCS:.cxx=.h) diff --git a/T0/AliT0QAChecker.cxx b/T0/AliT0QAChecker.cxx index 44b6cafc45a..fe38f5fcdca 100644 --- a/T0/AliT0QAChecker.cxx +++ b/T0/AliT0QAChecker.cxx @@ -51,16 +51,26 @@ ClassImp(AliT0QAChecker) +//____________________________________________________________________________ +Double_t * AliT0QAChecker::Check(AliQA::ALITASK_t /*index*/) +{ + Double_t * rv = new Double_t[AliRecoParam::kNSpecies] ; + for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) + rv[specie] = 0.0 ; + return rv ; +} + //__________________________________________________________________ -Double_t AliT0QAChecker::Check(AliQA::ALITASK_t index,TObjArray * list) +Double_t * AliT0QAChecker::Check(AliQA::ALITASK_t index,TObjArray ** list) { // Super-basic check on the QA histograms on the input list: // look whether they are empty! + Double_t * test = new Double_t[AliRecoParam::kNSpecies] ; + for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) + test[specie] = 10.0 ; - Double_t test = 10.0 ; - Double_t nent[250]; TString hname[250]; const char *cname; @@ -69,160 +79,141 @@ Double_t AliT0QAChecker::Check(AliQA::ALITASK_t index,TObjArray * list) memset(w,1,250*sizeof(Double_t)); TH2 *fhRecDiff[3]; TH2 *fhRawEff[250]; - TH1 *fhESD[2]; - - // TString dataType = AliQA::GetAliTaskName(index); - - if (list->GetEntries() == 0){ - test = 1. ; // nothing to check - } - else { - - TIter next(list) ; + TH1 *fhESD[2]; + + for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) { + // TString dataType = AliQA::GetAliTaskName(index); + if (list[specie]->GetEntries() == 0){ + test[specie] = 1. ; // nothing to check + } + else { + TIter next(list[specie]) ; TH1 * hdata ; - TH2 * h ; - // printf(" data type %i %s nentries %i\n", - // index,dataType.Data(),list->GetEntries()); - - for (Int_t ir=0; irGetEntries(); ir++) - { - //raw - if(index==0 ){ - /* - if(ir < 205) { - hdata = (TH1*) list->UncheckedAt(ir); - if(hdata) { - cname = hdata->GetName(); - hname[ir] = cname; - AliDebug(10,Form("count %i %s \n",ir, hname[ir].Data())) ; - fhRaw[ir] = hdata; - } - }*/ - if(ir > 204) { - // else{ - h = (TH2*) list->UncheckedAt(ir); - printf(" index %i ir %i \n", index,ir); - if(h) { - cname = h->GetName(); - hname[ir] = cname; - AliDebug(1,Form("count %i %s \n",ir, hname[ir].Data())) ; - fhRawEff[ir] = h; - } - } - } + // AliInfo(Form(" data type %i %s nentries %i\n", + // index,dataType.Data(),list->GetEntries())); + for (Int_t ir=0; irGetEntries(); ir++) { + //raw + if(index==0 ){ + /* + if(ir < 205) { + hdata = (TH1*) list[specie]->UncheckedAt(ir); + if(hdata) { + cname = hdata->GetName(); + hname[ir] = cname; + AliDebug(10,Form("count %i %s \n",ir, hname[ir].Data())) ; + fhRaw[ir] = hdata; + } + }*/ + if(ir > 204) { + // else{ + h = (TH2*) list[specie]->UncheckedAt(ir); + AliInfo(Form(" index %i ir %i \n", index,ir)); + if(h) { + cname = h->GetName(); + hname[ir] = cname; + AliDebug(1,Form("count %i %s \n",ir, hname[ir].Data())) ; + fhRawEff[ir] = h; + } + } + } - //rec - if(index==2){ - h = (TH2*) list->UncheckedAt(ir); - - if(h) { - cname = h->GetName(); - hname[ir] = cname; - AliDebug(1,Form("count %i %s \n",ir, hname[ir].Data())) ; - fhRecDiff[ir] = h; - } - } - //esd - if(index==3){ - cout<<" ir "<UncheckedAt(ir); - if(hdata){ - fhESD[ir] = hdata; - AliDebug(1,Form("count %i %s ",ir, hname[ir].Data()) ); - } - } + //rec + if(index==2){ + h = (TH2*) list[specie]->UncheckedAt(ir); + if(h) { + cname = h->GetName(); + hname[ir] = cname; + AliDebug(1,Form("count %i %s \n",ir, hname[ir].Data())) ; + fhRecDiff[ir] = h; + } + } + //esd + if(index==3){ + cout<<" ir "<UncheckedAt(ir); + if(hdata){ + fhESD[ir] = hdata; + AliDebug(1,Form("count %i %s ",ir, hname[ir].Data()) ); + } } - - if (index == 0) - { - //raw data + } + if (index == 0) { + //raw data - for (Int_t icase=205; icase<207; icase++) { - for (Int_t idet=0; idet<24; idet++) { - Double_t mean = fhRawEff[icase]-> - ProjectionY(Form("%s_py_%i_%i", - fhRawEff[icase]->GetName(), idet,icase), - idet,idet+1)->GetMean(); - Double_t rms= fhRawEff[icase]-> - ProjectionY(Form("%s_py%i_%i", - fhRawEff[icase]->GetName(), idet,icase), - idet,idet+1)->GetRMS(); - printf("name %s icase %i idet %i mean %f, rms %f\n", - fhRawEff[icase]->GetName(), icase, idet, mean,rms); - - if (mean<1.2 && mean> 0.8 ) { - test = 1; - AliDebug(1,Form("All channels works meane efficieny %f with rms %f test %f", mean, rms, test)) ; - } - if (mean<=0.8 && mean>= 0.5 ){ - test = 0.5; - AliDebug(1,Form("%s problem in channel %i efficieny %f test %f", - fhRawEff[icase]->GetName(), idet, mean, test)) ; - } - if (mean<0.5 ) { - test = 0.25; - AliDebug(1,Form("%s big problem in channel %i efficieny %f test %f", - fhRawEff[icase]->GetName(), idet, mean, test)) ; - } - - } - - } + for (Int_t icase=205; icase<207; icase++) { + for (Int_t idet=0; idet<24; idet++) { + Double_t mean = fhRawEff[icase]->ProjectionY(Form("%s_py_%i_%i", + fhRawEff[icase]->GetName(), idet,icase), + idet,idet+1)->GetMean(); + Double_t rms= fhRawEff[icase]->ProjectionY(Form("%s_py%i_%i", + fhRawEff[icase]->GetName(), idet,icase), + idet,idet+1)->GetRMS(); + AliInfo(Form("name %s icase %i idet %i mean %f, rms %f\n", + fhRawEff[icase]->GetName(), icase, idet, mean,rms)); + if (mean<1.2 && mean> 0.8 ) { + test[specie] = 1; + AliDebug(1,Form("All channels works meane efficieny %f with rms %f test %f", mean, rms, test[specie])) ; + } + if (mean<=0.8 && mean>= 0.5 ){ + test[specie] = 0.5; + AliDebug(1,Form("%s problem in channel %i efficieny %f test %f", + fhRawEff[icase]->GetName(), idet, mean, test[specie])) ; + } + if (mean<0.5 ) { + test[specie] = 0.25; + AliDebug(1,Form("%s big problem in channel %i efficieny %f test %f", + fhRawEff[icase]->GetName(), idet, mean, test[specie])) ; + } + } + } } - - if(index == 2){ - //rec points - for (Int_t icase=0; icase<2; icase++) { - for (Int_t idet=0; idet<24; idet++) { - Double_t mean = fhRecDiff[icase]-> - ProjectionY(Form("%s_py", fhRecDiff[icase]->GetName()), - idet,idet+1)->GetMean(); - Double_t rms= fhRecDiff[icase]-> - ProjectionY(Form("%s_py", fhRecDiff[icase]->GetName()), - idet,idet+1)->GetRMS(); - printf("name %s icase %i idet %i mean %f, rms %f\n", - fhRecDiff[icase]->GetName(), icase, idet, mean,rms); + if(index == 2){ + //rec points + for (Int_t icase=0; icase<2; icase++) { + for (Int_t idet=0; idet<24; idet++) { + Double_t mean = fhRecDiff[icase]-> + ProjectionY(Form("%s_py", fhRecDiff[icase]->GetName()), + idet,idet+1)->GetMean(); + Double_t rms= fhRecDiff[icase]-> + ProjectionY(Form("%s_py", fhRecDiff[icase]->GetName()), + idet,idet+1)->GetRMS(); + AliInfo(Form("name %s icase %i idet %i mean %f, rms %f\n", + fhRecDiff[icase]->GetName(), icase, idet, mean,rms)); - if(TMath::Abs(mean) >1.5 || rms >1){ - AliDebug(1,Form(" calibration is nor perfect; test=%f", test)) ; - test=0.25; - } - if(mean>3 || rms >5) { - test = 0.1; - AliDebug(1,Form(" wrong calibration test=%f", test)) ; - } - } - - } - } - - if (index == 3) { - //ESD - for (Int_t icase=0; icase<2; icase++) { - Double_t rmsVertex = fhESD[icase]->GetRMS(); - Double_t meanVertex = fhESD[icase]->GetMean(); - - test=1; - cout<<"numentries "<< fhESD[icase]->GetEntries()<<" meanVertex "<3) { - test=0.25; - AliDebug(1,Form("Vertex position resolution not good , rms= %f test=%f", - rmsVertex, test)) ; - } - if (TMath::Abs(meanVertex)>3) { - test=0.25; - AliDebug(1,Form("Vertex position bad calibrated , Mean= %f test=%f", - meanVertex, test)) ; - } + if(TMath::Abs(mean) >1.5 || rms >1){ + AliDebug(1,Form(" calibration is nor perfect; test=%f", test)) ; + test[specie]=0.25; + } + if(mean>3 || rms >5) { + test[specie] = 0.1; + AliDebug(1,Form(" wrong calibration test=%f", test[specie])) ; + } + } + } } - - } - - } // if (list->GetEntries() != 0 - - AliInfo(Form("Test Result = %f", test)) ; - + if (index == 3) { + //ESD + for (Int_t icase=0; icase<2; icase++) { + Double_t rmsVertex = fhESD[icase]->GetRMS(); + Double_t meanVertex = fhESD[icase]->GetMean(); + test[specie]=1; + AliInfo(Form("numentries %d meanVertex %f rmsVertex %f", fhESD[icase]->GetEntries(), meanVertex, rmsVertex)); + if (TMath::Abs(rmsVertex)>3) { + test[specie]=0.25; + AliDebug(1,Form("Vertex position resolution not good , rms= %f test=%f", + rmsVertex, test[specie])) ; + } + if (TMath::Abs(meanVertex)>3) { + test[specie]=0.25; + AliDebug(1,Form("Vertex position bad calibrated , Mean= %f test=%f", + meanVertex, test[specie])) ; + } + } + } + } // if (list->GetEntries() != 0 + AliInfo(Form("Test Result = %f", test[specie])) ; + } return test ; } diff --git a/T0/AliT0QAChecker.h b/T0/AliT0QAChecker.h index 9486441141a..1588b8b9cbb 100644 --- a/T0/AliT0QAChecker.h +++ b/T0/AliT0QAChecker.h @@ -30,13 +30,9 @@ public: // dtor virtual ~AliT0QAChecker() {;} private: - virtual Double_t Check(AliQA::ALITASK_t,TObjArray * list) ; - virtual Double_t Check(TObjArray*) {return 0.;} - virtual Double_t Check(AliQA::ALITASK_t, TNtupleD*) {return 0.;} - virtual Double_t Check(AliQA::ALITASK_t) {return 0.;} - virtual Double_t Check() {return 0.;} ; + virtual Double_t * Check(AliQA::ALITASK_t) ; + virtual Double_t * Check(AliQA::ALITASK_t, TObjArray ** list) ; - ClassDef(AliT0QAChecker,1) // description }; diff --git a/T0/AliT0QADataMakerRec.cxx b/T0/AliT0QADataMakerRec.cxx index ccd2fc99875..9fd3bedda68 100644 --- a/T0/AliT0QADataMakerRec.cxx +++ b/T0/AliT0QADataMakerRec.cxx @@ -81,35 +81,38 @@ AliT0QADataMakerRec& AliT0QADataMakerRec::operator = (const AliT0QADataMakerRec& return *this; } //____________________________________________________________________________ -void AliT0QADataMakerRec::EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray * list) +void AliT0QADataMakerRec::EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray ** list) { //Detector specific actions at end of cycle // do the QA checking AliQAChecker::Instance()->Run(AliQA::kT0, task, list) ; - if ( task == AliQA::kRAWS ) { - const Char_t *triggers[6] = {"mean", "vertex","ORA","ORC","central","semi-central"}; - for (Int_t itr=0; itr<6; itr++) { - GetRawsData(197)->Fill(triggers[itr], fNumTriggersCal[itr]); - GetRawsData(197)->SetBinContent(itr+1, fNumTriggersCal[itr]); - } - GetRawsData(205)->SetOption("COLZ"); - GetRawsData(206)->SetOption("COLZ"); - GetRawsData(207)->SetOption("COLZ"); - GetRawsData(205)->GetXaxis()->SetTitle("#PMT"); - GetRawsData(206)->GetXaxis()->SetTitle("#PMT"); - GetRawsData(205)->GetYaxis()->SetTitle("NeventsReg/Nevents"); - GetRawsData(206)->GetYaxis()->SetTitle("NeventsReg/Nevents"); - GetRawsData(207)->GetXaxis()->SetTitle("#PMT"); - GetRawsData(207)->GetYaxis()->SetTitle("Charge, #channels"); - } - if ( task == AliQA::kRECPOINTS) { - GetRecPointsData(0)->SetOption("COLZ"); - GetRecPointsData(1)->SetOption("COLZ"); - GetRecPointsData(0)->GetXaxis()->SetTitle("#PMT"); - GetRecPointsData(1)->GetXaxis()->SetTitle("#PMT"); - GetRecPointsData(0)->GetYaxis()->SetTitle("CFD time"); - GetRecPointsData(1)->GetYaxis()->SetTitle("Charge, #channels"); - } + for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) { + SetEventSpecie(specie) ; + if ( task == AliQA::kRAWS ) { + const Char_t *triggers[6] = {"mean", "vertex","ORA","ORC","central","semi-central"}; + for (Int_t itr=0; itr<6; itr++) { + GetRawsData(197)->Fill(triggers[itr], fNumTriggersCal[itr]); + GetRawsData(197)->SetBinContent(itr+1, fNumTriggersCal[itr]); + } + GetRawsData(205)->SetOption("COLZ"); + GetRawsData(206)->SetOption("COLZ"); + GetRawsData(207)->SetOption("COLZ"); + GetRawsData(205)->GetXaxis()->SetTitle("#PMT"); + GetRawsData(206)->GetXaxis()->SetTitle("#PMT"); + GetRawsData(205)->GetYaxis()->SetTitle("NeventsReg/Nevents"); + GetRawsData(206)->GetYaxis()->SetTitle("NeventsReg/Nevents"); + GetRawsData(207)->GetXaxis()->SetTitle("#PMT"); + GetRawsData(207)->GetYaxis()->SetTitle("Charge, #channels"); + } + if ( task == AliQA::kRECPOINTS) { + GetRecPointsData(0)->SetOption("COLZ"); + GetRecPointsData(1)->SetOption("COLZ"); + GetRecPointsData(0)->GetXaxis()->SetTitle("#PMT"); + GetRecPointsData(1)->GetXaxis()->SetTitle("#PMT"); + GetRecPointsData(0)->GetYaxis()->SetTitle("CFD time"); + GetRecPointsData(1)->GetYaxis()->SetTitle("Charge, #channels"); + } + } } //____________________________________________________________________________ diff --git a/T0/AliT0QADataMakerRec.h b/T0/AliT0QADataMakerRec.h index 4dfaba476ba..9a72b2cf181 100644 --- a/T0/AliT0QADataMakerRec.h +++ b/T0/AliT0QADataMakerRec.h @@ -37,7 +37,7 @@ private: virtual void MakeRaws(AliRawReader* rawReader) ; virtual void MakeRecPoints(TTree * clusters) ; //Fill cluster QA histo virtual void MakeESDs(AliESDEvent * esd) ; //Fill hit QA histo - virtual void EndOfDetectorCycle(AliQA::TASKINDEX_t, TObjArray * list) ; + virtual void EndOfDetectorCycle(AliQA::TASKINDEX_t, TObjArray ** list) ; virtual void StartOfDetectorCycle() ; Int_t fNumTriggers[6]; //number of trigger signals; diff --git a/T0/AliT0QADataMakerSim.cxx b/T0/AliT0QADataMakerSim.cxx index a94178321ac..880b8c281a9 100644 --- a/T0/AliT0QADataMakerSim.cxx +++ b/T0/AliT0QADataMakerSim.cxx @@ -90,7 +90,7 @@ AliT0QADataMakerSim& AliT0QADataMakerSim::operator = (const AliT0QADataMakerSim& return *this; } //____________________________________________________________________________ -void AliT0QADataMakerSim::EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray * list) +void AliT0QADataMakerSim::EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray ** list) { //Detector specific actions at end of cycle // do the QA checking diff --git a/T0/AliT0QADataMakerSim.h b/T0/AliT0QADataMakerSim.h index 36d6955a9cf..a38fe8fece8 100644 --- a/T0/AliT0QADataMakerSim.h +++ b/T0/AliT0QADataMakerSim.h @@ -37,7 +37,7 @@ private: virtual void MakeHits(TClonesArray *) {} //Dummy for the moment virtual void MakeDigits(TTree* digitsTree) ; //Fill Digit QA histo virtual void MakeDigits(TClonesArray *) {} //Dummy for the moment - virtual void EndOfDetectorCycle(AliQA::TASKINDEX_t, TObjArray * list) ; + virtual void EndOfDetectorCycle(AliQA::TASKINDEX_t, TObjArray ** list) ; virtual void StartOfDetectorCycle() ; ClassDef(AliT0QADataMakerSim,1) // description diff --git a/TOF/AliTOFQAChecker.cxx b/TOF/AliTOFQAChecker.cxx index 7b73e75c39e..89a5cd87dcb 100644 --- a/TOF/AliTOFQAChecker.cxx +++ b/TOF/AliTOFQAChecker.cxx @@ -36,47 +36,50 @@ ClassImp(AliTOFQAChecker) //____________________________________________________________________________ -Double_t AliTOFQAChecker::Check(AliQA::ALITASK_t /*index*/, TObjArray * list) +Double_t * AliTOFQAChecker::Check(AliQA::ALITASK_t /*index*/, TObjArray ** list) { // Super-basic check on the QA histograms on the input list: // look whether they are empty! - Double_t test = 0.0 ; - Int_t count = 0 ; - - if (list->GetEntries() == 0){ - test = 1. ; // nothing to check - } - else { - TIter next(list) ; - TH1 * hdata ; - count = 0 ; - while ( (hdata = dynamic_cast(next())) ) { - if (hdata) { - Double_t rv = 0.; - if(hdata->GetEntries()>0)rv=1; - AliInfo(Form("%s -> %f", hdata->GetName(), rv)) ; - count++ ; - test += rv ; - } - else{ - AliError("Data type cannot be processed") ; - } - + Double_t * test = new Double_t[AliRecoParam::kNSpecies] ; + Int_t count[AliRecoParam::kNSpecies] = { 0 }; + + for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) { + test[specie] = 1.0 ; + if ( !AliQA::Instance()->IsEventSpecieSet(specie) ) + continue ; + if (list[specie]->GetEntries() == 0){ + test[specie] = 0.0 ; // nothing to check } - if (count != 0) { - if (test==0) { - AliWarning("Histograms are there, but they are all empty: setting flag to kWARNING"); - test = 0.5; //upper limit value to set kWARNING flag for a task + else { + TIter next(list[specie]) ; + TH1 * hdata ; + count[specie] = 0 ; + while ( (hdata = dynamic_cast(next())) ) { + if (hdata) { + Double_t rv = 0.; + if(hdata->GetEntries()>0)rv=1; + AliInfo(Form("%s -> %f", hdata->GetName(), rv)) ; + count[specie]++ ; + test[specie] += rv ; + } + else{ + AliError("Data type cannot be processed") ; + } } - else { - test /= count ; + if (count[specie] != 0) { + if (test[specie]==0) { + AliWarning("Histograms are there, but they are all empty: setting flag to kWARNING"); + test[specie] = 0.5; //upper limit value to set kWARNING flag for a task + } + else { + test[specie] /= count[specie] ; + } + AliInfo(Form("Test Result = %f", test[specie])) ; } } } - - AliInfo(Form("Test Result = %f", test)) ; return test ; } diff --git a/TOF/AliTOFQAChecker.h b/TOF/AliTOFQAChecker.h index 2fdb8ae7d21..397900fe876 100644 --- a/TOF/AliTOFQAChecker.h +++ b/TOF/AliTOFQAChecker.h @@ -27,11 +27,8 @@ public: protected: - virtual Double_t Check(AliQA::ALITASK_t /*index*/, TObjArray * list) ; - virtual Double_t Check(AliQA::ALITASK_t /*index*/) {return 0.;} - virtual Double_t Check() {return 0.;} - virtual Double_t Check(TObjArray*) {return 0.;} - virtual Double_t Check(AliQA::ALITASK_t, TNtupleD*) {return 0.;} + virtual Double_t * Check(AliQA::ALITASK_t /*index*/, TObjArray ** list) ; + virtual Double_t * Check(AliQA::ALITASK_t /*index*/) {return NULL;} ClassDef(AliTOFQAChecker,2) // description diff --git a/TOF/AliTOFQADataMakerRec.cxx b/TOF/AliTOFQADataMakerRec.cxx index d0dabf91b2a..16622aad4bb 100644 --- a/TOF/AliTOFQADataMakerRec.cxx +++ b/TOF/AliTOFQADataMakerRec.cxx @@ -309,7 +309,7 @@ void AliTOFQADataMakerRec::StartOfDetectorCycle() } //____________________________________________________________________________ -void AliTOFQADataMakerRec::EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray * list) +void AliTOFQADataMakerRec::EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray ** list) { //Detector specific actions at end of cycle // do the QA checking diff --git a/TOF/AliTOFQADataMakerRec.h b/TOF/AliTOFQADataMakerRec.h index cee82f8a91f..f883b1657ec 100644 --- a/TOF/AliTOFQADataMakerRec.h +++ b/TOF/AliTOFQADataMakerRec.h @@ -29,7 +29,7 @@ private: virtual void MakeRecPoints(TTree * recTree) ; virtual void MakeRaws(AliRawReader* rawReader) ; virtual void StartOfDetectorCycle() ; - virtual void EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray * list) ; + virtual void EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray ** list) ; virtual void GetMapIndeces(Int_t *in, Int_t *out) ; ClassDef(AliTOFQADataMakerRec,1) // description diff --git a/TOF/AliTOFQADataMakerSim.cxx b/TOF/AliTOFQADataMakerSim.cxx index 35118fcd39c..bd7896ad771 100644 --- a/TOF/AliTOFQADataMakerSim.cxx +++ b/TOF/AliTOFQADataMakerSim.cxx @@ -338,7 +338,7 @@ void AliTOFQADataMakerSim::StartOfDetectorCycle() } //____________________________________________________________________________ -void AliTOFQADataMakerSim::EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray * list) +void AliTOFQADataMakerSim::EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray ** list) { //Detector specific actions at end of cycle // do the QA checking diff --git a/TOF/AliTOFQADataMakerSim.h b/TOF/AliTOFQADataMakerSim.h index 4054ae66762..98fbde5a7a3 100644 --- a/TOF/AliTOFQADataMakerSim.h +++ b/TOF/AliTOFQADataMakerSim.h @@ -32,7 +32,7 @@ private: virtual void MakeSDigits(TClonesArray * sdigits) ; virtual void MakeSDigits(TTree * sdigTree); virtual void StartOfDetectorCycle() ; - virtual void EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray * list) ; + virtual void EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray ** list) ; virtual void GetMapIndeces(Int_t *in, Int_t *out) ; ClassDef(AliTOFQADataMakerSim,1) // description diff --git a/TPC/AliTPCQADataMakerRec.cxx b/TPC/AliTPCQADataMakerRec.cxx index 96423d3b2e0..e9337628381 100644 --- a/TPC/AliTPCQADataMakerRec.cxx +++ b/TPC/AliTPCQADataMakerRec.cxx @@ -70,17 +70,13 @@ ClassImp(AliTPCQADataMakerRec) AliTPCQADataMakerRec::AliTPCQADataMakerRec() : AliQADataMakerRec(AliQA::GetDetName(AliQA::kTPC), "TPC Rec Quality Assurance Data Maker"), - fTPCdataQA(0), - fHistESDclusters(0),fHistESDratio(0), fHistESDpt(0), - fHistRawsOccupancy(0), fHistRawsOccupancyVsSector(0), - fHistRawsNClustersPerEventVsSector(0), fHistRawsQVsSector(0), - fHistRawsQmaxVsSector(0), - fHistRecPointsQmaxShort(0), fHistRecPointsQmaxMedium(0), - fHistRecPointsQmaxLong(0), fHistRecPointsQShort(0), - fHistRecPointsQMedium(0), fHistRecPointsQLong(0), - fHistRecPointsRow(0) + fTPCdataQA(NULL) { // ctor + fTPCdataQA = new AliTPCdataQA*[AliRecoParam::kNSpecies] ; + for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) + fTPCdataQA[specie] = NULL ; + for(Int_t i = 0; i < 6; i++) fMapping[i] = 0; } @@ -88,15 +84,7 @@ AliTPCQADataMakerRec::AliTPCQADataMakerRec() : //____________________________________________________________________________ AliTPCQADataMakerRec::AliTPCQADataMakerRec(const AliTPCQADataMakerRec& qadm) : AliQADataMakerRec(), - fTPCdataQA(0), - fHistESDclusters(0),fHistESDratio(0), fHistESDpt(0), - fHistRawsOccupancy(0), fHistRawsOccupancyVsSector(0), - fHistRawsNClustersPerEventVsSector(0), fHistRawsQVsSector(0), - fHistRawsQmaxVsSector(0), - fHistRecPointsQmaxShort(0), fHistRecPointsQmaxMedium(0), - fHistRecPointsQmaxLong(0), fHistRecPointsQShort(0), - fHistRecPointsQMedium(0), fHistRecPointsQLong(0), - fHistRecPointsRow(0) + fTPCdataQA(NULL) { //copy ctor // Does not copy the calibration object, instead InitRaws have to be @@ -104,6 +92,10 @@ AliTPCQADataMakerRec::AliTPCQADataMakerRec(const AliTPCQADataMakerRec& qadm) : SetName((const char*)qadm.GetName()) ; SetTitle((const char*)qadm.GetTitle()); + fTPCdataQA = new AliTPCdataQA*[AliRecoParam::kNSpecies] ; + for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) + fTPCdataQA[specie] = NULL ; + for(Int_t i = 0; i < 6; i++) fMapping[i] = 0; @@ -111,32 +103,7 @@ AliTPCQADataMakerRec::AliTPCQADataMakerRec(const AliTPCQADataMakerRec& qadm) : // Associate class histogram objects to the copies in the list // Could also be done with the indexes // - fHistESDclusters = (TH1F*)fESDsQAList->FindObject("hESDclusters"); - fHistESDratio = (TH1F*)fESDsQAList->FindObject("hESDratio"); - fHistESDpt = (TH1F*)fESDsQAList->FindObject("hESDpt"); - - fHistRawsOccupancy = (TH1F*)fRawsQAList->FindObject("hRawsOccupancy"); - fHistRawsOccupancyVsSector = - (TH1F*)fRawsQAList->FindObject("hRawsOccupancyVsSector"); - fHistRawsNClustersPerEventVsSector = - (TH1F*)fRawsQAList->FindObject("hRawsNClustersPerEventVsSector"); - fHistRawsQVsSector = (TH1F*)fRawsQAList->FindObject("hRawsQVsSector"); - fHistRawsQmaxVsSector = (TH1F*)fRawsQAList->FindObject("hRawsQmaxVsSector"); - - fHistRecPointsQmaxShort = - (TH1F*)fRecPointsQAList->FindObject("hRecPointsQmaxShort"); - fHistRecPointsQmaxMedium = - (TH1F*)fRecPointsQAList->FindObject("hRecPointsQmaxMedium"); - fHistRecPointsQmaxLong = - (TH1F*)fRecPointsQAList->FindObject("hRecPointsQmaxLong"); - fHistRecPointsQShort = - (TH1F*)fRecPointsQAList->FindObject("hRecPointsQShort"); - fHistRecPointsQMedium = - (TH1F*)fRecPointsQAList->FindObject("hRecPointsQMedium"); - fHistRecPointsQLong = - (TH1F*)fRecPointsQAList->FindObject("hRecPointsQLong"); - fHistRecPointsRow = - (TH1F*)fRecPointsQAList->FindObject("hRecPointsRow"); + } //__________________________________________________________________ @@ -152,95 +119,115 @@ AliTPCQADataMakerRec& AliTPCQADataMakerRec::operator = (const AliTPCQADataMakerR AliTPCQADataMakerRec::~AliTPCQADataMakerRec() { // Destructor - delete fTPCdataQA; + for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) + if ( fTPCdataQA[specie] != NULL ) + delete fTPCdataQA[specie] ; + delete[] fTPCdataQA; for(Int_t i = 0; i < 6; i++) delete fMapping[i]; } //____________________________________________________________________________ -void AliTPCQADataMakerRec::EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray * list) +void AliTPCQADataMakerRec::EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray ** list) { //Detector specific actions at end of cycle + + for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) { + if ( !AliQA::Instance()->IsEventSpecieSet(specie) ) + continue ; + if(fTPCdataQA[specie] != NULL) { // do the final step of the QA for Raw data - if(fTPCdataQA) { // do the final step of the QA for Raw data - - fTPCdataQA->Analyse(); // 31/1-08 Analyse is now protected against + fTPCdataQA[specie]->Analyse(); // 31/1-08 Analyse is now protected against // RAW data files with no TPC data - - //Add2RawsList(fTPCdataQA, 0); - // get the histograms and add them to the output - // 31/8-08 Histogram is only added if the Calibration class - // receives TPC data - const Int_t eventCounter = fTPCdataQA->GetEventCounter(); - if(eventCounter>0) { // some TPC data has been processed - - // Reset histograms and refill them - fHistRawsOccupancy->Reset(); - fHistRawsOccupancyVsSector->Reset(); - fHistRawsNClustersPerEventVsSector->Reset(); - fHistRawsQVsSector->Reset(); - fHistRawsQmaxVsSector->Reset(); + + SetEventSpecie(specie) ; + TH1F * histRawsOccupancy = (TH1F*)GetRawsData(kOccupancy) ; + TH1F * histRawsOccupancyVsSector = (TH1F*)GetRawsData(kOccupancyVsSector) ; + TH1F * histRawsNClustersPerEventVsSector = (TH1F*)GetRawsData(kNClustersPerEventVsSector) ; + TH1F * histRawsQVsSector = (TH1F*)GetRawsData(kQVsSector) ; + TH1F * histRawsQmaxVsSector = (TH1F*)GetRawsData(kQmaxVsSector) ; + if ( !histRawsOccupancy || + !histRawsOccupancyVsSector || + !histRawsNClustersPerEventVsSector || + !histRawsQVsSector || + !histRawsQmaxVsSector) { + AliError("Something very wrong here, corrupted memory ?????. Please check\n") ; + continue ; + } + + //Add2RawsList(fTPCdataQA, 0); + // get the histograms and add them to the output + // 31/8-08 Histogram is only added if the Calibration class + // receives TPC data + const Int_t eventCounter = fTPCdataQA[specie]->GetEventCounter(); + if(eventCounter>0) { // some TPC data has been processed + + // Reset histograms and refill them + histRawsOccupancy->Reset(); + histRawsOccupancyVsSector->Reset(); + histRawsNClustersPerEventVsSector->Reset(); + histRawsQVsSector->Reset(); + histRawsQmaxVsSector->Reset(); - TH1F* hNorm72 = new TH1F("hNorm72", "histogram to normalize 72 sectors", - 72, 0, 72); - hNorm72->Sumw2(); - TH1F* hNorm108 = new TH1F("hNorm108", "histogram to normalize 108 sectors (medium and long pads are split up)", - 108, 0, 108); - hNorm108->Sumw2(); - - for (Int_t iSec = 0; iSec < 72; iSec++) { + TH1F* hNorm72 = new TH1F("hNorm72", "histogram to normalize 72 sectors", + 72, 0, 72); + hNorm72->Sumw2(); + TH1F* hNorm108 = new TH1F("hNorm108", "histogram to normalize 108 sectors (medium and long pads are split up)", + 108, 0, 108); + hNorm108->Sumw2(); + + for (Int_t iSec = 0; iSec < 72; iSec++) { - AliTPCCalROC* occupancyROC = - fTPCdataQA->GetNoThreshold()->GetCalROC(iSec); - AliTPCCalROC* nclusterROC = - fTPCdataQA->GetNLocalMaxima()->GetCalROC(iSec); - AliTPCCalROC* qROC = - fTPCdataQA->GetMeanCharge()->GetCalROC(iSec); - AliTPCCalROC* qmaxROC = - fTPCdataQA->GetMaxCharge()->GetCalROC(iSec); - - const Int_t nRows = occupancyROC->GetNrows(); - for (Int_t iRow = 0; iRow < nRows; iRow++) { - - Int_t helpSector = iSec; - if(iRow>=64) - helpSector += 36; // OROC (long pads) - - const Int_t nPads = occupancyROC->GetNPads(iRow); - for (Int_t iPad = 0; iPad < nPads; iPad++) { + AliTPCCalROC* occupancyROC = + fTPCdataQA[specie]->GetNoThreshold()->GetCalROC(iSec); + AliTPCCalROC* nclusterROC = + fTPCdataQA[specie]->GetNLocalMaxima()->GetCalROC(iSec); + AliTPCCalROC* qROC = + fTPCdataQA[specie]->GetMeanCharge()->GetCalROC(iSec); + AliTPCCalROC* qmaxROC = + fTPCdataQA[specie]->GetMaxCharge()->GetCalROC(iSec); + + const Int_t nRows = occupancyROC->GetNrows(); + for (Int_t iRow = 0; iRow < nRows; iRow++) { + + Int_t helpSector = iSec; + if(iRow>=64) + helpSector += 36; // OROC (long pads) + + const Int_t nPads = occupancyROC->GetNPads(iRow); + for (Int_t iPad = 0; iPad < nPads; iPad++) { - fHistRawsOccupancy->Fill(occupancyROC->GetValue(iRow, iPad)); - hNorm72->Fill(iSec); - fHistRawsOccupancyVsSector - ->Fill(iSec, occupancyROC->GetValue(iRow, iPad)); + histRawsOccupancy->Fill(occupancyROC->GetValue(iRow, iPad)); + hNorm72->Fill(iSec); + histRawsOccupancyVsSector + ->Fill(iSec, occupancyROC->GetValue(iRow, iPad)); - const Int_t nClusters = TMath::Nint(nclusterROC->GetValue(iRow, iPad)); + const Int_t nClusters = TMath::Nint(nclusterROC->GetValue(iRow, iPad)); - if(nClusters>0) { + if(nClusters>0) { - fHistRawsNClustersPerEventVsSector->Fill(iSec, nClusters); - hNorm108->Fill(helpSector, nClusters); - fHistRawsQVsSector->Fill(helpSector, - nClusters*qROC->GetValue(iRow, iPad)); - fHistRawsQmaxVsSector->Fill(helpSector, - nClusters*qmaxROC->GetValue(iRow, iPad)); - } - } - } - } // end loop over sectors + histRawsNClustersPerEventVsSector->Fill(iSec, nClusters); + hNorm108->Fill(helpSector, nClusters); + histRawsQVsSector->Fill(helpSector, + nClusters*qROC->GetValue(iRow, iPad)); + histRawsQmaxVsSector->Fill(helpSector, + nClusters*qmaxROC->GetValue(iRow, iPad)); + } + } + } + } // end loop over sectors - // Normalize histograms - fHistRawsOccupancyVsSector->Divide(hNorm72); - fHistRawsNClustersPerEventVsSector->Scale(1.0/Float_t(eventCounter)); - fHistRawsQVsSector->Divide(hNorm108); - fHistRawsQmaxVsSector->Divide(hNorm108); - delete hNorm72; - delete hNorm108; - + // Normalize histograms + histRawsOccupancyVsSector->Divide(hNorm72); + histRawsNClustersPerEventVsSector->Scale(1.0/Float_t(eventCounter)); + histRawsQVsSector->Divide(hNorm108); + histRawsQmaxVsSector->Divide(hNorm108); + delete hNorm72; + delete hNorm108; + } } } - AliQAChecker::Instance()->Run(AliQA::kTPC, task, list) ; } @@ -248,23 +235,23 @@ void AliTPCQADataMakerRec::EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray void AliTPCQADataMakerRec::InitESDs() { //create ESDs histograms in ESDs subdir - fHistESDclusters = + TH1F * histESDclusters = new TH1F("hESDclusters", "N TPC clusters per track; N clusters; Counts", 160, 0, 160); - fHistESDclusters->Sumw2(); - Add2ESDsList(fHistESDclusters, 0); + histESDclusters->Sumw2(); + Add2ESDsList(histESDclusters, KClusters); - fHistESDratio = + TH1F * histESDratio = new TH1F("hESDratio", "Ratio: TPC clusters / findable; Ratio: cluster/findable; Counts", 100, 0, 1); - fHistESDratio->Sumw2(); - Add2ESDsList(fHistESDratio, 1); + histESDratio->Sumw2(); + Add2ESDsList(histESDratio, kRatio); - fHistESDpt = + TH1F * histESDpt = new TH1F("hESDpt", "P_{T} distribution; p_{T} [GeV/c]; Counts", 50, 0, 5); - fHistESDpt->Sumw2(); - Add2ESDsList(fHistESDpt, 2); + histESDpt->Sumw2(); + Add2ESDsList(histESDpt, kPt); } //____________________________________________________________________________ @@ -278,87 +265,89 @@ void AliTPCQADataMakerRec::InitRaws() // Laurent Aphecetche pointed out that the mapping was read from file // for each event, so now we read in the map here and set if for // the raw data qa - fTPCdataQA = new AliTPCdataQA(); - LoadMaps(); // Load Altro maps - fTPCdataQA->SetAltroMapping(fMapping); // set Altro mapping - fTPCdataQA->SetRangeTime(100, 920); // set time bin interval - Add2RawsList(fTPCdataQA, 0); // This is used by the AMORE monitoring + for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) { + fTPCdataQA[specie] = new AliTPCdataQA(AliRecoParam::Convert(specie)); + LoadMaps(); // Load Altro maps + fTPCdataQA[specie]->SetAltroMapping(fMapping); // set Altro mapping + fTPCdataQA[specie]->SetRangeTime(100, 920); // set time bin interval +// Add2RawsList(fTPCdataQA, kTPCdataQA); // This is used by the AMORE monitoring <------- THIS WILL FAIL (YS) + } - fHistRawsOccupancy = + TH1F * histRawsOccupancy = new TH1F("hRawsOccupancy", "Occupancy (all pads); Occupancy; Counts", 100, 0, 1); - fHistRawsOccupancy->Sumw2(); - Add2RawsList(fHistRawsOccupancy, 1); - - fHistRawsOccupancyVsSector = + histRawsOccupancy->Sumw2(); + Add2RawsList(histRawsOccupancy, kOccupancy); + + TH1F * histRawsOccupancyVsSector = new TH1F("hRawsOccupancyVsSector", "Occupancy vs sector; Sector; Occupancy", 72, 0, 72); - fHistRawsOccupancyVsSector->Sumw2(); - Add2RawsList(fHistRawsOccupancyVsSector, 2); + histRawsOccupancyVsSector->Sumw2(); + Add2RawsList(histRawsOccupancyVsSector, kOccupancyVsSector); - fHistRawsNClustersPerEventVsSector = + TH1F * histRawsNClustersPerEventVsSector = new TH1F("hRawsNClustersPerEventVsSector", "Nclusters per event vs sector; Sector; Nclusters per event", 72, 0, 72); - fHistRawsNClustersPerEventVsSector->Sumw2(); - Add2RawsList(fHistRawsNClustersPerEventVsSector, 3); + histRawsNClustersPerEventVsSector->Sumw2(); + Add2RawsList(histRawsNClustersPerEventVsSector, kNClustersPerEventVsSector); - fHistRawsQVsSector = + TH1F * histRawsQVsSector = new TH1F("hRawsQVsSector", " vs sector (OROC med: 36-71, long: 72-107); Sector; ", 108, 0, 108); - fHistRawsQVsSector->Sumw2(); - Add2RawsList(fHistRawsQVsSector, 4); + histRawsQVsSector->Sumw2(); + Add2RawsList(histRawsQVsSector, kQVsSector); - fHistRawsQmaxVsSector = + TH1F * histRawsQmaxVsSector = new TH1F("hRawsQmaxVsSector", " vs sector (OROC med: 36-71, long: 72-107); Sector; ", 108, 0, 108); - fHistRawsQmaxVsSector->Sumw2(); - Add2RawsList(fHistRawsQmaxVsSector, 5); + histRawsQmaxVsSector->Sumw2(); + Add2RawsList(histRawsQmaxVsSector, kQmaxVsSector); } //____________________________________________________________________________ void AliTPCQADataMakerRec::InitRecPoints() { - fHistRecPointsQmaxShort = + TH1F * histRecPointsQmaxShort = new TH1F("hRecPointsQmaxShort", "Qmax distrbution (short pads); Qmax; Counts", 100, 0, 300); - fHistRecPointsQmaxShort->Sumw2(); - Add2RecPointsList(fHistRecPointsQmaxShort, 0); + histRecPointsQmaxShort->Sumw2(); + Add2RecPointsList(histRecPointsQmaxShort, kQmaxShort); - fHistRecPointsQmaxMedium = + TH1F * histRecPointsQmaxMedium = new TH1F("hRecPointsQmaxMedium", "Qmax distrbution (medium pads); Qmax; Counts", 100, 0, 300); - fHistRecPointsQmaxMedium->Sumw2(); - Add2RecPointsList(fHistRecPointsQmaxMedium, 1); + histRecPointsQmaxMedium->Sumw2(); + Add2RecPointsList(histRecPointsQmaxMedium, kQmaxMedium); - fHistRecPointsQmaxLong = + TH1F * histRecPointsQmaxLong = new TH1F("hRecPointsQmaxLong", "Qmax distrbution (long pads); Qmax; Counts", 100, 0, 300); - fHistRecPointsQmaxLong->Sumw2(); - Add2RecPointsList(fHistRecPointsQmaxLong, 2); + histRecPointsQmaxLong->Sumw2(); + Add2RecPointsList(histRecPointsQmaxLong, kQmaxLong); - fHistRecPointsQShort = + TH1F * histRecPointsQShort = new TH1F("hRecPointsQShort", "Q distrbution (short pads); Q; Counts", 100, 0, 2000); - fHistRecPointsQShort->Sumw2(); - Add2RecPointsList(fHistRecPointsQShort, 3); + histRecPointsQShort->Sumw2(); + Add2RecPointsList(histRecPointsQShort, kQShort); - fHistRecPointsQMedium = + TH1F * histRecPointsQMedium = new TH1F("hRecPointsQMedium", "Q distrbution (medium pads); Q; Counts", 100, 0, 2000); - fHistRecPointsQMedium->Sumw2(); - Add2RecPointsList(fHistRecPointsQMedium, 4); + histRecPointsQMedium->Sumw2(); + Add2RecPointsList(histRecPointsQMedium, kQMedium); - fHistRecPointsQLong = + TH1F * histRecPointsQLong = new TH1F("hRecPointsQLong", "Q distrbution (long pads); Q; Counts", 100, 0, 2000); - fHistRecPointsQLong->Sumw2(); - Add2RecPointsList(fHistRecPointsQLong, 5); + histRecPointsQLong->Sumw2(); + Add2RecPointsList(histRecPointsQLong, kQLong); - fHistRecPointsRow = + TH1F * histRecPointsRow = new TH1F("hRecPointsRow", "Clusters per row; Row; Counts", 159, 0, 159); - fHistRecPointsRow->Sumw2(); - Add2RecPointsList(fHistRecPointsRow, 6); + histRecPointsRow->Sumw2(); + Add2RecPointsList(histRecPointsRow, kRow); } //____________________________________________________________________________ @@ -380,9 +369,9 @@ void AliTPCQADataMakerRec::MakeESDs(AliESDEvent * esd) Int_t nTPCclusters = track->GetTPCNcls(); Int_t nTPCclustersFindable = track->GetTPCNclsF(); if ( nTPCclustersFindable<=0) continue; - fHistESDclusters->Fill(nTPCclusters); - fHistESDratio->Fill(Float_t(nTPCclusters)/Float_t(nTPCclustersFindable)); - fHistESDpt->Fill(track->Pt()); + GetESDsData(KClusters)->Fill(nTPCclusters); + GetESDsData(kRatio)->Fill(Float_t(nTPCclusters)/Float_t(nTPCclustersFindable)); + GetESDsData(kPt)->Fill(track->Pt()); } } @@ -394,8 +383,8 @@ void AliTPCQADataMakerRec::MakeRaws(AliRawReader* rawReader) // to handle the data and then in the end extract the data // rawReader->Reset() ; - fTPCdataQA->ProcessEvent(rawReader); -} + fTPCdataQA[AliRecoParam::AConvert(fEventSpecie)]->ProcessEvent(rawReader); + } //____________________________________________________________________________ void AliTPCQADataMakerRec::MakeRecPoints(TTree* recTree) @@ -425,22 +414,22 @@ void AliTPCQADataMakerRec::MakeRecPoints(TTree* recTree) if(cluster->GetDetector()<36) { // IROC (short pads) - fHistRecPointsQmaxShort->Fill(Qmax); - fHistRecPointsQShort->Fill(Q); + GetRecPointsData(kQmaxShort)->Fill(Qmax); + GetRecPointsData(kQShort)->Fill(Q); } else { // OROC (medium and long pads) row += 63; if(cluster->GetRow()<64) { // medium pads - fHistRecPointsQmaxMedium->Fill(Qmax); - fHistRecPointsQMedium->Fill(Q); + GetRecPointsData(kQmaxMedium)->Fill(Qmax); + GetRecPointsData(kQMedium)->Fill(Q); } else { // long pads - fHistRecPointsQmaxLong->Fill(Qmax); - fHistRecPointsQLong->Fill(Q); + GetRecPointsData(kQmaxLong)->Fill(Qmax); + GetRecPointsData(kQLong)->Fill(Q); } } - fHistRecPointsRow->Fill(row); + GetRecPointsData(kRow)->Fill(row); } // end loop over clusters } // end loop over tree diff --git a/TPC/AliTPCQADataMakerRec.h b/TPC/AliTPCQADataMakerRec.h index 154a259e766..e4cae64c422 100644 --- a/TPC/AliTPCQADataMakerRec.h +++ b/TPC/AliTPCQADataMakerRec.h @@ -29,6 +29,10 @@ class AliTPCQADataMakerRec: public AliQADataMakerRec { public: + enum HRawsType_t {kTPCdataQA=0, kOccupancy, kOccupancyVsSector, kNClustersPerEventVsSector, kQVsSector, kQmaxVsSector} ; + enum HRECPOINTsType_t {KClusters=0, kRatio, kPt} ; + enum HESDsType_t {kQmaxShort=0, kQmaxMedium, kQmaxLong, kQShort, kQMedium, kQLong, kRow} ; + AliTPCQADataMakerRec() ; // ctor AliTPCQADataMakerRec(const AliTPCQADataMakerRec& qadm) ; AliTPCQADataMakerRec& operator = (const AliTPCQADataMakerRec& qadm) ; @@ -36,7 +40,7 @@ public: private: virtual void StartOfDetectorCycle() {}; // empty - virtual void EndOfDetectorCycle(AliQA::TASKINDEX_t, TObjArray* list) ; + virtual void EndOfDetectorCycle(AliQA::TASKINDEX_t, TObjArray** list) ; // ESD QA virtual void InitESDs() ; @@ -54,25 +58,7 @@ private: AliTPCAltroMapping *fMapping[6]; //! Pointers to ALTRO mapping - AliTPCdataQA* fTPCdataQA;//! TPC calibration object for making raw data QA - - TH1F* fHistESDclusters; //! Clusters per ESD track - TH1F* fHistESDratio; //! Ratio of clusters to findables - TH1F* fHistESDpt; //! Pt spectrum - - TH1F* fHistRawsOccupancy; //! Pad occupancy (1 entry per pad) - TH1F* fHistRawsOccupancyVsSector; //! Pad occupancy vs sector - TH1F* fHistRawsNClustersPerEventVsSector; //! Nclusters vs sector - TH1F* fHistRawsQVsSector; //! vs sector - TH1F* fHistRawsQmaxVsSector; //! vs sector - - TH1F* fHistRecPointsQmaxShort; //! Qmax (short pads) - TH1F* fHistRecPointsQmaxMedium;//! Qmax (medium pads) - TH1F* fHistRecPointsQmaxLong; //! Qmax (long pads) - TH1F* fHistRecPointsQShort; //! Q (short pads) - TH1F* fHistRecPointsQMedium; //! Q (medium pads) - TH1F* fHistRecPointsQLong; //! Q (long pads) - TH1F* fHistRecPointsRow; //! Row distribution + AliTPCdataQA** fTPCdataQA;//! TPC calibration object for making raw data QA ClassDef(AliTPCQADataMakerRec,1) // TPC Rec Quality Assurance Data Maker }; diff --git a/TPC/AliTPCQADataMakerSim.cxx b/TPC/AliTPCQADataMakerSim.cxx index 32fb22fcf8b..4ab389f898b 100644 --- a/TPC/AliTPCQADataMakerSim.cxx +++ b/TPC/AliTPCQADataMakerSim.cxx @@ -49,26 +49,14 @@ ClassImp(AliTPCQADataMakerSim) //____________________________________________________________________________ AliTPCQADataMakerSim::AliTPCQADataMakerSim() : AliQADataMakerSim(AliQA::GetDetName(AliQA::kTPC), - "TPC Sim Quality Assurance Data Maker"), - fHistDigitsADC(0), - fHistHitsNhits(0), - fHistHitsElectrons(0), - fHistHitsRadius(0), - fHistHitsPrimPerCm(0), - fHistHitsElectronsPerCm(0) + "TPC Sim Quality Assurance Data Maker") { // ctor } //____________________________________________________________________________ AliTPCQADataMakerSim::AliTPCQADataMakerSim(const AliTPCQADataMakerSim& qadm) : - AliQADataMakerSim(), - fHistDigitsADC(0), - fHistHitsNhits(0), - fHistHitsElectrons(0), - fHistHitsRadius(0), - fHistHitsPrimPerCm(0), - fHistHitsElectronsPerCm(0) + AliQADataMakerSim() { //copy ctor SetName((const char*)qadm.GetName()) ; @@ -78,14 +66,7 @@ AliTPCQADataMakerSim::AliTPCQADataMakerSim(const AliTPCQADataMakerSim& qadm) : // Associate class histogram objects to the copies in the list // Could also be done with the indexes // - fHistDigitsADC = (TH1F*)fDigitsQAList->FindObject("hDigitsADC"); - - fHistHitsNhits = (TH1F*)fHitsQAList->FindObject("hHitsNhits"); - fHistHitsElectrons = (TH1F*)fHitsQAList->FindObject("hHitsElectrons"); - fHistHitsRadius = (TH1F*)fHitsQAList->FindObject("hHitsRadius"); - fHistHitsPrimPerCm = (TH1F*)fHitsQAList->FindObject("hHitsPrimPerCm"); - fHistHitsElectronsPerCm = (TH1F*)fHitsQAList->FindObject("hHitsElectronsPerCm"); -} + } //__________________________________________________________________ AliTPCQADataMakerSim& AliTPCQADataMakerSim::operator = (const AliTPCQADataMakerSim& qadm ) @@ -97,7 +78,7 @@ AliTPCQADataMakerSim& AliTPCQADataMakerSim::operator = (const AliTPCQADataMakerS } //____________________________________________________________________________ -void AliTPCQADataMakerSim::EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray * list) +void AliTPCQADataMakerSim::EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray ** list) { //Detector specific actions at end of cycle // do the QA checking @@ -107,45 +88,45 @@ void AliTPCQADataMakerSim::EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray //____________________________________________________________________________ void AliTPCQADataMakerSim::InitDigits() { - fHistDigitsADC = + TH1F * histDigitsADC = new TH1F("hDigitsADC", "Digit ADC distribution; ADC; Counts", 1000, 0, 1000); - fHistDigitsADC->Sumw2(); - Add2DigitsList(fHistDigitsADC, 0); + histDigitsADC->Sumw2(); + Add2DigitsList(histDigitsADC, kDigitsADC); } //____________________________________________________________________________ void AliTPCQADataMakerSim::InitHits() { - fHistHitsNhits = + TH1F * histHitsNhits = new TH1F("hHitsNhits", "Interactions per primary track in the TPC volume; Number of primary interactions; Counts", 100, 0, 10000); - fHistHitsNhits->Sumw2(); - Add2HitsList(fHistHitsNhits, 0); + histHitsNhits->Sumw2(); + Add2HitsList(histHitsNhits, kNhits); - fHistHitsElectrons = + TH1F * histHitsElectrons = new TH1F("hHitsElectrons", "Electrons per interaction (primaries); Electrons; Counts", 300, 0, 300); - fHistHitsElectrons->Sumw2(); - Add2HitsList(fHistHitsElectrons, 1); + histHitsElectrons->Sumw2(); + Add2HitsList(histHitsElectrons, kElectrons); - fHistHitsRadius = + TH1F * histHitsRadius = new TH1F("hHitsRadius", "Position of interaction (Primary tracks only); Radius; Counts", 300, 0., 300.); - fHistHitsRadius->Sumw2(); - Add2HitsList(fHistHitsRadius, 2); + histHitsRadius->Sumw2(); + Add2HitsList(histHitsRadius, kRadius); - fHistHitsPrimPerCm = + TH1F * histHitsPrimPerCm = new TH1F("hHitsPrimPerCm", "Primaries per cm (Primary tracks only); Primaries; Counts", 100, 0., 100.); - fHistHitsPrimPerCm->Sumw2(); - Add2HitsList(fHistHitsPrimPerCm, 3); + histHitsPrimPerCm->Sumw2(); + Add2HitsList(histHitsPrimPerCm, kPrimPerCm); - fHistHitsElectronsPerCm = + TH1F * histHitsElectronsPerCm = new TH1F("hHitsElectronsPerCm", "Electrons per cm (Primary tracks only); Electrons; Counts", 300, 0., 300.); - fHistHitsElectronsPerCm->Sumw2(); - Add2HitsList(fHistHitsElectronsPerCm, 4); + histHitsElectronsPerCm->Sumw2(); + Add2HitsList(histHitsElectronsPerCm, kElectronsPerCm); } //____________________________________________________________________________ @@ -163,10 +144,9 @@ void AliTPCQADataMakerSim::MakeDigits(TTree* digitTree) if (digArray->First()) do { + Float_t dig = digArray->CurrentDigit(); - Float_t dig = digArray->CurrentDigit(); - - fHistDigitsADC->Fill(dig); + GetDigitsData(kDigitsADC)->Fill(dig); } while (digArray->Next()); } } @@ -197,55 +177,55 @@ void AliTPCQADataMakerSim::MakeHits(TTree * hitTree) Float_t radiusOld = TMath::Sqrt(xold*xold + yold*yold); Float_t q = 0.; while(tpcHit) { - Float_t x = tpcHit->X(); - Float_t y = tpcHit->Y(); - Float_t z = tpcHit->Z(); - Float_t radius = TMath::Sqrt(x*x + y*y); + Float_t x = tpcHit->X(); + Float_t y = tpcHit->Y(); + Float_t z = tpcHit->Z(); + Float_t radius = TMath::Sqrt(x*x + y*y); - if(radius>50) { // Skip hits at interaction point + if(radius>50) { // Skip hits at interaction point - nHits++; + nHits++; - Int_t trackNo = tpcHit->GetTrack(); + Int_t trackNo = tpcHit->GetTrack(); - if(trackNo==n) { // primary track + if(trackNo==n) { // primary track - fHistHitsElectrons->Fill(tpcHit->fQ); - fHistHitsRadius->Fill(radius); + GetDigitsData(kElectrons)->Fill(tpcHit->fQ); + GetDigitsData(kRadius)->Fill(radius); - // find the new distance - dist += TMath::Sqrt((x-xold)*(x-xold) + (y-yold)*(y-yold) + - (z-zold)*(z-zold)); - if(dist<1.){ - // add data to this 1 cm step - nprim++; - q += tpcHit->fQ; + // find the new distance + dist += TMath::Sqrt((x-xold)*(x-xold) + (y-yold)*(y-yold) + + (z-zold)*(z-zold)); + if(dist<1.){ + // add data to this 1 cm step + nprim++; + q += tpcHit->fQ; - } else{ - // Fill the histograms normalized to per cm + } else{ + // Fill the histograms normalized to per cm - if(nprim==1) - cout << radius << ", " << radiusOld << ", " << dist << endl; + if(nprim==1) + cout << radius << ", " << radiusOld << ", " << dist << endl; - fHistHitsPrimPerCm->Fill((Float_t)nprim); - fHistHitsElectronsPerCm->Fill(q); + GetDigitsData(kPrimPerCm)->Fill((Float_t)nprim); + GetDigitsData(kElectronsPerCm)->Fill(q); - dist = 0; - q = 0; - nprim = 0; - } - } - } + dist = 0; + q = 0; + nprim = 0; + } + } + } - radiusOld = radius; - xold = x; - yold = y; - zold = z; + radiusOld = radius; + xold = x; + yold = y; + zold = z; - tpcHit = (AliTPChit*) tpc->NextHit(); + tpcHit = (AliTPChit*) tpc->NextHit(); + } } + GetDigitsData(kNhits)->Fill(nHits); } - fHistHitsNhits->Fill(nHits); } -} diff --git a/TPC/AliTPCQADataMakerSim.h b/TPC/AliTPCQADataMakerSim.h index b7d45c4ec85..77b20fb6918 100644 --- a/TPC/AliTPCQADataMakerSim.h +++ b/TPC/AliTPCQADataMakerSim.h @@ -29,6 +29,9 @@ class AliTPCQADataMakerSim: public AliQADataMakerSim { public: + + enum HHitType_t {kNhits=0, kElectrons, kRadius, kPrimPerCm, kElectronsPerCm} ; + enum HDigitType_t {kDigitsADC=0} ; AliTPCQADataMakerSim() ; // ctor AliTPCQADataMakerSim(const AliTPCQADataMakerSim& qadm) ; AliTPCQADataMakerSim& operator = (const AliTPCQADataMakerSim& qadm) ; @@ -36,7 +39,7 @@ public: private: virtual void StartOfDetectorCycle() {}; // empty - virtual void EndOfDetectorCycle(AliQA::TASKINDEX_t, TObjArray* list) ; + virtual void EndOfDetectorCycle(AliQA::TASKINDEX_t, TObjArray** list) ; // Digits QA virtual void InitDigits(); @@ -53,14 +56,6 @@ private: virtual void MakeSDigits(TTree* ) {AliWarning("Method not implemented\n");} virtual void MakeSDigits(TClonesArray* ) {AliWarning("Method not implemented\n");} - TH1F* fHistDigitsADC; //! Digit ADC distribution - - TH1F* fHistHitsNhits; //! Number of primary interactions - TH1F* fHistHitsElectrons;//! Electrons per interaction - TH1F* fHistHitsRadius; //! Radius of interactions - TH1F* fHistHitsPrimPerCm;//! Primaries per cm - TH1F* fHistHitsElectronsPerCm;//! Electrons per cm - ClassDef(AliTPCQADataMakerSim,1) // TPC Sim Quality Assurance Data Maker }; diff --git a/TPC/AliTPCdataQA.cxx b/TPC/AliTPCdataQA.cxx index 9f34f43e50e..036e22bef3b 100644 --- a/TPC/AliTPCdataQA.cxx +++ b/TPC/AliTPCdataQA.cxx @@ -94,7 +94,6 @@ using namespace std; ClassImp(AliTPCdataQA) AliTPCdataQA::AliTPCdataQA() : /*FOLD00*/ - TH1F("TPCRAW","TPCRAW",100,0,100), fFirstTimeBin(60), fLastTimeBin(1000), fAdcMin(1), @@ -126,6 +125,38 @@ AliTPCdataQA::AliTPCdataQA() : /*FOLD00*/ // } +//_____________________________________________________________________ +AliTPCdataQA::AliTPCdataQA(AliRecoParam::EventSpecie_t es) : +fFirstTimeBin(60), +fLastTimeBin(1000), +fAdcMin(1), +fAdcMax(100), +fMapping(NULL), +fPedestal(0), +fNoise(0), +fNLocalMaxima(0), +fMaxCharge(0), +fMeanCharge(0), +fNoThreshold(0), +fNTimeBins(0), +fNPads(0), +fTimePosition(0), +fOverThreshold10(0), +fOverThreshold20(0), +fOverThreshold30(0), +fEventCounter(0), +fIsAnalysed(kFALSE), +fAllBins(0), +fAllSigBins(0), +fAllNSigBins(0), +fRowsMax(0), +fPadsMax(0), +fTimeBinsMax(0) +{ +// ctor creating the histogram + char * name = Form("TPCRAW_%s", AliRecoParam::GetEventSpecieName(es)) ; + TH1F(name, name,100,0,100) ; +} //_____________________________________________________________________ AliTPCdataQA::AliTPCdataQA(const AliTPCdataQA &ped) : /*FOLD00*/ diff --git a/TPC/AliTPCdataQA.h b/TPC/AliTPCdataQA.h index ce162cdbf08..441f3a78559 100644 --- a/TPC/AliTPCdataQA.h +++ b/TPC/AliTPCdataQA.h @@ -7,6 +7,7 @@ #include #include +#include "AliRecoParam.h" class TArrayF; class TH2F; @@ -25,6 +26,7 @@ class AliTPCdataQA : public TH1F { public: AliTPCdataQA(); + AliTPCdataQA(AliRecoParam::EventSpecie_t es); AliTPCdataQA(const AliTPCdataQA &ped); AliTPCdataQA(const TMap *config); virtual ~AliTPCdataQA(); diff --git a/TRD/AliTRDQAChecker.h b/TRD/AliTRDQAChecker.h index c5dce12787f..3572b3ff82a 100644 --- a/TRD/AliTRDQAChecker.h +++ b/TRD/AliTRDQAChecker.h @@ -33,10 +33,10 @@ public: AliTRDQAChecker(const AliTRDQAChecker& qac) : AliQACheckerBase(qac.GetName(), qac.GetTitle()) {;} // cpy ctor virtual ~AliTRDQAChecker() {;} // dtor - virtual Double_t Check(AliQA::ALITASK_t /*index*/) {return 1.0;} - virtual Double_t Check(TList * /*list*/) {return 1.0;} - virtual Double_t Check(AliQA::ALITASK_t /*index*/, TObjArray * /*list*/) {return 1.0;} - virtual Double_t Check(AliQA::ALITASK_t /*index*/, TNtupleD* /*nt*/) {return 1.0;} + virtual Double_t * Check(AliQA::ALITASK_t /*index*/) {return NULL;} + virtual Double_t * Check(TList * /*list*/) {return NULL;} + virtual Double_t * Check(AliQA::ALITASK_t /*index*/, TObjArray ** /*list*/) {return NULL;} + virtual Double_t * Check(AliQA::ALITASK_t /*index*/, TNtupleD** /*nt*/) {return NULL;} private: diff --git a/TRD/AliTRDQADataMakerRec.cxx b/TRD/AliTRDQADataMakerRec.cxx index ae70a15e8b4..b1aa101be6e 100644 --- a/TRD/AliTRDQADataMakerRec.cxx +++ b/TRD/AliTRDQADataMakerRec.cxx @@ -84,7 +84,7 @@ AliTRDQADataMakerRec& AliTRDQADataMakerRec::operator=(const AliTRDQADataMakerRec } //____________________________________________________________________________ -void AliTRDQADataMakerRec::EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray * list) +void AliTRDQADataMakerRec::EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray ** list) { // // Detector specific actions at end of cycle @@ -95,118 +95,107 @@ void AliTRDQADataMakerRec::EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray AliInfo("End of TRD cycle"); if (task == AliQA::kRECPOINTS) { + for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) { + TH1D * hist = new TH1D("fitHist", "", 200, -0.5, 199.5); + //list[specie]->Print(); - TH1D *hist = new TH1D("fitHist", "", 200, -0.5, 199.5); - //list->Print(); - - // fill detector map; - for(int i=0; i<540; i++) { - Double_t v = ((TH1D*)list->At(0))->GetBinContent(i+1); - Int_t sm = i/30; - Int_t det = i%30; - - TH2D *detMap = (TH2D*)list->At(87); - Int_t bin = detMap->FindBin(sm, det); - detMap->SetBinContent(bin, v); - } - - - // Rec points full chambers - for (Int_t i=0; i<540; i++) { + // fill detector map; + for(Int_t i = 0 ; i < 540 ; i++) { + Double_t v = ((TH1D*)list[specie]->At(0))->GetBinContent(i+1); + Int_t sm = i/30; + Int_t det = i%30; + TH2D *detMap = (TH2D*)list[specie]->At(87); + Int_t bin = detMap->FindBin(sm, det); + detMap->SetBinContent(bin, v); + } + // Rec points full chambers + for (Int_t i = 0 ; i < 540 ; i++) { + //AliInfo(Form("I = %d", i)); + //TH1D *h = ((TH2D*)list[specie]->At(1))->ProjectionY(Form("qaTRD_recPoints_amp_%d",i), i+1, i+1); + hist->Reset(); + for(Int_t b = 1 ; b < hist->GetXaxis()->GetNbins()-1 ; b++) { + Double_t xvalue = hist->GetBinCenter(b); + Int_t bin = ((TH2D*)list[specie]->At(1))->FindBin(i,xvalue); + Double_t value = ((TH2D*)list[specie]->At(1))->GetBinContent(bin); + hist->SetBinContent(b, value); + } + //AliInfo(Form("Sum = %d %f\n", i, hist->GetSum())); + if (hist->GetSum() < 100) + continue; // chamber not present - //AliInfo(Form("I = %d", i)); - - //TH1D *h = ((TH2D*)list->At(1))->ProjectionY(Form("qaTRD_recPoints_amp_%d",i), i+1, i+1); - hist->Reset(); - for(Int_t b=1; bGetXaxis()->GetNbins()-1; b++) { - Double_t xvalue = hist->GetBinCenter(b); - Int_t bin = ((TH2D*)list->At(1))->FindBin(i,xvalue); - Double_t value = ((TH2D*)list->At(1))->GetBinContent(bin); - hist->SetBinContent(b, value); + hist->Fit("landau", "q0", "goff", 10, 180); + TF1 *fit = hist->GetFunction("landau"); + ((TH1D*)list[specie]->At(12))->Fill(fit->GetParameter(1)); + ((TH1D*)list[specie]->At(13))->Fill(fit->GetParameter(2)); } - - //printf("Sum = %d %f\n", i, hist->GetSum()); - if (hist->GetSum() < 100) continue; // chamber not present - - hist->Fit("landau", "q0", "goff", 10, 180); - TF1 *fit = hist->GetFunction("landau"); - ((TH1D*)list->At(12))->Fill(fit->GetParameter(1)); - ((TH1D*)list->At(13))->Fill(fit->GetParameter(2)); - } - - // time-bin by time-bin sm by sm - for(Int_t i=0; i<18; i++) { // loop over super-modules - - for(Int_t j=0; j<35; j++) { // loop over time bins + // time-bin by time-bin sm by sm + for(Int_t i = 0 ; i < 18 ; i++) { // loop over super-modules + for(Int_t j = 0 ; j < 35 ; j++) { // loop over time bins + //TH1D *h = ((TH3D*)list[specie]->At(10))->ProjectionZ(Form("ampTime_%d",i), i+1, i+1, j+1, j+1); + hist->Reset(); + for(Int_t b = 1 ; b < hist->GetXaxis()->GetNbins()-1 ; b++) { + Double_t xvalue = hist->GetBinCenter(b); + Double_t svalue = 0.0; + for(Int_t det = i*30 ; det < (i+1)*30 ; det++) { // loop over detectors + Int_t bin = ((TH3D*)list[specie]->At(10))->FindBin(det,j,xvalue); + Double_t value = ((TH3D*)list[specie]->At(10))->GetBinContent(bin); + svalue += value; + } + //AliInfo(Form("v = %f\n", value)); + hist->SetBinContent(b, svalue); + } - //TH1D *h = ((TH3D*)list->At(10))->ProjectionZ(Form("ampTime_%d",i), i+1, i+1, j+1, j+1); - hist->Reset(); - for(Int_t b=1; bGetXaxis()->GetNbins()-1; b++) { - Double_t xvalue = hist->GetBinCenter(b); - Double_t svalue = 0; - - for(Int_t det=i*30; det<(i+1)*30; det++) { // loop over detectors - Int_t bin = ((TH3D*)list->At(10))->FindBin(det,j,xvalue); - Double_t value = ((TH3D*)list->At(10))->GetBinContent(bin); - svalue += value; - } - //printf("v = %f\n", value); - hist->SetBinContent(b, svalue); - } + if (hist->GetSum() < 100) + continue; + //AliInfo(Form("fitting %d %d %f\n", i, j, hist->GetSum())); - if (hist->GetSum() < 100) continue; - //printf("fitting %d %d %f\n", i, j, hist->GetSum()); + hist->Fit("landau", "q0", "goff", 10, 180); + TF1 *fit = hist->GetFunction("landau"); - hist->Fit("landau", "q0", "goff", 10, 180); - TF1 *fit = hist->GetFunction("landau"); - - TH1D *h1 = (TH1D*)list->At(14+18+i); - Int_t bin = h1->FindBin(j); - // printf("%d %d %d\n", det, j, bin); - h1->SetBinContent(bin, TMath::Abs(fit->GetParameter(1))); + TH1D *h1 = (TH1D*)list[specie]->At(14+18+i); + Int_t bin = h1->FindBin(j); + // AliInfo(Form("%d %d %d\n", det, j, bin)); + h1->SetBinContent(bin, TMath::Abs(fit->GetParameter(1))); + } } - } - - // time-bin by time-bin chamber by chamber - for (Int_t i=0; i<540; i++) { - - //TH1D *test = ((TH3D*)list->At(10))->ProjectionZ(Form("ampTime_%d",i), i+1, i+1, 0, 35); - //if (test->GetSum() < 100) continue; + // time-bin by time-bin chamber by chamber + for(Int_t i = 0 ; i < 540 ; i++) { + //TH1D *test = ((TH3D*)list[specie]->At(10))->ProjectionZ(Form("ampTime_%d",i), i+1, i+1, 0, 35); + //if (test->GetSum() < 100) continue; - //AliInfo(Form("fitting det = %d", i)); + //AliInfo(Form("fitting det = %d", i)); - for(Int_t j=0; j<35; j++) { - - //TH1D *h = ((TH3D*)list->At(10))->ProjectionZ(Form("ampTime_%d",i), i+1, i+1, j+1, j+1); - hist->Reset(); - for(Int_t b=1; bGetXaxis()->GetNbins()-1; b++) { - Double_t xvalue = hist->GetBinCenter(b); - Int_t bin = ((TH3D*)list->At(10))->FindBin(i,j,xvalue); - Double_t value = ((TH3D*)list->At(10))->GetBinContent(bin); - //printf("v = %f\n", value); - hist->SetBinContent(b, value); - } + for(Int_t j = 0 ; j < 35 ; j++) { + //TH1D *h = ((TH3D*)list[specie]->At(10))->ProjectionZ(Form("ampTime_%d",i), i+1, i+1, j+1, j+1); + hist->Reset(); + for(Int_t b = 1 ; b < hist->GetXaxis()->GetNbins()-1 ; b++) { + Double_t xvalue = hist->GetBinCenter(b); + Int_t bin = ((TH3D*)list[specie]->At(10))->FindBin(i,j,xvalue); + Double_t value = ((TH3D*)list[specie]->At(10))->GetBinContent(bin); + //AliInfo(Form("v = %f\n", value)); + hist->SetBinContent(b, value); + } - if (hist->GetSum() < 100) continue; - //printf("fitting %d %d %f\n", i, j, hist->GetSum()); + if (hist->GetSum() < 100) continue; + //AliInfo(Form("fitting %d %d %f\n", i, j, hist->GetSum())); - hist->Fit("landau", "q0", "goff", 10, 180); - TF1 *fit = hist->GetFunction("landau"); + hist->Fit("landau", "q0", "goff", 10, 180); + TF1 *fit = hist->GetFunction("landau"); - Int_t sm = i/30; - Int_t det = i%30; - TH2D *h2 = (TH2D*)list->At(14+sm); - Int_t bin = h2->FindBin(det,j); - // printf("%d %d %d\n", det, j, bin); - h2->SetBinContent(bin, TMath::Abs(fit->GetParameter(1))); - h2->SetBinError(bin,fit->GetParError(1)); + Int_t sm = i/30; + Int_t det = i%30; + TH2D *h2 = (TH2D*)list[specie]->At(14+sm); + Int_t bin = h2->FindBin(det,j); + // AliInfo(Form("%d %d %d\n", det, j, bin)); + h2->SetBinContent(bin, TMath::Abs(fit->GetParameter(1))); + h2->SetBinError(bin,fit->GetParError(1)); + } } + if (hist) + delete hist; } - - if (hist) delete hist; } - ////////////////////////// // const Int_t knbits = 6; // const char *suf[knbits] = {"TPCi", "TPCo", "TPCz", "TRDo", "TRDr", "TRDz"}; @@ -219,28 +208,25 @@ void AliTRDQADataMakerRec::EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray const Int_t kD[knRatio] = {3,1,1,3}; // create ratios - for(Int_t type=0; type<2; type++) { - for(Int_t i=0; iAt(19 + 2*i + type); - TH1D *histN = (TH1D*)list->At(3 + 2*kN[i] + type); - TH1D *histD = (TH1D*)list->At(3 + 2*kD[i] + type); - - BuildRatio(ratio, histN, histD); - //ratio->Reset(); - //ratio->Add(histN); - //ratio->Divide(histD); + for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) { + for(Int_t type = 0 ; type < 2 ; type++) { + for(Int_t i = 0 ; i < knRatio ; i++) { + TH1D *ratio = (TH1D*)list[specie]->At(19 + 2*i + type); + TH1D *histN = (TH1D*)list[specie]->At(3 + 2*kN[i] + type); + TH1D *histD = (TH1D*)list[specie]->At(3 + 2*kD[i] + type); + BuildRatio(ratio, histN, histD); + //ratio->Reset(); + //ratio->Add(histN); + //ratio->Divide(histD); + } } + // ratio for the fraction of electrons per stack + TH1D *histN = (TH1D*)list[specie]->At(33); + TH1D *histD = (TH1D*)list[specie]->At(32); + TH1D *ratio = (TH1D*)list[specie]->At(34); + BuildRatio(ratio, histN, histD); } - - // ratio for the fraction of electrons per stack - TH1D *histN = (TH1D*)list->At(33); - TH1D *histD = (TH1D*)list->At(32); - TH1D *ratio = (TH1D*)list->At(34); - BuildRatio(ratio, histN, histD); } - - // call the checker AliQAChecker::Instance()->Run(AliQA::kTRD, task, list) ; } diff --git a/TRD/AliTRDQADataMakerRec.h b/TRD/AliTRDQADataMakerRec.h index 06c77024bc6..f7f00e0f5c0 100644 --- a/TRD/AliTRDQADataMakerRec.h +++ b/TRD/AliTRDQADataMakerRec.h @@ -35,7 +35,7 @@ class AliTRDQADataMakerRec: public AliQADataMakerRec { private: - virtual void EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray * list) ; + virtual void EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray ** list) ; virtual void InitESDs() ; virtual void InitRecPoints() ; virtual void InitRaws() ; diff --git a/TRD/AliTRDQADataMakerSim.cxx b/TRD/AliTRDQADataMakerSim.cxx index 24f5ad80173..73909ca63ac 100644 --- a/TRD/AliTRDQADataMakerSim.cxx +++ b/TRD/AliTRDQADataMakerSim.cxx @@ -88,7 +88,7 @@ AliTRDQADataMakerSim& AliTRDQADataMakerSim::operator=(const AliTRDQADataMakerSim } //____________________________________________________________________________ -void AliTRDQADataMakerSim::EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray * list) +void AliTRDQADataMakerSim::EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray ** list) { // // Detector specific actions at end of cycle diff --git a/TRD/AliTRDQADataMakerSim.h b/TRD/AliTRDQADataMakerSim.h index 98d9597d5aa..2bc7e456045 100644 --- a/TRD/AliTRDQADataMakerSim.h +++ b/TRD/AliTRDQADataMakerSim.h @@ -35,7 +35,7 @@ class AliTRDQADataMakerSim: public AliQADataMakerSim { private: - virtual void EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray * list) ; + virtual void EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray ** list) ; virtual void InitHits() ; virtual void InitDigits() ; virtual void InitSDigits() ; diff --git a/VZERO/AliVZEROQAChecker.cxx b/VZERO/AliVZEROQAChecker.cxx index 30e21aca91d..ec81c301f62 100644 --- a/VZERO/AliVZEROQAChecker.cxx +++ b/VZERO/AliVZEROQAChecker.cxx @@ -41,8 +41,17 @@ ClassImp(AliVZEROQAChecker) +//____________________________________________________________________________ +Double_t * AliVZEROQAChecker::Check(AliQA::ALITASK_t /*index*/) +{ + Double_t * rv = new Double_t[AliRecoParam::kNSpecies] ; + for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) + rv[specie] = 0.0 ; + return rv ; +} + //__________________________________________________________________ -Double_t AliVZEROQAChecker::Check(AliQA::ALITASK_t index, TObjArray * list) +Double_t * AliVZEROQAChecker::Check(AliQA::ALITASK_t index, TObjArray ** list) { // Main check function: Depending on the TASK, different checks will be applied @@ -56,17 +65,22 @@ Double_t AliVZEROQAChecker::Check(AliQA::ALITASK_t index, TObjArray * list) // } // Check that histos are filled - (FATAL) set if empty - if(CheckEntries(list) == 0.0){ - return CheckEntries(list); - } - -// Check for one disk missing (FATAL) or one ring missing (ERROR) in ESDs - if(index == AliQA::kESD) { - return CheckEsds(list); - } - - return 1.0; + Double_t * check = new Double_t[AliRecoParam::kNSpecies] ; + for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) { + check[specie] = 1.0 ; + if ( !AliQA::Instance()->IsEventSpecieSet(specie) ) + continue ; + if(CheckEntries(list[specie]) == 0.0){ + check[specie] = CheckEntries(list[specie]); + } else { + // Check for one disk missing (FATAL) or one ring missing (ERROR) in ESDs + if(index == AliQA::kESD) + check[specie] = CheckEsds(list[specie]); + } + } + return check; } + //_________________________________________________________________ Double_t AliVZEROQAChecker::CheckEntries(TObjArray * list) const { @@ -174,19 +188,45 @@ Double_t AliVZEROQAChecker::CheckEsds(TObjArray * list) const } //______________________________________________________________________________ -void AliVZEROQAChecker::SetQA(AliQA::ALITASK_t index, const Double_t value) const +void AliVZEROQAChecker::Init(const AliQA::DETECTORINDEX_t det) +{ + // intialises QA and QA checker settings + AliQA::Instance(det) ; + Float_t * hiValue = new Float_t[AliQA::kNBIT] ; + Float_t * lowValue = new Float_t[AliQA::kNBIT] ; + lowValue[AliQA::kINFO] = 0.5 ; + hiValue[AliQA::kINFO] = 1.0 ; + lowValue[AliQA::kWARNING] = 0.2 ; + hiValue[AliQA::kWARNING] = 0.5 ; + lowValue[AliQA::kERROR] = 0.0 ; + hiValue[AliQA::kERROR] = 0.2 ; + lowValue[AliQA::kFATAL] = -1.0 ; + hiValue[AliQA::kFATAL] = 0.0 ; + SetHiLo(hiValue, lowValue) ; +} + +//______________________________________________________________________________ +void AliVZEROQAChecker::SetQA(AliQA::ALITASK_t index, Double_t * value) const { // sets the QA word according to return value of the Check AliQA * qa = AliQA::Instance(index); - - qa->UnSet(AliQA::kFATAL); - qa->UnSet(AliQA::kWARNING); - qa->UnSet(AliQA::kERROR); - qa->UnSet(AliQA::kINFO); - - if ( value <= 0.0 ) qa->Set(AliQA::kFATAL) ; - else if ( value > 0.0 && value <= 0.2 ) qa->Set(AliQA::kERROR) ; - else if ( value > 0.2 && value <= 0.5 ) qa->Set(AliQA::kWARNING) ; - else if ( value > 0.5 && value < 1.0 ) qa->Set(AliQA::kINFO) ; + for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) { + qa->UnSet(AliQA::kFATAL, specie); + qa->UnSet(AliQA::kWARNING, specie); + qa->UnSet(AliQA::kERROR, specie); + qa->UnSet(AliQA::kINFO, specie); + if ( ! value ) { // No checker is implemented, set all QA to Fatal + qa->Set(AliQA::kFATAL, specie) ; + } else { + if ( value[specie] >= fLowTestValue[AliQA::kFATAL] && value[specie] < fUpTestValue[AliQA::kFATAL] ) + qa->Set(AliQA::kFATAL, specie) ; + else if ( value[specie] > fLowTestValue[AliQA::kERROR] && value[specie] <= fUpTestValue[AliQA::kERROR] ) + qa->Set(AliQA::kERROR, specie) ; + else if ( value[specie] > fLowTestValue[AliQA::kWARNING] && value[specie] <= fUpTestValue[AliQA::kWARNING] ) + qa->Set(AliQA::kWARNING, specie) ; + else if ( value[specie] > fLowTestValue[AliQA::kINFO] && value[specie] <= fUpTestValue[AliQA::kINFO] ) + qa->Set(AliQA::kINFO, specie) ; + } + } } diff --git a/VZERO/AliVZEROQAChecker.h b/VZERO/AliVZEROQAChecker.h index 7bd2d7bc5fa..65866b371e2 100644 --- a/VZERO/AliVZEROQAChecker.h +++ b/VZERO/AliVZEROQAChecker.h @@ -30,14 +30,15 @@ public: AliVZEROQAChecker(const AliVZEROQAChecker& qac) : AliQACheckerBase(qac.GetName(), qac.GetTitle()) {;} // cpy ctor virtual ~AliVZEROQAChecker() {;} // destructor + virtual void Init(const AliQA::DETECTORINDEX_t det) ; + protected: - virtual Double_t Check(AliQA::ALITASK_t index, TObjArray * list); - Double_t Check(AliQA::ALITASK_t ) {AliFatal("Not implemented\n"); return 0;} - Double_t Check(AliQA::ALITASK_t, TNtupleD*) {AliFatal("Not implemented\n"); return 0;} + virtual Double_t * Check(AliQA::ALITASK_t index, TObjArray ** list); + virtual Double_t * Check(AliQA::ALITASK_t ) ; Double_t CheckEntries(TObjArray * list) const ; Double_t CheckEsds(TObjArray * list) const; - virtual void SetQA(AliQA::ALITASK_t index, const Double_t value) const ; + virtual void SetQA(AliQA::ALITASK_t index, Double_t * value) const ; private: diff --git a/VZERO/AliVZEROQADataMakerRec.cxx b/VZERO/AliVZEROQADataMakerRec.cxx index e90f5edc838..cdffd96d2d2 100644 --- a/VZERO/AliVZEROQADataMakerRec.cxx +++ b/VZERO/AliVZEROQADataMakerRec.cxx @@ -115,39 +115,41 @@ AliVZEROCalibData* AliVZEROQADataMakerRec::GetCalibData() const } //____________________________________________________________________________ -void AliVZEROQADataMakerRec::EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray * list) +void AliVZEROQADataMakerRec::EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray ** list) { // Detector specific actions at end of cycle // Does the QA checking AliQAChecker::Instance()->Run(AliQA::kVZERO, task, list) ; - - if(task == AliQA::kRAWS){ + + for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) { + SetEventSpecie(specie) ; + if(task == AliQA::kRAWS){ int nMaxBin = GetRawsData(kPedestalTimeInt0)->GetNbinsY(); - if(fCurrentCycle%nMaxBin==0) { - GetRawsData(kPedestalTimeInt0)->Reset(); - GetRawsData(kPedestalTimeInt1)->Reset(); - GetRawsData(kChargeEoITimeInt0)->Reset(); - GetRawsData(kChargeEoITimeInt1)->Reset(); - } - TH1D* hProj; - char name[50]; - for(Int_t iChannel=0; iChannel<64; iChannel++) { - for(Int_t integrator=0;integrator<2;integrator++){ - sprintf(name,"Ped_%d_%d",iChannel,integrator); - hProj = ((TH2I*)GetRawsData((integrator == 0 ? kPedestalCycleInt0 : kPedestalCycleInt1)))->ProjectionY(name,iChannel+1,iChannel+1); - ((TH2D*)GetRawsData((integrator == 0 ? kPedestalTimeInt0 : kPedestalTimeInt1)))->Fill((double)iChannel,(double)(fCurrentCycle%nMaxBin),(double)hProj->GetMean()); - delete hProj; - - sprintf(name,"Charge_%d_%d",iChannel,integrator); - hProj = ((TH2I*)GetRawsData((integrator == 0 ? kChargeEoICycleInt0 : kChargeEoICycleInt1)))->ProjectionY(name,iChannel+1,iChannel+1); - ((TH2D*)GetRawsData((integrator == 0 ? kChargeEoITimeInt0 : kChargeEoITimeInt1)))->Fill((double)iChannel,(double)(fCurrentCycle%nMaxBin),hProj->GetMean()); - delete hProj; - } - } - } else if (task == AliQA::kESDS) { + if(fCurrentCycle%nMaxBin==0) { + GetRawsData(kPedestalTimeInt0)->Reset(); + GetRawsData(kPedestalTimeInt1)->Reset(); + GetRawsData(kChargeEoITimeInt0)->Reset(); + GetRawsData(kChargeEoITimeInt1)->Reset(); + } + TH1D* hProj; + char name[50]; + for(Int_t iChannel=0; iChannel<64; iChannel++) { + for(Int_t integrator=0;integrator<2;integrator++){ + sprintf(name,"Ped_%d_%d",iChannel,integrator); + hProj = ((TH2I*)GetRawsData((integrator == 0 ? kPedestalCycleInt0 : kPedestalCycleInt1)))->ProjectionY(name,iChannel+1,iChannel+1); + ((TH2D*)GetRawsData((integrator == 0 ? kPedestalTimeInt0 : kPedestalTimeInt1)))->Fill((double)iChannel,(double)(fCurrentCycle%nMaxBin),(double)hProj->GetMean()); + delete hProj; + + sprintf(name,"Charge_%d_%d",iChannel,integrator); + hProj = ((TH2I*)GetRawsData((integrator == 0 ? kChargeEoICycleInt0 : kChargeEoICycleInt1)))->ProjectionY(name,iChannel+1,iChannel+1); + ((TH2D*)GetRawsData((integrator == 0 ? kChargeEoITimeInt0 : kChargeEoITimeInt1)))->Fill((double)iChannel,(double)(fCurrentCycle%nMaxBin),hProj->GetMean()); + delete hProj; + } + } + } else if (task == AliQA::kESDS) { + } } - } //____________________________________________________________________________ @@ -162,20 +164,20 @@ void AliVZEROQADataMakerRec::InitESDs() TH1D * h1d; h1i = new TH1I("H1I_Cell_Multiplicity_V0A", "Cell Multiplicity in V0A", 35, 0, 35) ; - Add2ESDsList(h1i, kCellMultiV0A, !expert) ; h1i->GetXaxis()->SetTitle("Multiplicity (Nb of Cell)"); + Add2ESDsList(h1i, kCellMultiV0A, !expert) ; h1i = new TH1I("H1I_Cell_Multiplicity_V0C", "Cell Multiplicity in V0C", 35, 0, 35) ; - Add2ESDsList(h1i, kCellMultiV0C, !expert) ; h1i->GetXaxis()->SetTitle("Multiplicity (Nb of Cell)"); + Add2ESDsList(h1i, kCellMultiV0C, !expert) ; h1d = new TH1D("H1D_MIP_Multiplicity_V0A", "MIP Multiplicity in V0A", 1000, 0, 1000) ; - Add2ESDsList(h1d, kMIPMultiV0A, !expert) ; h1d->GetXaxis()->SetTitle("Multiplicity (Nb of MIP)"); + Add2ESDsList(h1d, kMIPMultiV0A, !expert) ; h1d = new TH1D("H1D_MIP_Multiplicity_V0C", "MIP Multiplicity in V0C", 1000, 0, 1000) ; - Add2ESDsList(h1d, kMIPMultiV0C, !expert) ; h1d->GetXaxis()->SetTitle("Multiplicity (Nb of MIP)"); + Add2ESDsList(h1d, kMIPMultiV0C, !expert) ; h2d = new TH2D("H2D_MIP_Multiplicity_Channel", "MIP Multiplicity per Channel",64, 0, 64, 100, 0, 100) ; h2d->GetXaxis()->SetTitle("Channel"); diff --git a/VZERO/AliVZEROQADataMakerRec.h b/VZERO/AliVZEROQADataMakerRec.h index aafeb6442f3..c9271991c73 100644 --- a/VZERO/AliVZEROQADataMakerRec.h +++ b/VZERO/AliVZEROQADataMakerRec.h @@ -52,7 +52,7 @@ protected: AliVZEROCalibData *fCalibData; //! calibration data private: - virtual void EndOfDetectorCycle(AliQA::TASKINDEX_t, TObjArray * list) ; + virtual void EndOfDetectorCycle(AliQA::TASKINDEX_t, TObjArray ** list) ; virtual void InitESDs() ; virtual void InitRaws() ; virtual void MakeESDs(AliESDEvent * esd) ; diff --git a/VZERO/AliVZEROQADataMakerSim.cxx b/VZERO/AliVZEROQADataMakerSim.cxx index 2f1528fd4a6..91e4bb20a83 100644 --- a/VZERO/AliVZEROQADataMakerSim.cxx +++ b/VZERO/AliVZEROQADataMakerSim.cxx @@ -68,7 +68,7 @@ AliVZEROQADataMakerSim& AliVZEROQADataMakerSim::operator = (const AliVZEROQAData return *this; } //____________________________________________________________________________ -void AliVZEROQADataMakerSim::EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray * list) +void AliVZEROQADataMakerSim::EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray ** list) { //Detector specific actions at end of cycle // do the QA checking diff --git a/VZERO/AliVZEROQADataMakerSim.h b/VZERO/AliVZEROQADataMakerSim.h index 6b106cd3c01..46e2c2f6fbf 100644 --- a/VZERO/AliVZEROQADataMakerSim.h +++ b/VZERO/AliVZEROQADataMakerSim.h @@ -30,7 +30,7 @@ class AliVZEROQADataMakerSim: public AliQADataMakerSim { virtual ~AliVZEROQADataMakerSim() {} // dtor private: - virtual void EndOfDetectorCycle(AliQA::TASKINDEX_t, TObjArray * list); + virtual void EndOfDetectorCycle(AliQA::TASKINDEX_t, TObjArray ** list); virtual void InitHits(); virtual void InitDigits(); virtual void MakeHits(TClonesArray* hits) ; diff --git a/ZDC/AliZDCQAChecker.cxx b/ZDC/AliZDCQAChecker.cxx index e34af121b79..ca19f479206 100644 --- a/ZDC/AliZDCQAChecker.cxx +++ b/ZDC/AliZDCQAChecker.cxx @@ -28,549 +28,481 @@ ClassImp(AliZDCQAChecker) //____________________________________________________________________________ -Double_t AliZDCQAChecker::Check(AliQA::ALITASK_t index, TObjArray * list) +Double_t * AliZDCQAChecker::Check(AliQA::ALITASK_t index, TObjArray ** list) { - // Checks the QA histograms on the input list: - // - Double_t test=0.; - Int_t ntests=0; - const char* taskName = AliQA::GetAliTaskName(index); - // - Int_t beamType=0; // 0 -> protons, 1 -> ions - - // ==================================================================== - // Checks for p-p events - // ==================================================================== - if (beamType==0){ - // ------------------------------------------------------------------- - if(index == AliQA::kSIM){ + // Checks the QA histograms on the input list: + // + Double_t * test = new Double_t[AliRecoParam::kNSpecies] ; + Int_t * ntests = new Int_t[AliRecoParam::kNSpecies] ; + const char* taskName = AliQA::GetAliTaskName(index); + // - if(list->GetEntries()==0){ - AliWarning("\tAliZDCQAChecker->The list to be checked is empty!"); - test = 1.; // nothing to check - return test; - } - //printf("\n\tAliZDCQAChecker-> checking QA histograms for task %s\n\n",taskName); - - TIter next(list); - TH1 * hdata; - // - ntests = 0; - // - while((hdata = dynamic_cast(next()))){ - if(hdata){ - //printf("\tAliZDCQAChecker-> checking histo %s",hdata->GetName()); - // Check DIGITS histos - if(!(strncmp(hdata->GetName(),"hDig",4))){ - if(hdata->GetEntries()>0){ - test += 1.; ntests++; - } - } - // Check HITS histos - else{ - if(hdata->GetEntries()>0){ - test += 1.; ntests++; - } - - } - } - else{ - AliError("AliZDCQAChecker-> No histos!!!\n"); - } - } - if(ntests!=0) test = test/ntests; - //printf("\n\tAliZDCQAChecker-> QA check result = %1.2f\n",test); - } - - // ------------------------------------------------------------------- - else if(index == AliQA::kRAW){ - - if(list->GetEntries()==0){ - AliWarning("\tAliZDCQAChecker->The list to be checked is empty!"); - test = 1.; // nothing to check - return test; - } - printf("\n\tAliZDCQAChecker-> checking QA histograms for task %s\n\n",taskName); - - TIter next(list); - TH1 * hdata; - ntests = 0; - // - while((hdata = dynamic_cast(next()))){ - if(hdata){ - if(hdata->GetEntries()!=0){ - if(hdata->GetMean()>10.) test += 1.; - else test = 0.5; - ntests++; - } + //YS Int_t beamType=0; // 0 -> protons, 1 -> ions + for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) { + test[specie] = 1.0 ; + ntests[specie] = 0 ; + if ( !AliQA::Instance()->IsEventSpecieSet(specie) ) + continue ; + // ==================================================================== + // Checks for p-p events + // ==================================================================== + //if (beamType==0){ + if ( specie == AliRecoParam::kLowMult) { + if(list[specie]->GetEntries()==0){ + AliWarning("\tAliZDCQAChecker->The list to be checked is empty!"); // nothing to check + return test; } - // - //printf("\t %d performed tests, results %1.2f\n",ntests,test/ntests); - else{ - AliError("\t AliZDCQAChecker->No histos!!!\n"); - } - } - if(ntests!=0) test = test/ntests; - //printf("\n\tAliZDCQAChecker-> QA check result = %1.2f\n",test); - } - - // ------------------------------------------------------------------- - else if(index == AliQA::kESD){ - - if(list->GetEntries()==0){ - AliWarning("\tAliZDCQAChecker->The list to be checked is empty!"); - test = 1.; // nothing to check - return test; - } - printf("\n\tAliZDCQAChecker-> checking QA histograms for task %s\n\n",taskName); - - TIter next(list); - TH1 * hdata; - Int_t esdInd=0; - // - ntests = 0; - // - while((hdata = dynamic_cast(next()))){ - if(hdata){ - if(hdata->GetEntries()!=0){ - if(esdInd>1){ - if(hdata->GetMean()>10.) test += 1.; - else test = 0.5; - ntests++; - } - } - // - esdInd++; - } - else{ - AliError("AliZDCQAChecker-> No histos!!!\n"); - } - } - if(ntests!=0) test = test/ntests; - //printf("\n\tAliZDCQAChecker-> QA check result = %1.2f\n\n",test); - } - else{ - AliWarning(Form("\n\t No ZDC QA for %s task\n",taskName)); - return 1.; - } - } - // ==================================================================== - // Checks for A-A events - // ==================================================================== - else if (beamType==1){ - // ------------------------------------------------------------------- - if(index == AliQA::kSIM){ - - if(list->GetEntries()==0){ - AliWarning("\tAliZDCQAChecker->The list to be checked is empty!"); - test = 1.; // nothing to check - return test; - } - //printf("\n\tAliZDCQAChecker-> checking QA histograms for task %s\n\n",taskName); - - TIter next(list); - TH1 * hdata; - Double_t meanX=0., meanY=0.; - Double_t meanZNA=0., rmsZNA=0., meanZNC=0.; - Double_t meanZPA=0., rmsZPA=0., meanZPC=0.; - Double_t pmCZNA=0., pmCZNC=0., pmCZPA=0., pmCZPC=0.; - Double_t pmQZNA=0., pmQZNC=0., pmQZPA=0., pmQZPC=0.; - Float_t res=0.; - Int_t digInd=0, testgood=0; - // - ntests = 0; - // - while((hdata = dynamic_cast(next()))){ - if(hdata){ - //printf("\tAliZDCQAChecker-> checking histo %s",hdata->GetName()); - // Check DIGITS histos - if (!(strncmp(hdata->GetName(),"hDig",4))){ - // [1] check response of ZNC vs. ZNA - if(digInd==0 || digInd==1){ - if(digInd==0){ - if(hdata->GetEntries() != 0.){ - testgood=1; - meanZNA = hdata->GetMean(); - rmsZNA = hdata->GetRMS(); - } - } - else{ - if(hdata->GetEntries() != 0.){ - testgood=1; - meanZNC = hdata->GetMean(); - } - else testgood=0; - // check if the response m.v. of ZNA and ZNC are equal (@ 1sigma level) - if(testgood==1){ - if(TMath::Abs(meanZNA-meanZNC)GetEntries() != 0.){ - testgood=1; - meanZPA = hdata->GetMean(); - rmsZPA = hdata->GetRMS(); - } - } - else{ - if(hdata->GetEntries() != 0.){ - testgood=1; - meanZPC = hdata->GetMean(); - } - // check if the response m.v. of ZPA and ZPC are equal (@ 3sigma level) - if(testgood==1){ - if(TMath::Abs(meanZPA-meanZPC)<(3.*rmsZPA)) res=1.; - else res=.5; - test += res; - ntests++; - testgood=0; - // - //printf("\t %d performed tests, results %1.2f\n",ntests,test/ntests); - } - else res=0.; - } - } - // [2] check PMC responses vs. summed PMQ responses - else if(digInd>3 && digInd<12){ - if(digInd==4) pmQZNC = hdata->GetMean(); - else if(digInd==5) pmQZNA = hdata->GetMean(); - else if(digInd==6) pmQZPC = hdata->GetMean(); - else if(digInd==7) pmQZPA = hdata->GetMean(); - else if(digInd==8){ - pmCZNC = hdata->GetMean(); - if(TMath::Abs(pmQZNC-pmCZNC)<(0.1*(pmQZNC+pmCZNC)/2)) res=1.; - else res=0.5; - test += res; - ntests++; - // - //printf("\t %d performed tests, results %1.2f\n",ntests,test/ntests); + //AliInfo(Form("\n\tAliZDCQAChecker-> checking QA histograms for task %s\n\n",taskName)); + TIter next(list[specie]); + ntests[specie] = 0; + TH1 * hdata; + while((hdata = dynamic_cast(next()))){ + if(hdata){ + // ------------------------------------------------------------------- + if(index == AliQA::kSIM){ + //AliInfo(Form("\tAliZDCQAChecker-> checking histo %s",hdata->GetName())); + // Check DIGITS histos + if(!(strncmp(hdata->GetName(),"hDig",4))){ + if(hdata->GetEntries()>0){ + test[specie] += 1.; + ntests[specie]++; + } } - else if(digInd==9){ - pmCZNA = hdata->GetMean(); - if(TMath::Abs(pmQZNA-pmCZNA)<(0.1*(pmQZNA+pmCZNA)/2)) res=1.; - else res=0.5; - test += res; - ntests++; - // - //printf("\t %d performed tests, results %1.2f\n",ntests,test/ntests); + // Check HITS histos + else{ + if(hdata->GetEntries()>0){ + test[specie] += 1.; + ntests[specie]++; + } } - else if(digInd==10){ - pmCZPC = hdata->GetMean(); - if(TMath::Abs(pmQZPC-pmCZPC)<(0.1*(pmQZPC+pmCZPC)/2)) res=1.; - else res=0.5; - test += res; - ntests++; - // - //printf("\t %d performed tests, results %1.2f\n",ntests,test/ntests); + // ------------------------------------------------------------------- + } else if(index == AliQA::kRAW) { + if(hdata->GetEntries()!=0){ + if(hdata->GetMean()>10.) + test[specie] += 1.; + else + test[specie] = 0.5; + ntests[specie]++; } - else if(digInd==11){ - pmCZPA = hdata->GetMean(); - if(TMath::Abs(pmQZPA-pmCZPA)<(0.1*(pmQZPA+pmCZPA)/2)) res=1.; - else res=0.5; - test += res; - ntests++; - // - //printf("\t %d performed tests, results %1.2f\n",ntests,test/ntests); + // ------------------------------------------------------------------- + } else if(index == AliQA::kESD) { + Int_t esdInd=0; + if(hdata->GetEntries()!=0){ + if(esdInd>1){ + if(hdata->GetMean()>10.) + test[specie] += 1.; + else + test[specie] = 0.5; + ntests[specie]++; + } } - } - // - digInd++; - } - // Check HITS histos - else{ - // hits histos - meanX = hdata->GetMean(1); - meanY = hdata->GetMean(2); - // check if the spot is centered - if((TMath::Abs(meanX)<0.2) && (TMath::Abs(meanY)<0.2)) res=1.; - else res=0.5; - test += res; - ntests++; - // - //printf("\t %d performed tests, results %1.2f\n",ntests,test/ntests); - } - } - else{ - AliError("AliZDCQAChecker-> No histos!!!\n"); + esdInd++; + // ------------------------------------------------------------------- + } else { + AliWarning(Form("\n\t No ZDC QA for %s task\n",taskName)); + return NULL; + } + } else + AliError("AliZDCQAChecker-> No histos!!!\n"); } } - if(ntests!=0) test = test/ntests; - printf("\n\tAliZDCQAChecker-> QA check result = %1.2f\n",test); - } - - // ------------------------------------------------------------------- - else if(index == AliQA::kRAW){ - - if(list->GetEntries()==0){ - AliWarning("\tAliZDCQAChecker->The list to be checked is empty!"); - test = 1.; // nothing to check - return test; - } - printf("\n\tAliZDCQAChecker-> checking QA histograms for task %s\n\n",taskName); - - TIter next(list); - TH1 * hdata; - Double_t meanZNA=0., rmsZNA=0., meanZNC=0.; - Double_t meanZPA=0., rmsZPA=0., meanZPC=0.; - Double_t pmCZNA=0., pmCZNC=0., pmCZPA=0., pmCZPC=0.; - Double_t pmQZNA=0., pmQZNC=0., pmQZPA=0., pmQZPC=0.; - Float_t res=0.; - Int_t rawInd=0, testgood=0; - ntests = 0; - // - while((hdata = dynamic_cast(next()))){ - if(hdata){ - // [1] check response of ZNC vs. ZNA - if(rawInd==0 || rawInd==1){ - if(rawInd==0){ - if(hdata->GetEntries() != 0.){ - testgood=1; - meanZNA = hdata->GetMean(); - rmsZNA = hdata->GetRMS(); - } - } - else{ - if(hdata->GetEntries() != 0.){ - testgood=1; - meanZNC = hdata->GetMean(); - } - else testgood=0; - // check if the response m.v. of ZNA and ZNC are equal (@ 1sigma level) - if(testgood==1){ - if(TMath::Abs(meanZNA-meanZNC)GetEntries() != 0.){ - testgood=1; - meanZPA = hdata->GetMean(); - rmsZPA = hdata->GetRMS(); - } - } - else{ - if(hdata->GetEntries() != 0.){ - testgood=1; - meanZPC = hdata->GetMean(); - } + // ==================================================================== + // Checks for A-A events + // ==================================================================== + //else if (beamType==1){ + else if ( specie == AliRecoParam::kHighMult) { + if(list[specie]->GetEntries()==0){ + AliWarning("\tAliZDCQAChecker->The list to be checked is empty!"); + return test; + } + //AliInfo(Form("\n\tAliZDCQAChecker-> checking QA histograms for task %s\n\n",taskName)); + + TIter next(list[specie]); + TH1 * hdata; + while((hdata = dynamic_cast(next()))){ + if(hdata){ + //AliInfo(Form("\tAliZDCQAChecker-> checking histo %s",hdata->GetName())); + ntests[specie] = 0; + Double_t meanX=0., meanY=0.; + Double_t meanZNA=0., rmsZNA=0., meanZNC=0.; + Double_t meanZPA=0., rmsZPA=0., meanZPC=0.; + Double_t pmCZNA=0., pmCZNC=0., pmCZPA=0., pmCZPC=0.; + Double_t pmQZNA=0., pmQZNC=0., pmQZPA=0., pmQZPC=0.; + Float_t res=0.; + Int_t testgood=0; + // ------------------------------------------------------------------- + if(index == AliQA::kSIM){ + Int_t digInd=0; + // Check DIGITS histos + if (!(strncmp(hdata->GetName(),"hDig",4))){ + // [1] check response of ZNC vs. ZNA + if(digInd==0 || digInd==1){ + if(digInd==0){ + if(hdata->GetEntries() != 0.){ + testgood=1; + meanZNA = hdata->GetMean(); + rmsZNA = hdata->GetRMS(); + } + } + else{ + if(hdata->GetEntries() != 0.){ + testgood=1; + meanZNC = hdata->GetMean(); + } + else testgood=0; + // check if the response m.v. of ZNA and ZNC are equal (@ 1sigma level) + if(testgood==1){ + if(TMath::Abs(meanZNA-meanZNC)GetEntries() != 0.){ + testgood=1; + meanZPA = hdata->GetMean(); + rmsZPA = hdata->GetRMS(); + } + } + else{ + if(hdata->GetEntries() != 0.){ + testgood=1; + meanZPC = hdata->GetMean(); + } // check if the response m.v. of ZPA and ZPC are equal (@ 3sigma level) if(testgood==1){ - if(TMath::Abs(meanZPA-meanZPC)<(3.*rmsZPA)) res=1.; - else res=.5; - test += res; - ntests++; - testgood=0; + if(TMath::Abs(meanZPA-meanZPC)<(3.*rmsZPA)) + res=1.; + else + res=.5; + test[specie] += res; + ntests[specie]++; + testgood=0; + //AliInfo(Form("\t %d performed tests, results %1.2f\n",ntests[specie],test[specie]/ntests[specie]); } else res=0.; - } - } - // [2] check PMC responses vs. summed PMQ responses - else if(rawInd>3 && rawInd<12){ - if(rawInd==4) pmQZNC = hdata->GetMean(); - else if(rawInd==5) pmQZNA = hdata->GetMean(); - else if(rawInd==6) pmQZPC = hdata->GetMean(); - else if(rawInd==7) pmQZPA = hdata->GetMean(); - else if(rawInd==8){ - pmCZNC = hdata->GetMean(); - if(TMath::Abs(pmQZNC-pmCZNC)<(0.1*(pmQZNC+pmCZNC)/2)) res=1.; - else res=0.5; - test += res; - ntests++; - } - else if(rawInd==9){ - pmCZNA = hdata->GetMean(); - if(TMath::Abs(pmQZNA-pmCZNA)<(0.1*(pmQZNA+pmCZNA)/2)) res=1.; - else res=0.5; - test += res; - ntests++; - } - else if(rawInd==10){ - pmCZPC = hdata->GetMean(); - if(TMath::Abs(pmQZPC-pmCZPC)<(0.1*(pmQZPC+pmCZPC)/2)) res=1.; - else res=0.5; - test += res; - ntests++; + } + } + // [2] check PMC responses vs. summed PMQ responses + else if(digInd>3 && digInd<12){ + if(digInd==4) pmQZNC = hdata->GetMean(); + else if(digInd==5) pmQZNA = hdata->GetMean(); + else if(digInd==6) pmQZPC = hdata->GetMean(); + else if(digInd==7) pmQZPA = hdata->GetMean(); + else if(digInd==8){ + pmCZNC = hdata->GetMean(); + if(TMath::Abs(pmQZNC-pmCZNC)<(0.1*(pmQZNC+pmCZNC)/2)) + res=1.; + else + res=0.5; + test[specie] += res; + ntests[specie]++; + //AliInfo(Form("\t %d performed tests, results %1.2f\n",ntests[specie],test[specie]/ntests[specie])); + } + else if(digInd==9){ + pmCZNA = hdata->GetMean(); + if(TMath::Abs(pmQZNA-pmCZNA)<(0.1*(pmQZNA+pmCZNA)/2)) + res=1.; + else + res=0.5; + test[specie] += res; + ntests[specie]++; + //AliInfo(Form("\t %d performed tests, results %1.2f\n",ntests[specie],test[specie]/ntests[specie])); + } + else if(digInd==10){ + pmCZPC = hdata->GetMean(); + if(TMath::Abs(pmQZPC-pmCZPC)<(0.1*(pmQZPC+pmCZPC)/2)) + res=1.; + else + res=0.5; + test[specie] += res; + ntests[specie]++; + //AliInfor(Form("\t %d performed tests, results %1.2f\n",ntests[specie],test[specie]/ntests[specie]); + } + else if(digInd==11){ + pmCZPA = hdata->GetMean(); + if(TMath::Abs(pmQZPA-pmCZPA)<(0.1*(pmQZPA+pmCZPA)/2)) + res=1.; + else + res=0.5; + test[specie] += res; + ntests[specie]++; + //AliInfor(Form("\t %d performed tests, results %1.2f\n",ntests[specie],test[specie]/ntests[specie])); + } + } + digInd++; } - else if(rawInd==11){ - pmCZPA = hdata->GetMean(); - if(TMath::Abs(pmQZPA-pmCZPA)<(0.1*(pmQZPA+pmCZPA)/2)) res=1.; - else res=0.5; - test += res; - ntests++; + // Check HITS histos + else{ + // hits histos + meanX = hdata->GetMean(1); + meanY = hdata->GetMean(2); + // check if the spot is centered + if((TMath::Abs(meanX)<0.2) && (TMath::Abs(meanY)<0.2)) + res=1.; + else + res=0.5; + test[specie] += res; + ntests[specie]++; + //AliInfo(Form("\t %d performed tests, results %1.2f\n",ntests[specie],test[specie]/ntests[specie]); } } - // - rawInd++; - } - // - //printf("\t %d performed tests, results %1.2f\n",ntests,test/ntests); - else{ - AliError("\t AliZDCQAChecker->No histos!!!\n"); - } - } - if(ntests!=0) test = test/ntests; - printf("\n\tAliZDCQAChecker-> QA check result = %1.2f\n",test); - } - - // ------------------------------------------------------------------- - else if(index == AliQA::kESD){ - - if(list->GetEntries()==0){ - AliWarning("\tAliZDCQAChecker->The list to be checked is empty!"); - test = 1.; // nothing to check - return test; - } - printf("\n\tAliZDCQAChecker-> checking QA histograms for task %s\n\n",taskName); - - TIter next(list); - TH1 * hdata; - Double_t meanX=0., meanY=0.; - Double_t meanZNA=0., rmsZNA=0., meanZNC=0.; - Double_t meanZPA=0., rmsZPA=0., meanZPC=0.; - Double_t eneCZNA=0., eneCZNC=0., eneCZPA=0., eneCZPC=0.; - Double_t eneQZNA=0., eneQZNC=0., eneQZPA=0., eneQZPC=0.; - Float_t res=0.; - Int_t esdInd=0, testgood=0; - // - ntests = 0; - // - while((hdata = dynamic_cast(next()))){ - if(hdata){ - //printf("\tAliZDCQAChecker-> checking histo %s",hdata->GetName()); - if(esdInd<2){ - // hits histos - meanX = hdata->GetMean(1); - meanY = hdata->GetMean(2); - // check if the spot is centered - if((TMath::Abs(meanX)<0.2) && (TMath::Abs(meanY)<0.2)) res=1.; - else res=0.5; - test += res; - ntests++; - } - // - else{ - // [1] check response of ZNC vs. ZNA - if(esdInd==0 || esdInd==1){ - if(esdInd==0){ - if(hdata->GetEntries() != 0.){ - testgood=1; - meanZNA = hdata->GetMean(); - rmsZNA = hdata->GetRMS(); - } - } - else{ - if(hdata->GetEntries() != 0.){ - testgood=1; - meanZNC = hdata->GetMean(); - } - else testgood=0; - // check if the response m.v. of ZNA and ZNC are equal (@ 1sigma level) - if(testgood==1){ - if(TMath::Abs(meanZNA-meanZNC)GetEntries() != 0.){ - testgood=1; - meanZPA = hdata->GetMean(); - rmsZPA = hdata->GetRMS(); - } - } - else{ - if(hdata->GetEntries() != 0.){ - testgood=1; - meanZPC = hdata->GetMean(); - } - // check if the response m.v. of ZPA and ZPC are equal (@ 3sigma level) - if(testgood==1){ - if(TMath::Abs(meanZPA-meanZPC)<(3.*rmsZPA)) res=1.; - else res=.5; - test += res; - ntests++; - testgood=0; - } - else res=0.; - } - } - // [2] check eneC responses vs. summed eneQ responses - else if(esdInd>3 && esdInd<12){ - if(esdInd==4) eneQZNC = hdata->GetMean(); - else if(esdInd==5) eneQZNA = hdata->GetMean(); - else if(esdInd==6) eneQZPC = hdata->GetMean(); - else if(esdInd==7) eneQZPA = hdata->GetMean(); - else if(esdInd==8){ - eneCZNC = hdata->GetMean(); - if(TMath::Abs(eneQZNC-eneCZNC)<(0.1*(eneQZNC+eneCZNC)/2)) res=1.; - else res=0.5; - test += res; - ntests++; + // ------------------------------------------------------------------- + else if(index == AliQA::kRAW){ + Int_t rawInd=0; + // [1] check response of ZNC vs. ZNA + if(rawInd==0 || rawInd==1){ + if(rawInd==0){ + if(hdata->GetEntries() != 0.){ + testgood=1; + meanZNA = hdata->GetMean(); + rmsZNA = hdata->GetRMS(); + } + } + else{ + if(hdata->GetEntries() != 0.){ + testgood=1; + meanZNC = hdata->GetMean(); + } + else testgood=0; + // check if the response m.v. of ZNA and ZNC are equal (@ 1sigma level) + if(testgood==1){ + if(TMath::Abs(meanZNA-meanZNC)GetMean(); - if(TMath::Abs(eneQZNA-eneCZNA)<(0.1*(eneQZNA+eneCZNA)/2)) res=1.; - else res=0.5; - test += res; - ntests++; + // [2] check response of ZPC vs. ZPA + else if(rawInd==2 || rawInd==3){ + if(rawInd==2){ + if(hdata->GetEntries() != 0.){ + testgood=1; + meanZPA = hdata->GetMean(); + rmsZPA = hdata->GetRMS(); + } + } + else{ + if(hdata->GetEntries() != 0.){ + testgood=1; + meanZPC = hdata->GetMean(); + } + // check if the response m.v. of ZPA and ZPC are equal (@ 3sigma level) + if(testgood==1){ + if(TMath::Abs(meanZPA-meanZPC)<(3.*rmsZPA)) + res=1.; + else + res=.5; + test[specie] += res; + ntests[specie]++; + testgood=0; + } + else + res=0.; + } } - else if(esdInd==10){ - eneCZPC = hdata->GetMean(); - if(TMath::Abs(eneQZPC-eneCZPC)<(0.1*(eneQZPC+eneCZPC)/2)) res=1.; - else res=0.5; - test += res; - ntests++; + // [2] check PMC responses vs. summed PMQ responses + else if(rawInd>3 && rawInd<12){ + if(rawInd==4) pmQZNC = hdata->GetMean(); + else if(rawInd==5) pmQZNA = hdata->GetMean(); + else if(rawInd==6) pmQZPC = hdata->GetMean(); + else if(rawInd==7) pmQZPA = hdata->GetMean(); + else if(rawInd==8){ + pmCZNC = hdata->GetMean(); + if(TMath::Abs(pmQZNC-pmCZNC)<(0.1*(pmQZNC+pmCZNC)/2)) + res=1.; + else + res=0.5; + test[specie] += res; + ntests[specie]++; + } + else if(rawInd==9){ + pmCZNA = hdata->GetMean(); + if(TMath::Abs(pmQZNA-pmCZNA)<(0.1*(pmQZNA+pmCZNA)/2)) + res=1.; + else + res=0.5; + test[specie] += res; + ntests[specie]++; + } + else if(rawInd==10){ + pmCZPC = hdata->GetMean(); + if(TMath::Abs(pmQZPC-pmCZPC)<(0.1*(pmQZPC+pmCZPC)/2)) + res=1.; + else + res=0.5; + test[specie] += res; + ntests[specie]++; + } + else if(rawInd==11){ + pmCZPA = hdata->GetMean(); + if(TMath::Abs(pmQZPA-pmCZPA)<(0.1*(pmQZPA+pmCZPA)/2)) + res=1.; + else + res=0.5; + test[specie] += res; + ntests[specie]++; + } + } + rawInd++; + } + // ------------------------------------------------------------------- + else if(index == AliQA::kESD){ + Double_t eneQZNC, eneQZNA ; + Double_t eneQZPC, eneQZPA ; + Double_t eneCZNC, eneCZNA ; + Double_t eneCZPC, eneCZPA ; + Int_t esdInd=0; + if(esdInd<2){ + // hits histos + meanX = hdata->GetMean(1); + meanY = hdata->GetMean(2); + // check if the spot is centered + if((TMath::Abs(meanX)<0.2) && (TMath::Abs(meanY)<0.2)) + res=1.; + else + res=0.5; + test[specie] += res; + ntests[specie]++; } - else if(esdInd==11){ - eneCZPA = hdata->GetMean(); - if(TMath::Abs(eneQZPA-eneCZPA)<(0.1*(eneQZPA+eneCZPA)/2)) res=1.; - else res=0.5; - test += res; - ntests++; + // + else{ + // [1] check response of ZNC vs. ZNA + if(esdInd==0 || esdInd==1){ + if(esdInd==0){ + if(hdata->GetEntries() != 0.){ + testgood=1; + meanZNA = hdata->GetMean(); + rmsZNA = hdata->GetRMS(); + } + } + else{ + if(hdata->GetEntries() != 0.){ + testgood=1; + meanZNC = hdata->GetMean(); + } + else testgood=0; + // check if the response m.v. of ZNA and ZNC are equal (@ 1sigma level) + if(testgood==1){ + if(TMath::Abs(meanZNA-meanZNC)GetEntries() != 0.){ + testgood=1; + meanZPA = hdata->GetMean(); + rmsZPA = hdata->GetRMS(); + } + } + else{ + if(hdata->GetEntries() != 0.){ + testgood=1; + meanZPC = hdata->GetMean(); + } + // check if the response m.v. of ZPA and ZPC are equal (@ 3sigma level) + if(testgood==1){ + if(TMath::Abs(meanZPA-meanZPC)<(3.*rmsZPA)) + res=1.; + else + res=.5; + test[specie] += res; + ntests[specie]++; + testgood=0; + } + else res=0.; + } + } + // [2] check eneC responses vs. summed eneQ responses + else if(esdInd>3 && esdInd<12){ + if(esdInd==4) eneQZNC = hdata->GetMean(); + else if(esdInd==5) eneQZNA = hdata->GetMean(); + else if(esdInd==6) eneQZPC = hdata->GetMean(); + else if(esdInd==7) eneQZPA = hdata->GetMean(); + else if(esdInd==8){ + eneCZNC = hdata->GetMean(); + if(TMath::Abs(eneQZNC-eneCZNC)<(0.1*(eneQZNC+eneCZNC)/2)) + res=1.; + else + res=0.5; + test[specie] += res; + ntests[specie]++; + } + else if(esdInd==9){ + eneCZNA = hdata->GetMean(); + if(TMath::Abs(eneQZNA-eneCZNA)<(0.1*(eneQZNA+eneCZNA)/2)) + res=1.; + else + res=0.5; + test[specie] += res; + ntests[specie]++; + } + else if(esdInd==10){ + eneCZPC = hdata->GetMean(); + if(TMath::Abs(eneQZPC-eneCZPC)<(0.1*(eneQZPC+eneCZPC)/2)) + res=1.; + else + res=0.5; + test[specie] += res; + ntests[specie]++; + } + else if(esdInd==11){ + eneCZPA = hdata->GetMean(); + if(TMath::Abs(eneQZPA-eneCZPA)<(0.1*(eneQZPA+eneCZPA)/2)) + res=1.; + else + res=0.5; + test[specie] += res; + ntests[specie]++; + } + } + esdInd++; } + //AliInfor(Form("\t %d performed tests, results %1.2f\n",ntests[specie],test[specie]/ntests[specie])); } - // - esdInd++; + else { + AliWarning(Form("\n\t No ZDC QA for %s task\n",taskName)); + return NULL; + } + } else + AliError("\t AliZDCQAChecker->No histos!!!\n"); } - // - //printf("\t %d performed tests, results %1.2f\n",ntests,test/ntests); - } - else{ - AliError("AliZDCQAChecker-> No histos!!!\n"); - } + } else { + AliError(Form("Checking not implemented for %s, %s", + AliRecoParam::GetEventSpecieName(AliRecoParam::kCosmic), + AliRecoParam::GetEventSpecieName(AliRecoParam::kCalib))) ; } - if(ntests!=0) test = test/ntests; - printf("\n\tAliZDCQAChecker-> QA check result = %1.2f\n\n",test); } - else{ - AliWarning(Form("\n\t No ZDC QA for %s task\n",taskName)); - return 1.; + + for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) { + if(ntests[specie]!=0) test[specie] = test[specie]/ntests[specie]; + printf("\n\tAliZDCQAChecker-> QA check result = %1.2f\n",test[specie]); } - } - - AliInfo(Form("Test Result = %f", test)); - return test; + delete [] ntests ; + return test; } + diff --git a/ZDC/AliZDCQAChecker.h b/ZDC/AliZDCQAChecker.h index 0d32cd5cd44..56c21ef0413 100644 --- a/ZDC/AliZDCQAChecker.h +++ b/ZDC/AliZDCQAChecker.h @@ -22,11 +22,8 @@ public: protected: - virtual Double_t Check(AliQA::ALITASK_t index, TObjArray * list); - virtual Double_t Check(AliQA::ALITASK_t /*index*/) {return 0.5;} - virtual Double_t Check() {return 0.;} - virtual Double_t Check(TObjArray*) {return 0.;} - virtual Double_t Check(AliQA::ALITASK_t, TNtupleD*) {return 0.;} + virtual Double_t * Check(AliQA::ALITASK_t index, TObjArray ** list) ; + virtual Double_t * Check(AliQA::ALITASK_t /*index*/) { return NULL ; } ClassDef(AliZDCQAChecker,1) // description diff --git a/ZDC/AliZDCQADataMakerRec.cxx b/ZDC/AliZDCQADataMakerRec.cxx index 9c7625cda2b..b66919a396f 100644 --- a/ZDC/AliZDCQADataMakerRec.cxx +++ b/ZDC/AliZDCQADataMakerRec.cxx @@ -364,7 +364,7 @@ void AliZDCQADataMakerRec::StartOfDetectorCycle() } //____________________________________________________________________________ -void AliZDCQADataMakerRec::EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray * list) +void AliZDCQADataMakerRec::EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray ** list) { //Detector specific actions at end of cycle // do the QA checking diff --git a/ZDC/AliZDCQADataMakerRec.h b/ZDC/AliZDCQADataMakerRec.h index 75a4739ffb6..d0586de080d 100644 --- a/ZDC/AliZDCQADataMakerRec.h +++ b/ZDC/AliZDCQADataMakerRec.h @@ -28,7 +28,7 @@ private: virtual void MakeRaws(AliRawReader* rawReader) ; virtual void MakeESDs(AliESDEvent * esd) ; virtual void StartOfDetectorCycle() ; - virtual void EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray * list) ; + virtual void EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray ** list) ; ClassDef(AliZDCQADataMakerRec,1) // description diff --git a/ZDC/AliZDCQADataMakerSim.cxx b/ZDC/AliZDCQADataMakerSim.cxx index 9e09cc78a6e..fbbb6c89b3b 100644 --- a/ZDC/AliZDCQADataMakerSim.cxx +++ b/ZDC/AliZDCQADataMakerSim.cxx @@ -310,7 +310,7 @@ void AliZDCQADataMakerSim::StartOfDetectorCycle() } //____________________________________________________________________________ -void AliZDCQADataMakerSim::EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray * list) +void AliZDCQADataMakerSim::EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray ** list) { // Detector specific actions at end of cycle // do the QA checking diff --git a/ZDC/AliZDCQADataMakerSim.h b/ZDC/AliZDCQADataMakerSim.h index 981cd29eeb6..7ec17716a7b 100644 --- a/ZDC/AliZDCQADataMakerSim.h +++ b/ZDC/AliZDCQADataMakerSim.h @@ -32,7 +32,7 @@ private: virtual void MakeSDigits(TClonesArray * /*sdigits*/) {;} virtual void MakeSDigits(TTree * /*sdigTree*/) {;} virtual void StartOfDetectorCycle(); - virtual void EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray * list); + virtual void EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray ** list); // TClonesArray *fHits; //! Array containing ZDC hits AliZDCDigit *fDigit; //! Pointer to digit in tree diff --git a/test/QA/Config.C b/test/QA/Config.C index e0289ee2f1a..3d0c595ae47 100644 --- a/test/QA/Config.C +++ b/test/QA/Config.C @@ -43,7 +43,7 @@ #include "STEER/AliConfig.h" #include "PYTHIA6/AliDecayerPythia.h" #include "PYTHIA6/AliGenPythia.h" -#include "STEER/AliMagWrapCheb.h" +#include "STEER/AliMagFCheb.h" #include "STRUCT/AliBODY.h" #include "STRUCT/AliMAG.h" #include "STRUCT/AliABSOv3.h" @@ -183,14 +183,23 @@ void Config() // Get settings from environment variables ProcessEnvironmentVars(); + // Random Number seed + if (gSystem->Getenv("CONFIG_SEED")) { + seed = atoi(gSystem->Getenv("CONFIG_SEED")); + } + else if(gSystem->Getenv("DC_EVENT") && gSystem->Getenv("DC_RUN")){ + seed = runNumber * 100000 + eventNumber; + } + gRandom->SetSeed(seed); + cout<<"Seed for random number generation= "<GetSeed()<Load("liblhapdf.so"); // Parton density functions - gSystem->Load("libpythia6.so"); // Pythia + gSystem->Load("liblhapdf"); // Parton density functions + gSystem->Load("libEGPythia6"); // TGenerator interface + gSystem->Load("libpythia6"); // Pythia + gSystem->Load("libAliPythia6"); // ALICE specific implementations gSystem->Load("libgeant321"); - gSystem->Load("libEG"); - gSystem->Load("libEGPythia6.so"); // TGenerator interface - gSystem->Load("libAliPythia6.so"); // ALICE specific implementations #endif new TGeant3TGeo("C++ Interface to Geant3"); @@ -200,6 +209,9 @@ void Config() //======================================================================= // Run loader AliRunLoader* rl=0x0; + + AliLog::Message(AliLog::kInfo, "Creating Run Loader", "", "", "Config()"," ConfigPPR.C", __LINE__); + rl = AliRunLoader::Open("galice.root", AliConfig::GetDefaultEventFolderName(), "recreate"); @@ -209,16 +221,38 @@ void Config() return; } rl->SetCompressionLevel(2); - rl->SetNumberOfEventsPerFile(1000); + rl->SetNumberOfEventsPerFile(100); gAlice->SetRunLoader(rl); - // Run number - //gAlice->SetRunNumber(runNumber); - // Set the trigger configuration gAlice->SetTriggerDescriptor(TrigConfName[trig]); cout<<"Trigger configuration is set to "<SetForceDecay(kAll); + break; + case kHadr: + decayer->SetForceDecay(kHadronicD); + break; + case kSemiEl: + decayer->SetForceDecay(kSemiElectronic); + break; + case kSemiMu: + decayer->SetForceDecay(kSemiMuonic); + break; + } + decayer->Init(); + gMC->SetExternalDecayer(decayer); + if(proc == kPyJetJetPHOSv2) // in this case we decay the pi0 + decayer->SetForceDecay(kNeutralPion); + // //======================================================================= // ************* STEERING parameters FOR ALICE SIMULATION ************** @@ -256,30 +290,6 @@ void Config() gMC->SetCut("PPCUTM", cut); gMC->SetCut("TOFMAX", tofmax); - //======================// - // Set External decayer // - //======================// - TVirtualMCDecayer* decayer = new AliDecayerPythia(); - // DECAYS - // - switch(decHvFl) { - case kNature: - decayer->SetForceDecay(kAll); - break; - case kHadr: - decayer->SetForceDecay(kHadronicD); - break; - case kSemiEl: - decayer->SetForceDecay(kSemiElectronic); - break; - case kSemiMu: - decayer->SetForceDecay(kSemiMuonic); - break; - } - decayer->Init(); - gMC->SetExternalDecayer(decayer); - if(proc == kPyJetJetPHOSv2) // in this case we decay the pi0 - decayer->SetForceDecay(kNeutralPion); //=========================// // Generator Configuration // @@ -400,10 +410,10 @@ void Config() } printf("\n \n Comment: %s \n \n", comment.Data()); - AliMagWrapCheb* field = new AliMagWrapCheb("Maps","Maps", 2, 1., 10., mag); + AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 1., 10., mag); + field->SetL3ConstField(0); //Using const. field in the barrel rl->CdGAFile(); - gAlice->SetField(field); - + gAlice->SetField(field); Int_t iABSO = 1; @@ -917,15 +927,7 @@ void ProcessEnvironmentVars() } //cout<<"Event number "<Getenv("CONFIG_SEED")) { - seed = atoi(gSystem->Getenv("CONFIG_SEED")); - } - else if(gSystem->Getenv("DC_EVENT") && gSystem->Getenv("DC_RUN")){ - seed = runNumber * 100000 + eventNumber; - } - gRandom->SetSeed(seed); cout<<"////////////////////////////////////////////////////////////////////////////////////"<GetSeed()<