FairRoot
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
FairAnaSelector.h
Go to the documentation of this file.
1 /********************************************************************************
2  * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
3  * *
4  * This software is distributed under the terms of the *
5  * GNU Lesser General Public Licence (LGPL) version 3, *
6  * copied verbatim in the file "LICENSE" *
7  ********************************************************************************/
8 // -------------------------------------------------------------------------
9 // ----- FairAnaSelector header file -----
10 // ----- Created 14/10/11 by R. Karabowicz -----
11 // ----- Updated 01/02/12 by R. Karabowicz -----
12 // -------------------------------------------------------------------------
13 
14 #ifndef FAIRANASELECTOR_H
15 #define FAIRANASELECTOR_H
16 
17 #include "FairLogger.h" // for FairLogger, MESSAGE_ORIGIN
18 
19 #include <Rtypes.h> // for Int_t, Bool_t, etc
20 #include <TSelector.h> // for TSelector
21 #include <TSelectorList.h> // for TSelectorList
22 #include <TString.h> // for TString
23 #include <TTree.h> // for TTree
24 
25 class FairFileSource;
26 class FairRunAnaProof;
27 
28 class TFile;
29 class TList;
30 class TObject;
31 class TProofOutputFile;
32 
33 class FairAnaSelector : public TSelector
34 {
35  public:
36  TProofOutputFile* fProofFile;
37  TFile* fFile;
38  TTree* fChain;
40 
41  FairAnaSelector(TTree* /*tree*/ = 0)
42  : fProofFile(0)
43  , fFile(0)
44  , fChain(0)
45  , fRunAna(nullptr)
46  , fProofSource(0)
47  , fCurrentDirectory("")
48  {}
49 
50  virtual ~FairAnaSelector() {}
51  virtual Int_t Version() const { return 1; }
52  virtual void Begin(TTree* tree);
53  virtual void SlaveBegin(TTree* tree);
54  virtual void Init(TTree* tree);
55  virtual Bool_t Notify();
56  virtual Bool_t Process(Long64_t entry);
57  virtual Int_t GetEntry(Long64_t entry, Int_t getall = 0)
58  {
59  return fChain ? fChain->GetTree()->GetEntry(entry, getall) : 0;
60  }
61  virtual void SetOption(const char* option) { fOption = option; }
62  virtual void SetObject(TObject* obj) { fObject = obj; }
63  virtual void SetInputList(TList* input) { fInput = input; }
64  virtual TList* GetOutputList() const { return fOutput; }
65  virtual void SlaveTerminate();
66  virtual void Terminate();
67 
68  void SetFairRunAnaProof(FairRunAnaProof* runAna) { fRunAna = runAna; }
69 
70  private:
72  FairAnaSelector operator=(const FairAnaSelector&);
73 
74  FairFileSource* fProofSource;
75 
76  TString fCurrentDirectory;
77 
78  ClassDef(FairAnaSelector, 0);
79 };
80 
81 #endif // FAIRANASELECTOR_H
void SetFairRunAnaProof(FairRunAnaProof *runAna)
virtual void SlaveBegin(TTree *tree)
virtual void SetObject(TObject *obj)
virtual Int_t Version() const
virtual void SetOption(const char *option)
TProofOutputFile * fProofFile
virtual void SlaveTerminate()
virtual Int_t GetEntry(Long64_t entry, Int_t getall=0)
FairRunAnaProof * fRunAna
pointer to the analyzed TTree or TChain
virtual void Init(TTree *tree)
virtual ~FairAnaSelector()
virtual void Terminate()
FairAnaSelector(TTree *=0)
virtual void Begin(TTree *tree)
virtual Bool_t Process(Long64_t entry)
virtual void SetInputList(TList *input)
virtual TList * GetOutputList() const
virtual Bool_t Notify()