From d7d3b67b622c9ecf094a36477d6c458a53939133 Mon Sep 17 00:00:00 2001 From: schutz Date: Thu, 5 Feb 2004 16:18:18 +0000 Subject: [PATCH] When calling the getter, the name of the file that holds gAlice is specified. Added option for first and last event to process --- PHOS/AliPHOSReconstructioner.cxx | 17 +++++++++++++---- PHOS/AliPHOSReconstructioner.h | 6 ++++-- PHOS/AliPHOSSDigitizer.cxx | 14 +++++++------- 3 files changed, 24 insertions(+), 13 deletions(-) diff --git a/PHOS/AliPHOSReconstructioner.cxx b/PHOS/AliPHOSReconstructioner.cxx index 479bbab9507..8624d3df5a9 100644 --- a/PHOS/AliPHOSReconstructioner.cxx +++ b/PHOS/AliPHOSReconstructioner.cxx @@ -80,7 +80,8 @@ ClassImp(AliPHOSReconstructioner) fClusterizer = 0 ; fTSMaker = 0 ; fPID = 0 ; - + fFirstEvent = 0 ; + fLastEvent = -1 ; fIsInitialized = kFALSE ; } @@ -94,17 +95,14 @@ TTask("AliPHOSReconstructioner",evFoldName) AliPHOSGetter::Instance(evFoldName) ; fRecPointBranch=branchName ; - Info("ctor", "Creating Clusterizer") ; fClusterizer = new AliPHOSClusterizerv1(evFoldName, GetTitle()); Add(fClusterizer); fTSBranch=branchName ; - Info("ctor", "Creating Track Segment Maker") ; fTSMaker = new AliPHOSTrackSegmentMakerv1(evFoldName, GetTitle()); Add(fTSMaker) ; fRecPartBranch=branchName ; - Info("ctor", "Creating PID") ; fPID = new AliPHOSPIDv1(evFoldName, GetTitle()); Add(fPID); @@ -201,3 +199,14 @@ void AliPHOSReconstructioner::Print()const { fTSMaker->GetName(), fTSBranch.Data() , fPID->GetName(), fRecPartBranch.Data() ) ; } + +//____________________________________________________________________________ +void AliPHOSReconstructioner::SetEventRange(Int_t first, Int_t last) +{ + // Set the event range to process + fFirstEvent=first; + fLastEvent=last; + fClusterizer->SetEventRange(fFirstEvent, fLastEvent) ; + fTSMaker->SetEventRange(fFirstEvent, fLastEvent) ; + fPID->SetEventRange(fFirstEvent, fLastEvent) ; +} diff --git a/PHOS/AliPHOSReconstructioner.h b/PHOS/AliPHOSReconstructioner.h index 6923e9cefdf..17bf961cea4 100644 --- a/PHOS/AliPHOSReconstructioner.h +++ b/PHOS/AliPHOSReconstructioner.h @@ -45,6 +45,7 @@ public: AliPHOSClusterizer * GetClusterizer()const { return fClusterizer ; } AliPHOSPID * GetPID() const { return fPID; } AliPHOSTrackSegmentMaker * GetTSMaker() const { return fTSMaker ; } + void SetEventRange(Int_t first=0, Int_t last=-1) ; void Print()const ; @@ -68,8 +69,9 @@ private: AliPHOSClusterizer * fClusterizer ; //! Pointer to AliPHOSClusterizer AliPHOSPID * fPID ; //! Pointer to AliPHOSPID AliPHOSTrackSegmentMaker * fTSMaker ; //! Pointer to AliPHOSTrackSegmentMaker - - Bool_t fIsInitialized ; // kTRUE if reconstructioner is initialized + Bool_t fIsInitialized ; // kTRUE if reconstructioner is initialized + Int_t fFirstEvent; // first event to process + Int_t fLastEvent; // last event to process ClassDef(AliPHOSReconstructioner,1) // Reconstruction algorithm class (Base Class) diff --git a/PHOS/AliPHOSSDigitizer.cxx b/PHOS/AliPHOSSDigitizer.cxx index 9d3f8938cfb..6774eabd426 100644 --- a/PHOS/AliPHOSSDigitizer.cxx +++ b/PHOS/AliPHOSSDigitizer.cxx @@ -70,6 +70,7 @@ ClassImp(AliPHOSSDigitizer) AliPHOSSDigitizer::AliPHOSSDigitizer():TTask("","") { // ctor + fFirstEvent = fLastEvent = 0 ; InitParameters() ; fDefaultInit = kTRUE ; } @@ -81,6 +82,7 @@ AliPHOSSDigitizer::AliPHOSSDigitizer(const char * alirunFileName, const char * e { // ctor + fFirstEvent = fLastEvent = 0 ; // runs one event by defaut InitParameters() ; Init(); fDefaultInit = kFALSE ; @@ -92,6 +94,8 @@ AliPHOSSDigitizer::AliPHOSSDigitizer(const AliPHOSSDigitizer & sd) { //cpy ctor + fFirstEvent = sd.fFirstEvent ; + fLastEvent = sd.fLastEvent ; fA = sd.fA ; fB = sd.fB ; fPrimThreshold = sd.fPrimThreshold ; @@ -141,7 +145,6 @@ void AliPHOSSDigitizer::InitParameters() fB = 10000000.; fPrimThreshold = 0.01 ; fSDigitsInRun = 0 ; - SetEventRange(0,-1) ; } //____________________________________________________________________________ @@ -163,7 +166,7 @@ void AliPHOSSDigitizer::Exec(Option_t *option) if(strstr(option,"tim")) gBenchmark->Start("PHOSSDigitizer"); - AliPHOSGetter * gime = AliPHOSGetter::Instance() ; + AliPHOSGetter * gime = AliPHOSGetter::Instance(GetTitle()) ; //switch off reloading of this task while getting event if (!fInit) { // to prevent overwrite existing file @@ -171,18 +174,15 @@ void AliPHOSSDigitizer::Exec(Option_t *option) return ; } - if (fLastEvent == -1) fLastEvent = gime->MaxEvent() - 1 ; else - fLastEvent = TMath::Min(fLastEvent,gime->MaxEvent()); + fLastEvent = TMath::Min(fFirstEvent, gime->MaxEvent()); // only ine event at the time Int_t nEvents = fLastEvent - fFirstEvent + 1; Int_t ievent ; for (ievent = fFirstEvent; ievent <= fLastEvent; ievent++) { - gime->Event(ievent,"H") ; - TTree * treeS = gime->TreeS(); TClonesArray * hits = gime->Hits() ; TClonesArray * sdigits = gime->SDigits() ; @@ -306,7 +306,7 @@ void AliPHOSSDigitizer::PrintSDigits(Option_t * option) digit = dynamic_cast( sdigits->At(index) ) ; // if(digit->GetNprimary() == 0) // continue; - printf("%6d %8d %6.5e %4d %2d :", + printf("%6d %8d %6.5e %4d %2d :\n", digit->GetId(), digit->GetAmp(), digit->GetTime(), digit->GetIndexInList(), digit->GetNprimary()) ; Int_t iprimary; for (iprimary=0; iprimaryGetNprimary(); iprimary++) { -- 2.43.0