00001
00002
00004 #ifndef __MakeTriggers__
00005 #define __MakeTriggers__
00006
00007 #include "Streams.h"
00008 #include "Triggers.h"
00009
00010 using namespace std;
00011
00019 class MakeTriggers: public Triggers, public Segments , public Streams {
00020
00021 public:
00022
00046 MakeTriggers(const string aOutDir,
00047 const string aStreamName,
00048 const string aFileFormat="root",
00049 const int aVerbose=0);
00050
00054 virtual ~MakeTriggers(void);
00066 void Reset(void);
00077 inline void SetMprocessname(const string aMprocessname){ Mprocessname=aMprocessname; };
00078
00086 bool InitUserMetaData(vector<string> aMusername, vector<string> aMusertype);
00087
00094 bool SetUserMetaData(const string aMusername, const double aMuservalue);
00095
00102 bool SetUserMetaData(const string aMusername, const int aMuservalue);
00103
00110 bool SetUserMetaData(const string aMusername, const string aMuservalue);
00111
00128 string Write(const string aFileName="default", const string aSubDir="", const string aWriteMode="RECREATE", const bool aWriteMeta=true);
00129
00135 inline bool SetOutputDirectory(const string aOutDir){
00136 if(!IsDirectory(aOutDir)){
00137 cerr<<"MakeTriggers::SetOutputDirectory: output directory "<<aOutDir<<" does not exist"<<endl;
00138 return false;
00139 }
00140 OutDir=aOutDir;
00141 return true;
00142 };
00143
00148 inline void SetProcessVersion(const string aVersion){ Mprocessversion=aVersion; };
00149
00150 protected:
00151
00152
00153 string OutDir;
00154 vector <string> FileFormat;
00155
00156
00157 TTree *Mtree;
00158 double Mstart,
00159 Mend;
00160 string Mprocessname,
00161 Mstreamname,
00162 Mprocessversion,
00163 Mprocessuser;
00164 double Mfmin,
00165 Mfmax,
00166 Mqmin,
00167 Mqmax,
00168 Msnrmin,
00169 Msnrmax;
00170 vector <string> Musername;
00171 vector <string> Musertype;
00172 double *Mdvar;
00173 int *Mivar;
00174 string *Msvar;
00175
00176 private:
00177
00178 bool WriteTXT(const string txtfilename);
00179 bool WriteXML(const string xmlfilename);
00180
00181 ClassDef(MakeTriggers,0)
00182 };
00183
00184 #endif
00185
00186