StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StTrsMaker.h
1 // $Id: StTrsMaker.h,v 1.24 2008/06/20 15:00:57 fisyak Exp $
2 //
3 // $Log: StTrsMaker.h,v $
4 // Revision 1.24 2008/06/20 15:00:57 fisyak
5 // move from StTrsData to StTpcRawData
6 //
7 // Revision 1.23 2005/09/09 22:12:48 perev
8 // Bug fix + IdTruth added
9 //
10 // Revision 1.21 2005/07/19 22:21:06 perev
11 // Bug fix
12 //
13 // Revision 1.20 2003/12/24 13:44:47 fisyak
14 // Add (GEANT) track Id information in Trs; propagate it via St_tpcdaq_Maker; account interface change in StTrsZeroSuppressedReaded in StMixerMaker
15 //
16 // Revision 1.19 2003/09/10 19:47:41 perev
17 // ansi corrs
18 //
19 // Revision 1.18 2003/05/02 23:54:19 hardtke
20 // Allow user to adjust normalFactor (i.e. Fudge Factor)
21 //
22 // Revision 1.17 2002/02/05 22:21:28 hardtke
23 // Move Init code to InitRun
24 //
25 // Revision 1.16 2000/08/04 21:03:58 perev
26 // Leaks + Clear() cleanup
27 //
28 // Revision 1.15 2000/01/10 23:11:07 lasiuk
29 // Include MACROS for compatibility with SUN CC5.0
30 //
31 // Revision 1.14 1999/11/11 19:42:25 calderon
32 // Add #ifdef HISTOGRAM for Ntuple Diagnostics.
33 // Use ROOT_DATABASE_PARAMETERS. As soon as Jeff and Dave give Ok,
34 // we will switch to TPC_DATABASE_PARAMETERS.
35 //
36 // Revision 1.13 1999/11/05 22:10:13 calderon
37 // Added Clear() method in StTrsMaker.
38 // Removed StTrsUnpacker from maker.
39 // Added StTrsZeroSuppressedReader and StTrsZeroSuppressedReader
40 // for DAQ type interface to event data.
41 // Made private copy constructor and operator= in classes that needed it.
42 // Renamed the DigitalSignalGenerators: Fast -> Old, Parameterized -> Fast,
43 // and the default to use is the new "Fast" which has the 10-8 bit conversion.
44 // Removed vestigial loop in AnalogSignalGenerator.
45 // Added Time diagnostics.
46 // Added trsinterface.pdf in doc/ directory.
47 // Write version of data format in .trs data file.
48 //
49 // Revision 1.12 1999/10/11 23:54:32 calderon
50 // Version with Database Access and persistent file.
51 // Not fully tested due to problems with cons, it
52 // doesn't find the local files at compile time.
53 // Yuri suggests forcing commit to work directly with
54 // files in repository.
55 //
56 // Revision 1.11 1999/10/04 17:33:43 long
57 // add mUseParameterizedSignalGenerator
58 //
59 // Revision 1.10 1999/07/20 02:16:59 lasiuk
60 // bring in line with new options (TSS algorithms)
61 //
62 // Revision 1.9 1999/07/15 13:57:31 perev
63 // cleanup
64 //
65 // Revision 1.8 1999/03/20 20:07:57 fisyak
66 // Add access to DataSet with parameters
67 //
68 // Revision 1.7 1999/03/20 03:23:58 lasiuk
69 // setMiniSegmentLength()
70 // setFirstSectorToProcess()
71 // setLastSectorToProcess()
72 //
73 // Revision 1.6 1999/03/16 02:01:45 lasiuk
74 // add Finish() which frees the memory allocated in Init()
75 //
76 // Revision 1.5 1999/03/15 02:52:26 perev
77 // new Maker schema
78 //
79 // Revision 1.4 1999/02/19 16:28:24 fisyak
80 // Change given name of Maker
81 //
82 // Revision 1.3 1999/02/10 04:30:02 lasiuk
83 // add unpacker and rawevent as data members/ passed by dataset
84 //
85 // Revision 1.2 1999/02/04 18:39:25 lasiuk
86 // Add private member whichSector() to decode volumeId;
87 // add multiple sector capabilities
88 // add unpacker
89 // runs in LINUX
90 //
91 // Revision 1.1 1999/01/22 21:31:46 lasiuk
92 // Name change
93 //
94 // Revision 1.2 1999/01/22 11:43:09 lasiuk
95 // add output structures
96 //
97 //
98 #ifndef STAR_St_Trs_Maker
99 #define STAR_St_Trs_Maker
100 
102 // //
103 // StTrsMaker virtual base class for Maker //
104 // //
106 #ifndef StMaker_H
107 #include "StMaker.h"
108 #endif
109 
110 #ifndef HEP_SYSTEM_OF_UNITS_H
111 #include "SystemOfUnits.h"
112 #endif
113 #ifndef ST_NO_NAMESPACES
114 using namespace units;
115 #endif
116 
117 
118 // Dbs
119 class StTpcGeometry;
120 class StTpcSlowControl;
121 class StMagneticField;
122 class StTpcElectronics;
123 class StTrsDeDx;
124 
125 // Processes
129 
130 // Containers
131 class StTrsWireHistogram;
132 class StTrsSector;
133 #include "StTrsDigitalSector.hh"
134 
135 // Output Data
136 #include "StTrsRawDataEvent.hh"
137 
138 class TFile;
139 class TNtuple;
140 class g2t_tpc_hit_st;
141 
142 class StTrsMaker : public StMaker {
143  private:
144  StTrsMaker(const StTrsMaker&);
145  StTrsMaker& operator=(const StTrsMaker&);
146 // static Char_t m_VersionCVS = "$Id: StTrsMaker.h,v 1.24 2008/06/20 15:00:57 fisyak Exp $";
147 // Int_t m_mode; // mode 1 = primaries;
148 // St_stk_stkpar *m_stk_stkpar; //! pointer to stk parameters
149 
150 
151  // DataBases
152  char mBeg[1];
153  StTpcGeometry *mGeometryDb;
154  StTpcSlowControl *mSlowControlDb;
155  StMagneticField *mMagneticFieldDb;
156  StTpcElectronics *mElectronicsDb;
157  StTrsDeDx *mGasDb;
158 
159  // Processes
160  StTrsChargeTransporter *mChargeTransporter;
161  StTrsAnalogSignalGenerator *mAnalogSignalGenerator;
162  StTrsDigitalSignalGenerator *mDigitalSignalGenerator;
163 
164  // Container
165  StTrsWireHistogram *mWireHistogram;
166  StTrsSector *mSector;
167  StTrsDigitalSector *mDigitalSector;
168 
169  // Output
170  StTrsRawDataEvent *mAllTheData;
171 
172  // Calculation and Initialization Done Internally in the Maker
173  double mMiniSegmentLength;
174  int mFirstSectorToProcess;
175  int mLastSectorToProcess;
176  // should be a boolean
177  int mProcessPseudoPadRows;
178  int mWriteToFile;
179  int mReadFromFile;
180 
181  // Which Algorithm to be used:
182  int mUseParameterizedSignalGenerator;
183 
184  // Gain normalization Factor
185  double mNormalFactor;
186 
187 protected:
188 
189 public:
190  TFile* mTrsNtupleFile;
191  TNtuple* mWireNtuple;
192  TNtuple* mContinuousAnalogNtuple;
193  TNtuple* mDiscreteAnalogNtuple;
194  TNtuple* mDigitalNtuple;
195  char mEnd[1];
196 
197 public:
198  StTrsMaker(const char *name="Trs");
199  ~StTrsMaker();
200  Int_t Init();
201  Int_t InitRun(int runnumber);
202  Int_t Make();
203  Int_t Finish();
204  void Clear(const char *opt="");
205 
206  void setMiniSegmentLength(double len=4.) {mMiniSegmentLength = len*millimeter;} // *MENU*
207  void setFirstSectorToProcess(int first=1){mFirstSectorToProcess = first;} // *MENU*
208  void setLastSectorToProcess(int last=24) {mLastSectorToProcess = last;} // *MENU*
209 
210  int readFile(char*);
211  int writeFile(char*, int);
212  void setNormalFactor(double FudgeFactor=1.0);
213 
214  virtual const char *GetCVS() const
215  {
216  static const char cvs[]= "Tag $Name: $ $Id: StTrsMaker.h,v 1.24 2008/06/20 15:00:57 fisyak Exp $ built __DATE__ __TIME__" ; return cvs;}
217 
218  ClassDef(StTrsMaker,0) //StAF chain virtual base class for Makers
219 
220 private:
221  void whichSector(int, int*, int*, int*);
222  void CheckTruth(int no_tpc_hits, g2t_tpc_hit_st *tpc_hit);
223 
224 };
225 
226 #endif