]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
changed selector to only depend on ESD library, other functionality moved to AliSelec...
authorjgrosseo <jgrosseo@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 24 May 2006 17:07:27 +0000 (17:07 +0000)
committerjgrosseo <jgrosseo@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 24 May 2006 17:07:27 +0000 (17:07 +0000)
PWG0/AliSelector.cxx
PWG0/AliSelector.h

index 7f679f3eeaf23bccaa7acb5a9598ca583e2e0b6f..12d390d3fc2638d65bb003804a55f3107f341ee1 100644 (file)
 
 ClassImp(AliSelector)
 
-AliSelector::AliSelector(TTree *) :
+AliSelector::AliSelector() :
   TSelector(),
   fChain(0),
   fESD(0),
   fHeader(0),
-  fKineFile(0),
-  fRunLoader(0)
+  fKineFile(0)
 {
   //
   // Constructor. Initialization of pointers
@@ -128,12 +127,11 @@ Bool_t AliSelector::Notify()
   AliDebug(AliLog::kDebug, "=========NOTIFY==========");
   AliDebug(AliLog::kDebug, Form("Hostname: %s", gSystem->HostName()));
   AliDebug(AliLog::kDebug, Form("Time: %s", gSystem->Now().AsString()));
-  
+
   TFile *f = fChain->GetCurrentFile();
   AliDebug(AliLog::kInfo, Form("Processing file %s", f->GetName()));
 
   DeleteKinematicsFile();
-  DeleteRunLoader();
 
   return kTRUE;
 }
@@ -188,7 +186,6 @@ void AliSelector::SlaveTerminate()
   // on each slave server.
 
   DeleteKinematicsFile();
-  DeleteRunLoader();
 }
 
 void AliSelector::Terminate()
@@ -269,43 +266,6 @@ void AliSelector::DeleteKinematicsFile()
   }
 }
 
-AliRun* AliSelector::GetAliRun()
-{
-  // Returns AliRun instance corresponding to current ESD active in fChain
-  // Loads galice.root, the file is identified by replacing "AliESDs" to
-  // "galice" in the file path of the ESD file. This is a hack, to be changed!
-
-  if (!fRunLoader)
-  {
-    if (!fChain->GetCurrentFile())
-      return 0;
-
-    TString fileName(fChain->GetCurrentFile()->GetName());
-    fileName.ReplaceAll("AliESDs", "galice");
-
-    fRunLoader = AliRunLoader::Open(fileName);
-    if (!fRunLoader)
-      return 0;
-
-    fRunLoader->LoadgAlice();
-  }
-
-  return fRunLoader->GetAliRun();
-}
-
-void AliSelector::DeleteRunLoader()
-{
-  //
-  // deletes the runloader
-  //
-
-  if (fRunLoader)
-  {
-    fRunLoader->Delete();
-    fRunLoader = 0;
-  }
-}
-
 Bool_t AliSelector::IsPrimaryCharged(TParticle* aParticle, Int_t aTotalPrimaries) const
 {
   //
index 14c63aafb063e753f646dd7d5470ba34fc439d84..4a8c16ac23a0c381023935fa1ab39b7fe10879df 100644 (file)
@@ -1,20 +1,20 @@
 #ifndef ALISELECTOR_H
 #define ALISELECTOR_H
 
+// This selector is only dependent on the ESD library, if you need the whole of AliROOT use AliSelectorRL
+
 #include <TFile.h>
 #include <TSelector.h>
 #include <TChain.h>
 
 #include <AliESD.h>
 #include <AliHeader.h>
-#include <AliRun.h>
-#include <AliRunLoader.h>
 
 class TParticle;
 
 class AliSelector : public TSelector {
   public:
-    AliSelector(TTree *tree=0);
+    AliSelector();
     virtual ~AliSelector();
 
     virtual Int_t   Version() const {return 1;}
@@ -28,8 +28,6 @@ class AliSelector : public TSelector {
 
  protected:
     TTree*  GetKinematics();
-    AliRun* GetAliRun();
-
     Bool_t IsPrimaryCharged(TParticle* aParticle, Int_t aTotalPrimaries) const;
 
     TChain          *fChain;   //! pointer to the analyzed TTree or TChain
@@ -38,11 +36,9 @@ class AliSelector : public TSelector {
     AliHeader*       fHeader;  //! "TE" branch in fChain, contains event header
 
  private:
-  void DeleteKinematicsFile();
-  void DeleteRunLoader();
+    void DeleteKinematicsFile();
 
-  TFile*        fKineFile;  //! pointer to Kinematics.root if the file was opened
-  AliRunLoader* fRunLoader;    //! pointer to the RunLoader if galice.root was opened
+    TFile*        fKineFile;  //! pointer to Kinematics.root if the file was opened
 
   ClassDef(AliSelector,0);
 };