]> git.uio.no Git - u/mrichter/AliRoot.git/blame - STEER/STEERBase/AliInputEventHandler.h
debug message removed
[u/mrichter/AliRoot.git] / STEER / STEERBase / AliInputEventHandler.h
CommitLineData
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 17class AliVEvent;
b2af62ab 18class AliVCuts;
1aa09fd1 19class AliRunTag;
cec9e119 20class AliEventTag;
d6e39fcb 21class AliPIDResponse;
205cbea7 22class AliMCEvent;
b2af62ab 23
76147823 24class AliInputEventHandler : public AliVEventHandler {
25
26 public:
aaf2d706 27 enum EInputHandlerFlags {
f4de59f4 28 kUserCallSelectionMask = BIT(14), // Watch out for defining base class bits
9e15d933 29 kCheckStatistics = BIT(15),
30 kNeedField = BIT(16)
aaf2d706 31 };
76147823 32 AliInputEventHandler();
33 AliInputEventHandler(const char* name, const char* title);
34 virtual ~AliInputEventHandler();
fdbaa4ce 35 virtual void SetInputFileName(const char* fname);
36 virtual const char *GetInputFileName() const {return fInputFileName;}
0931e76a 37 virtual void SetOutputFileName(const char* /*fname*/) {;}
fdbaa4ce 38 virtual const char *GetOutputFileName() const {return 0;}
a37ff5af 39 virtual Bool_t Init(Option_t* opt) {if(fMixingHandler) fMixingHandler->Init(opt);return kTRUE;}
40 virtual Bool_t Init(TTree* tree, Option_t* opt) {if(fMixingHandler) fMixingHandler->Init(tree,opt);return kTRUE;}
0d6a82a5 41 virtual Bool_t GetEntry() {if(fMixingHandler) fMixingHandler->GetEntry(); return kTRUE;}
a37ff5af 42 virtual Bool_t BeginEvent(Long64_t entry) {if(fMixingHandler) fMixingHandler->BeginEvent(entry);return kTRUE;}
9e15d933 43 virtual Bool_t NeedField() const {return TObject::TestBit(kNeedField);}
44 //
a37ff5af 45 virtual Bool_t Notify() { return AliVEventHandler::Notify();}
46 virtual Bool_t Notify(const char *path) {if(fMixingHandler) fMixingHandler->Notify(path);return kTRUE;}
47 virtual Bool_t FinishEvent() {if(fMixingHandler) fMixingHandler->FinishEvent();return kTRUE;}
48 virtual Bool_t Terminate() {if(fMixingHandler) fMixingHandler->Terminate();return kTRUE;}
49 virtual Bool_t TerminateIO() {if(fMixingHandler) fMixingHandler->TerminateIO();return kTRUE;}
76147823 50 // Setters
300d5701 51 virtual void SetInputTree(TTree* tree) {fTree = tree;}
59e0dcd5 52 virtual void SetEventSelection(AliVCuts* cuts) {if (fEventCuts) Changed(); fEventCuts = cuts;}
aaf2d706 53 virtual void SetUserCallSelectionMask(Bool_t flag=kTRUE) {TObject::SetBit(kUserCallSelectionMask,flag);}
59e0dcd5 54 virtual void SetCheckStatistics(Bool_t flag=kTRUE) {Changed(); TObject::SetBit(kCheckStatistics,flag);}
9e15d933 55 virtual void SetNeedField(Bool_t flag=kTRUE) {TObject::SetBit(kNeedField,flag);}
f16ba708 56 //
59e0dcd5 57 void SetInactiveBranches(const char* branches) {Changed(); fBranches = branches;}
58 void SetActiveBranches (const char* branches) {Changed(); fBranchesOn = branches;}
fedd7a0d 59 // Getters
1aa09fd1 60 virtual AliVEvent *GetEvent() const {return 0;}
cec9e119 61 virtual const AliEventTag *GetEventTag() const {return 0;}
1aa09fd1 62 virtual AliRunTag *GetRunTag() const {return 0;}
70908d05 63 // Get the statistics object (currently TH2). Option can be BIN0.
64 virtual TObject *GetStatistics(Option_t *option="") const;
1aa09fd1 65 virtual Option_t *GetAnalysisType() const {return 0;}
66 virtual TTree *GetTree( ) const {return fTree;}
2af85599 67 virtual AliVCuts *GetEventSelection() const {return fEventCuts;}
f0ee78b0 68 virtual Long64_t GetReadEntry() const;
f4de59f4 69 virtual Bool_t IsCheckStatistics() const {return TObject::TestBit(kCheckStatistics);}
aaf2d706 70 virtual Bool_t IsUserCallSelectionMask() const {return TObject::TestBit(kUserCallSelectionMask);}
f0ee78b0 71 virtual Bool_t NewEvent()
72 {Bool_t ne = fNewEvent; fNewEvent = kFALSE; return ne;}
0c6c629b 73 virtual UInt_t IsEventSelected()
74 {return fIsSelectedResult;}
205cbea7 75 virtual AliMCEvent* MCEvent() const {return 0;}
4cf1e5f2 76 TList *GetUserInfo() const {return fUserInfo;}
8ed10396 77 // Mixing
59e0dcd5 78 void SetMixingHandler(AliInputEventHandler* mixing) {Changed(); fMixingHandler = mixing;}
79 AliInputEventHandler* MixingHandler() {return fMixingHandler;}
7af7146c 80 // Parent Handler
59e0dcd5 81 void SetParentHandler(AliInputEventHandler* parent) {Changed(); fParentHandler = parent;}
82 AliInputEventHandler* ParentHandler() {return fParentHandler;}
8ed10396 83
d6e39fcb 84 //PID response
85 virtual AliPIDResponse* GetPIDResponse() {return 0x0;}
86 virtual void CreatePIDResponse(Bool_t /*isMC*/=kFALSE) {;}
87
f16ba708 88 protected:
89 void SwitchOffBranches() const;
90 void SwitchOnBranches() const;
87d395bd 91 private:
92 AliInputEventHandler(const AliInputEventHandler& handler);
93 AliInputEventHandler& operator=(const AliInputEventHandler& handler);
76147823 94 protected:
f16ba708 95 TTree *fTree; //! Pointer to the tree
96 TString fBranches; // List of branches to be switched off (separated by space)
97 TString fBranchesOn; // List of branches to be switched on (separated by space)
fdbaa4ce 98 TString fInputFileName; // Name of the input file
f0ee78b0 99 Bool_t fNewEvent; // New event flag
b2af62ab 100 AliVCuts* fEventCuts; // Cuts on the event level
0c6c629b 101 UInt_t fIsSelectedResult; // Selection result
7af7146c 102 AliInputEventHandler* fMixingHandler; // Optionla plugin for mixing
103 AliInputEventHandler* fParentHandler; // optional pointer to parent handlers (used in AliMultiInputEventHandler)
4cf1e5f2 104 TList *fUserInfo; //! transient user info for current tree
fdbaa4ce 105 ClassDef(AliInputEventHandler, 7);
76147823 106};
107
108#endif