StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StVertexSeedMaker.h
1 
76 #ifndef STAR_StVertexSeedMaker
77 #define STAR_StVertexSeedMaker
78 
79 #ifndef StMaker_H
80 #include "StMaker.h"
81 #endif
82 #include "TString.h"
83 class TNtuple;
84 class TNtupleD;
85 class St_vertexSeed;
86 class St_vertexSeedTriggers;
87 
88 
89 class StVertexSeedMaker : public StMaker {
90  public:
91  StVertexSeedMaker(const char *name="VtxSeedMkr",
92  const char* defaultDir="./StarDb/Calibrations/rhic/");
93  virtual ~StVertexSeedMaker();
94  virtual Int_t Init();
95  virtual Int_t Make();
96  virtual void PrintInfo();
97  virtual void Clear(Option_t *option);
98  virtual Int_t Finish();
99  virtual int Aggregate(char* dir=0, const char* cuts="", const int offset=0);
100 
101  virtual void FitData();
102  virtual void FindResult(bool checkDb=kTRUE);
103  virtual int GetValidityDate();
104  virtual int GetValidityTime();
105  virtual void UseEventDateTime();
106  virtual void UseFillDateTime();
107  virtual void UseAllTriggers();
108  virtual St_vertexSeed* VertexSeedTable();
109  virtual void WriteTableToFile(); // Write vertex seed table
110  virtual void SetOffset(int offset=0) {foffset = offset;} // time offset in writing table name
111  virtual void SetNoClobber(bool noclob=kTRUE) {noclobber = noclob;} // clobber existing files?
112  virtual void SetMinEntries(int entries); //minimum number of valid events for seed
113  virtual void SetMaxX0Err(float err); //maximum allowed error for x0
114  virtual void SetMaxY0Err(float err); //maximum allowed error for y0
115  virtual void WriteHistFile(bool writeFit); // Write out vertexseedhist.root file w/results
116  virtual void HistFileByDefault(); // Write out file on Finish
117  virtual void SetVertexZmax(float zmax); //Set max z vertex for seed calculation
118  virtual void SetVertexZmin(float zmin); //Set min z vertex for seed calculation
119  virtual void SetVertexR2max(float r2max); //Set max r^2 vertex for seed calculation
120  virtual void SetDefDir(const char* dir) {defDir = dir;}
121  virtual const char *GetCVS() const {
122  static const char cvs[]="Tag $Name: $ $Id: StVertexSeedMaker.h,v 1.25 2016/08/02 21:17:17 genevb Exp $ built " __DATE__ " " __TIME__ ;
123  return cvs;
124  }
125 
126  protected:
127  virtual void Reset();
128  virtual int FillAssumed();
129  virtual int GetVertexSeedTriggers();
130  virtual void GetADateTime();
131  virtual void GetFillDateTime();
132  virtual bool BetterErrors();
133  virtual bool ChangedValues();
134  virtual bool CheckTriggers() { return kTRUE; }
135  virtual bool ValidTrigger(unsigned int);
136  virtual int GetEventData() { return kStErr; }
137  virtual void AddResults(TNtupleD* ntup);
138  virtual TString NameFile(const char* type, const char* prefix, const char* suffix);
139  virtual TNtupleD* newBLpars();
140  virtual void Packer(int firstbit, int nbits, int& var, unsigned short val);
141 
142  TH1F* xdist;
143  TH1F* ydist;
144  TH1F* xerr;
145  TH1F* yerr;
146  TNtuple* resNtuple;
147  TNtupleD* parsNtuple;
148  float xguess;
149  float yguess;
150  float zvertex;
151  float yvertex;
152  float xvertex;
153  float eyvertex;
154  float exvertex;
155  float vpd_zvertex;
156  float mult;
157  float trig;
158  float HIST_MIN;
159  float HIST_MAX;
160  float zVertexMax; //maximum allowed z vertex for mean calculation
161  float zVertexMin; //minimum allowed z vertex for mean calculation
162  float r2VertexMax; //minimum allowed radius^2 vertex for mean calculation
163  int fill;
164  int date;
165  int time;
166  int foffset;
167  bool noclobber;
168  int run; // excludes first 2 digits (Run year) for 24 bit precision limit
169  float zdc; // ZDC coincidence rate
170  float sumzdc; // running sum of zdc
171  int timeEvent; // unix time of event
172  int timeFill; // unix time of fill
173  // The following integer maps can only be stored to 24 bits
174  // because of the conversion to float
175  int itpc; // inner tpc track map
176  int otpc; // inner tpc track map
177  int detmap; // map any other detectors
178  int bmatch; // matches with BEMC
179  int ematch; // matches with EEMC
180  int tmatch; // matches with BTOF
181  int cmatch; // matches across TPC Central Membrane
182  int hmatch; // matches with HFT
183  int pmatch; // matches with TPC prompt hits
184  int pct; // post-crossing tracks
185  float rank;
186  unsigned int pvn; // primery vertex index number
187  int minEntries;
188  float maxX0Err;
189  float maxY0Err;
190  bool mHistOut;
191  TFile* mTempOut;
192  bool useEventDateTime;
193  bool useAllTriggers;
194  double p[4]; // calculated params
195  double ep[4]; // calculated errs
196  double a[4]; // database params
197  double ea[4]; // database errs
198  double chi;
199  TString defDir;
200  St_vertexSeedTriggers* dbTriggersTable;
201 
202  ClassDef(StVertexSeedMaker,0)
203 };
204 
205 
206 inline void StVertexSeedMaker::UseEventDateTime() {useEventDateTime = kTRUE;}
207 inline void StVertexSeedMaker::UseFillDateTime() {useEventDateTime = kFALSE;}
208 inline void StVertexSeedMaker::UseAllTriggers() {useAllTriggers = kTRUE;}
209 inline void StVertexSeedMaker::SetMinEntries(int entries){minEntries = entries; }
210 inline void StVertexSeedMaker::SetMaxX0Err(float err){maxX0Err = err;}
211 inline void StVertexSeedMaker::SetMaxY0Err(float err){maxY0Err = err;}
212 inline int StVertexSeedMaker::GetValidityDate(){return date;}
213 inline int StVertexSeedMaker::GetValidityTime(){return time;}
214 inline void StVertexSeedMaker::HistFileByDefault(){mHistOut = kTRUE;}
215 inline void StVertexSeedMaker::SetVertexZmax(float zmax){zVertexMax = zmax;}
216 inline void StVertexSeedMaker::SetVertexZmin(float zmin){zVertexMin = zmin;}
217 inline void StVertexSeedMaker::SetVertexR2max(float r2max){r2VertexMax = r2max;}
218 
219 #endif
220 
221 // $Id: StVertexSeedMaker.h,v 1.25 2016/08/02 21:17:17 genevb Exp $
222 // $Log: StVertexSeedMaker.h,v $
223 // Revision 1.25 2016/08/02 21:17:17 genevb
224 // Added tDay,tFill to resNtuple, and improved C++11 compliance
225 //
226 // Revision 1.24 2015/05/18 21:25:47 genevb
227 // Use HFT hits
228 //
229 // Revision 1.23 2015/05/15 05:38:21 genevb
230 // Include prompt hits and post-crossing tracks, simplify detmap packing, update doxygen documentation
231 //
232 // Revision 1.22 2015/05/14 20:29:25 genevb
233 // Add z of VPD vertex
234 //
235 // Revision 1.21 2014/08/06 11:43:32 jeromel
236 // Suffix on literals need to be space (later gcc compiler makes it an error) - first wave of fixes
237 //
238 // Revision 1.20 2013/08/14 21:42:48 genevb
239 // Introduce time offsets, noclobber toggle, more matched-tracks controls
240 //
241 // Revision 1.19 2012/08/22 04:52:35 genevb
242 // Add BeamLine parameter ntuples to output
243 //
244 // Revision 1.18 2012/08/17 22:57:33 genevb
245 // Add index of vertex within event to ntuple
246 //
247 // Revision 1.17 2012/08/15 22:16:53 genevb
248 // Re-worded documentation
249 //
250 // Revision 1.16 2012/08/15 22:11:06 genevb
251 // Improved doxygen-ready documentation
252 //
253 // Revision 1.15 2012/08/14 23:56:06 genevb
254 // detmap now includes BEMC+EEMC+BTOF+CM, added mean zdc to log output
255 //
256 // Revision 1.14 2010/07/02 22:36:10 genevb
257 // Option for using all triggers
258 //
259 // Revision 1.13 2009/11/23 21:38:56 genevb
260 // Fix problems with memory-resident TNtuple by using a temporary disk file
261 //
262 // Revision 1.12 2009/11/16 22:31:11 genevb
263 // phase out usage of old tables
264 //
265 // Revision 1.11 2009/05/22 23:50:50 genevb
266 // Code mods for BEMC matches, BeamWidth
267 //
268 // Revision 1.10 2008/05/21 17:48:39 genevb
269 // Use vertex errors for weighting
270 //
271 // Revision 1.9 2008/04/29 23:30:34 genevb
272 // Added cuts capability to Aggregate
273 //
274 // Revision 1.8 2007/11/27 23:42:48 genevb
275 // Move valid triggers from code to DB
276 //
277 // Revision 1.7 2006/09/01 22:27:16 genevb
278 // More detailed info in ntuple
279 //
280 // Revision 1.6 2005/07/01 21:46:01 genevb
281 // Specify output directory
282 //
283 // Revision 1.5 2005/06/14 18:51:31 genevb
284 // Updates to allow for pp2005 triggers, and inheritance
285 //
286 // Revision 1.4 2002/03/20 00:40:43 genevb
287 // Addition of Aggregate feature, minor updates
288 //
289 //
290 //
virtual void Clear(Option_t *option)
User defined functions.
virtual Int_t Make()
BeamLine Constraint calibration base class.
Definition: Stypes.h:44
virtual Int_t Finish()