Add method:
[u/mrichter/AliRoot.git] / EVE / EveBase / AliEveMacro.h
CommitLineData
f6afd0e1 1// @(#)root/eve:$Id$
2// Author: Matevz Tadel 2007
3
4/**************************************************************************
5 * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. *
6 * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for *
7 * full copyright notice. *
8 **************************************************************************/
9
10#ifndef AliEveMacro_H
11#define AliEveMacro_H
12
13#include <TObject.h>
14#include <TString.h>
15
68ca2fe7 16class TEveElement;
17
f6afd0e1 18//______________________________________________________________________________
19// Short description of AliEveMacro
20//
21
22class AliEveMacro : public TObject
23{
24 friend class AliEveMacroEditor;
25
26public:
68ca2fe7 27 enum DataSource_e { kNone = 0,
28 kRunLoader = 1,
29 kESD = 2,
30 kESDfriend = 4,
08b0f222 31 kRawReader = 8,
32 kAOD = 16 };
68ca2fe7 33
34 enum ExecStatus_e { kNotRun = -2,
35 kNoData = -1,
36 kOK = 0,
37 kException = 1,
38 kError = 2 };
f6afd0e1 39
7b2d546e 40 AliEveMacro(Int_t src, const TString& tags, const TString& mac, const TString& foo,
f6afd0e1 41 const TString& args="", Bool_t act=kTRUE);
42 virtual ~AliEveMacro() {}
43
44 Int_t GetSources() const { return fSources; }
45 void SetSources(Int_t x) { fSources = x; }
7b2d546e 46 const TString& GetTags() const { return fTags; }
47 void SetTags(const TString& x) { fTags = x; }
f6afd0e1 48 const TString& GetMacro() const { return fMacro; }
49 void SetMacro(const TString& x) { fMacro = x; }
50 const TString& GetFunc() const { return fFunc; }
51 void SetFunc(const TString& x) { fFunc = x; }
52 const TString& GetArgs() const { return fArgs; }
53 void SetArgs(const TString& x) { fArgs = x; }
54 Bool_t GetActive() const { return fActive; }
55 void SetActive(Bool_t x) { fActive = x; }
56
68ca2fe7 57 Bool_t RequiresRunLoader() const { return fSources & kRunLoader; }
58 Bool_t RequiresESD() const { return fSources & kESD; }
59 Bool_t RequiresESDfriend() const { return fSources & kESDfriend; }
60 Bool_t RequiresRawReader() const { return fSources & kRawReader; }
08b0f222 61 Bool_t RequiresAOD() const { return fSources & kAOD; }
68ca2fe7 62
63 void ResetExecState();
64
65 void SetExecNoData();
66 void SetExecOK(TEveElement* result);
67 void SetExecException(const TString& exception);
68 void SetExecError();
69
70 ExecStatus_e GetExecStatus() const { return fExecStatus; }
71 const TString& GetExecException() const { return fExecExcString; }
72 TEveElement* GetExecResult() const { return fExecResult; }
73
74 Bool_t WasExecTried() const { return fExecStatus >= kOK; }
75 Bool_t WasExecOK() const { return fExecStatus == kOK; }
76
f6afd0e1 77 TString FormForExec() const;
78 TString FormForDisplay() const;
79
80protected:
68ca2fe7 81 Int_t fSources; // Source of data, bitwise or of DataSource_e entries.
7b2d546e 82 TString fTags; // Tags describing the macro (for selection).
83 TString fMacro; // Macro where func is defined; if null, assume it is there.
84 TString fFunc; // Function to call.
85 TString fArgs; // Arguments for the function.
86 Bool_t fActive; // Flag if macro is active.
f6afd0e1 87
68ca2fe7 88 ExecStatus_e fExecStatus;
89 TString fExecExcString;
90 TEveElement *fExecResult;
91
f6afd0e1 92private:
68ca2fe7 93 AliEveMacro(const AliEveMacro&); // Not implemented
94 AliEveMacro& operator=(const AliEveMacro&); // Not implemented
f6afd0e1 95
68ca2fe7 96 ClassDef(AliEveMacro, 0); // Encapsulation of data reqired for execution of a CINT macro and the result of its last execution.
f6afd0e1 97};
98
99#endif