StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
eventTrackerLib.hh
1 #ifndef TRG_VERSION
2 #define TRG_VERSION 0x32
3 #endif
4 
5 #include <daqFormats.h>
6 #include "gl3Event.h"
7 #include "l3Coordinates.h"
8 #include "l3EmcCalibration.h"
9 #include "gl3LMVertexFinder.h"
10 #include "FtfSl3.h"
11 #include "sizes.h"
12 #include "DAQ_L3/daq_l3.h"
13 
14 // bField is a pain in the neck.
15 //
16 // Starting FY2005, we have bField in data file, but
17 // it is not 100% reliable, as we depend on RHIC feed & STAR db
18 // which have failed in past.
19 //
20 // The I use are:
21 //
22 // If you use the EventTracker(float bField), constructor,
23 // you override all intellegence. The specified bField is used
24 //
25 // If you use the EventTracker() constructor, the bField from the
26 // file is used. If the bField is not available from the file, I
27 // use "defaultBField" which starts out .5, but can be set
28 // using the setDefaultBField() function.
29 
30 class EventTracker {
31 public:
32 
33 
34  EventTracker()
35  {
36  bField = 1000;
37  constructor_helper();
38  }
39 
40  EventTracker(float magField)
41  {
42  bField = magField;
43  constructor_helper();
44  };
45 
46  void constructor_helper()
47  {
48  defaultBField = .5;
49  transformer = new l3CoordinateTransformer();
50  // bemcCalib = new l3EmcCalibration(4800);
51  // eemcCalib = new l3EmcCalibration(720);
52  lmv = new gl3LMVertexFinder();
53  // gl3 = new gl3Event(transformer,
54  // bemcCalib,
55  // eemcCalib,
56  // 500000,
57  // 20000);
58 
59  lmv->setParameters(10, 3, 250.0, 10.0, 3.0, 3.0);
60 
61 
62 
63  gl3 = new gl3Event(transformer,
64  NULL,
65  NULL);
66 
67  gl3->setLMVertexFinder(lmv);
68  gl3->setVertexFinderMethod(3);
69 
70  // tracker = new FtfSl3(transformer);
71  }
72 
73  void setDefaultBField(float def)
74  {
75  defaultBField = def;
76  }
77 
78  ~EventTracker()
79  {
80  // delete tracker;
81  delete gl3;
82  delete lmv;
83  // delete eemcCalib;
84  // delete bemcCalib;
85  delete transformer;
86  }
87 
88 
89  // Does tracking and fills gtd given datap.
90  //
91  // suggested max_size = 0x800000
92  //
93 
94 #ifdef OLD_DAQ_READER
95  int trackEvent(evpReader *evp, char *mem, L3_P *l3p, int max_size);
96  int trackTPC(evpReader *evp, char *mem, L3_GTD *gtd, int max_size);
97 #else /* OLD_DAQ_READER */
98  int trackEvent(daqReader *daq, char *mem, L3_P *l3p, int max_size);
99  int trackTPC(daqReader *daq, char *mem, L3_GTD *gtd, int max_size);
100 #endif /* OLD_DAQ_READER */
101 
102 #ifdef OBSOLETE
103  int trackEvent(DATAP *datap, L3_P *l3p, int max_size);
104  int trackTPC(DATAP *datap, L3_GTD *gtd, int max_size);
105 #endif
106 
107  void dumpGTD(L3_GTD *gtd);
108  gl3Event *getL3Event() const { return gl3;}
109 
110  int copyl3_t(l3_t &l3, L3_P *l3p);
111 
112 private:
113 
114  //int init(); // load the config files...automatic on first trackEvent() call
115  int gl3Event_to_GTD(L3_GTD *gtd, u_int max_size);
116 
117  //int initialized;
118 
119  l3CoordinateTransformer *transformer;
120 
121  float bField;
122 
123  float defaultBField;
124  int bFieldOverride;
125 
126  // l3EmcCalibration *bemcCalib;
127  // l3EmcCalibration *eemcCalib;
128  gl3LMVertexFinder *lmv;
129  gl3Event *gl3;
130  //FtfSl3 *tracker;
131 };
Definition: daq_l3.h:10