]>
Commit | Line | Data |
---|---|---|
76147823 | 1 | #ifndef ALIINPUTEVENTHANDLER_H |
2 | #define ALIINPUTEVENTHANDLER_H | |
3 | /* Copyright(c) 1998-2007, ALICE Experiment at CERN, All rights reserved. * | |
4 | * See cxx source for full Copyright notice */ | |
5 | ||
6 | /* $Id$ */ | |
7 | ||
8 | //------------------------------------------------------------------------- | |
9 | // Input Handler realisation of the AliVEventHandler interface | |
10 | // Author: Andreas Morsch, CERN | |
11 | //------------------------------------------------------------------------- | |
12 | ||
13 | #include "AliVEventHandler.h" | |
97acfdbe | 14 | #include <TTree.h> |
15 | ||
76147823 | 16 | |
76147823 | 17 | class AliVEvent; |
b2af62ab | 18 | class AliVCuts; |
1aa09fd1 | 19 | class AliRunTag; |
cec9e119 | 20 | class AliEventTag; |
76147823 | 21 | |
b2af62ab | 22 | |
76147823 | 23 | class AliInputEventHandler : public AliVEventHandler { |
24 | ||
25 | public: | |
aaf2d706 | 26 | enum EInputHandlerFlags { |
f4de59f4 | 27 | kUserCallSelectionMask = BIT(14), // Watch out for defining base class bits |
28 | kCheckStatistics = BIT(15) | |
aaf2d706 | 29 | }; |
76147823 | 30 | AliInputEventHandler(); |
31 | AliInputEventHandler(const char* name, const char* title); | |
32 | virtual ~AliInputEventHandler(); | |
0931e76a | 33 | virtual void SetOutputFileName(const char* /*fname*/) {;} |
34 | virtual const char *GetOutputFileName() {return 0;} | |
a37ff5af | 35 | virtual Bool_t Init(Option_t* opt) {if(fMixingHandler) fMixingHandler->Init(opt);return kTRUE;} |
36 | virtual Bool_t Init(TTree* tree, Option_t* opt) {if(fMixingHandler) fMixingHandler->Init(tree,opt);return kTRUE;} | |
0d6a82a5 | 37 | virtual Bool_t GetEntry() {if(fMixingHandler) fMixingHandler->GetEntry(); return kTRUE;} |
a37ff5af | 38 | virtual Bool_t BeginEvent(Long64_t entry) {if(fMixingHandler) fMixingHandler->BeginEvent(entry);return kTRUE;} |
39 | ||
40 | virtual Bool_t Notify() { return AliVEventHandler::Notify();} | |
41 | virtual Bool_t Notify(const char *path) {if(fMixingHandler) fMixingHandler->Notify(path);return kTRUE;} | |
42 | virtual Bool_t FinishEvent() {if(fMixingHandler) fMixingHandler->FinishEvent();return kTRUE;} | |
43 | virtual Bool_t Terminate() {if(fMixingHandler) fMixingHandler->Terminate();return kTRUE;} | |
44 | virtual Bool_t TerminateIO() {if(fMixingHandler) fMixingHandler->TerminateIO();return kTRUE;} | |
45 | ||
76147823 | 46 | // Setters |
300d5701 | 47 | virtual void SetInputTree(TTree* tree) {fTree = tree;} |
b2af62ab | 48 | virtual void SetEventSelection(AliVCuts* cuts) {fEventCuts = cuts;} |
aaf2d706 | 49 | virtual void SetUserCallSelectionMask(Bool_t flag=kTRUE) {TObject::SetBit(kUserCallSelectionMask,flag);} |
f4de59f4 | 50 | virtual void SetCheckStatistics(Bool_t flag=kTRUE) {TObject::SetBit(kCheckStatistics,flag);} |
f16ba708 | 51 | // |
52 | void SetInactiveBranches(const char* branches) {fBranches = branches;} | |
53 | void SetActiveBranches (const char* branches) {fBranchesOn = branches;} | |
fedd7a0d | 54 | // Getters |
1aa09fd1 | 55 | virtual AliVEvent *GetEvent() const {return 0;} |
cec9e119 | 56 | virtual const AliEventTag *GetEventTag() const {return 0;} |
1aa09fd1 | 57 | virtual AliRunTag *GetRunTag() const {return 0;} |
70908d05 | 58 | // Get the statistics object (currently TH2). Option can be BIN0. |
59 | virtual TObject *GetStatistics(Option_t *option="") const; | |
1aa09fd1 | 60 | virtual Option_t *GetAnalysisType() const {return 0;} |
61 | virtual TTree *GetTree( ) const {return fTree;} | |
2af85599 | 62 | virtual AliVCuts *GetEventSelection() const {return fEventCuts;} |
f0ee78b0 | 63 | virtual Long64_t GetReadEntry() const; |
f4de59f4 | 64 | virtual Bool_t IsCheckStatistics() const {return TObject::TestBit(kCheckStatistics);} |
aaf2d706 | 65 | virtual Bool_t IsUserCallSelectionMask() const {return TObject::TestBit(kUserCallSelectionMask);} |
f0ee78b0 | 66 | virtual Bool_t NewEvent() |
67 | {Bool_t ne = fNewEvent; fNewEvent = kFALSE; return ne;} | |
0c6c629b | 68 | virtual UInt_t IsEventSelected() |
69 | {return fIsSelectedResult;} | |
8ed10396 | 70 | // Mixing |
71 | void SetMixingHandler(AliInputEventHandler* mixing) | |
72 | {fMixingHandler = mixing;} | |
73 | AliInputEventHandler* MixingHandler() | |
74 | {return fMixingHandler;} | |
7af7146c | 75 | // Parent Handler |
76 | void SetParentHandler(AliInputEventHandler* parent) {fParentHandler = parent;} | |
77 | AliInputEventHandler* ParentHandler() {return fParentHandler;} | |
8ed10396 | 78 | |
f16ba708 | 79 | protected: |
80 | void SwitchOffBranches() const; | |
81 | void SwitchOnBranches() const; | |
87d395bd | 82 | private: |
83 | AliInputEventHandler(const AliInputEventHandler& handler); | |
84 | AliInputEventHandler& operator=(const AliInputEventHandler& handler); | |
76147823 | 85 | protected: |
f16ba708 | 86 | TTree *fTree; //! Pointer to the tree |
87 | TString fBranches; // List of branches to be switched off (separated by space) | |
88 | TString fBranchesOn; // List of branches to be switched on (separated by space) | |
f0ee78b0 | 89 | Bool_t fNewEvent; // New event flag |
b2af62ab | 90 | AliVCuts* fEventCuts; // Cuts on the event level |
0c6c629b | 91 | UInt_t fIsSelectedResult; // Selection result |
7af7146c | 92 | AliInputEventHandler* fMixingHandler; // Optionla plugin for mixing |
93 | AliInputEventHandler* fParentHandler; // optional pointer to parent handlers (used in AliMultiInputEventHandler) | |
94 | ClassDef(AliInputEventHandler, 6); | |
76147823 | 95 | }; |
96 | ||
97 | #endif |