3 #include "AliSelectorRL.h"
6 #include <AliRunLoader.h>
12 // This selector depends on the RunLoader, therefore to use it you have to have the whole AliRoot available
13 // The benefit is that you can use the RunLoader to access everything in the data structure
14 // If you only have the ESD library use AliSelector instead
17 ClassImp(AliSelectorRL)
19 AliSelectorRL::AliSelectorRL() :
24 // Constructor. Initialization of pointers
28 AliSelectorRL::~AliSelectorRL()
34 // histograms are in the output list and deleted when the output
35 // list is deleted by the TSelector dtor
38 Bool_t AliSelectorRL::Notify()
40 // Calls base class Notify
41 // On top of that run loader is closed, because we change the input file
43 if (AliSelector::Notify() == kFALSE)
51 Bool_t AliSelectorRL::Process(Long64_t entry)
53 // Call the baseclass Process and set event number in runLoader (if loaded)
55 if (AliSelector::Process(entry) == kFALSE)
59 fRunLoader->GetEvent(entry);
64 void AliSelectorRL::SlaveTerminate()
68 AliSelector::SlaveTerminate();
73 AliRunLoader* AliSelectorRL::GetRunLoader()
75 // Returns AliRun instance corresponding to current ESD active in fTree
76 // Loads galice.root, the file is identified by replacing "AliESDs" to
77 // "galice" in the file path of the ESD file. This is a hack, to be changed!
81 if (!fTree->GetCurrentFile())
84 TString fileName(fTree->GetCurrentFile()->GetName());
85 fileName.ReplaceAll("AliESDs", "galice");
87 fRunLoader = AliRunLoader::Open(fileName);
91 fRunLoader->LoadgAlice();
92 fRunLoader->GetEvent(fTree->GetTree()->GetReadEntry());
98 void AliSelectorRL::DeleteRunLoader()
101 // deletes the runloader
106 fRunLoader->Delete();
111 AliHeader* AliSelectorRL::GetHeader()
113 // Returns header retrieved from RunLoader
115 AliRunLoader* runLoader = GetRunLoader();
119 if (runLoader->GetHeader() == 0)
120 runLoader->LoadHeader();
122 return runLoader->GetHeader();
125 AliStack* AliSelectorRL::GetStack()
127 // Returns stack retrieved from RunLoader
129 AliRunLoader* runLoader = GetRunLoader();
133 if (runLoader->Stack() == 0)
134 runLoader->LoadKinematics();
136 return runLoader->Stack();