Logo ROOT   6.07/09
Reference Guide
TQueryResult.h
Go to the documentation of this file.
1 // @(#)root/tree:$Id$
2 // Author: G Ganis Sep 2005
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2005, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #ifndef ROOT_TQueryResult
13 #define ROOT_TQueryResult
14 
15 
16 //////////////////////////////////////////////////////////////////////////
17 // //
18 // TQueryResult //
19 // //
20 // A container class for the results of a query. //
21 // //
22 //////////////////////////////////////////////////////////////////////////
23 
24 #ifndef ROOT_TNamed
25 #include "TNamed.h"
26 #endif
27 #ifndef ROOT_TDatime
28 #include "TDatime.h"
29 #endif
30 #ifndef ROOT_TMacro
31 #include "TMacro.h"
32 #endif
33 #ifndef ROOT_TString
34 #include "TString.h"
35 #endif
36 
37 class TBrowser;
38 class TTreePlayer;
39 class TQueryResult;
40 
41 Bool_t operator==(const TQueryResult &qr1, const TQueryResult &qr2);
42 
43 
44 class TQueryResult : public TNamed {
45 
46 friend class TTreePlayer;
47 friend class TProofPlayerLite;
48 friend class TProofPlayerRemote;
49 friend class TProof;
50 friend class TProofLite;
51 friend class TProofServ;
52 friend class TQueryResultManager;
53 
54 public:
55  enum EQueryStatus {
57  };
58 
59 protected:
60  Int_t fSeqNum; ///< query unique sequential number
61  Bool_t fDraw; ///< true if draw action query
62  EQueryStatus fStatus; ///< query status
63  TDatime fStart; ///< time when processing started
64  TDatime fEnd; ///< time when processing ended
65  Float_t fUsedCPU; ///< real CPU time used (seconds)
66  TString fOptions; ///< processing options + aclic mode (< opt >#< aclic_mode >)
67  TList *fInputList; ///< input list; contains also data sets, entry list, ...
68  Long64_t fEntries; ///< number of entries processed
69  Long64_t fFirst; ///< first entry processed
70  Long64_t fBytes; ///< number of bytes processed
71  TMacro *fLogFile; ///< file with log messages from the query
72  TMacro *fSelecHdr; ///< selector header file
73  TMacro *fSelecImp; ///< selector implementation file
74  TString fLibList; ///< blank-separated list of libs loaded at fStart
75  TString fParList; ///< colon-separated list of PAR loaded at fStart
76  TList *fOutputList; ///< output list
77  Bool_t fFinalized; ///< whether Terminate has been run
78  Bool_t fArchived; ///< whether the query has been archived
79  TString fResultFile; ///< URL of the file where results have been archived
80  Float_t fPrepTime; ///< Prepare time (seconds) (millisec precision)
81  Float_t fInitTime; ///< Initialization time (seconds) (millisec precision)
82  Float_t fProcTime; ///< Processing time (seconds) (millisec precision)
83  Float_t fMergeTime; ///< Merging time (seconds) (millisec precision)
84  Float_t fRecvTime; ///< Transfer-to-client time (seconds) (millisec precision)
85  Float_t fTermTime; ///< Terminate time (seconds) (millisec precision)
86  Int_t fNumWrks; ///< Number of workers at start
87  Int_t fNumMergers; ///< Number of submergers
88 
89  TQueryResult(Int_t seqnum, const char *opt, TList *inlist,
90  Long64_t entries, Long64_t first,
91  const char *selec);
92 
93  void AddInput(TObject *obj);
94  void AddLogLine(const char *logline);
96  virtual void RecordEnd(EQueryStatus status, TList *outlist = 0);
97  void SaveSelector(const char *selec);
98  void SetArchived(const char *archfile);
99  virtual void SetFinalized() { fFinalized = kTRUE; }
100  virtual void SetInputList(TList *in, Bool_t adopt = kTRUE);
101  virtual void SetOutputList(TList *out, Bool_t adopt = kTRUE);
102  virtual void SetProcessInfo(Long64_t ent, Float_t cpu = 0.,
103  Long64_t siz = -1,
104  Float_t inittime = 0., Float_t proctime = 0.);
105  void SetPrepTime(Float_t preptime) { fPrepTime = preptime; }
106  void SetMergeTime(Float_t mergetime) { fMergeTime = mergetime; }
107  void SetRecvTime(Float_t recvtime) { fRecvTime = recvtime; }
108  void SetTermTime(Float_t termtime) { fTermTime = termtime; }
109  void SetNumMergers(Int_t nmergers) { fNumMergers = nmergers; }
110 
111 public:
112  TQueryResult() : fSeqNum(-1), fDraw(0), fStatus(kSubmitted), fUsedCPU(0.),
113  fInputList(0), fEntries(-1), fFirst(-1), fBytes(0),
114  fLogFile(0), fSelecHdr(0), fSelecImp(0),
115  fLibList("-"), fOutputList(0),
116  fFinalized(kFALSE), fArchived(kFALSE), fPrepTime(0.),
117  fInitTime(0.), fProcTime(0.), fMergeTime(0.),
118  fRecvTime(-1), fTermTime(0.), fNumWrks(-1), fNumMergers(-1) { }
119  virtual ~TQueryResult();
120 
121  void Browse(TBrowser *b = 0);
122 
123  Int_t GetSeqNum() const { return fSeqNum; }
124  EQueryStatus GetStatus() const { return fStatus; }
125  TDatime GetStartTime() const { return fStart; }
126  TDatime GetEndTime() const { return fEnd; }
127  const char *GetOptions() const { return fOptions; }
129  TObject *GetInputObject(const char *classname) const;
130  Long64_t GetEntries() const { return fEntries; }
131  Long64_t GetFirst() const { return fFirst; }
132  Long64_t GetBytes() const { return fBytes; }
133  Float_t GetUsedCPU() const { return fUsedCPU; }
134  TMacro *GetLogFile() const { return fLogFile; }
135  TMacro *GetSelecHdr() const { return fSelecHdr; }
136  TMacro *GetSelecImp() const { return fSelecImp; }
137  const char *GetLibList() const { return fLibList; }
138  const char *GetParList() const { return fParList; }
140  const char *GetResultFile() const { return fResultFile; }
141  Float_t GetPrepTime() const { return fPrepTime; }
142  Float_t GetInitTime() const { return fInitTime; }
143  Float_t GetProcTime() const { return fProcTime; }
144  Float_t GetMergeTime() const { return fMergeTime; }
145  Float_t GetRecvTime() const { return fRecvTime; }
146  Float_t GetTermTime() const { return fTermTime; }
147  Int_t GetNumWrks() const { return fNumWrks; }
148  Int_t GetNumMergers() const { return fNumMergers; }
149 
150  Bool_t IsArchived() const { return fArchived; }
151  virtual Bool_t IsDone() const { return (fStatus > kRunning); }
152  Bool_t IsDraw() const { return fDraw; }
153  Bool_t IsFinalized() const { return fFinalized; }
154 
155  Bool_t Matches(const char *ref);
156 
157  void Print(Option_t *opt = "") const;
158 
159  ClassDef(TQueryResult,5) //Class describing a query
160 };
161 
162 inline Bool_t operator!=(const TQueryResult &qr1, const TQueryResult &qr2)
163  { return !(qr1 == qr2); }
164 
165 #endif
TList * GetOutputList()
Definition: TQueryResult.h:139
This class starts a PROOF session on the local machine: no daemons, client and master merged...
Definition: TProofLite.h:42
void Browse(TBrowser *b=0)
To support browsing of the results.
Bool_t IsDraw() const
Definition: TQueryResult.h:152
Float_t fRecvTime
Transfer-to-client time (seconds) (millisec precision)
Definition: TQueryResult.h:84
void SaveSelector(const char *selec)
Save the selector header and implementation into the dedicated TMacro instances.
Int_t GetSeqNum() const
Definition: TQueryResult.h:123
long long Long64_t
Definition: RtypesCore.h:69
void SetNumMergers(Int_t nmergers)
Definition: TQueryResult.h:109
Bool_t IsFinalized() const
Definition: TQueryResult.h:153
float Float_t
Definition: RtypesCore.h:53
Float_t fUsedCPU
real CPU time used (seconds)
Definition: TQueryResult.h:65
const char Option_t
Definition: RtypesCore.h:62
void SetPrepTime(Float_t preptime)
Definition: TQueryResult.h:105
EQueryStatus fStatus
query status
Definition: TQueryResult.h:62
TMacro * GetSelecHdr() const
Definition: TQueryResult.h:135
const char * GetOptions() const
Definition: TQueryResult.h:127
void AddLogLine(const char *logline)
Fill log file.
EQueryStatus GetStatus() const
Definition: TQueryResult.h:124
TMacro * GetLogFile() const
Definition: TQueryResult.h:134
Class supporting a collection of lines with C++ code.
Definition: TMacro.h:33
Basic string class.
Definition: TString.h:137
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
Float_t GetPrepTime() const
Definition: TQueryResult.h:141
TQueryResult * CloneInfo()
Return an instance of TQueryResult containing only the local info fields, i.e.
const Bool_t kFALSE
Definition: Rtypes.h:92
Float_t GetTermTime() const
Definition: TQueryResult.h:146
Float_t fTermTime
Terminate time (seconds) (millisec precision)
Definition: TQueryResult.h:85
void SetRecvTime(Float_t recvtime)
Definition: TQueryResult.h:107
TMacro * GetSelecImp() const
Definition: TQueryResult.h:136
TDatime fEnd
time when processing ended
Definition: TQueryResult.h:64
Int_t fNumMergers
Number of submergers.
Definition: TQueryResult.h:87
TMacro * fSelecHdr
selector header file
Definition: TQueryResult.h:72
Bool_t fFinalized
whether Terminate has been run
Definition: TQueryResult.h:77
TMacro * fLogFile
file with log messages from the query
Definition: TQueryResult.h:71
Int_t GetNumMergers() const
Definition: TQueryResult.h:148
virtual Bool_t IsDone() const
Definition: TQueryResult.h:151
Float_t GetInitTime() const
Definition: TQueryResult.h:142
const char * GetParList() const
Definition: TQueryResult.h:138
TString fResultFile
URL of the file where results have been archived.
Definition: TQueryResult.h:79
TDatime fStart
time when processing started
Definition: TQueryResult.h:63
void Print(Option_t *opt="") const
Print query content. Use opt = "F" for a full listing.
#define ClassDef(name, id)
Definition: Rtypes.h:254
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:33
void SetMergeTime(Float_t mergetime)
Definition: TQueryResult.h:106
Long64_t fFirst
first entry processed
Definition: TQueryResult.h:69
Bool_t operator==(const TQueryResult &qr1, const TQueryResult &qr2)
Compare two query result instances for equality.
TMacro * fSelecImp
selector implementation file
Definition: TQueryResult.h:73
virtual void SetOutputList(TList *out, Bool_t adopt=kTRUE)
Set / change the output list.
Version of TProofPlayerRemote merges the functionality needed by clients and masters.
A container class for query results.
Definition: TQueryResult.h:44
Bool_t operator!=(const TQueryResult &qr1, const TQueryResult &qr2)
Definition: TQueryResult.h:162
Long64_t GetEntries() const
Definition: TQueryResult.h:130
virtual void SetProcessInfo(Long64_t ent, Float_t cpu=0., Long64_t siz=-1, Float_t inittime=0., Float_t proctime=0.)
Set processing info.
void SetTermTime(Float_t termtime)
Definition: TQueryResult.h:108
TList * fOutputList
output list
Definition: TQueryResult.h:76
void AddInput(TObject *obj)
Add obj to the input list.
A doubly linked list.
Definition: TList.h:47
Using a TBrowser one can browse all ROOT objects.
Definition: TBrowser.h:41
Bool_t fArchived
whether the query has been archived
Definition: TQueryResult.h:78
Class managing the query-result area.
Class providing the PROOF server.
Definition: TProofServ.h:80
Float_t GetUsedCPU() const
Definition: TQueryResult.h:133
Bool_t IsArchived() const
Definition: TQueryResult.h:150
TList * fInputList
input list; contains also data sets, entry list, ...
Definition: TQueryResult.h:67
Long64_t GetBytes() const
Definition: TQueryResult.h:132
const char * GetLibList() const
Definition: TQueryResult.h:137
TList * GetInputList()
Definition: TQueryResult.h:128
virtual void RecordEnd(EQueryStatus status, TList *outlist=0)
End of query settings.
Int_t fNumWrks
Number of workers at start.
Definition: TQueryResult.h:86
Int_t fSeqNum
query unique sequential number
Definition: TQueryResult.h:60
virtual void SetFinalized()
Definition: TQueryResult.h:99
const char * GetResultFile() const
Definition: TQueryResult.h:140
Bool_t Matches(const char *ref)
Return TRUE if reference ref matches.
TDatime GetStartTime() const
Definition: TQueryResult.h:125
Float_t fPrepTime
Prepare time (seconds) (millisec precision)
Definition: TQueryResult.h:80
TObject * GetInputObject(const char *classname) const
Return first instance of class &#39;classname&#39; in the input list.
Long64_t GetFirst() const
Definition: TQueryResult.h:131
Float_t fProcTime
Processing time (seconds) (millisec precision)
Definition: TQueryResult.h:82
This class controls a Parallel ROOT Facility, PROOF, cluster.
Definition: TProof.h:346
virtual void SetInputList(TList *in, Bool_t adopt=kTRUE)
Set / change the input list.
virtual ~TQueryResult()
Destructor.
TString fLibList
blank-separated list of libs loaded at fStart
Definition: TQueryResult.h:74
void SetArchived(const char *archfile)
Set (or update) query in archived state.
Int_t GetNumWrks() const
Definition: TQueryResult.h:147
Mother of all ROOT objects.
Definition: TObject.h:44
Float_t fMergeTime
Merging time (seconds) (millisec precision)
Definition: TQueryResult.h:83
Long64_t fEntries
number of entries processed
Definition: TQueryResult.h:68
you should not use this method at all Int_t Int_t Double_t Double_t Double_t Int_t Double_t Double_t Double_t Double_t b
Definition: TRolke.cxx:630
Long64_t fBytes
number of bytes processed
Definition: TQueryResult.h:70
Definition: first.py:1
Float_t GetRecvTime() const
Definition: TQueryResult.h:145
Implement some of the functionality of the class TTree requiring access to extra libraries (Histogram...
Definition: TTreePlayer.h:43
const Bool_t kTRUE
Definition: Rtypes.h:91
Float_t GetProcTime() const
Definition: TQueryResult.h:143
Float_t GetMergeTime() const
Definition: TQueryResult.h:144
TString fParList
colon-separated list of PAR loaded at fStart
Definition: TQueryResult.h:75
TDatime GetEndTime() const
Definition: TQueryResult.h:126
Bool_t fDraw
true if draw action query
Definition: TQueryResult.h:61
This class stores the date and time with a precision of one second in an unsigned 32 bit word (950130...
Definition: TDatime.h:39
TString fOptions
processing options + aclic mode (< opt >#< aclic_mode >)
Definition: TQueryResult.h:66
Float_t fInitTime
Initialization time (seconds) (millisec precision)
Definition: TQueryResult.h:81