13 #include "TDataSetIter.h"
14 #include "TObjectSet.h"
21 #include "StEvtHddr.h"
22 #ifndef ROOT_TClonesArray
23 #include "TClonesArray.h"
25 #include "TStopwatch.h"
26 #include "StMessMgr.h"
29 #if ROOT_VERSION_CODE >= ROOT_VERSION(3,05,04)
30 typedef TDataSet::EDataSetPass EDataSetPass;
60 typedef enum {kNormal, kDebug} EDebugLevel;
61 enum {kSTAFCV_BAD, kSTAFCV_OK, kSTAFCV_ERR=2, kSTAFCV_FATAL=3} EModule_return_Status;
62 enum EMakerStatus {kInitBeg = 1, kInitEnd = 2,
63 kMakeBeg = 3, kCleaBeg = 4,
64 kFiniBeg = 5, kFiniEnd = 6,
79 static Int_t fgTallyMaker[
kStFatal+1];
99 StMaker(
const char *name=
"",
const char *dummy=0);
101 virtual Int_t IsChain()
const {
return 0;}
105 virtual void Clear(Option_t *option=
"");
106 virtual Int_t InitRun(Int_t runumber);
107 virtual Int_t Init();
108 virtual void StartMaker();
109 virtual Int_t
Make();
110 virtual Int_t IMake(Int_t number){SetNumber(number);
return Make();};
111 virtual void EndMaker (Int_t ierr);
113 virtual Int_t FinishRun(Int_t oldrunumber);
116 virtual void FatalErr(Int_t Ierr,
const char *Com);
117 virtual void PrintInfo();
118 virtual void NotifyMe(
const char *,
const void *){}
119 virtual void AddMaker (
StMaker *mk);
121 virtual void MakeDoc(
const TString &stardir=
"$(STAR)",
const TString &outdir=
"$(STAR)/StRoot/html",Bool_t baseClasses=kTRUE);
123 virtual void MakeDoc(
const TString &,
const TString &,Bool_t ) {}
127 virtual TDataSet *AddObj (TObject *obj ,
const char *dir,
int owner=1);
128 virtual TDataSet *ToWhiteBoard(
const char *name,
void *dat);
129 virtual TDataSet *ToWhiteBoard(
const char *name,
void *dat,
void *del);
130 virtual TDataSet *ToWhiteBoard(
const char *name, TObject *dat, Int_t owner);
132 virtual TDataSet *ToWhiteConst(
const char *name, TObject *dat);
133 virtual TDataSet *ToWhiteConst(
const char *name,
void *dat);
136 virtual TDataSet *WhiteBoard (
const char *name,
void *v=0)
const;
138 virtual Int_t Skip(Int_t nskip);
141 virtual void AddHist(TH1 *h,
const char *dir=0);
144 virtual void AddRunco (Double_t par,
const char *name,
const char *comment);
146 virtual TList *GetHistList()
const {
return (TList*)GetDirObj(
".hist");};
147 virtual TH1 *GetHist(
const char *histName)
const {TList *l=GetHistList();
return l?(TH1*)l->FindObject(histName):(TH1*)0;};
149 virtual StMaker *Cd(){
return cd();};
150 static StMaker *New(
const char *classname,
const char *name=
"",
void *title=0);
155 virtual void SetNumber(Int_t number) ;
159 virtual StMaker *GetParentChain()
const;
161 virtual void SetIventNumber(Int_t iv);
162 virtual Int_t GetEventNumber()
const ;
164 virtual const TDatime &GetDateTime()
const;
165 virtual const TDatime &GetDBTime()
const;
166 virtual void SetDateTime(Int_t idat,Int_t itim);
168 virtual Int_t GetDate()
const ;
169 virtual Int_t GetTime()
const ;
170 virtual const char *GetEventType()
const ;
174 virtual TDataSet *GetData(
const char *name,
const char *dir=
".data")
const;
175 virtual TDataSet *GetData()
const {
return m_DataSet ;}
176 virtual TDataSet *GetConst()
const {
return m_ConstSet;}
177 virtual TDataSet *GetDataSet (
const char *logInput)
const {
return FindDataSet(logInput);}
178 virtual TDataSet * DataSet (
const char *logInput)
const
179 {
return GetDataSet(logInput);};
180 virtual TDataSet *GetInputDS (
const char *logInput)
const
181 {
return GetDataSet(logInput);};
183 virtual TDataSet *GetDataBase(
const char *logInput,
const TDatime *td=0);
184 virtual TDataSet *GetInputDB (
const char *logInput)
185 {
return GetDataBase(logInput);};
189 virtual Int_t Debug()
const {
return GetDebug();};
190 virtual Int_t GetMakeReturn()
const {
return m_MakeReturn;}
191 virtual TList *Histograms()
const {
return GetHistList();}
192 virtual TString GetAlias (
const char *log,
const char *dir=
".aliases")
const ;
193 virtual TString GetInput (
const char *log)
const {
return GetAlias(log);};
194 virtual TString GetOutput(
const char *log)
const {
return GetAlias(log,
".aliases");};
195 virtual TList *GetMakeList()
const ;
196 virtual StMaker *GetParentMaker ()
const;
197 virtual StMaker *GetMaker (
const char *mkname);
198 virtual StMaker *GetMakerInheritsFrom (
const char *mktype)
const;
199 virtual Bool_t IsActive() {
return TestBIT(kActive);}
200 virtual StMaker *Maker (
const char *mkname){
return GetMaker (mkname);};
205 virtual void ResetBIT(EMakerStatus k) {CLRBIT(
fStatus,k);}
206 virtual Bool_t TestBIT(EMakerStatus k) {
return TESTBIT(
fStatus,k);}
208 virtual void SetActive(Bool_t k=kTRUE) {
if(k)
SetBIT(kActive);
else ResetBIT(kActive);}
209 virtual void SetDebug(Int_t l=1);
210 virtual void SetDEBUG(Int_t l=1);
211 virtual void SetFlavor(
const char *flav,
const char *tabname);
212 virtual void SetMakeReturn(Int_t ret){
m_MakeReturn=ret;}
213 virtual void SetAlias(
const char *log,
const char *act,
const char *dir=
".aliases");
214 virtual void AddAlias(
const char *log,
const char *act,
const char *dir=
".aliases");
215 virtual void SetInput(
const char *log,
const char *act){SetAlias(log,act);};
216 virtual void SetOutput(
const char *log,
const char *act){SetAlias(log,act,
".aliases");};
217 virtual void SetOutput(
const char *log,
TDataSet *ds);
218 virtual void SetOutput(
TDataSet *ds){SetOutput(0,ds);};
219 virtual void SetOutputAll(
TDataSet *ds,Int_t level=1);
220 virtual void SetMode(Int_t mode=0) {
m_Mode=mode;}
221 virtual void SetNotify(
const char *about,
StMaker *mk);
222 virtual Int_t GetMode() {
return m_Mode;}
224 virtual const StChainOpt *GetChainOpt()
const;
225 virtual TFile *GetTFile()
const;
227 virtual void NotifyEm(
const char *about,
const void *ptr);
229 virtual Double_t RealTime(){
return m_Timer.RealTime();}
230 virtual Double_t CpuTime() {
return m_Timer.CpuTime();}
231 virtual void StartTimer(Bool_t reset = kFALSE){
m_Timer.Start(reset);}
232 virtual void StopTimer(){
m_Timer.Stop();}
234 virtual void PrintTotalTime(){}
236 virtual const char *
GetName()
const;
241 static const char *RetCodeAsString(Int_t kode);
242 static Int_t AliasDate(
const char *alias);
243 static Int_t AliasTime(
const char *alias);
244 static const char *AliasGeometry(
const char *alias);
248 TObject *GetDirObj(
const char *dir)
const;
249 void SetDirObj(TObject *obj,
const char *dir);
250 virtual const char *GetCVS()
const
251 {
static const char cvs[]=
"Tag $Name: $ $Id: StMaker.h,v 1.101 2017/04/26 18:33:12 perev Exp $ built " __DATE__
" " __TIME__ ;
return cvs;}
253 virtual TDataSet *FindDataSet (
const char *logInput,
255 const StMaker *dowMk=0)
const ;
258 static Int_t Cleanup(
TDataSet *&ds);
259 static void lsMakers(
const StMaker *top);
266 Int_t SetAttr(
const char *key,
const char *val,
const char *to=
".");
267 Int_t SetAttr(
const char *key,Int_t val,
const char *to=
".");
268 Int_t SetAttr(
const char *key,UInt_t val,
const char *to=
".");
269 Int_t SetAttr(
const char *key,Double_t val,
const char *to=
".");
270 Int_t SetAttr(
const StMaker *mk);
271 Int_t RemAttr(
const char *key,
const char *to=
".")
272 {
return SetAttr(key,
".remove",to);}
273 const TAttr *GetAttr()
const {
return m_Attr;}
274 Int_t IAttr(
const char *key)
const;
275 UInt_t UAttr(
const char *key)
const;
276 Double_t DAttr(
const char *key)
const;
277 const char *SAttr(
const char *key)
const;
278 void PrintAttr()
const;
303 virtual void SetNext(
StMaker *mk);
304 virtual void Print(
const char *opt=
"")
const;
static StMaker * fgFailedMaker
current pointer to StChain
StMessMgr * fLogger
Maker status.
Int_t fTallyMaker[kStFatal+1]
counters
TDataSet * m_Ouputs
list of logInput:ActualInput
virtual void AddData(TDataSet *data, const char *dir=".data")
User methods.
Int_t fStatus
StMemStat for Clear.
StTestMaker(const char *name="")
Constructor & Destructor.
virtual Int_t GetNumber() const
STAR methods.
static StTestMaker * fgTestMaker
current pointer to failed maker
virtual void Clear(Option_t *option="")
User defined functions.
Int_t m_Number
Integer mode of maker.
TDataSet * m_Runco
list of logOuput:ActualOuput
StMemStat * fMemStatMake
Timer object.
Int_t m_DebugLevel
Last Run number.
Int_t m_MakeReturn
Debug level.
virtual void SetBIT(EMakerStatus k)
Maker Status Bits.
static StMaker * fgTopChain
list of Histograms
static StMaker * fgStChain
pointer to top StChain
TStopwatch m_Timer
Make() return flag.
StMaker(const char *name="", const char *dummy=0)
Constructor & Destructor.
StMemStat * fMemStatClear
StMemStat for Make.
virtual const char * GetName() const
special overload
virtual Int_t GetRunNumber() const
Returns the current RunNumber.
static EDataSetPass ClearDS(TDataSet *ds, void *user)
virtual Int_t GetIventNumber() const
Returns the current event number.
Int_t m_LastRun
Serial event number.
virtual void SetActive(Bool_t k=kTRUE)
Setters for flags and switches.
TList * m_Histograms
Run Control parameters.
virtual void PrintTimer(Option_t *option="")