Fix in the last caall to CleanOwnPrimaryVertex
[u/mrichter/AliRoot.git] / ANALYSIS / AliAnalysisDataSlot.h
CommitLineData
d3106602 1#ifndef ALIANALYSISDATASLOT_H
2#define ALIANALYSISDATASLOT_H
3/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5
6/* $Id$ */
7// Author: Andrei Gheata, 31/05/2006
8
9//==============================================================================
10// AliAnalysysDataSlot - Class representing a data slot of an analysis task.
11// An analysis slot enforces a certain data type required by the Exec()
12// method of the analysis task. The slot must be connected to a data
13// container with data of the same type.
14//==============================================================================
15
c52c2132 16#ifndef ROOT_TNamed
17#include "TNamed.h"
d3106602 18#endif
19
20class TClass;
b1310ef5 21class TTree;
d3106602 22class AliAnalysisDataContainer;
23class AliAnalysisTask;
24
c52c2132 25class AliAnalysisDataSlot : public TNamed {
d3106602 26
27public:
c52c2132 28 AliAnalysisDataSlot() : TNamed(), fType(NULL), fParent(NULL), fContainer(NULL) {}
29 AliAnalysisDataSlot(TClass *type, AliAnalysisTask *task);
30 AliAnalysisDataSlot(const AliAnalysisDataSlot &slot);
37a26056 31 virtual ~AliAnalysisDataSlot() {}
32
33 // Assignment
34 AliAnalysisDataSlot &operator=(const AliAnalysisDataSlot &slot);
d3106602 35 // Connect some container to the slot
36 Bool_t ConnectContainer(AliAnalysisDataContainer *cont);
b1310ef5 37 static Int_t EnableBranch(const char *bname, TTree *tree);
d3106602 38 // Getters
327eaf46 39 void *GetBranchAddress(const char *branch) const;
40 Bool_t SetBranchAddress(const char *branch, void *address);
c52c2132 41 TClass *GetType() const;
d3106602 42 AliAnalysisTask *GetParent() const {return fParent;}
43 AliAnalysisDataContainer *GetContainer() const {return fContainer;}
44 TObject *GetData() const;
45 // Slot status checking
46 Bool_t IsConnected() const {return ((fContainer)?kTRUE:kFALSE);}
47 Bool_t IsDataReady() const;
c52c2132 48
49private:
50 void SetType(TClass *type) {fType = type;}
d3106602 51
52protected:
c52c2132 53 TClass *fType; //! Type of the slot
d3106602 54 AliAnalysisTask *fParent; // Analysis task to which the slot belongs
55 AliAnalysisDataContainer *fContainer; // Container connected to the slot
56
57 ClassDef(AliAnalysisDataSlot,1) // Class describing an analysis data slot
58};
59#endif