60 #include "SystemOfUnits.h"
61 #ifndef ST_NO_NAMESPACES
62 using namespace units;
64 #include "PhysicalConstants.h"
66 #include "StTrsChargeTransporter.hh"
69 RandFlat StTrsChargeTransporter::mFlatDistribution(mEngine);
70 RandGauss StTrsChargeTransporter::mGaussDistribution(mEngine);
73 :mChargeAttachment(false), mGatingGridTransparency(false), mTransverseDiffusion(false), mLongitudinalDiffusion(false), mExB(false)
80 mDriftVelocity = scdb->driftVelocity(13);
81 mAttachment = gasdb->attachmentCoefficient();
85 mDriftVelocity*(mMagDb->at(
StThreeVector<double>(0,0,0)).z())/(fabs(scdb->driftVoltage())/(mGeomDb->frischGrid()));
87 mSigmaTransverse = gasdb->transverseDiffusionCoefficient();
88 mSigmaLongitudinal = gasdb->longitudinalDiffusionCoefficient();
89 mO2Concentration = 50.;
90 mGateVoltage = -130*volt;
93 mDoTransparencyCalc =
true;
96 StTrsChargeTransporter::~StTrsChargeTransporter() {}
101 void StTrsChargeTransporter::Lg()
103 mLg = mZGate - mGatePitch/(2*pi)*::log(2*pi*mGateWireRadius/mGatePitch)-sqr(mZGate)/mDriftDistance;
106 double StTrsChargeTransporter::transitionVoltage()
109 value = mDriftVoltage/mDriftDistance*(mZGate - 4*pi*mGateWireRadius*mLg/mGatePitch);
113 double StTrsChargeTransporter::maximumTransparency()
116 value = mDriftVoltage/mDriftDistance*(4*pi*mGateWireRadius*mLg/mGatePitch + mZGate);
120 void StTrsChargeTransporter::sigmaGC()
122 mSGC = ::fabs(4*pi*mGateWireRadius*epsilon0*mDriftVoltage/mDriftDistance/mGatePitch);
126 void StTrsChargeTransporter::sigmaG()
128 mSG = epsilon0*(mGateVoltage - mZGate*mDriftVoltage/mDriftDistance)/mLg;
132 double StTrsChargeTransporter::sigmaGPlus()
136 double term1, term2, value;
138 term1 = ( 1./pi*(mSGC*::sqrt(1-sqr(mSG/mSGC))) );
139 term2 = ( 1./pi*mSG*acos(-mSG/mSGC) ) ;
140 value = term1 + term2;
147 double StTrsChargeTransporter::zeroGateVoltage()
150 value = 1.-mZGate/mLg;
154 double StTrsChargeTransporter::linearOnset()
157 value = 1 - 4*pi*mGateWireRadius/mGatePitch;
161 double StTrsChargeTransporter::linearTransparency()
165 double T1 = zeroGateVoltage();
166 double T2 = linearOnset();
167 double V2 = transitionVoltage();
169 double slope = (T2-T1)/V2;
170 double eqn = slope*(mGateVoltage) + T1;
174 double StTrsChargeTransporter::transparencyCalculation()
177 mDriftVoltage = mSCDb->driftVoltage();
180 mDriftDistance = mGeomDb->driftDistance();
183 mGateWireRadius = mGeomDb->gateWireRadius();
186 mGatePitch = mGeomDb->gatePitch();
190 mZGate = mGeomDb->outerSectorGatingGridPadPlaneSeparation() -
191 mGeomDb->outerSectorFrischGridPadPlaneSeparation();
197 double trans=-999999.;
198 if(mGateVoltage <= maximumTransparency()) {
201 else if(mGateVoltage > maximumTransparency() && mGateVoltage < transitionVoltage()) {
202 double sigmaP = ::fabs(epsilon0*mDriftVoltage/mDriftDistance);
203 trans = (1-(sigmaGPlus()/sigmaP));
205 else if(mGateVoltage >=transitionVoltage()) {
206 trans = linearTransparency();
209 return (trans>0) ? trans : 0;