From: schutz Date: Fri, 19 Oct 2007 18:04:29 +0000 (+0000) Subject: The standalone QA data maker is called from AliSimulation and AliReconstruction outsi... X-Git-Url: http://git.uio.no/git/?a=commitdiff_plain;h=c65c502a01b61b2ef74c74e3532768e30ed7d51a;p=u%2Fmrichter%2FAliRoot.git The standalone QA data maker is called from AliSimulation and AliReconstruction outside the event loop; i.e. re-reading the data. The QA data making in the event loop has been commented out. --- diff --git a/PHOS/AliPHOSDigitizer.cxx b/PHOS/AliPHOSDigitizer.cxx index 944d1dbe8c3..22c098fb389 100644 --- a/PHOS/AliPHOSDigitizer.cxx +++ b/PHOS/AliPHOSDigitizer.cxx @@ -18,6 +18,9 @@ /* History of cvs commits: * * $Log$ + * Revision 1.101 2007/10/14 21:08:10 schutz + * Introduced the checking of QA results from previous step before entering the event loop + * * Revision 1.100 2007/10/10 09:05:10 schutz * Changing name QualAss to QA * @@ -155,7 +158,7 @@ AliPHOSDigitizer::AliPHOSDigitizer() : fEventFolderName(""), fFirstEvent(0), fLastEvent(0), - fQADM (0x0), +// fQADM (0x0), fEventCounter(0) { // ctor @@ -190,7 +193,7 @@ AliPHOSDigitizer::AliPHOSDigitizer(TString alirunFileName, fEventFolderName(eventFolderName), fFirstEvent(0), fLastEvent(0), - fQADM (0x0), +// fQADM (0x0), fEventCounter(0) { // ctor @@ -198,13 +201,13 @@ AliPHOSDigitizer::AliPHOSDigitizer(TString alirunFileName, Init() ; fDefaultInit = kFALSE ; fManager = 0 ; // We work in the standalong mode - //Initialize the quality assurance data maker only once - fQADM = new AliPHOSQADataMaker() ; - //FIXME: get the run number - Int_t run = 0 ; - //EMXIF - GetQADataMaker()->Init(AliQA::kDIGITS, run, fgkCycles) ; - GetQADataMaker()->StartOfCycle(AliQA::kDIGITS) ; + // //Initialize the quality assurance data maker only once +// fQADM = new AliPHOSQADataMaker() ; +// //FIXME: get the run number +// Int_t run = 0 ; +// //EMXIF +// GetQADataMaker()->Init(AliQA::kDIGITS, run, fgkCycles) ; +// GetQADataMaker()->StartOfCycle(AliQA::kDIGITS) ; } //____________________________________________________________________________ @@ -233,7 +236,7 @@ AliPHOSDigitizer::AliPHOSDigitizer(const AliPHOSDigitizer & d) : fEventFolderName(d.fEventFolderName), fFirstEvent(d.fFirstEvent), fLastEvent(d.fLastEvent), - fQADM (d.fQADM), +// fQADM (d.fQADM), fEventCounter(0) { @@ -242,10 +245,10 @@ AliPHOSDigitizer::AliPHOSDigitizer(const AliPHOSDigitizer & d) : SetTitle(d.GetTitle()) ; //Initialize the quality assurance data maker only once //FIXME: get the run number - Int_t run = 0 ; - //EMXIF - GetQADataMaker()->Init(AliQA::kDIGITS, run, fgkCycles) ; - GetQADataMaker()->StartOfCycle(AliQA::kDIGITS) ; +// Int_t run = 0 ; +// //EMXIF +// GetQADataMaker()->Init(AliQA::kDIGITS, run, fgkCycles) ; +// GetQADataMaker()->StartOfCycle(AliQA::kDIGITS) ; } //____________________________________________________________________________ @@ -274,7 +277,7 @@ AliPHOSDigitizer::AliPHOSDigitizer(AliRunDigitizer * rd) : fEventFolderName(fManager->GetInputFolderName(0)), fFirstEvent(0), fLastEvent(0), - fQADM (0x0), +// fQADM (0x0), fEventCounter(0) { @@ -284,12 +287,12 @@ AliPHOSDigitizer::AliPHOSDigitizer(AliRunDigitizer * rd) : InitParameters() ; fDefaultInit = kFALSE ; //Initialize the quality assurance data maker only once - fQADM = new AliPHOSQADataMaker() ; - //FIXME: get the run number - Int_t run = 0 ; - //EMXIF - GetQADataMaker()->Init(AliQA::kDIGITS, run) ; - GetQADataMaker()->StartOfCycle(AliQA::kDIGITS) ; +// fQADM = new AliPHOSQADataMaker() ; +// //FIXME: get the run number +// Int_t run = 0 ; +// //EMXIF +// GetQADataMaker()->Init(AliQA::kDIGITS, run) ; +// GetQADataMaker()->StartOfCycle(AliQA::kDIGITS) ; } //____________________________________________________________________________ @@ -303,7 +306,7 @@ AliPHOSDigitizer::AliPHOSDigitizer(AliRunDigitizer * rd) : delete [] fInputFileNames ; delete [] fEventNames ; - delete fQADM ; +// delete fQADM ; } @@ -660,13 +663,13 @@ void AliPHOSDigitizer::Exec(Option_t *option) Digitize(ievent) ; //Add prepared SDigits to digits and add the noise - //makes the quality assurance data - if (GetQADataMaker()->IsCycleDone() ) { - GetQADataMaker()->EndOfCycle(AliQA::kDIGITS) ; - GetQADataMaker()->StartOfCycle(AliQA::kDIGITS) ; - } - GetQADataMaker()->Exec(AliQA::kDIGITS, gime->Digits()) ; - GetQADataMaker()->Increment() ; +// //makes the quality assurance data +// if (GetQADataMaker()->IsCycleDone() ) { +// GetQADataMaker()->EndOfCycle(AliQA::kDIGITS) ; +// GetQADataMaker()->StartOfCycle(AliQA::kDIGITS) ; +// } +// GetQADataMaker()->Exec(AliQA::kDIGITS, gime->Digits()) ; +// GetQADataMaker()->Increment() ; WriteDigits() ; @@ -677,11 +680,11 @@ void AliPHOSDigitizer::Exec(Option_t *option) fDigitsInRun += gime->Digits()->GetEntriesFast() ; } - //Write the quality assurance data only after the last event - if ( fEventCounter == gime->MaxEvent() ) { - GetQADataMaker()->EndOfCycle(AliQA::kDIGITS) ; - GetQADataMaker()->Finish(AliQA::kDIGITS) ; - } +// //Write the quality assurance data only after the last event +// if ( fEventCounter == gime->MaxEvent() ) { +// GetQADataMaker()->EndOfCycle(AliQA::kDIGITS) ; +// GetQADataMaker()->Finish() ; +// } gime->PhosLoader()->CleanDigitizer(); diff --git a/PHOS/AliPHOSDigitizer.h b/PHOS/AliPHOSDigitizer.h index aefc71ffbf6..861b413726e 100644 --- a/PHOS/AliPHOSDigitizer.h +++ b/PHOS/AliPHOSDigitizer.h @@ -8,6 +8,9 @@ /* History of cvs commits: * * $Log$ + * Revision 1.37 2007/10/10 09:05:10 schutz + * Changing name QualAss to QA + * * Revision 1.36 2007/09/30 17:08:20 schutz * Introducing the notion of QA data acquisition cycle (needed by online) * @@ -41,7 +44,7 @@ class TClonesArray ; // --- AliRoot header files --- #include "AliDigitizer.h" class AliPHOSSDigitizer ; -class AliPHOSQADataMaker ; +//class AliPHOSQADataMaker ; class AliRunDigitizer ; class AliPHOSDigitizer: public AliDigitizer { @@ -100,7 +103,7 @@ public: private: - AliPHOSQADataMaker * GetQADataMaker() const { return fQADM ; } +// AliPHOSQADataMaker * GetQADataMaker() const { return fQADM ; } virtual Bool_t Init() ; void InitParameters() ; @@ -149,11 +152,11 @@ private: TString fEventFolderName; // skowron: name of EFN to read data from in stand alone mode Int_t fFirstEvent; // first event to process Int_t fLastEvent; // last event to process - AliPHOSQADataMaker * fQADM ; //!Quality Assurance Data Maker +// AliPHOSQADataMaker * fQADM ; //!Quality Assurance Data Maker Int_t fEventCounter ; //! counts the events processed //QA stuff - static const Int_t fgkCycles = 9999 ; // QA data accumulation cycle +// static const Int_t fgkCycles = 9999 ; // QA data accumulation cycle ClassDef(AliPHOSDigitizer,4) // description diff --git a/PHOS/AliPHOSQADataMaker.cxx b/PHOS/AliPHOSQADataMaker.cxx index 522bf37675f..837c1de8483 100644 --- a/PHOS/AliPHOSQADataMaker.cxx +++ b/PHOS/AliPHOSQADataMaker.cxx @@ -113,7 +113,7 @@ void AliPHOSQADataMaker::InitDigits() Add2DigitsList(h0, 0) ; TH1I * h1 = new TH1I("hPhosDigitsMul", "Digits multiplicity distribution in PHOS", 500, 0, 1000) ; h1->Sumw2() ; - Add2DigitsList(h1, 0) ; + Add2DigitsList(h1, 1) ; } //____________________________________________________________________________ diff --git a/PHOS/AliPHOSSDigitizer.cxx b/PHOS/AliPHOSSDigitizer.cxx index 9f9d44a229e..f39ba09462d 100644 --- a/PHOS/AliPHOSSDigitizer.cxx +++ b/PHOS/AliPHOSSDigitizer.cxx @@ -7,7 +7,8 @@ * Permission to use, copy, modify and distribute this software and its * * documentation strictly for non-commercial purposes is hereby granted * * without fee, provided that the above copyright notice appears in all * - * copies and that both the copyright notice and this permission notice *Ă„Qual * appear in the supporting documentation. The authors make no claims * + * copies and that both the copyright notice and this permission notice * + * appear in the supporting documentation. The authors make no claims * * about the suitability of this software for any purpose. It is * * provided "as is" without express or implied warranty. * **************************************************************************/ @@ -18,6 +19,9 @@ /* History of cvs commits: * * $Log$ + * Revision 1.55 2007/10/14 21:08:10 schutz + * Introduced the checking of QA results from previous step before entering the event loop + * * Revision 1.54 2007/10/10 09:05:10 schutz * Changing name QualAss to QA * @@ -106,8 +110,8 @@ AliPHOSSDigitizer::AliPHOSSDigitizer() : fInit(kFALSE), fSDigitsInRun(0), fFirstEvent(0), - fLastEvent(0), - fQADM (0x0) + fLastEvent(0) +// , fQADM (0x0) { // ctor // Intialize the quality assurance data maker @@ -124,21 +128,21 @@ AliPHOSSDigitizer::AliPHOSSDigitizer(const char * alirunFileName, fInit(kFALSE), fSDigitsInRun(0), fFirstEvent(0), - fLastEvent(0), - fQADM (0x0) + fLastEvent(0) +// , fQADM (0x0) { // ctor InitParameters() ; Init(); fDefaultInit = kFALSE ; - // Intialize the quality assurance data maker - //FIXME: get the run number - Int_t run = 0 ; - //EMXIF - GetQADataMaker()->Init(AliQA::kHITS, run, fgkCycles) ; - GetQADataMaker()->StartOfCycle(AliQA::kHITS) ; - GetQADataMaker()->Init(AliQA::kSDIGITS, run) ; - GetQADataMaker()->StartOfCycle(AliQA::kSDIGITS, "same") ; +// // Intialize the quality assurance data maker +// //FIXME: get the run number +// Int_t run = 0 ; +// //EMXIF +// GetQADataMaker()->Init(AliQA::kHITS, run, fgkCycles) ; +// GetQADataMaker()->StartOfCycle(AliQA::kHITS) ; +// GetQADataMaker()->Init(AliQA::kSDIGITS, run) ; +// GetQADataMaker()->StartOfCycle(AliQA::kSDIGITS, kTRUE) ; } //____________________________________________________________________________ @@ -151,18 +155,18 @@ AliPHOSSDigitizer::AliPHOSSDigitizer(const AliPHOSSDigitizer& sd) : fInit(kFALSE), fSDigitsInRun(sd.fSDigitsInRun), fFirstEvent(sd.fFirstEvent), - fLastEvent(sd.fLastEvent), - fQADM (sd.fQADM) + fLastEvent(sd.fLastEvent) +// , fQADM (sd.fQADM) { // cpy ctor - // Intialize the quality assurance data maker - //FIXME: get the run number - Int_t run = 0 ; - //EMXIF - GetQADataMaker()->Init(AliQA::kHITS, run, fgkCycles) ; - GetQADataMaker()->StartOfCycle(AliQA::kHITS) ; - GetQADataMaker()->Init(AliQA::kSDIGITS, run) ; - GetQADataMaker()->StartOfCycle(AliQA::kSDIGITS, "same") ; +// // Intialize the quality assurance data maker +// //FIXME: get the run number +// Int_t run = 0 ; +// //EMXIF +// GetQADataMaker()->Init(AliQA::kHITS, run, fgkCycles) ; +// GetQADataMaker()->StartOfCycle(AliQA::kHITS) ; +// GetQADataMaker()->Init(AliQA::kSDIGITS, run) ; +// GetQADataMaker()->StartOfCycle(AliQA::kSDIGITS, kTRUE) ; } //_____________________________________________________________________________ @@ -183,7 +187,7 @@ AliPHOSSDigitizer::~AliPHOSSDigitizer() { AliPHOSGetter * gime = AliPHOSGetter::Instance(); gime->PhosLoader()->CleanSDigitizer(); - delete fQADM ; +// delete fQADM ; } //____________________________________________________________________________ @@ -208,7 +212,7 @@ void AliPHOSSDigitizer::Init() gime->PostSDigitizer(this); gime->PhosLoader()->GetSDigitsDataLoader()->GetBaseTaskLoader()->SetDoNotReload(kTRUE); - fQADM = new AliPHOSQADataMaker() ; +// fQADM = new AliPHOSQADataMaker() ; } @@ -305,17 +309,17 @@ void AliPHOSSDigitizer::Exec(Option_t *option) digit->SetIndexInList(i) ; } - // make Quality Assurance data - - if (GetQADataMaker()->IsCycleDone() ) { - GetQADataMaker()->EndOfCycle(AliQA::kHITS) ; - GetQADataMaker()->EndOfCycle(AliQA::kSDIGITS) ; - GetQADataMaker()->StartOfCycle(AliQA::kHITS) ; - GetQADataMaker()->StartOfCycle(AliQA::kSDIGITS, "same") ; - } - GetQADataMaker()->Exec(AliQA::kHITS, hits) ; - GetQADataMaker()->Exec(AliQA::kSDIGITS, sdigits) ; - GetQADataMaker()->Increment() ; +// // make Quality Assurance data +// +// if (GetQADataMaker()->IsCycleDone() ) { +// GetQADataMaker()->EndOfCycle(AliQA::kHITS) ; +// GetQADataMaker()->EndOfCycle(AliQA::kSDIGITS) ; +// GetQADataMaker()->StartOfCycle(AliQA::kHITS) ; +// GetQADataMaker()->StartOfCycle(AliQA::kSDIGITS, kTRUE) ; +// } +// GetQADataMaker()->Exec(AliQA::kHITS, hits) ; +// GetQADataMaker()->Exec(AliQA::kSDIGITS, sdigits) ; +// GetQADataMaker()->Increment() ; //Now write SDigits @@ -340,11 +344,10 @@ void AliPHOSSDigitizer::Exec(Option_t *option) //memwatcher.Watch(ievent); }// event loop - //Write the quality assurance data - GetQADataMaker()->EndOfCycle(AliQA::kHITS) ; - GetQADataMaker()->EndOfCycle(AliQA::kSDIGITS) ; - GetQADataMaker()->Finish(AliQA::kHITS) ; - GetQADataMaker()->Finish(AliQA::kSDIGITS) ; +// //Write the quality assurance data +// GetQADataMaker()->EndOfCycle(AliQA::kHITS) ; +// GetQADataMaker()->EndOfCycle(AliQA::kSDIGITS) ; +// GetQADataMaker()->Finish() ; Unload(); diff --git a/PHOS/AliPHOSSDigitizer.h b/PHOS/AliPHOSSDigitizer.h index 03fe5358c63..4bebb781a1b 100644 --- a/PHOS/AliPHOSSDigitizer.h +++ b/PHOS/AliPHOSSDigitizer.h @@ -9,6 +9,9 @@ /* History of cvs commits: * * $Log$ + * Revision 1.29 2007/10/10 09:05:10 schutz + * Changing name QualAss to QA + * * Revision 1.28 2007/09/30 17:08:20 schutz * Introducing the notion of QA data acquisition cycle (needed by online) * @@ -43,7 +46,7 @@ class TFile ; // --- Standard library --- // --- AliRoot header files --- -class AliPHOSQADataMaker ; +//class AliPHOSQADataMaker ; class AliPHOSSDigitizer: public TTask { @@ -67,7 +70,7 @@ public: private: - AliPHOSQADataMaker * GetQADataMaker() const { return fQADM ; } +// AliPHOSQADataMaker * GetQADataMaker() const { return fQADM ; } void Init() ; void InitParameters() ; @@ -86,8 +89,8 @@ private: Int_t fFirstEvent; // first event to process Int_t fLastEvent; // last event to process - AliPHOSQADataMaker * fQADM ; //!Quality Assurance Data Maker - static const Int_t fgkCycles = 9999 ; // QA data accumulation cycle +// AliPHOSQADataMaker * fQADM ; //!Quality Assurance Data Maker +// static const Int_t fgkCycles = 9999 ; // QA data accumulation cycle ClassDef(AliPHOSSDigitizer,4) // description diff --git a/STEER/AliQADataMaker.cxx b/STEER/AliQADataMaker.cxx index 4c09c1e1262..0d505c1cd59 100644 --- a/STEER/AliQADataMaker.cxx +++ b/STEER/AliQADataMaker.cxx @@ -236,7 +236,7 @@ void AliQADataMaker::Exec(AliQA::TASKINDEX task, TObject * data) } //____________________________________________________________________________ -void AliQADataMaker::Finish(AliQA::TASKINDEX) const +void AliQADataMaker::Finish() const { // write to the output File fOutput->Close() ; @@ -356,11 +356,19 @@ void AliQADataMaker::Init(AliQA::TASKINDEX task, TList * list, Int_t run, Int_t } //____________________________________________________________________________ -void AliQADataMaker::StartOfCycle(AliQA::TASKINDEX task, Option_t * sameCycle) +void AliQADataMaker::Reset() +{ + // Resets defaut value of data members + fCurrentCycle = -1 ; + fCycleCounter = 0 ; +} + +//____________________________________________________________________________ +void AliQADataMaker::StartOfCycle(AliQA::TASKINDEX task, const Bool_t sameCycle) { // Finishes a cycle of QA data acquistion - if ( (strcmp(sameCycle, "new") == 0) ) { + if ( !sameCycle ) { ResetCycle() ; if (fOutput) fOutput->Close() ; diff --git a/STEER/AliQADataMaker.h b/STEER/AliQADataMaker.h index 34d32ecdc64..bbb5a3d6a28 100644 --- a/STEER/AliQADataMaker.h +++ b/STEER/AliQADataMaker.h @@ -48,7 +48,7 @@ public: const Int_t Add2SDigitsList(TH1 * hist, const Int_t index) { return Add2List(hist, index, fSDigitsQAList) ; } virtual void Exec(AliQA::TASKINDEX, TObject * data) ; void EndOfCycle(AliQA::TASKINDEX) ; - void Finish(AliQA::TASKINDEX task) const ; + void Finish() const ; TH1 * GetDigitsData(const Int_t index) { return dynamic_cast(GetData(fDigitsQAList, index)) ; } TH1 * GetESDsData(const Int_t index) { return dynamic_cast(GetData(fESDsQAList, index)) ; } TH1 * GetHitsData(const Int_t index) { return dynamic_cast(GetData(fHitsQAList, index)) ; } @@ -60,8 +60,9 @@ public: TList * Init(AliQA::TASKINDEX, Int_t run, Int_t cycles = -1) ; void Init(AliQA::TASKINDEX, TList * list, Int_t run, Int_t cycles = -1) ; const Bool_t IsCycleDone() const { return fCycleCounter > fCycle ? kTRUE : kFALSE ; } + void Reset() ; void SetCycle(Int_t nevts) { fCycle = nevts ; } - void StartOfCycle(AliQA::TASKINDEX, Option_t * sameCycle = "new") ; + void StartOfCycle(AliQA::TASKINDEX, const Bool_t sameCycle = kFALSE) ; protected: diff --git a/STEER/AliQADataMakerSteer.cxx b/STEER/AliQADataMakerSteer.cxx index 743edc96185..8f3346cde4e 100644 --- a/STEER/AliQADataMakerSteer.cxx +++ b/STEER/AliQADataMakerSteer.cxx @@ -35,7 +35,7 @@ ClassImp(AliQADataMakerSteer) //_____________________________________________________________________________ AliQADataMakerSteer::AliQADataMakerSteer(const char* gAliceFilename, const char * name, const char * title) : TNamed(name, title), - fCycleOption("new"), + fCycleSame(kFALSE), fESD(NULL), fESDTree(NULL), fFirst(kTRUE), @@ -56,7 +56,7 @@ AliQADataMakerSteer::AliQADataMakerSteer(const char* gAliceFilename, const char //_____________________________________________________________________________ AliQADataMakerSteer::AliQADataMakerSteer(const AliQADataMakerSteer & qas) : TNamed(qas), - fCycleOption("new"), + fCycleSame(kFALSE), fESD(NULL), fESDTree(NULL), fFirst(qas.fFirst), @@ -89,14 +89,16 @@ AliQADataMakerSteer::~AliQADataMakerSteer() // dtor for (UInt_t iDet = 0; iDet < fgkNDetectors; iDet++) { fLoader[iDet] = NULL; - delete fQADataMaker[iDet]; - fQADataMaker[iDet] = NULL; + if (fQADataMaker[iDet]) { + (fQADataMaker[iDet])->Finish() ; + delete fQADataMaker[iDet] ; + fQADataMaker[iDet] = NULL ; + } } - delete fRunLoader; - fRunLoader = NULL; - delete fRawReader; - fRawReader = NULL; + fRunLoader = NULL ; + delete fRawReader ; + fRawReader = NULL ; } //_____________________________________________________________________________ @@ -219,7 +221,7 @@ Bool_t AliQADataMakerSteer::Init(const AliQA::TASKINDEX taskIndex, const char * } else { AliInfo(Form("Data Maker found for %s", qadm->GetName())) ; qadm->Init(taskIndex, fRunNumber, GetQACycles(iDet)) ; - qadm->StartOfCycle(taskIndex, fCycleOption) ; + qadm->StartOfCycle(taskIndex, fCycleSame) ; } } fFirst = kFALSE ; @@ -231,7 +233,7 @@ Bool_t AliQADataMakerSteer::InitRunLoader() { // get or create the run loader if (fRunLoader) { - fCycleOption = "same" ; + fCycleSame = kTRUE ; return kTRUE ; } @@ -276,12 +278,35 @@ Bool_t AliQADataMakerSteer::Finish(const AliQA::TASKINDEX taskIndex) AliQADataMaker * qadm = GetQADataMaker(iDet) ; if (qadm) { qadm->EndOfCycle(taskIndex) ; - qadm->Finish(taskIndex) ; } } return kTRUE ; } +//_____________________________________________________________________________ +void AliQADataMakerSteer::Reset() +{ + // Reset the default data members + for (UInt_t iDet = 0; iDet < fgkNDetectors; iDet++) { + fLoader[iDet] = NULL; + if (fQADataMaker[iDet]) { + (fQADataMaker[iDet])->Reset() ; +// delete fQADataMaker[iDet] ; +// fQADataMaker[iDet] = NULL ; + } + } + + fRunLoader = NULL ; + delete fRawReader ; + fRawReader = NULL ; + + fCycleSame = kFALSE ; + fESD = NULL ; + fESDTree = NULL ; + fFirst = kTRUE ; + fNumberOfEvents = 0 ; +} + //_____________________________________________________________________________ Bool_t AliQADataMakerSteer::Run(const AliQA::TASKINDEX taskIndex, const char * fileName ) { diff --git a/STEER/AliQADataMakerSteer.h b/STEER/AliQADataMakerSteer.h index 8c7483a0354..225f5d4452c 100644 --- a/STEER/AliQADataMakerSteer.h +++ b/STEER/AliQADataMakerSteer.h @@ -26,6 +26,7 @@ class AliQADataMaker ; class AliRawReaderRoot ; class AliRunLoader ; +class AliESDEvent ; class AliQADataMakerSteer: public TNamed { public: @@ -35,6 +36,7 @@ public: AliQADataMakerSteer(const AliQADataMakerSteer & qas) ; AliQADataMakerSteer & operator = (const AliQADataMakerSteer & qas) ; virtual ~AliQADataMakerSteer() ; + void Reset() ; Bool_t Run(const AliQA::TASKINDEX taskIndex, const char * fileName = NULL) ; void SetCycleLength(const AliQA::DETECTORINDEX det, const Int_t cycle) { fQACycles[det] = cycle ; } @@ -47,7 +49,7 @@ private: Bool_t Finish(const AliQA::TASKINDEX taskIndex) ; - Option_t * fCycleOption ; //! new or same in case of 2 consecutive data making for a same detector + Bool_t fCycleSame ; //! true if 2 consecutive data making for a same detector AliESDEvent * fESD ; //! current ESD TTree * fESDTree ; //! current ESD Tree Bool_t fFirst ; //! to search the detector QA data maker only once diff --git a/STEER/AliReconstruction.cxx b/STEER/AliReconstruction.cxx index 9451e2cf53f..d806a6e6f95 100644 --- a/STEER/AliReconstruction.cxx +++ b/STEER/AliReconstruction.cxx @@ -180,7 +180,9 @@ #include "AliAODFmdCluster.h" #include "AliAODTracklets.h" -#include "AliQADataMaker.h" +//#include "AliQADataMaker.h" +#include "AliQA.h" +#include "AliQADataMakerSteer.h" #include "AliSysInfo.h" // memory snapshots @@ -247,8 +249,8 @@ AliReconstruction::AliReconstruction(const char* gAliceFilename, const char* cdb fReconstructor[iDet] = NULL; fLoader[iDet] = NULL; fTracker[iDet] = NULL; - fQADataMaker[iDet] = NULL; - fQACycles[iDet] = 999999; +// fQADataMaker[iDet] = NULL; +// fQACycles[iDet] = 999999; } AliPID pid; } @@ -311,8 +313,8 @@ AliReconstruction::AliReconstruction(const AliReconstruction& rec) : fReconstructor[iDet] = NULL; fLoader[iDet] = NULL; fTracker[iDet] = NULL; - fQADataMaker[iDet] = NULL; - fQACycles[iDet] = rec.fQACycles[iDet]; +// fQADataMaker[iDet] = NULL; +// fQACycles[iDet] = rec.fQACycles[iDet]; } for (Int_t i = 0; i < rec.fSpecCDBUri.GetEntriesFast(); i++) { if (rec.fSpecCDBUri[i]) fSpecCDBUri.Add(rec.fSpecCDBUri[i]->Clone()); @@ -812,8 +814,8 @@ Bool_t AliReconstruction::Run(const char* input) } } - if (!fFillESD.IsNull()) - RunQA(fFillESD.Data(), esd); +// if (!fFillESD.IsNull()) +// RunQA(fFillESD.Data(), esd); // fill Event header information from the RawEventHeader if (fRawReader){FillRawEventHeaderESD(esd);} @@ -899,17 +901,16 @@ Bool_t AliReconstruction::Run(const char* input) } detStr = fFillESD ; - // write quality assurance ESDs data (one entry for all events) - for (Int_t iDet = 0; iDet < fgkNDetectors; iDet++) { - if (!IsSelected(fgkDetectorName[iDet], detStr)) - continue; - AliQADataMaker * qadm = GetQADataMaker(iDet); - if (!qadm) continue; - qadm->EndOfCycle(AliQA::kRECPOINTS); - qadm->EndOfCycle(AliQA::kESDS); - qadm->Finish(AliQA::kRECPOINTS); - qadm->Finish(AliQA::kESDS) ; - } +// // write quality assurance ESDs data (one entry for all events) +// for (Int_t iDet = 0; iDet < fgkNDetectors; iDet++) { +// if (!IsSelected(fgkDetectorName[iDet], detStr)) +// continue; +// AliQADataMaker * qadm = GetQADataMaker(iDet); +// if (!qadm) continue; +// qadm->EndOfCycle(AliQA::kRECPOINTS); +// qadm->EndOfCycle(AliQA::kESDS); +// qadm->Finish(); +// } tree->GetUserInfo()->Add(esd); hlttree->GetUserInfo()->Add(hltesd); @@ -948,6 +949,12 @@ Bool_t AliReconstruction::Run(const char* input) aodtagCreator->CreateAODTags(fFirstEvent,fLastEvent,fGRPList); } + //QA + AliQADataMakerSteer qas ; + qas.Run(AliQA::kRECPOINTS) ; + qas.Reset() ; + qas.Run(AliQA::kESDS) ; + return kTRUE; } @@ -1062,20 +1069,20 @@ Bool_t AliReconstruction::RunLocalEventReconstruction(const TString& detectors) loader->UnloadDigits(); } - AliQADataMaker * qadm = GetQADataMaker(iDet); - if (qadm) { - AliCodeTimerStart(Form("running quality assurance data maker for %s", fgkDetectorName[iDet])); - AliInfo(Form("running quality assurance data maker for %s", fgkDetectorName[iDet])); - - if (qadm->IsCycleDone() ) { - qadm->EndOfCycle(AliQA::kRECPOINTS) ; - qadm->EndOfCycle(AliQA::kESDS) ; - qadm->StartOfCycle(AliQA::kRECPOINTS) ; - qadm->StartOfCycle(AliQA::kESDS, "same") ; - } - qadm->Exec(AliQA::kRECPOINTS, clustersTree) ; - AliCodeTimerStop(Form("running quality assurance data maker for %s", fgkDetectorName[iDet])); - } +// AliQADataMaker * qadm = GetQADataMaker(iDet); +// if (qadm) { +// AliCodeTimerStart(Form("running quality assurance data maker for %s", fgkDetectorName[iDet])); +// AliInfo(Form("running quality assurance data maker for %s", fgkDetectorName[iDet])); +// +// if (qadm->IsCycleDone() ) { +// qadm->EndOfCycle(AliQA::kRECPOINTS) ; +// qadm->EndOfCycle(AliQA::kESDS) ; +// qadm->StartOfCycle(AliQA::kRECPOINTS) ; +// qadm->StartOfCycle(AliQA::kESDS, "same") ; +// } +// qadm->Exec(AliQA::kRECPOINTS, clustersTree) ; +// AliCodeTimerStop(Form("running quality assurance data maker for %s", fgkDetectorName[iDet])); +// } loader->WriteRecPoints("OVERWRITE"); loader->UnloadRecPoints(); @@ -1806,8 +1813,8 @@ void AliReconstruction::CleanUp(TFile* file, TFile* fileOld) fLoader[iDet] = NULL; delete fTracker[iDet]; fTracker[iDet] = NULL; - delete fQADataMaker[iDet]; - fQADataMaker[iDet] = NULL; +// delete fQADataMaker[iDet]; +// fQADataMaker[iDet] = NULL; } delete fVertexer; fVertexer = NULL; @@ -2765,84 +2772,84 @@ void AliReconstruction::TNamedToFile(TTree* fTree, TString fName){ //_____________________________________________________________________________ -AliQADataMaker * AliReconstruction::GetQADataMaker(Int_t iDet) -{ +//AliQADataMaker * AliReconstruction::GetQADataMaker(Int_t iDet) +//{ // get the quality assurance data maker object and the loader for a detector - - if (fQADataMaker[iDet]) - return fQADataMaker[iDet]; - - // load the QA data maker object - TPluginManager* pluginManager = gROOT->GetPluginManager(); - TString detName = fgkDetectorName[iDet]; - TString qadmName = "Ali" + detName + "QADataMaker"; - if (gAlice && !gAlice->GetDetector(detName) && (detName != "HLT")) - return NULL; - - AliQADataMaker * qadm = NULL; - // first check if a plugin is defined for the quality assurance data maker - TPluginHandler* pluginHandler = pluginManager->FindHandler("AliQADataMaker", detName); - // if not, add a plugin for it - if (!pluginHandler) { - AliDebug(1, Form("defining plugin for %s", qadmName.Data())); - TString libs = gSystem->GetLibraries(); - if (libs.Contains("lib" + detName + "base.so") || - (gSystem->Load("lib" + detName + "base.so") >= 0)) { - pluginManager->AddHandler("AliQADataMaker", detName, - qadmName, detName + "qadm", qadmName + "()"); - } else { - pluginManager->AddHandler("AliQADataMaker", detName, - qadmName, detName, qadmName + "()"); - } - pluginHandler = pluginManager->FindHandler("AliQADataMaker", detName); - } - if (pluginHandler && (pluginHandler->LoadPlugin() == 0)) { - qadm = (AliQADataMaker *) pluginHandler->ExecPlugin(0); - } - if (qadm) { - AliInfo(Form("Initializing quality assurance data maker for %s", fgkDetectorName[iDet])); - qadm->Init(AliQA::kRECPOINTS, AliCDBManager::Instance()->GetRun(), GetQACycles(fgkDetectorName[iDet])); - qadm->StartOfCycle(AliQA::kRECPOINTS); - qadm->Init(AliQA::kESDS, AliCDBManager::Instance()->GetRun()); - qadm->StartOfCycle(AliQA::kESDS, "same") ; - fQADataMaker[iDet] = qadm; - } - - return qadm; -} - +// +// if (fQADataMaker[iDet]) +// return fQADataMaker[iDet]; +// +// // load the QA data maker object +// TPluginManager* pluginManager = gROOT->GetPluginManager(); +// TString detName = fgkDetectorName[iDet]; +// TString qadmName = "Ali" + detName + "QADataMaker"; +// if (gAlice && !gAlice->GetDetector(detName) && (detName != "HLT")) +// return NULL; +// +// AliQADataMaker * qadm = NULL; +// // first check if a plugin is defined for the quality assurance data maker +// TPluginHandler* pluginHandler = pluginManager->FindHandler("AliQADataMaker", detName); +// // if not, add a plugin for it +// if (!pluginHandler) { +// AliDebug(1, Form("defining plugin for %s", qadmName.Data())); +// TString libs = gSystem->GetLibraries(); +// if (libs.Contains("lib" + detName + "base.so") || +// (gSystem->Load("lib" + detName + "base.so") >= 0)) { +// pluginManager->AddHandler("AliQADataMaker", detName, +// qadmName, detName + "qadm", qadmName + "()"); +// } else { +// pluginManager->AddHandler("AliQADataMaker", detName, +// qadmName, detName, qadmName + "()"); +// } +// pluginHandler = pluginManager->FindHandler("AliQADataMaker", detName); +// } +// if (pluginHandler && (pluginHandler->LoadPlugin() == 0)) { +// qadm = (AliQADataMaker *) pluginHandler->ExecPlugin(0); +// } +// if (qadm) { +// AliInfo(Form("Initializing quality assurance data maker for %s", fgkDetectorName[iDet])); +// qadm->Init(AliQA::kRECPOINTS, AliCDBManager::Instance()->GetRun(), GetQACycles(fgkDetectorName[iDet])); +// qadm->StartOfCycle(AliQA::kRECPOINTS); +// qadm->Init(AliQA::kESDS, AliCDBManager::Instance()->GetRun()); +// qadm->StartOfCycle(AliQA::kESDS, "same") ; +// fQADataMaker[iDet] = qadm; +// } +// +// return qadm; +//} +// //_____________________________________________________________________________ -Bool_t AliReconstruction::RunQA(const char* detectors, AliESDEvent *& esd) -{ - // run the Quality Assurance data producer - - AliCodeTimerAuto("") - TString detStr = detectors; - for (Int_t iDet = 0; iDet < fgkNDetectors; iDet++) { - if (!IsSelected(fgkDetectorName[iDet], detStr)) - continue; - AliQADataMaker * qadm = GetQADataMaker(iDet); - if (!qadm) - continue; - AliCodeTimerStart(Form("running quality assurance data maker for %s", fgkDetectorName[iDet])); - AliInfo(Form("running quality assurance data maker for %s", fgkDetectorName[iDet])); - - qadm->Exec(AliQA::kESDS, esd) ; - qadm->Increment() ; - - AliCodeTimerStop(Form("running quality assurance data maker for %s", fgkDetectorName[iDet])); - } - if ((detStr.CompareTo("ALL") != 0) && !detStr.IsNull()) { - AliError(Form("the following detectors were not found: %s", - detStr.Data())); - if (fStopOnError) - return kFALSE; - } - - return kTRUE; - -} - +//Bool_t AliReconstruction::RunQA(const char* detectors, AliESDEvent *& esd) +//{ +// // run the Quality Assurance data producer +// +// AliCodeTimerAuto("") +// TString detStr = detectors; +// for (Int_t iDet = 0; iDet < fgkNDetectors; iDet++) { +// if (!IsSelected(fgkDetectorName[iDet], detStr)) +// continue; +// AliQADataMaker * qadm = GetQADataMaker(iDet); +// if (!qadm) +// continue; +// AliCodeTimerStart(Form("running quality assurance data maker for %s", fgkDetectorName[iDet])); +// AliInfo(Form("running quality assurance data maker for %s", fgkDetectorName[iDet])); +// +// qadm->Exec(AliQA::kESDS, esd) ; +// qadm->Increment() ; +// +// AliCodeTimerStop(Form("running quality assurance data maker for %s", fgkDetectorName[iDet])); +// } +// if ((detStr.CompareTo("ALL") != 0) && !detStr.IsNull()) { +// AliError(Form("the following detectors were not found: %s", +// detStr.Data())); +// if (fStopOnError) +// return kFALSE; +// } +// +// return kTRUE; +// +//} +// //_____________________________________________________________________________ void AliReconstruction::CheckQA() diff --git a/STEER/AliReconstruction.h b/STEER/AliReconstruction.h index 551020d7389..03100a0f9e5 100644 --- a/STEER/AliReconstruction.h +++ b/STEER/AliReconstruction.h @@ -109,8 +109,8 @@ public: virtual Bool_t Run(const char* input = NULL); // Quality Assurance - virtual Bool_t RunQA(const char* detectors, AliESDEvent *& esd); - void SetQACycles(const char * detector, const Int_t cycles) { fQACycles[GetDetIndex(detector)] = cycles ; } +// virtual Bool_t RunQA(const char* detectors, AliESDEvent *& esd); +// void SetQACycles(const char * detector, const Int_t cycles) { fQACycles[GetDetIndex(detector)] = cycles ; } private: Bool_t RunLocalReconstruction(const TString& detectors); @@ -143,8 +143,8 @@ private: //Quality Assurance Int_t GetDetIndex(const char * detector); - AliQADataMaker* GetQADataMaker(Int_t iDet); - const Int_t GetQACycles(const char * detector) { return fQACycles[GetDetIndex(detector)] ; } +// AliQADataMaker* GetQADataMaker(Int_t iDet); +// const Int_t GetQACycles(const char * detector) { return fQACycles[GetDetIndex(detector)] ; } void CheckQA() ; //*** Global reconstruction flags ******************* @@ -202,8 +202,8 @@ private: TObjArray fSpecCDBUri; // Array with detector specific CDB storages //Quality Assurance - AliQADataMaker * fQADataMaker[fgkNDetectors]; //! array of QA data maker objects - Int_t fQACycles[fgkNDetectors] ; // cycle length (# events) over which QA data are accumulated +// AliQADataMaker * fQADataMaker[fgkNDetectors]; //! array of QA data maker objects +// Int_t fQACycles[fgkNDetectors] ; // cycle length (# events) over which QA data are accumulated ClassDef(AliReconstruction, 15) // class for running the reconstruction }; diff --git a/STEER/AliSimulation.cxx b/STEER/AliSimulation.cxx index e5f14995cf7..20b8a08afec 100644 --- a/STEER/AliSimulation.cxx +++ b/STEER/AliSimulation.cxx @@ -138,6 +138,8 @@ #include "AliGenEventHeader.h" #include "AliMC.h" #include "AliHLTSimulation.h" +#include "AliQA.h" +#include "AliQADataMakerSteer.h" ClassImp(AliSimulation) @@ -213,7 +215,8 @@ AliSimulation::AliSimulation(const AliSimulation& sim) : fCDBUri(sim.fCDBUri), fRemoteCDBUri(sim.fRemoteCDBUri), fSpecCDBUri(), - fEmbeddingFlag(sim.fEmbeddingFlag) + fEmbeddingFlag(sim.fEmbeddingFlag), + fRunHLT(sim.fRunHLT) { // copy constructor @@ -521,7 +524,8 @@ Bool_t AliSimulation::Run(Int_t nEvents) { // run the generation, simulation and digitization - AliCodeTimerAuto("") + + AliCodeTimerAuto("") InitCDBStorage(); @@ -532,6 +536,10 @@ Bool_t AliSimulation::Run(Int_t nEvents) if (!RunSimulation()) if (fStopOnError) return kFALSE; } +//QA + AliQADataMakerSteer qas ; + qas.Run(AliQA::kHITS); + // Set run number in CDBManager (if it is not already set in RunSimulation) if (!SetRunNumber()) if (fStopOnError) return kFALSE; @@ -548,6 +556,10 @@ Bool_t AliSimulation::Run(Int_t nEvents) if (!fMakeSDigits.IsNull()) { if (!RunSDigitization(fMakeSDigits)) if (fStopOnError) return kFALSE; } + + //QA + qas.Reset() ; + qas.Run(AliQA::kSDIGITS); // summable digits -> digits if (!fMakeDigits.IsNull()) { @@ -568,6 +580,10 @@ Bool_t AliSimulation::Run(Int_t nEvents) if (fStopOnError) return kFALSE; } } + + //QA + qas.Reset() ; + qas.Run(AliQA::kDIGITS); // digits -> trigger if (!RunTrigger(fMakeTrigger)) {