]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PHOS/AliPHOSReconstructioner.cxx
Write header with vertex position.
[u/mrichter/AliRoot.git] / PHOS / AliPHOSReconstructioner.cxx
index add207d148aa3794cac313e42757956c6edf95a2..8624d3df5a9e020c3dcd1154cb38efbcca4095e4 100644 (file)
 //
 //             // And finally one can call ExecuteTask() with the following options
 //  root [5] r->ExecuteTask("debug all timing")
-//             // deb     - prints the numbers of produced SDigits, Digits etc.
-//             // deb all - prints in addition list of made SDigits, digits etc.
-//             // timing  - prints benchmarking results
+//            // deb     - prints the numbers of RecPoints, TrackSegments, RecParticles 
+//            // deb all - prints in addition list of RecPoints, TrackSegments, RecParticles  
+//            // timing  - prints benchmarking results
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
 // --- ROOT system ---
 
 // --- Standard library ---
-#include "Riostream.h"
 
 // --- AliRoot header files ---
-#include "AliRunLoader.h"
 #include "AliESD.h"
 #include "AliESDCaloTrack.h"
 #include "AliPHOSReconstructioner.h"
 #include "AliPHOSClusterizerv1.h"
-#include "AliPHOSDigitizer.h"
-#include "AliPHOSSDigitizer.h"
 #include "AliPHOSTrackSegmentMakerv1.h"
 #include "AliPHOSPIDv1.h"
 #include "AliPHOSGetter.h"
 
-#include "AliPHOSLoader.h"
 
 ClassImp(AliPHOSReconstructioner)
 
@@ -82,12 +77,11 @@ ClassImp(AliPHOSReconstructioner)
   AliPHOSReconstructioner::AliPHOSReconstructioner():TTask("AliPHOSReconstructioner","")
 {
   // ctor
-  fDigitizer   = 0 ;
   fClusterizer = 0 ;
   fTSMaker     = 0 ;
   fPID         = 0 ; 
-  fSDigitizer  = 0 ;
-
+  fFirstEvent  = 0 ; 
+  fLastEvent   = -1 ; 
   fIsInitialized = kFALSE ;
 
 } 
@@ -97,75 +91,27 @@ AliPHOSReconstructioner::AliPHOSReconstructioner(const char* evFoldName,const ch
 TTask("AliPHOSReconstructioner",evFoldName)
 {
   // ctor
-  AliRunLoader* rl = AliRunLoader::GetRunLoader(evFoldName);
-  if (rl == 0x0)
-   {
-     Fatal("AliPHOSReconstructioner","Can not get Run Loader from folder %s.",evFoldName);
-   } 
-  if (rl->GetAliRun() == 0x0)
-   {
-     delete gAlice;
-     gAlice = 0x0;
-     rl->LoadgAlice();
-     gAlice = rl->GetAliRun();
-   }
-
-  AliPHOSLoader* gime = dynamic_cast<AliPHOSLoader*>(rl->GetLoader("PHOSLoader"));
-  if (gime == 0x0)
-   {
-     Error("AliPHOSReconstructioner","Can not get PHOS Loader");
-     return;  
-   }
-  
-  TString galicefn = rl->GetFileName();
-  TString method("AliPHOSReconstructioner::AliPHOSReconstructioner(");
-  method = (((method + evFoldName)+",")+branchName)+"): ";
-  
-  fSDigitsBranch= branchName; 
-  
-  //P.Skowronski remark
-  // Tasks has default fixed names
-  // other tasks can be added, even runtime
-  // with arbitrary name. See AliDataLoader::
-  cout<<"\n\n\n";
-  cout<<method<<"\n\nCreating SDigitizer\n";
-  fSDigitizer  = new AliPHOSSDigitizer(galicefn,GetTitle());
-  Add(fSDigitizer);
-  gime->PostSDigitizer(fSDigitizer);
 
-  fDigitsBranch=branchName ;
-  cout<<"\n\n\n";
-  cout<<method<<"\n\nCreating Digitizer\n";
-  fDigitizer   = new AliPHOSDigitizer(galicefn,GetTitle()) ;
-  Add(fDigitizer) ;
-  gime->PostDigitizer(fDigitizer);
+  AliPHOSGetter::Instance(evFoldName) ; 
 
   fRecPointBranch=branchName ; 
-  cout<<"\n\n\n";
-  cout<<method<<"Creating Clusterizer\n";
-  fClusterizer = new AliPHOSClusterizerv1(galicefn,GetTitle());
+  fClusterizer = new AliPHOSClusterizerv1(evFoldName, GetTitle());
   Add(fClusterizer);
-  gime->PostReconstructioner(fClusterizer);
   
   fTSBranch=branchName ; 
-  fTSMaker     = new AliPHOSTrackSegmentMakerv1(galicefn,GetTitle());
+  fTSMaker     = new AliPHOSTrackSegmentMakerv1(evFoldName, GetTitle());
   Add(fTSMaker) ;
-  gime->PostTracker(fTSMaker);
-
   
   fRecPartBranch=branchName ; 
-  cout<<"\n\n\n";
-  cout<<method<<"Creating PID\n";
-  fPID         = new AliPHOSPIDv1(galicefn,GetTitle());
+  fPID         = new AliPHOSPIDv1(evFoldName, GetTitle());
   Add(fPID);
-  cout<<"\nFINISHED \n\n"<<method;
   
   fIsInitialized = kTRUE ;
 } 
 //____________________________________________________________________________
 void AliPHOSReconstructioner::Exec(Option_t *opt)
 {
-  //check, if the names of branches, which should be made conicide with already
+  //check, if the names of branches, which should be made coincide with already
   //existing
   if (!opt) 
     return ; 
@@ -204,16 +150,7 @@ void AliPHOSReconstructioner:: Clusters2Tracks(Int_t ievent, AliESD *event)
   // initiliaze Reconstructioner if necessary: we can not do this in default constructor
 
   if(!fIsInitialized){
-    // Initialisation
-
-    fSDigitsBranch="Default" ; 
-    fSDigitizer  = new AliPHOSSDigitizer(GetTitle(),fSDigitsBranch.Data()) ; 
-    Add(fSDigitizer) ;
-
-    fDigitsBranch="Default" ; 
-    fDigitizer   = new AliPHOSDigitizer(GetTitle(),fDigitsBranch.Data());
-    Add(fDigitizer) ;
-
+    
     fRecPointBranch="Default" ; 
     fClusterizer = new AliPHOSClusterizerv1(GetTitle(),fRecPointBranch.Data());
     Add(fClusterizer) ;
@@ -245,13 +182,6 @@ void AliPHOSReconstructioner::Print()const {
   message += " Reconstruction of the header file %s\n" ;
   message += " with the following modules:\n" ;
 
-  if(fSDigitizer->IsActive()){
-    message += "   (+)   %s to branch %s\n" ; 
-  }
-  if(fDigitizer->IsActive()){
-    message += "   (+)   %s to branch %s\n" ; 
-  }
-  
   if(fClusterizer->IsActive()){
     message += "   (+)   %s to branch %s\n" ;
   }
@@ -265,9 +195,18 @@ void AliPHOSReconstructioner::Print()const {
   }
   Info("Print", message.Data(), 
        GetTitle(), 
-       fSDigitizer->GetName(), fSDigitsBranch.Data(), 
-       fDigitizer->GetName(), fDigitsBranch.Data() , 
        fClusterizer->GetName(), fRecPointBranch.Data(), 
        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) ;
+}