ClassImp(AliSelector)
-AliSelector::AliSelector(TTree *) :
+AliSelector::AliSelector() :
TSelector(),
fChain(0),
fESD(0),
fHeader(0),
- fKineFile(0),
- fRunLoader(0)
+ fKineFile(0)
{
//
// Constructor. Initialization of pointers
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;
}
// on each slave server.
DeleteKinematicsFile();
- DeleteRunLoader();
}
void AliSelector::Terminate()
}
}
-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
{
//
#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;}
protected:
TTree* GetKinematics();
- AliRun* GetAliRun();
-
Bool_t IsPrimaryCharged(TParticle* aParticle, Int_t aTotalPrimaries) const;
TChain *fChain; //! pointer to the analyzed TTree or TChain
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);
};