StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StFtpcSlowSimCluster.cc
1 // $Id: StFtpcSlowSimCluster.cc,v 1.11 2007/04/17 04:59:22 perev Exp $
2 // $Log: StFtpcSlowSimCluster.cc,v $
3 // Revision 1.11 2007/04/17 04:59:22 perev
4 // Remove garbage at the end of include
5 //
6 // Revision 1.10 2007/01/15 15:02:19 jcs
7 // replace printf, cout and gMesMgr with Logger
8 //
9 // Revision 1.9 2003/09/02 17:58:16 perev
10 // gcc 3.2 updates + WarnOff
11 //
12 // Revision 1.8 2003/07/03 13:28:59 fsimon
13 // Functionality for cathode offset simulation: Additional parameters for
14 // StFtpcSlowSimField::GetVelocityZ
15 //
16 // Revision 1.7 2003/02/14 16:56:56 fsimon
17 // Add functionality that allows for different temperature corrections
18 // in west and east, important for embedding. StFtpcSlowSimField now
19 // has to be called with the full padrow (0 to 19), to be able to
20 // select east/west.
21 //
22 // Revision 1.6 2002/06/07 09:55:39 fsimon
23 // Additional debug info to trace electron drift
24 //
25 // Revision 1.5 2002/04/19 22:24:12 perev
26 // fixes for ROOT/3.02.07
27 //
28 // Revision 1.4 2001/04/02 12:04:31 jcs
29 // get FTPC calibrations,geometry from MySQL database and code parameters from StarDb/ftpc
30 //
31 // Revision 1.3 2001/03/19 15:53:10 jcs
32 // use ftpcDimensions from database
33 //
34 // Revision 1.2 2001/03/06 23:35:55 jcs
35 // use database instead of params
36 //
37 // Revision 1.1 2000/11/23 10:16:43 hummler
38 // New FTPC slow simulator in pure maker form
39 //
40 //
42 // Author: W.G.Gong
43 // Email: gong@mppmu.mpg.de
44 // Date: Oct 25, 1996
46 
47 #include <Stiostream.h>
48 #include "StFtpcSlowSimCluster.hh"
49 #include "StFtpcSlowSimField.hh"
50 #include "StFtpcClusterMaker/StFtpcParamReader.hh"
51 #include "StFtpcClusterMaker/StFtpcDbReader.hh"
52 #include "StMessMgr.h"
53 #include "StMessMgr.h"
54 
55 StFtpcSlowSimCluster::StFtpcSlowSimCluster(StFtpcParamReader *paramReader,
56  StFtpcDbReader *dbReader,
57  StFtpcSlowSimField *field,
58  const float el, const float rad_offset,
59  const float pad_offset, const float r,
60  const float ph, const float time,
61  const int call_padrow)
62 {
63  outerRadius=dbReader->sensitiveVolumeOuterRadius();
64  mIntDiffCoarseness=paramReader->diffusionCoarseness();
65  mFlDiffCoarseness=(float) mIntDiffCoarseness;
66  electron = el;
67  radialDipWidth = rad_offset;
68  azimuthalCrossWidth = pad_offset;
69  sigma_rad_squared = 0;
70  sigma_phi_squared = 0;
71  currentRadius = r;
72  currentPhi = ph;
73  drift_time = time;
74 
75  original_padrow = call_padrow; //needed for debug info
76 
77  padrow=call_padrow;
78  /* // Now, the full padrow is needed to correct for different temperatures! Done in StFtpcSlowSimField
79  if(padrow>=10)
80  padrow -= 10;
81  // only absolute padrow in one chamber is needed for the field
82  */
83  deltaRadius = field->GetDeltaRadius();
84  twoDeltaRadius = field->GetTwoDeltaRadius();
85  electronLoss = -deltaRadius * dbReader->gasAttenuation();
86 
87 }
88 
89 StFtpcSlowSimCluster::~StFtpcSlowSimCluster() {}
90 
91 void StFtpcSlowSimCluster::DriftDiffuse(StFtpcSlowSimField *field)
92 {
93 
94 
95  //LOG_INFO << "DriftDiffuse: Padrow: "<<original_padrow<<" Drift r = "<<currentRadius<<" ; phi = "<<currentPhi << endm;
96  int i=0;
97  while(currentRadius < outerRadius )
98  {
99  float inverseRadius = 1/currentRadius;
100  float deltaRadiusRelative = deltaRadius * inverseRadius;
101 
102  int index = field->GetGridIndex(currentRadius);
103 
104  // deflection angle
105  float lorentz, inverseVelocity;
106  field->GetVelocityZ(inverseRadius, padrow, currentPhi, &inverseVelocity, &lorentz);
107  currentPhi += deltaRadiusRelative * lorentz;
108 
109  // accumulative drift time
110  drift_time += deltaRadius * inverseVelocity;
111 
112  // calculate diffusion in coarser steps than the cluster center
113  if(i==mIntDiffCoarseness)
114  {
115  // longitudinal diffusion + velocity gradience
116  sigma_rad_squared = field->GetDiffusionZSqr(index)
117  *deltaRadius*mFlDiffCoarseness+
118  sigma_rad_squared*(1.+field->GetDlnvDr(index)
119  *twoDeltaRadius*mFlDiffCoarseness);
120 
121  // transverse diffusion + radius divergence
122  float divergenceFactor= 1.+deltaRadiusRelative*mFlDiffCoarseness;
123  sigma_phi_squared =field->GetDiffusionXSqr(index)
124  *mFlDiffCoarseness*deltaRadius +
125  sigma_phi_squared*divergenceFactor*divergenceFactor;
126 
127  // attenuation
128  electron += mFlDiffCoarseness*electronLoss;
129  i=1;
130  }
131  else
132  i++;
133  // next step
134  currentRadius += deltaRadius;
135  }
136  //LOG_INFO <<" ====> r = "<<currentRadius<<" ; phi = "<<currentPhi<<endm;
137 
138 }
139 
140 void StFtpcSlowSimCluster::Print() const
141 {
142  LOG_INFO << " Cluster parameter : " << endm;
143  LOG_INFO << "number of electrons = " << electron << endm;
144  LOG_INFO << "sigma_rad [um] = " << ::sqrt(sigma_rad_squared) << endm;
145  LOG_INFO << "sigma_phi [um] = " << ::sqrt(sigma_phi_squared) << endm;
146  LOG_INFO << "currentPhi [deg] = " << currentPhi << endm;
147  LOG_INFO << "currentRadius [cm] = " << currentRadius << endm;
148  LOG_INFO << "Td [usec] = " << drift_time << endm;
149 }