CMS 3D CMS Logo

ChargeDrifterFP420 Class Reference

#include <SimRomanPot/SimFP420/interface/ChargeDrifterFP420.h>

Inheritance diagram for ChargeDrifterFP420:

CDrifterFP420

List of all members.

Public Member Functions

 ChargeDrifterFP420 (double, double, double, double, double, double, double, double, double)
CDrifterFP420::collection_type drift (const CDrifterFP420::ionization_type, const G4ThreeVector &, const int &)

Private Member Functions

AmplitudeSegmentFP420 drift (const EnergySegmentFP420 &, const G4ThreeVector &, const int &)

Private Attributes

double appV
double constDe
double constTe
double depV
double ldriftcurrX
double ldriftcurrY
double modulePath
double startT0
double temperature


Detailed Description

Definition at line 7 of file ChargeDrifterFP420.h.


Constructor & Destructor Documentation

ChargeDrifterFP420::ChargeDrifterFP420 ( double  mt,
double  tn,
double  dc,
double  tm,
double  cdr,
double  dv,
double  av,
double  ptx,
double  pty 
)

Definition at line 10 of file ChargeDrifterFP420.cc.

References appV, constDe, constTe, GenMuonPlsPt100GeV_cfg::cout, depV, lat::endl(), ldriftcurrX, ldriftcurrY, modulePath, startT0, and temperature.

00018                                                                                  {
00019   //
00020   //
00021   modulePath = mt;
00022   constTe = tn;
00023   constDe = dc;
00024   temperature = tm;// keep just in case
00025   startT0 = cdr;
00026   depV = dv;
00027   appV = av;
00028   
00029   ldriftcurrX = ptx;
00030   ldriftcurrY = pty;
00031   //
00032   //
00033   
00034   
00035   
00036   //      edm::LogInfo("ChargeDrifterFP420") << "call constructor";
00037 #ifdef mydigidebug5
00038   std::cout << "ChargeDrifterFP420: call constructor" << std::endl;
00039   std::cout << "ldriftcurrX= " << ldriftcurrX << "ldriftcurrY= " << ldriftcurrY << std::endl;
00040   std::cout << "modulePath= " << modulePath << "constTe= " << constTe << std::endl;
00041   std::cout << "ChargeDrifterFP420:----------------------" << std::endl;
00042 #endif
00043 }


Member Function Documentation

AmplitudeSegmentFP420 ChargeDrifterFP420::drift ( const EnergySegmentFP420 edu,
const G4ThreeVector &  drift,
const int zside 
) [private]

Definition at line 65 of file ChargeDrifterFP420.cc.

References appV, constDe, constTe, GenMuonPlsPt100GeV_cfg::cout, depV, lat::endl(), relval_parameters_module::energy, int, ldriftcurrX, ldriftcurrY, funct::log(), funct::sqrt(), startT0, x, y, and z.

00065                                                                              {
00066   //
00067   //
00068   //    sliX sliY sliZ are LOCALl(!) coordinates coming from ...hit.getEntryLocalP()...  
00069   //
00070   //
00071   //                Exchange zside 1 <-> 2
00072   double sliX = (edu).x();
00073   double sliY = (edu).y();
00074   double sliZ = (edu).z();
00075 
00076   double currX = sliX;
00077   double currY = sliY;
00078   double currZ = sliZ;
00079 
00080   double pathFraction=0., pathValue=0.;
00081   double tanShiftAngleX=0.,tanShiftAngleY=0.,tanShiftAngleZ=0.;
00082   double xDriftDueToField=0.,yDriftDueToField=0.,zDriftDueToField=0.;
00083 #ifdef mydigidebug5
00084   std::cout << "=================================================================== " << std::endl;
00085   std::cout << "ChargeDrifterFP420: zside= " << zside << std::endl;
00086   std::cout << "constTe= " <<  constTe << "ldriftcurrX= " <<  ldriftcurrX << "ldriftcurrY= " <<  ldriftcurrY << std::endl;
00087   std::cout << "1currX = " << currX  << "  1currY = " << currY  << "  1currZ = " << currZ  << std::endl;
00088   std::cout << "drift.x() = " << drift.x()  << "  drift.y() = " << drift.y()  << "  drift.z() = " << drift.z()  << std::endl;
00089 #endif
00090 
00091     // Yglobal Xlocal:
00092   //
00093   //
00094   // will define drift time of electrons along Xlocal or Ygobal with ldriftcurrY from Yglobal
00095   // change of ldriftcurrX to ldriftcurrY is done in intialization of ChargeDrifterFP420, so use old names for ldriftcurres
00096   if(zside == 2) {
00097     tanShiftAngleY = drift.y()/drift.x();
00098     tanShiftAngleZ = drift.z()/drift.x();
00099 
00100     //    pathValue = fabs(sliX-ldriftcurrX*int(sliX/ldriftcurrX));
00101     pathValue = fabs(sliX)-int(fabs(sliX/(2*ldriftcurrX))+0.5)*(2*ldriftcurrX);
00102     pathValue = fabs(pathValue);
00103     pathFraction = pathValue/ldriftcurrX; 
00104 #ifdef mydigidebug5
00105   std::cout << "==================================" << std::endl;
00106   std::cout << "fabs(sliX)= " << fabs(sliX) << "ldriftcurrX= " << ldriftcurrX << std::endl;
00107   std::cout << "fabs(sliX/(2*ldriftcurrX))+0.5= " << fabs(sliX/(2*ldriftcurrX))+0.5 << std::endl;
00108   std::cout << "int(fabs(sliX/(2*ldriftcurrX))+0.5)*(2*ldriftcurrX)= " << int(fabs(sliX/(2*ldriftcurrX))+0.5)*(2*ldriftcurrX) << std::endl;
00109   std::cout << "pathValue= " << pathValue << std::endl;
00110   std::cout << "pathFraction= " << pathFraction << std::endl;
00111   std::cout << "==================================" << std::endl;
00112 #endif
00113 
00114     pathFraction = pathFraction>0. ? pathFraction : 0. ;
00115     pathFraction = pathFraction<1. ? pathFraction : 1. ;
00116 
00117     yDriftDueToField // Drift along Y due to BField
00118       = pathValue*tanShiftAngleY;
00119     zDriftDueToField // Drift along Z due to BField
00120       = pathValue*tanShiftAngleZ;
00121   // will define Y and Z ccordinates (E along X)
00122     currY = sliY + yDriftDueToField;
00123     currZ = sliZ + zDriftDueToField;
00124   }
00125 
00126     // Xglobal Ylocal:
00127   // will define drift time of electrons along Ylocal
00128   else if(zside == 1) {
00129     tanShiftAngleX = drift.x()/drift.y();
00130     tanShiftAngleZ = drift.z()/drift.y();
00131 
00132     //pathValue = fabs(sliY-ldriftcurrY*int(sliY/ldriftcurrY));
00133     pathValue = fabs(sliY)-int(fabs(sliY/(2*ldriftcurrY))+0.5)*(2*ldriftcurrY);
00134     pathValue = fabs(pathValue);
00135     pathFraction = pathValue/ldriftcurrY; 
00136   //
00137   //
00138 #ifdef mydigidebug5
00139   std::cout << "==================================" << std::endl;
00140   std::cout << "fabs(sliY)= " << fabs(sliY) << "ldriftcurrY= " << ldriftcurrY << std::endl;
00141   std::cout << "fabs(sliY/(2*ldriftcurrY))+0.5= " << fabs(sliY/(2*ldriftcurrY))+0.5 << std::endl;
00142   std::cout << "int(fabs(sliY/(2*ldriftcurrY))+0.5)*(2*ldriftcurrY)= " << int(fabs(sliY/(2*ldriftcurrY))+0.5)*(2*ldriftcurrY) << std::endl;
00143   std::cout << "pathValue= " << pathValue << std::endl;
00144   std::cout << "pathFraction= " << pathFraction << std::endl;
00145   std::cout << "==================================" << std::endl;
00146 #endif
00147 
00148   if(pathFraction<0. || pathFraction>1.) std::cout << "ChargeDrifterFP420: ERROR:pathFraction=" << pathFraction << std::endl;
00149     pathFraction = pathFraction>0. ? pathFraction : 0. ;
00150     pathFraction = pathFraction<1. ? pathFraction : 1. ;
00151     xDriftDueToField // Drift along X due to BField
00152       = pathValue*tanShiftAngleX;
00153     //      = (ldriftcurrY-sliY)*tanShiftAngleX;
00154     zDriftDueToField // Drift along Z due to BField
00155       = pathValue*tanShiftAngleZ;
00156   // will define X and Z ccordinates (E along Y)
00157     currX = sliX + xDriftDueToField;
00158     currZ = sliZ + zDriftDueToField;
00159   }
00160   //  double tanShiftAngleX = drift.x()/drift.z();
00161   //  double tanShiftAngleY = drift.y()/drift.z();
00162   // double pathFraction = (modulePath/2.-sliZ)/modulePath ; 
00163   // pathFraction = pathFraction>0. ? pathFraction : 0. ;
00164   // pathFraction = pathFraction<1. ? pathFraction : 1. ;
00165   
00166   //uble xDriftDueToField // Drift along X due to BField
00167   //= (modulePath/2. - sliZ)*tanShiftAngleX;
00168   //uble yDriftDueToField // Drift along Y due to BField
00169   //= (modulePath/2. - sliZ)*tanShiftAngleY;
00170   //uble currX = sliX + xDriftDueToField;
00171   //uble currY = sliY + yDriftDueToField;
00172   //  
00173   //  
00174   // log is a ln 
00175   //  std::cout << "ChargeDrifterFP420: depV=" <<depV  << "  appV=" << appV << " startT0 =" <<startT0  << " 1.-2*depV*pathFraction/(depV+appV) =" <<1.-2*depV*pathFraction/(depV+appV)  << " log(1.-2*depV*pathFraction/(depV+appV)) =" <<log(1.-2*depV*pathFraction/(depV+appV))  << std::endl;
00176   double bbb = 1.-2*depV*pathFraction/(depV+appV);
00177   if(bbb<0.) std::cout << "ChargeDrifterFP420:ERROR: check your Voltage for log(bbb) bbb=" << bbb << std::endl;
00178   double driftTime = -constTe*log(bbb) + startT0;  
00179   //    log(1.-2*depV*pathFraction/(depV+appV)) + startT0;  
00180   // since no magnetic field the Sigma_x, Sigma_y are the same =  sigma  !!!!!!!!!!!!!!!!! 
00181     double sigma = sqrt(2.*constDe*driftTime*100.);  //  * 100.  - since constDe is [cm2/sec], but i want [mm2/sec]
00182 
00183   //  std::cout << "ChargeDrifterFP420: driftTime=  " << driftTime << "  pathFraction=  " << pathFraction << "  constTe=  " << constTe << "  sigma=  " << sigma << std::endl;
00184 #ifdef mydigidebug5
00185   std::cout << "ChargeDrifterFP420: drift: zside=" << zside << "pathFraction=" << pathFraction << std::endl;
00186   std::cout << "  constTe= " << constTe  << "  driftTime = " << driftTime << " startT0  = " << startT0 <<  std::endl;
00187   std::cout << " log = " << log(1.-2*depV*pathFraction/(depV+appV))  << std::endl;
00188   std::cout << " negativ inside log = " << -2*depV*pathFraction/(depV+appV)  << std::endl;
00189   std::cout << " constDe = " << constDe  << "  sigma = " << sigma << std::endl;
00190 #endif
00191 #ifdef mydigidebug5
00192   std::cout << "ChargeDrifterFP420: drift: zside=" << zside << "pathValue=" << pathValue << std::endl;
00193   std::cout << " tanShiftAngleX = " << tanShiftAngleX  << "  tanShiftAngleY = " << tanShiftAngleY  << "  tanShiftAngleZ = " << tanShiftAngleZ  << std::endl;
00194   std::cout << "sliX = " << sliX  << "  sliY = " << sliY  << "  sliZ = " << sliZ  << std::endl;
00195   std::cout << "pathFraction = " << pathFraction  << "  driftTime = " << driftTime  << std::endl;
00196   std::cout << "sigma = " << sigma  << std::endl;
00197   std::cout << "xDriftDueToField = " << xDriftDueToField  << "  yDriftDueToField = " << yDriftDueToField  << "  zDriftDueToField = " << zDriftDueToField  << std::endl;
00198   std::cout << "2currX = " << currX  << "  2currY = " << currY  << "  2currZ = " << currZ  << std::endl;
00199   std::cout << "ChargeDrifterFP420: drift; finally, rETURN AmplitudeSlimentFP420" << std::endl;
00200   std::cout << "===================================================================" << std::endl;
00201   std::cout << " (edu).energy()= " << (edu).energy() << std::endl;
00202   std::cout << "==" << std::endl;
00203 #endif
00204   //  std::cout << "ChargeDrifterFP420: (edu).energy()= " << (edu).energy() << std::endl;
00205   return AmplitudeSegmentFP420(currX,currY,currZ,sigma,
00206                        (edu).energy());  
00207 }

CDrifterFP420::collection_type ChargeDrifterFP420::drift ( const CDrifterFP420::ionization_type  ion,
const G4ThreeVector &  driftDir,
const int zside 
) [virtual]

Implements CDrifterFP420.

Definition at line 47 of file ChargeDrifterFP420.cc.

References GenMuonPlsPt100GeV_cfg::cout, lat::endl(), and i.

00047                                                                                                                                             {
00048   //
00049   //
00050 #ifdef mydigidebug5
00051   std::cout << "ChargeDrifterFP420: collection_type call drift" << std::endl;
00052 #endif
00053   //
00054   //
00055   collection_type _temp;
00056   _temp.resize(ion.size());
00057   
00058   for (unsigned int i=0; i<ion.size(); i++){
00059     _temp[i] = drift(ion[i], driftDir, zside);
00060   }
00061   return _temp;
00062 }


Member Data Documentation

double ChargeDrifterFP420::appV [private]

Definition at line 22 of file ChargeDrifterFP420.h.

Referenced by ChargeDrifterFP420(), and drift().

double ChargeDrifterFP420::constDe [private]

Definition at line 18 of file ChargeDrifterFP420.h.

Referenced by ChargeDrifterFP420(), and drift().

double ChargeDrifterFP420::constTe [private]

Definition at line 17 of file ChargeDrifterFP420.h.

Referenced by ChargeDrifterFP420(), and drift().

double ChargeDrifterFP420::depV [private]

Definition at line 21 of file ChargeDrifterFP420.h.

Referenced by ChargeDrifterFP420(), and drift().

double ChargeDrifterFP420::ldriftcurrX [private]

Definition at line 23 of file ChargeDrifterFP420.h.

Referenced by ChargeDrifterFP420(), and drift().

double ChargeDrifterFP420::ldriftcurrY [private]

Definition at line 24 of file ChargeDrifterFP420.h.

Referenced by ChargeDrifterFP420(), and drift().

double ChargeDrifterFP420::modulePath [private]

Definition at line 16 of file ChargeDrifterFP420.h.

Referenced by ChargeDrifterFP420().

double ChargeDrifterFP420::startT0 [private]

Definition at line 20 of file ChargeDrifterFP420.h.

Referenced by ChargeDrifterFP420(), and drift().

double ChargeDrifterFP420::temperature [private]

Definition at line 19 of file ChargeDrifterFP420.h.

Referenced by ChargeDrifterFP420().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:16:16 2009 for CMSSW by  doxygen 1.5.4