CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
ChargeDrifterFP420 Class Reference

#include <ChargeDrifterFP420.h>

Inheritance diagram for ChargeDrifterFP420:
CDrifterFP420

Public Member Functions

 ChargeDrifterFP420 (double, double, double, double, double, double, double, double, double, int)
 
CDrifterFP420::collection_type drift (const CDrifterFP420::ionization_type &, const G4ThreeVector &, const int &)
 
- Public Member Functions inherited from CDrifterFP420
virtual ~CDrifterFP420 ()
 

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
 
int verbo
 

Additional Inherited Members

- Public Types inherited from CDrifterFP420
typedef std::vector< AmplitudeSegmentFP420collection_type
 
typedef std::vector< EnergySegmentFP420ionization_type
 

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,
int  verbosity 
)

Definition at line 10 of file ChargeDrifterFP420.cc.

References gather_cfg::cout, TtSemiLepEvtBuilder_cfi::mt, jvcParameters_cfi::temperature, and HIPAlignmentAlgorithm_cfi::verbosity.

18  {
19  //
20  //
22  modulePath = mt;
23  constTe = tn;
24  constDe = dc;
25  temperature = tm;// keep just in case
26  startT0 = cdr;
27  depV = dv;
28  appV = av;
29 
30  ldriftcurrX = ptx;
31  ldriftcurrY = pty;
32  //
33  //
34 
35 
36 
37  // edm::LogInfo("ChargeDrifterFP420") << "call constructor";
38  if(verbo>0) {
39  std::cout << "ChargeDrifterFP420: call constructor" << std::endl;
40  std::cout << "ldriftcurrX= " << ldriftcurrX << "ldriftcurrY= " << ldriftcurrY << std::endl;
41  std::cout << "modulePath= " << modulePath << "constTe= " << constTe << std::endl;
42  std::cout << "ChargeDrifterFP420:----------------------" << std::endl;
43  }
44 }

Member Function Documentation

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

Implements CDrifterFP420.

Definition at line 48 of file ChargeDrifterFP420.cc.

References gather_cfg::cout, shallow::drift(), and i.

48  {
49  //
50  //
51  if(verbo>0) {
52  std::cout << "ChargeDrifterFP420: collection_type call drift" << std::endl;
53  }
54  //
55  //
56  collection_type _temp;
57  _temp.resize(ion.size());
58 
59  for (unsigned int i=0; i<ion.size(); i++){
60  _temp[i] = drift(ion[i], driftDir, xytype);
61  }
62  return _temp;
63 }
int i
Definition: DBlmapReader.cc:9
CDrifterFP420::collection_type drift(const CDrifterFP420::ionization_type &, const G4ThreeVector &, const int &)
std::vector< AmplitudeSegmentFP420 > collection_type
Definition: CDrifterFP420.h:14
AmplitudeSegmentFP420 ChargeDrifterFP420::drift ( const EnergySegmentFP420 edu,
const G4ThreeVector &  drift,
const int &  xytype 
)
private

Definition at line 66 of file ChargeDrifterFP420.cc.

References gather_cfg::cout, createfilelist::int, cmsBatch::log, mathSSE::sqrt(), and x().

66  {
67  //
68  //
69  // sliX sliY sliZ are LOCALl(!) coordinates coming from ...hit.getEntryLocalP()...
70  //
71  //
72  // Exchange xytype 1 <-> 2
73  double sliX = (edu).x();
74  double sliY = (edu).y();
75  double sliZ = (edu).z();
76 
77  double currX = sliX;
78  double currY = sliY;
79  double currZ = sliZ;
80 
81  double pathFraction=0., pathValue=0.;
82  double tanShiftAngleX=0.,tanShiftAngleY=0.,tanShiftAngleZ=0.;
83  double xDriftDueToField=0.,yDriftDueToField=0.,zDriftDueToField=0.;
84  if(verbo>0) {
85  std::cout << "=================================================================== " << std::endl;
86  std::cout << "ChargeDrifterFP420: xytype= " << xytype << std::endl;
87  std::cout << "constTe= " << constTe << "ldriftcurrX= " << ldriftcurrX << "ldriftcurrY= " << ldriftcurrY << std::endl;
88  std::cout << "1currX = " << currX << " 1currY = " << currY << " 1currZ = " << currZ << std::endl;
89  std::cout << "drift.x() = " << drift.x() << " drift.y() = " << drift.y() << " drift.z() = " << drift.z() << std::endl;
90  }
91 
92  // Yglobal Xlocal:
93  //
94  //
95  // will define drift time of electrons along Xlocal or Ygobal with ldriftcurrY from Yglobal
96  // change of ldriftcurrX to ldriftcurrY is done in intialization of ChargeDrifterFP420, so use old names for ldriftcurres
97  if(xytype == 2) {
98  tanShiftAngleY = drift.y()/drift.x();
99  tanShiftAngleZ = drift.z()/drift.x();
100 
101  // pathValue = fabs(sliX-ldriftcurrX*int(sliX/ldriftcurrX));
102  pathValue = fabs(sliX)-int(fabs(sliX/(2*ldriftcurrX))+0.5)*(2*ldriftcurrX);
103  pathValue = fabs(pathValue);
104  pathFraction = pathValue/ldriftcurrX;
105  if(verbo>0) {
106  std::cout << "==================================" << std::endl;
107  std::cout << "fabs(sliX)= " << fabs(sliX) << "ldriftcurrX= " << ldriftcurrX << std::endl;
108  std::cout << "fabs(sliX/(2*ldriftcurrX))+0.5= " << fabs(sliX/(2*ldriftcurrX))+0.5 << std::endl;
109  std::cout << "int(fabs(sliX/(2*ldriftcurrX))+0.5)*(2*ldriftcurrX)= " << int(fabs(sliX/(2*ldriftcurrX))+0.5)*(2*ldriftcurrX) << std::endl;
110  std::cout << "pathValue= " << pathValue << std::endl;
111  std::cout << "pathFraction= " << pathFraction << std::endl;
112  std::cout << "==================================" << std::endl;
113  }
114 
115  pathFraction = pathFraction>0. ? pathFraction : 0. ;
116  pathFraction = pathFraction<1. ? pathFraction : 1. ;
117 
118  yDriftDueToField // Drift along Y due to BField
119  = pathValue*tanShiftAngleY;
120  zDriftDueToField // Drift along Z due to BField
121  = pathValue*tanShiftAngleZ;
122  // will define Y and Z ccordinates (E along X)
123  currY = sliY + yDriftDueToField;
124  currZ = sliZ + zDriftDueToField;
125  }
126 
127  // Xglobal Ylocal:
128  // will define drift time of electrons along Ylocal
129  else if(xytype == 1) {
130  tanShiftAngleX = drift.x()/drift.y();
131  tanShiftAngleZ = drift.z()/drift.y();
132 
133  //pathValue = fabs(sliY-ldriftcurrY*int(sliY/ldriftcurrY));
134  pathValue = fabs(sliY)-int(fabs(sliY/(2*ldriftcurrY))+0.5)*(2*ldriftcurrY);
135  pathValue = fabs(pathValue);
136  pathFraction = pathValue/ldriftcurrY;
137  //
138  //
139 
140  if(verbo>0) {
141  std::cout << "==================================" << std::endl;
142  std::cout << "fabs(sliY)= " << fabs(sliY) << "ldriftcurrY= " << ldriftcurrY << std::endl;
143  std::cout << "fabs(sliY/(2*ldriftcurrY))+0.5= " << fabs(sliY/(2*ldriftcurrY))+0.5 << std::endl;
144  std::cout << "int(fabs(sliY/(2*ldriftcurrY))+0.5)*(2*ldriftcurrY)= " << int(fabs(sliY/(2*ldriftcurrY))+0.5)*(2*ldriftcurrY) << std::endl;
145  std::cout << "pathValue= " << pathValue << std::endl;
146  std::cout << "pathFraction= " << pathFraction << std::endl;
147  std::cout << "==================================" << std::endl;
148  }
149 
150  if(pathFraction<0. || pathFraction>1.) std::cout << "ChargeDrifterFP420: ERROR:pathFraction=" << pathFraction << std::endl;
151  pathFraction = pathFraction>0. ? pathFraction : 0. ;
152  pathFraction = pathFraction<1. ? pathFraction : 1. ;
153  xDriftDueToField // Drift along X due to BField
154  = pathValue*tanShiftAngleX;
155  // = (ldriftcurrY-sliY)*tanShiftAngleX;
156  zDriftDueToField // Drift along Z due to BField
157  = pathValue*tanShiftAngleZ;
158  // will define X and Z ccordinates (E along Y)
159  currX = sliX + xDriftDueToField;
160  currZ = sliZ + zDriftDueToField;
161  }
162  // double tanShiftAngleX = drift.x()/drift.z();
163  // double tanShiftAngleY = drift.y()/drift.z();
164  // double pathFraction = (modulePath/2.-sliZ)/modulePath ;
165  // pathFraction = pathFraction>0. ? pathFraction : 0. ;
166  // pathFraction = pathFraction<1. ? pathFraction : 1. ;
167 
168  //uble xDriftDueToField // Drift along X due to BField
169  //= (modulePath/2. - sliZ)*tanShiftAngleX;
170  //uble yDriftDueToField // Drift along Y due to BField
171  //= (modulePath/2. - sliZ)*tanShiftAngleY;
172  //uble currX = sliX + xDriftDueToField;
173  //uble currY = sliY + yDriftDueToField;
174  //
175  //
176  // log is a ln
177  // 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;
178  double bbb = 1.-2*depV*pathFraction/(depV+appV);
179  if(bbb<0.) std::cout << "ChargeDrifterFP420:ERROR: check your Voltage for log(bbb) bbb=" << bbb << std::endl;
180  double driftTime = -constTe*log(bbb) + startT0;
181  // log(1.-2*depV*pathFraction/(depV+appV)) + startT0;
182  // since no magnetic field the Sigma_x, Sigma_y are the same = sigma !!!!!!!!!!!!!!!!!
183  double sigma = sqrt(2.*constDe*driftTime*100.); // * 100. - since constDe is [cm2/sec], but i want [mm2/sec]
184 
185  // std::cout << "ChargeDrifterFP420: driftTime= " << driftTime << " pathFraction= " << pathFraction << " constTe= " << constTe << " sigma= " << sigma << std::endl;
186  if(verbo>0) {
187  std::cout << "ChargeDrifterFP420: drift: xytype=" << xytype << "pathFraction=" << pathFraction << std::endl;
188  std::cout << " constTe= " << constTe << " driftTime = " << driftTime << " startT0 = " << startT0 << std::endl;
189  std::cout << " log = " << log(1.-2*depV*pathFraction/(depV+appV)) << std::endl;
190  std::cout << " negativ inside log = " << -2*depV*pathFraction/(depV+appV) << std::endl;
191  std::cout << " constDe = " << constDe << " sigma = " << sigma << std::endl;
192 
193  std::cout << "ChargeDrifterFP420: drift: xytype=" << xytype << "pathValue=" << pathValue << std::endl;
194  std::cout << " tanShiftAngleX = " << tanShiftAngleX << " tanShiftAngleY = " << tanShiftAngleY << " tanShiftAngleZ = " << tanShiftAngleZ << std::endl;
195  std::cout << "sliX = " << sliX << " sliY = " << sliY << " sliZ = " << sliZ << std::endl;
196  std::cout << "pathFraction = " << pathFraction << " driftTime = " << driftTime << std::endl;
197  std::cout << "sigma = " << sigma << std::endl;
198  std::cout << "xDriftDueToField = " << xDriftDueToField << " yDriftDueToField = " << yDriftDueToField << " zDriftDueToField = " << zDriftDueToField << std::endl;
199  std::cout << "2currX = " << currX << " 2currY = " << currY << " 2currZ = " << currZ << std::endl;
200  std::cout << "ChargeDrifterFP420: drift; finally, rETURN AmplitudeSlimentFP420" << std::endl;
201  std::cout << "===================================================================" << std::endl;
202  std::cout << " (edu).energy()= " << (edu).energy() << std::endl;
203  std::cout << "==" << std::endl;
204  }
205  // std::cout << "ChargeDrifterFP420: (edu).energy()= " << (edu).energy() << std::endl;
206  return AmplitudeSegmentFP420(currX,currY,currZ,sigma,
207  (edu).energy());
208 }
CDrifterFP420::collection_type drift(const CDrifterFP420::ionization_type &, const G4ThreeVector &, const int &)
T sqrt(T t)
Definition: SSEVec.h:18

Member Data Documentation

double ChargeDrifterFP420::appV
private

Definition at line 22 of file ChargeDrifterFP420.h.

double ChargeDrifterFP420::constDe
private

Definition at line 18 of file ChargeDrifterFP420.h.

double ChargeDrifterFP420::constTe
private

Definition at line 17 of file ChargeDrifterFP420.h.

double ChargeDrifterFP420::depV
private

Definition at line 21 of file ChargeDrifterFP420.h.

double ChargeDrifterFP420::ldriftcurrX
private

Definition at line 23 of file ChargeDrifterFP420.h.

double ChargeDrifterFP420::ldriftcurrY
private

Definition at line 24 of file ChargeDrifterFP420.h.

double ChargeDrifterFP420::modulePath
private

Definition at line 16 of file ChargeDrifterFP420.h.

double ChargeDrifterFP420::startT0
private

Definition at line 20 of file ChargeDrifterFP420.h.

double ChargeDrifterFP420::temperature
private

Definition at line 19 of file ChargeDrifterFP420.h.

int ChargeDrifterFP420::verbo
private

Definition at line 25 of file ChargeDrifterFP420.h.