StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StTrsChargeSegment.hh
1 /***************************************************************************
2  *
3  * $Id: StTrsChargeSegment.hh,v 1.12 2012/06/11 15:04:55 fisyak Exp $
4  *
5  * Author: brian May 18, 1998
6  *
7  ***************************************************************************
8  *
9  * Description: Wrapper for the g2t structures with added functionality
10  *
11  ***************************************************************************
12  *
13  * $Log: StTrsChargeSegment.hh,v $
14  * Revision 1.12 2012/06/11 15:04:55 fisyak
15  * std namespace
16  *
17  * Revision 1.11 2011/01/18 14:40:15 fisyak
18  * Clean up TpcDb interfaces and Tpc coordinate transformation
19  *
20  * Revision 1.10 2003/12/24 13:44:51 fisyak
21  * Add (GEANT) track Id information in Trs; propagate it via St_tpcdaq_Maker; account interface change in StTrsZeroSuppressedReaded in StMixerMaker
22  *
23  * Revision 1.9 2003/09/02 17:59:16 perev
24  * gcc 3.2 updates + WarnOff
25  *
26  * Revision 1.8 2000/01/10 23:11:31 lasiuk
27  * Include MACROS for compatibility with SUN CC5.0
28  *
29  * Revision 1.7 1999/07/20 02:17:51 lasiuk
30  * remove CVS merge conflicts
31  *
32  * Revision 1.6 1999/07/19 21:37:59 lasiuk
33  * - tssSplit() and associated parameterizations from
34  * tss are included (requires linking with cernlib)
35  * - introduce static random number generators
36  * - whichGEANTParticle() introduced for g2t input
37  *
38  * Revision 1.5 1999/02/18 21:18:43 lasiuk
39  * rotate() mods to StTpcCoordinateTranform
40  *
41  * Revision 1.4 1999/02/10 18:02:09 lasiuk
42  * ostream (const)
43  *
44  * Revision 1.3 1999/01/22 20:59:36 fisyak
45  * remove iostream from private list
46  *
47  * Revision 1.2 1999/01/15 11:02:26 lasiuk
48  * remove g2t pointer
49  * add pid member; add systemofunits; mv access fcts to .hh
50  * add ostream operator
51  *
52  * Revision 1.1 1998/11/10 17:12:09 fisyak
53  * Put Brian trs versin into StRoot
54  *
55  * Revision 1.5 1998/11/08 17:04:35 lasiuk
56  * use built in types,
57  * namespace macro
58  * vector allocators
59  *
60  * Revision 1.4 1998/10/22 00:23:19 lasiuk
61  * Oct 22
62  *
63  * Revision 1.3 1998/06/04 23:15:07 lasiuk
64  * remove transportToWire(); add gas and magfield db;
65  * **Still requires work on the saving of the g2t as a pointer**
66  *
67  * Revision 1.2 1998/05/21 21:27:39 lasiuk
68  * Initial revision
69  *
70  * Revision 1.1.1.1 1998/05/19 22:33:44 lasiuk
71  * Initial Revision
72  *
73  **************************************************************************/
74 #ifndef ST_TRS_CHARGE_SEGMENT_HH
75 #define ST_TRS_CHARGE_SEGMENT_HH
76 
77 #include <Stiostream.h>
78 #include <list>
79 
80 using std::list;
81 
82 #include "SystemOfUnits.h"
83 #include "StGlobals.hh"
84 #include "StThreeVector.hh"
85 #include "StMatrix.hh"
86 #include "Randomize.h"
87 
88 //#include "g2t_tpc_hit.hh"
89 #include "StTpcSlowControl.hh"
90 #include "StTpcGeometry.hh"
91 #include "StTpcElectronics.hh"
92 #include "StMagneticField.hh"
93 #include "StTrsDeDx.hh"
94 #include "StTrsMiniChargeSegment.hh"
95 
97 
98 public:
102  int id, // geant track id
103  double de, // energy deposited
104  double ds, // pathlength
105  int pid = -1, // pid #
106  double ne = -1); // numberOfElectrons
107 
109  //StTrsChargeSegment(const StTrsChargeSegment&);
110  //StTrsChargeSegment& operator=(cont StTrsChargeSegment&);
111 
112  //
113  // access functions
114  //
115  const StThreeVector<double>& position() const;
116  const StThreeVector<double>& momentum() const;
117  double dE() const;
118  double ds() const;
119  int id() const;
120  int pid() const;
121  double numberOfElectrons() const;
122 
123 #ifndef ST_NO_TEMPLATE_DEF_ARGS
124  void split(StTrsDeDx*, StMagneticField*, int, list<StTrsMiniChargeSegment>*);
125  void tssSplit(StTrsDeDx*, StMagneticField*, int, list<StTrsMiniChargeSegment>*);
126 #else
127  void split(StTrsDeDx*, StMagneticField*, int, list<StTrsMiniChargeSegment, allocator<StTrsMiniChargeSegment> >*);
128  void tssSplit(StTrsDeDx*, StMagneticField*, int, list<StTrsMiniChargeSegment, allocator<StTrsMiniChargeSegment> >*);
129 #endif
130 
131 public:
132  // TSS segment splitting functions
133  double sigmaParameter(double, double, double, int) const;
134  double meanParameter(double,double, double, int) const;
135  double xReflectedGauss(double, double) const;
136  double xReflectedLandau(double, double) const;
137  double binaryPartition(double, double, double) const;
138 
139 
140 
141 private:
142  void whichGEANTParticle(double&, int&);
143 
144 private:
145  StThreeVector<double> mPosition;
146  StThreeVector<double> mSector12Position;
147  StThreeVector<double> mMomentum;
148  int mId;
149  double mDE;
150  double mDs;
151  int mPid;
152 
153  double mNumberOfElectrons;
154  int mSectorOfOrigin;
155 
156  static HepJamesRandom mEngine;
157  static RandFlat mFlatDistribution;
158 };
159 inline const StThreeVector<double>& StTrsChargeSegment::position() const {return mPosition;}
160 inline const StThreeVector<double>& StTrsChargeSegment::momentum() const {return mMomentum;}
161 inline double StTrsChargeSegment::dE() const {return mDE;}
162 inline double StTrsChargeSegment::ds() const {return mDs;}
163 inline int StTrsChargeSegment::id() const {return mId;}
164 inline int StTrsChargeSegment::pid() const {return mPid;}
165 inline double StTrsChargeSegment::numberOfElectrons() const {return mNumberOfElectrons;}
166 
167 // Non-member Function
168 ostream& operator<<(ostream&, const StTrsChargeSegment&);
169 #endif