]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Possibility to reconstruct selected events via SetEventRange()
authorschutz <schutz@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 9 Jan 2004 17:53:25 +0000 (17:53 +0000)
committerschutz <schutz@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 9 Jan 2004 17:53:25 +0000 (17:53 +0000)
PHOS/AliPHOSClusterizer.h
PHOS/AliPHOSClusterizerv1.cxx
PHOS/AliPHOSClusterizerv1.h
PHOS/AliPHOSPID.h
PHOS/AliPHOSPIDv1.cxx
PHOS/AliPHOSPIDv1.h
PHOS/AliPHOSTrackSegmentMaker.h
PHOS/AliPHOSTrackSegmentMakerv1.cxx
PHOS/AliPHOSTrackSegmentMakerv1.h

index 6f41f15e07758add32e74b9a9d6dba7745365bd1..b768ee0f39e04032ee9f2048aa40abbe6b3e1ca2 100644 (file)
@@ -48,7 +48,8 @@ public:
   virtual void SetCpvLocalMaxCut(Float_t)         = 0;
   virtual void SetCpvLogWeight(Float_t)           = 0;
   virtual void SetUnfolding(Bool_t)               = 0;
-  void   SetEventFolderName(TString name) { fEventFolderName = name ; }
+  void SetEventRange(Int_t first=0, Int_t last=-1) {fFirstEvent=first; fLastEvent=last; }
+  void SetEventFolderName(TString name) { fEventFolderName = name ; }
 
   AliPHOSClusterizer & operator = (const AliPHOSClusterizer & /*rvalue*/)  {return *this ;} 
  
@@ -56,9 +57,10 @@ public:
 
 protected:
   TString fEventFolderName ;  // event folder name
+  Int_t   fFirstEvent;        // first event to process
+  Int_t   fLastEvent;         // last  event to process
 
-
-  ClassDef(AliPHOSClusterizer,3)  // Clusterization algorithm class 
+  ClassDef(AliPHOSClusterizer,4)  // Clusterization algorithm class 
 
 } ;
 
index 44b067e3d3132681b1b9f9f1eccb1579d773f57a..69e0b5c970a80fc7022774cd241ed9923d47cc98 100644 (file)
@@ -114,23 +114,28 @@ Float_t  AliPHOSClusterizerv1::Calibrate(Int_t amp, Int_t absId) const
 }
 
 //____________________________________________________________________________
-void AliPHOSClusterizerv1::Exec(Option_t * option)
+void AliPHOSClusterizerv1::Exec(Option_t *option)
 {
-  // Steering method
+  // Steering method to perform clusterization for events
+  // in the range from fFirstEvent to fLastEvent.
+  // This range is optionally set by SetEventRange().
+  // if fLastEvent=-1 (by default), then process events until the end.
 
   if(strstr(option,"tim"))
     gBenchmark->Start("PHOSClusterizer"); 
   
-  if(strstr(option,"print"))
+  if(strstr(option,"print")) {
     Print() ; 
+    return ;
+  }
 
   AliPHOSGetter * gime = AliPHOSGetter::Instance() ; 
   
-  Int_t nevents = gime->MaxEvent() ;
-  Int_t ievent ;
+  if (fLastEvent == -1) fLastEvent = gime->MaxEvent() - 1 ;
+  else fLastEvent = TMath::Min(fLastEvent,gime->MaxEvent());
+  Int_t nEvents   = fLastEvent - fFirstEvent + 1;
   
-  for(ievent = 0; ievent < nevents; ievent++)
-   {
+  for (Int_t ievent = fFirstEvent; ievent <= fLastEvent; ievent++) {
     gime->Event(ievent, "D");
 
     GetCalibrationParameters() ;
@@ -158,7 +163,7 @@ void AliPHOSClusterizerv1::Exec(Option_t * option)
     gBenchmark->Stop("PHOSClusterizer");
     Info("Exec", "  took %f seconds for Clusterizing %f seconds per event \n",
         gBenchmark->GetCpuTime("PHOSClusterizer"), 
-        gBenchmark->GetCpuTime("PHOSClusterizer")/nevents ) ; 
+        gBenchmark->GetCpuTime("PHOSClusterizer")/nEvents ) ; 
   } 
 }
 
@@ -316,6 +321,7 @@ void AliPHOSClusterizerv1::InitParameters()
     
   fRecPointsInRun          = 0 ;
 
+  SetEventRange(0,-1) ;
 }
 
 //____________________________________________________________________________
index 893e3d41a99582e99711744f0a71b0dc0a114730..48281f2ffac5d26a887809c3b17669be6af696c2 100644 (file)
@@ -58,7 +58,7 @@ public:
   virtual const char *  GetRecPointsBranch() const{ return GetName() ;}
   virtual const Int_t GetRecPointsInRun() const   {return fRecPointsInRun ;} 
 
-  void    Exec(Option_t *option);                // Does the job
+  virtual void    Exec(Option_t *option);   // Does the job
 
   void Print()const ;
 
index 71826fdba16e5f826dd148ae29b74b1681091b30..d12878f2b5802ee728b99aa77f9a204c892eb6c9 100644 (file)
@@ -36,20 +36,22 @@ class AliPHOSPID : public TTask {
   AliPHOSPID(const AliPHOSPID & pid) : TTask(pid) {;} 
   virtual ~AliPHOSPID() ; // dtor
 
-  virtual void Exec(Option_t *) = 0;
   virtual const Int_t GetRecParticlesInRun()  const { Warning("GetRecParticlesInRun", "not defined" ) ; return 0 ;} 
   virtual void Print() const { Warning("Print", "not defined" ) ;}
-  void   SetEventFolderName(TString name) { fEventFolderName = name ; }
+  void SetEventRange(Int_t first=0, Int_t last=-1) {fFirstEvent=first; fLastEvent=last; }
+  void SetEventFolderName(TString name) { fEventFolderName = name ; }
   virtual const char * Version() const { Warning("Version", "not defined" ) ; return 0 ; }  
   virtual void WriteRecParticles() = 0;
 
 protected:
   TString fEventFolderName ;  // event folder name
+  Int_t   fFirstEvent;        // first event to process
+  Int_t   fLastEvent;         // last  event to process
 
 private: 
   virtual void Init() { Warning("Init", "not defined" ) ; } 
 
-  ClassDef(AliPHOSPID,3)  // Particle Identifier algorithm (base class)
+  ClassDef(AliPHOSPID,4)  // Particle Identifier algorithm (base class)
 
 } ;
 
index f571de571a76c9bc485170f113e29dc4dc96af9a..a6974d093b501ddd2c77f623d064017fb27d90da 100644 (file)
@@ -173,13 +173,16 @@ void AliPHOSPIDv1::InitParameters()
   fNEvent            = 0 ;            
   fRecParticlesInRun = 0 ;
   SetParameters() ; // fill the parameters matrix from parameters file
+  SetEventRange(0,-1) ;
 }
 
 //________________________________________________________________________
-void  AliPHOSPIDv1::Exec(Option_t * option) 
+void  AliPHOSPIDv1::Exec(Option_t *option)
 {
-  //Steering method
-  
+  // Steering method to perform particle reconstruction and identification
+  // for the event range from fFirstEvent to fLastEvent.
+  // This range is optionally set by SetEventRange().
+  // if fLastEvent=-1 (by default), then process events until the end.
 
   if(strstr(option,"tim"))
     gBenchmark->Start("PHOSPID");
@@ -192,11 +195,11 @@ void  AliPHOSPIDv1::Exec(Option_t * option)
 
   AliPHOSGetter * gime = AliPHOSGetter::Instance() ; 
  
-  Int_t nevents = gime->MaxEvent() ;       
-  Int_t ievent ;
-
+  if (fLastEvent == -1) fLastEvent = gime->MaxEvent() - 1 ;
+  else fLastEvent = TMath::Min(fLastEvent,gime->MaxEvent());
+  Int_t nEvents   = fLastEvent - fFirstEvent + 1;
 
-  for(ievent = 0; ievent < nevents; ievent++){
+  for (Int_t ievent = fFirstEvent; ievent <= fLastEvent; ievent++) {
     gime->Event(ievent,"TR") ;
     if(gime->TrackSegments() && //Skip events, where no track segments made
        gime->TrackSegments()->GetEntriesFast()) {
@@ -212,7 +215,7 @@ void  AliPHOSPIDv1::Exec(Option_t * option)
     gBenchmark->Stop("PHOSPID");
     Info("Exec", "took %f seconds for PID %f seconds per event", 
         gBenchmark->GetCpuTime("PHOSPID"),  
-        gBenchmark->GetCpuTime("PHOSPID")/nevents) ;
+        gBenchmark->GetCpuTime("PHOSPID")/nEvents) ;
   }
  
   Unload();
index c3356b6d3e700e8319349d46747999d78ed0f199..6fa64d670e1ef62f7bc521483184a970fb6af733 100644 (file)
@@ -35,7 +35,7 @@ public:
   
   virtual ~AliPHOSPIDv1() ; // dtor
   
-  virtual void Exec(Option_t * option) ;
+  virtual void Exec(Option_t *option);  // Does the job
 
   //Get file name that contain the PCA
   const TString GetFileNamePrincipal(TString particle) const;
index 02de07a62544197bd9d48e7b83cf95bd1bde024c..0b1ab5c8882387c7a6217730da5755cf50056583 100644 (file)
@@ -35,19 +35,20 @@ public:
   AliPHOSTrackSegmentMaker(const AliPHOSTrackSegmentMaker & tsmaker) : TTask(tsmaker) { ; } 
   virtual ~ AliPHOSTrackSegmentMaker() ;
 
-  virtual void    Exec(Option_t *) = 0;
-
   virtual const Int_t GetTrackSegmentsInRun()  const {Warning("GetTrackSegmentsInRun", "Not Defined" ) ; return 0 ; } 
 
   virtual void    Print()const {Warning("Print", "Not Defined" ) ; }
-  void   SetEventFolderName(TString name) { fEventFolderName = name ; }
+  void SetEventRange(Int_t first=0, Int_t last=-1) {fFirstEvent=first; fLastEvent=last; }
+  void SetEventFolderName(TString name) { fEventFolderName = name ; }
 
   virtual void WriteTrackSegments() = 0;
   
 protected:
   TString fEventFolderName ;  // event folder name
+  Int_t   fFirstEvent;        // first event to process
+  Int_t   fLastEvent;         // last  event to process
 
-  ClassDef( AliPHOSTrackSegmentMaker,3)    // Algorithm class to make PHOS track segments (Base Class)
+  ClassDef( AliPHOSTrackSegmentMaker,4)  // Algorithm class to make PHOS track segments (Base Class)
 };
 
 #endif // ALIPHOSTRACKSEGMENTMAKER_H
index fec7a0006969f527b81272e8285cafcef1fad471..d8dc263b063a1cb0fe55efb995a95b6db2a74281 100644 (file)
@@ -182,6 +182,7 @@ void  AliPHOSTrackSegmentMakerv1::InitParameters()
   fCpvLast   = 0 ;   
   fLinkUpArray = 0 ;
   fTrackSegmentsInRun       = 0 ; 
+  SetEventRange(0,-1) ;
 }
 
 
@@ -299,9 +300,12 @@ void  AliPHOSTrackSegmentMakerv1::MakePairs()
 }
 
 //____________________________________________________________________________
-void  AliPHOSTrackSegmentMakerv1::Exec(Option_t * option)
+void  AliPHOSTrackSegmentMakerv1::Exec(Option_t *option)
 {
-  // STEERing method
+  // Steering method to perform track segment construction for events
+  // in the range from fFirstEvent to fLastEvent.
+  // This range is optionally set by SetEventRange().
+  // if fLastEvent=-1 (by default), then process events until the end.
   
   if(strstr(option,"tim"))
     gBenchmark->Start("PHOSTSMaker");
@@ -315,10 +319,11 @@ void  AliPHOSTrackSegmentMakerv1::Exec(Option_t * option)
   
   const AliPHOSGeometry * geom = gime->PHOSGeometry() ; 
 
-  Int_t nevents = gime->MaxEvent() ;    
-  Int_t ievent ;
+  if (fLastEvent == -1) fLastEvent = gime->MaxEvent() - 1 ;
+  else fLastEvent = TMath::Min(fLastEvent,gime->MaxEvent());
+  Int_t nEvents   = fLastEvent - fFirstEvent + 1;
 
-  for(ievent = 0; ievent < nevents; ievent++) {
+  for (Int_t ievent = fFirstEvent; ievent <= fLastEvent; ievent++) {
     gime->Event(ievent,"R") ;
     //Make some initializations 
     fNTrackSegments = 0 ;
@@ -351,7 +356,7 @@ void  AliPHOSTrackSegmentMakerv1::Exec(Option_t * option)
     gBenchmark->Stop("PHOSTSMaker");
     Info("Exec", "took %f seconds for making TS %f seconds per event", 
           gBenchmark->GetCpuTime("PHOSTSMaker"), 
-          gBenchmark->GetCpuTime("PHOSTSMaker")/nevents) ;
+          gBenchmark->GetCpuTime("PHOSTSMaker")/nEvents) ;
    }
   Unload();
 }
index 3a14fb81dc01f0b79d90f48e6f3102a85ca3c2f6..7e93110ebef6cf1b34864765da57f71bd72542af 100644 (file)
@@ -40,7 +40,7 @@ public:
   //  virtual char*  GetTrackSegmentsBranch(void)const{return (char*)fTrackSegmentsBranchTitle.Data() ;}
   virtual const Int_t GetTrackSegmentsInRun()const {return fTrackSegmentsInRun ;}  
 
-  virtual void   Exec(Option_t * option) ;
+  virtual void   Exec(Option_t *option); // Does the job
           void   FillOneModule() ;       // Finds range in which RecPoints belonging current PHOS module are
 
           void   MakeLinks() const;      //Evaluates distances(links) between EMC and PPSD