StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
1 #ifndef STAR_StBFChain
2 #define STAR_StBFChain
21 #include "StChain.h"
23 #include "TFile.h"
24 #include "TTable.h"
25 #include "Ttypes.h"
26 #include "Bfc.h"
27 //_____________________________________________________________________
29 class StFileI;
30 class TObjArray;
32 class StBFChain : public StChain {
33  private:
34  Bfc_st *fBFC; // Private chain
35  StFileI *fSetFiles; //
36  TString fInFile; //
37  TString fFileOut; //
38  TFile *fTFile;
39  Int_t FDate; // floating timestamp date (MaxDateTime)
40  Int_t FTime; // floating timestamp time (unused)
41  Int_t FDateS; // floating timestamp date (DateTime)
42  Int_t FTimeS; // floating timestamp time (DateTime)
43  TString fFiltTrg; // trigger filtering properties (flavor, inc/exc)
44  Int_t fRunG; // on fly simulation run no. & set for RDNM
45  TString fFmsGainCorrTag; // FMS GainCorrection Flavor Tag
46  Int_t fNoChainOptions;
47  vector<TString> Gproperty; // a global property name
48  vector<TString> Gpattern; // a global pattern
49  vector<TString> Gvalue; // a global value
51  StVecBFCTS GTSOptions; // global set of detector specific timestamps
52 #endif /* USE_BFCTIMESTAMP */
53  St_Bfc *fchainOpt;
54  Int_t fkChain; // Master chain option
56  public:
57  StBFChain(const char *name="bfc", const Bool_t UseOwnHeader = kFALSE) :
58  StChain(name,UseOwnHeader)
59  ,fBFC(0), fSetFiles(0),fInFile(""),fFileOut(""),fTFile(0)
60  ,FDate(0),FTime(0),FDateS(0),FTimeS(0),fFiltTrg(""),fRunG(0)
61  ,fNoChainOptions(0), fchainOpt(0), fkChain(-1) {}
63 #if 0
64  StBFChain(Int_t /* mode */, const char *name="bfc",const Bool_t UseOwnHeader = kFALSE) :
65  StChain(name,UseOwnHeader)
66  ,fSetFiles(0),fInFile(""),fFileOut(""),fTFile(0)
67  ,fNoChainOptions(0), fchainOpt(0), fkChain(-1) {}
68 #endif
69  void Setup(Int_t mode=1);
70  virtual ~StBFChain();
71  virtual Int_t Make(int number){ SetIventNumber(number); return StChain::Make(number);};
72  virtual Int_t Make(){return StChain::Make();};
73  virtual Int_t Load();
74  virtual Int_t Instantiate();
75  virtual Int_t Init();
76  virtual Int_t AddAB (const Char_t *after="",const StMaker *maker=0,const Int_t Opt=1);
77  virtual Int_t AddAfter (const Char_t *after, const StMaker *maker) {return AddAB (after,maker);}
78  virtual Int_t AddBefore (const Char_t *before,const StMaker *maker) {return AddAB (before,maker,-1);}
79  static Int_t ParseString (const TString &tChain, TObjArray &Opt, Bool_t Sort=kFALSE);
80  void SetFlags(const Char_t *Chain="gstar tfs"); // *MENU*
81  void Set_IO_Files(const Char_t *infile=0, const Char_t *outfile=0); // *MENU
82  void SetInputFile(const Char_t *infile=0); // *MENU
83  void SetOutputFile(const Char_t *outfile=0); // *MENU
84  void SetTFile(TFile *tf) {fTFile=tf;}
85  TFile *GetTFile() const {return fTFile;}
86  virtual Int_t kOpt(const TString *Tag, Bool_t Check = kTRUE) const;
87  virtual Int_t kOpt(const Char_t *Tag, Bool_t Check = kTRUE) const;
88  virtual void SetDbOptions(StMaker *db=0);
89  virtual void SetGeantOptions(StMaker *geant=0);
90  virtual void SetTreeOptions();
91  virtual void SetOption(const Int_t k, const Char_t *chain="Chain");
92  virtual void SetOption(const Char_t* Opt, const Char_t *chain="Chain") {SetOption(kOpt(Opt), chain);}
93  virtual void SetOption(const TString* Opt, const Char_t *chain="Chain") {SetOption(kOpt(Opt),chain);}
94  virtual void SetOptions(const Char_t* Opt, const Char_t *chain="Chain");
95  virtual void SetOptionOff(const Char_t* Opt, const Char_t *chain="Chain") {SetOption(-kOpt(Opt),chain);}
96  virtual void SetOptionOff(const TString* Opt, const Char_t *chain="Chain") {SetOption(-kOpt(Opt),chain);}
97  virtual Int_t Finish();
98  virtual Option_t* GetOption() const{return TObject::GetOption();}
99  virtual Bool_t GetOption(const Int_t k) const;
100  virtual Bool_t GetOption(const TString *Opt, Bool_t Check = kTRUE) const {return GetOption(kOpt(Opt,Check));}
101  virtual Bool_t GetOption(const Char_t *Opt, Bool_t Check = kTRUE) const {return GetOption(kOpt(Opt,Check));}
102  virtual Char_t *GetOptionString(const Char_t *);
103  virtual const TString &GetFileIn() const {return *(&fInFile);}
104  virtual const TString &GetFileOut() const {return *(&fFileOut);}
105  TString GetGeometry() const;
106  virtual Long_t ProcessLine(const char *line);
107  virtual const char *GetCVS() const {
108  static const char cvs[]="Tag $Name: $ $Id: StBFChain.h,v 1.59 2019/11/19 17:26:17 jeromel Exp $ built " __DATE__ " " __TIME__ ;
109  return cvs;
110  }
112  ClassDef(StBFChain, 3)
113 };
114 #endif
virtual Int_t Instantiate()
Maker-instantiation handler.
Definition: StBFChain.cxx:214
virtual Int_t Finish()
Really the destructor (close files, delete pointers etc ...)
Definition: StBFChain.cxx:1051
virtual Char_t * GetOptionString(const Char_t *)
Returns the comment string associated to an option.
Definition: StBFChain.cxx:1472
void Setup(Int_t mode=1)
Definition: StBFChain.cxx:59
void SetFlags(const Char_t *Chain="gstar tfs")
Scan all flags, check if they are correct, manipulate the comment if necessary.
Definition: StBFChain.cxx:1510
virtual void SetTreeOptions()
Creates output-tree branches.
Definition: StBFChain.cxx:1926
virtual void SetGeantOptions(StMaker *geant=0)
Handles all geant options.
Definition: StBFChain.cxx:1734
virtual void SetDbOptions(StMaker *db=0)
Treats the DbV options used for database timestamp.
Definition: StBFChain.cxx:1779
Definition: Bfc.h:8
virtual Int_t kOpt(const TString *Tag, Bool_t Check=kTRUE) const
Check option if defined.
Definition: StBFChain.cxx:1137
virtual Int_t Make()
Definition: StBFChain.h:72
virtual Int_t Make()
Definition: StChain.cxx:110
virtual void SetOption(const Int_t k, const Char_t *chain="Chain")
Enable/disable valid command line options.
Definition: StBFChain.cxx:1427
virtual void Sort()
Sort recursively all members of the TDataSet with TList::Sort method.
Definition: TDataSet.cxx:874
virtual Int_t Load()
Routine handling library loading depending on chain options.
Definition: StBFChain.cxx:117
virtual ~StBFChain()
Destructor. Call Finish() . See this method for detail on what is cleaned.
Definition: StBFChain.cxx:112
void SetOutputFile(const Char_t *outfile=0)
Takes care of output file name (extension)
Definition: StBFChain.cxx:1644
Definition: Bfc.h:28