]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
When calling the getter, the name of the file that holds gAlice is specified.
authorschutz <schutz@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 5 Feb 2004 16:18:18 +0000 (16:18 +0000)
committerschutz <schutz@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 5 Feb 2004 16:18:18 +0000 (16:18 +0000)
Added option for first and last event to process

PHOS/AliPHOSReconstructioner.cxx
PHOS/AliPHOSReconstructioner.h
PHOS/AliPHOSSDigitizer.cxx

index 479bbab950794e6fe457959dc7275376e30fc3cd..8624d3df5a9e020c3dcd1154cb38efbcca4095e4 100644 (file)
@@ -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) ;
+}
index 6923e9cefdfcdd7198d51a8fbde5cb2c34ea2a66..17bf961cea4673470d497a2c229949ae621e527d 100644 (file)
@@ -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)
 
index 9d3f8938cfbf293e83f318debcd7b471ca2d3f4a..6774eabd4267eeb10bffbf6b0ad05e25b1b20f6c 100644 (file)
@@ -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<AliPHOSDigit *>( 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; iprimary<digit->GetNprimary(); iprimary++) {