12 #ifndef ROOT_TTVSession
13 #define ROOT_TTVSession
29 class TTVRecord :
public TObject {
36 TString fCut, fCutAlias;
38 Bool_t fScanRedirected;
46 void ExecuteUserCode();
47 void FormFrom(TTreeViewer *tv);
48 void PlugIn(TTreeViewer *tv);
49 const char *GetX()
const {
return fX;}
50 const char *GetY()
const {
return fY;}
51 const char *GetZ()
const {
return fZ;}
52 virtual const char *GetName()
const {
return fName;}
53 const char *GetUserCode()
const {
return fUserCode;}
54 Bool_t HasUserCode()
const {
return fUserCode.Length() != 0 ? kTRUE : kFALSE;}
55 Bool_t MustExecuteCode()
const {
return fAutoexec;}
56 void SetAutoexec(Bool_t autoexec=kTRUE) {fAutoexec=autoexec;}
57 void SetName(
const char* name =
"") {fName = name;}
58 void SetX(
const char *x =
"",
const char *xal =
"-empty-") {fX = x; fXAlias = xal;}
59 void SetY(
const char *y =
"",
const char *yal =
"-empty-") {fY = y; fYAlias = yal;}
60 void SetZ(
const char *z =
"",
const char *zal =
"-empty-") {fZ = z; fZAlias = zal;}
61 void SetCut(
const char *cut =
"",
const char *cal =
"-empty-") {fCut = cut; fCutAlias = cal;}
62 void SetOption(
const char *option =
"") {fOption = option;}
63 void SetRC(Bool_t redirect = kFALSE, Bool_t cut = kTRUE) {fScanRedirected = redirect; fCutEnabled = cut;}
64 void SetUserCode(
const char *code, Bool_t autoexec=kTRUE) {fUserCode = code; fAutoexec=autoexec;}
65 void SaveSource(std::ofstream &out);
67 ClassDef(TTVRecord, 0)
70 class TTVSession :
public TObject {
80 TTVSession(TTreeViewer *tv);
82 virtual const char *GetName()
const {
return fName;}
83 void SetName(
const char *name) {fName = name;}
84 void SetRecordName(
const char* name);
85 TTVRecord *AddRecord(Bool_t fromFile = kFALSE);
86 Int_t GetEntries() {
return fRecords;}
87 TTVRecord *GetCurrent() {
return GetRecord(fCurrent);}
88 TTVRecord *GetRecord(Int_t i);
89 TTVRecord *First() {
return GetRecord(0);}
90 TTVRecord *Last() {
return GetRecord(fRecords-1);}
91 TTVRecord *Next() {
return GetRecord(fCurrent+1);}
92 TTVRecord *Previous() {
return GetRecord(fCurrent-1);}
94 void RemoveLastRecord();
95 void Show(TTVRecord *rec);
96 void SaveSource(std::ofstream &out);
97 void UpdateRecord(
const char *name);
99 ClassDef(TTVSession, 0)