CMS 3D CMS Logo

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

#include <HitDigitizerFP420.h>

Public Types

typedef std::map< int, float, std::less< int > > hit_map_type
 

Public Member Functions

 HitDigitizerFP420 (float in, float ild, float ildx, float ildy, float in0, float in2, float in3, int verbosity)
 
hit_map_type processHit (const PSimHit &, const G4ThreeVector &, int, int, double, int, double, double, int)
 
void setChargeCollectionDrifter (CDrifterFP420 *cd)
 
void setChargeDivider (CDividerFP420 *cd)
 
void setInduceChargeOnElectrods (IChargeFP420 *cd)
 
 ~HitDigitizerFP420 ()
 

Private Member Functions

G4ThreeVector DriftDirection (const G4ThreeVector &, int, int)
 

Private Attributes

double appliedVoltage
 
double chargeDistributionRMS
 
double chargeMobility
 
double depletionVoltage
 
double gevperelectron
 
double moduleThickness
 
bool noDiffusion
 
float tanLorentzAnglePerTesla
 
double temperature
 
CDividerFP420theCDividerFP420
 
CDrifterFP420theCDrifterFP420
 
IChargeFP420theIChargeFP420
 

Detailed Description

Definition at line 16 of file HitDigitizerFP420.h.

Member Typedef Documentation

◆ hit_map_type

typedef std::map<int, float, std::less<int> > HitDigitizerFP420::hit_map_type

Definition at line 18 of file HitDigitizerFP420.h.

Constructor & Destructor Documentation

◆ HitDigitizerFP420()

HitDigitizerFP420::HitDigitizerFP420 ( float  in,
float  ild,
float  ildx,
float  ildy,
float  in0,
float  in2,
float  in3,
int  verbosity 
)

Definition at line 29 of file HitDigitizerFP420.cc.

30  {
32  double bz420 = in0;
33  double bzD2 = in2;
34  double bzD3 = in3;
35  // double pitch =inp;
36  // double pitchX =inpx;
37  // double pitchY =inpy;
38  double ldrift = ild;
39  double ldriftX = ildx;
40  double ldriftY = ildy;
41  //
42  // Construct default classes
43  //
44 
45  // theCDividerFP420 = new ChargeDividerFP420(pitch);
47 
48  depletionVoltage = 20.0; //
49  appliedVoltage = 25.0; // a bit bigger than depletionVoltage to have positive
50  // value A for logA, A=1-2*Tfract.*Vd/(Vd+Vb)
51 
52  // chargeMobility=480.0;// = 480.0 !holes mobility [cm**2/V/sec] p-side;
53  // = 1350.0 !electron mobility - n-side
54  chargeMobility = 1350.0; // = 480.0 !holes mobility [cm**2/V/sec] p-side;
55  // = 1350.0 !electron mobility - n-side
56  // temperature=297.; // 24 C degree +273 = 297 ---->diffusion const for
57  // electrons= (1.38E-23/1.6E-19)*1350.0*297=34.6
58  // diffusion const for holes = 12.3 [cm**2/sec]
59  temperature = 263.; // -10 C degree +273 = 263 ---->diffusion const for
60  // electrons= (1.38E-23/1.6E-19)*1350.0*263=30.6
61  double diffusionConstant = CBOLTZ / e_SI * chargeMobility * temperature;
62  // noDiffusion=true; // true if no Diffusion
63  noDiffusion = false; // false if Diffusion
64  if (noDiffusion)
65  diffusionConstant *= 1.0e-3;
66 
67  chargeDistributionRMS = 6.5e-10;
68 
69  // arbitrary:
70  tanLorentzAnglePerTesla = 0.; // try =0.106 if B field exist
71 
72  // double timeNormalisation =
73  // pow(moduleThickness,2)/(2.*depletionVoltage*chargeMobility); double
74  // timeNormalisation = pow(pitch,2)/(2.*depletionVoltage*chargeMobility);
75 
76  double timeNormalisation = pow(ldrift, 2) / (2. * depletionVoltage * chargeMobility); //
77  // double timeNormalisation =
78  // pow(ldrift,2)/(2.*depletionVoltage*chargeMobility);//
79  timeNormalisation = timeNormalisation * 0.01; // because ldrift in [mm] but mu_e in [cm2/V/sec
80 
81  // double timeNormalisation =
82  // pow(pitch/2.,2)/(2.*depletionVoltage*chargeMobility);// i entered
83  // pitch as a distance between 2 read-out strips, not real distance
84  // between any (p or n) electrods which will be in 2 times less. But in
85  // expression for timeNormalisation the real distance of charge
86  // collection must be, so use pitch/2. !
87 
88  double clusterWidth = 5.; // was = 3
89  gevperelectron = 3.61e-09; // double GevPerElectron = 3.61e-09
90 
91  // GevPerElectron AZ:average deposited energy per e-h pair [keV]??? =0.0036
92  if (verbosity > 0) {
93  std::cout << "HitDigitizerFP420: constructor ldrift= " << ldrift << std::endl;
94  std::cout << "ldriftY= " << ldriftY << "ldriftX= " << ldriftX << std::endl;
95  std::cout << "depletionVoltage" << depletionVoltage << "appliedVoltage" << appliedVoltage << "chargeMobility"
96  << chargeMobility << "temperature" << temperature << "diffusionConstant" << diffusionConstant
97  << "chargeDistributionRMS" << chargeDistributionRMS << "moduleThickness" << moduleThickness
98  << "timeNormalisation" << timeNormalisation << "gevperelectron" << gevperelectron << std::endl;
99  }
100  // ndif
101 
103  timeNormalisation,
104  diffusionConstant,
105  temperature,
109  ldriftX,
110  ldriftY,
111  verbosity);
112  // pitchX,
113  // pitchY);
114 
115  theIChargeFP420 = new InduceChargeFP420(clusterWidth, gevperelectron);
116 }

References CBOLTZ, gather_cfg::cout, e_SI, recoMuon::in, SiStripSimParameters_cfi::noDiffusion, funct::pow(), jvcParameters_cfi::temperature, and ctppsCommonDQMSource_cfi::verbosity.

◆ ~HitDigitizerFP420()

HitDigitizerFP420::~HitDigitizerFP420 ( )

Definition at line 118 of file HitDigitizerFP420.cc.

118  {
119  delete theCDividerFP420;
120  delete theCDrifterFP420;
121  delete theIChargeFP420;
122 }

Member Function Documentation

◆ DriftDirection()

G4ThreeVector HitDigitizerFP420::DriftDirection ( const G4ThreeVector &  _bfield,
int  xytype,
int  verbosity 
)
private

Definition at line 231 of file HitDigitizerFP420.cc.

231  {
232  // LOCAL hit: exchange xytype: 1 <-> 2
233 
234  // Frame detFrame(_detp->surface().position(),_detp->surface().rotation());
235  // G4ThreeVector Bfield=detFrame.toLocal(_bfield);
236  const G4ThreeVector &Bfield = _bfield;
237  float dir_x, dir_y, dir_z;
238  // this lines with dir_... have to be specified(sign?) in dependence of field
239  // direction:
240  /*
241  float dir_x = tanLorentzAnglePerTesla * Bfield.y();
242  float dir_y = -tanLorentzAnglePerTesla * Bfield.x();
243  float dir_z = 1.; // if E field is in z direction
244  */
245  // for electrons:
246  // E field is either in X or Y direction with change vector to opposite
247 
248  // global Y or localX
249  // E field is in Xlocal direction with change vector to opposite
250  if (xytype == 2) {
251  dir_x = 1.; // E field in Xlocal direction
252  dir_y = +tanLorentzAnglePerTesla * Bfield.z();
253  dir_z = -tanLorentzAnglePerTesla * Bfield.y();
254  }
255  // global X
256  // E field is in Ylocal direction with change vector to opposite
257  else if (xytype == 1) {
258  dir_x = +tanLorentzAnglePerTesla * Bfield.z();
259  dir_y = 1.; // E field in Ylocal direction
260  dir_z = -tanLorentzAnglePerTesla * Bfield.x();
261  } else {
262  dir_x = 0.;
263  dir_y = 0.;
264  dir_z = 0.;
265  std::cout << "HitDigitizerFP420: ERROR - wrong xytype=" << xytype << std::endl;
266  }
267 
268  // G4ThreeVector theDriftDirection = LocalVector(dir_x,dir_y,dir_z);
269  G4ThreeVector theDriftDirection(dir_x, dir_y, dir_z);
270  // Local3DPoint
271  // EntryPo(aHit->getEntry().x(),aHit->getEntry().y(),aHit->getEntry().z());
272  if (verbosity > 0) {
273  std::cout << "HitDigitizerFP420:DriftDirection tanLorentzAnglePerTesla= " << tanLorentzAnglePerTesla << std::endl;
274  std::cout << "HitDigitizerFP420:DriftDirection The drift direction in "
275  "local coordinate is "
276  << theDriftDirection << std::endl;
277  }
278 
279  return theDriftDirection;
280 }

References gather_cfg::cout, and ctppsCommonDQMSource_cfi::verbosity.

◆ processHit()

HitDigitizerFP420::hit_map_type HitDigitizerFP420::processHit ( const PSimHit hit,
const G4ThreeVector &  bfield,
int  xytype,
int  numStrips,
double  pitch,
int  numStripsW,
double  pitchW,
double  moduleThickness,
int  verbosity 
)

Definition at line 126 of file HitDigitizerFP420.cc.

134  {
135  // use chargePosition just for cross-check in "induce" method
136  // hit center in 3D-detector r.f.
137 
138  float middlex = (hit.exitPoint().x() + hit.entryPoint().x()) / 2.;
139  float middley = (hit.exitPoint().y() + hit.entryPoint().y()) / 2.;
140 
141  float chargePosition = -100.;
142  // Y:
143  if (xytype == 1) {
144  // chargePosition = fabs(-numStrips/2. - ( int(middle.x()/pitch) +1.)
145  // );
146  // chargePosition = fabs(int(middle.x()/pitch+0.5*(numStrips+1)) + 1.);
147  // chargePosition = fabs(int(middle.y()/pitch+0.5*(numStrips+1))
148  // + 1.);
149  // local and global reference frames are rotated in 90 degree, so global X
150  // and local Y are collinear
151  // chargePosition = int(fabs(middle.x()/pitch + 0.5*numStrips + 1.));//
152  // charge in strip coord
153  chargePosition = 0.5 * (numStrips) + middlex / pitch; // charge in strip coord 0 - numStrips-1
154 
155  }
156  // X:
157  else if (xytype == 2) {
158  // chargePosition = fabs(-numStrips/2. - ( int(middle.y()/pitch) +1.)
159  // );
160  // chargePosition = fabs(int(middle.y()/pitch+0.5*(numStrips+1)) + 1.);
161  // chargePosition = fabs(int(middle.x()/pitch+0.5*(numStrips+1))
162  // + 1.);
163  // local and global reference frames are rotated in 90 degree, so global X
164  // and local Y are collinear
165  // chargePosition = int(fabs(middle.y()/pitch + 0.5*numStrips + 1.));
166  chargePosition = 0.5 * (numStrips) + middley / pitch; // charge in strip coord 0 - numStrips-1
167 
168  // std::cout << " chargePosition SiHitDi... = " << chargePosition <<
169  // std::endl;
170  } else {
171  std::cout << "================================================================" << std::endl;
172  std::cout << "**** HitDigitizerFP420: !!! ERROR: you have not to be "
173  "here !!! xytype="
174  << xytype << std::endl;
175  // std::cout << "**** HitDigitizerFP420: !!! ERROR: you have not to be
176  // here !!! xytype=" << xytype << std::endl;
177 
178  // break;
179  }
180  // if(chargePosition > numStrips || chargePosition<1) {
181  if (chargePosition > numStrips || chargePosition < 0) {
182  std::cout << "**** HitDigitizerFP420: !!! ERROR: check correspondence of XY "
183  "detector dimensions in XML and here !!! chargePosition = "
184  << chargePosition << std::endl;
185  // break;
186  }
187 
188  if (verbosity > 0) {
189  std::cout << " ====== **** HitDigitizerFP420: !!! processHit !!! : "
190  "input: xytype="
191  << xytype << " numStrips= " << numStrips << " pitch= " << pitch
192  << " Calculated chargePosition= " << chargePosition << std::endl;
193  std::cout << "The middle of hit point on input was: middlex = " << middlex << std::endl;
194  std::cout << "The middle of hit point on input was: middley = " << middley << std::endl;
195  // std::cout << "For checks: hit point Entry = " << hit.getEntry() <<
196  // std::endl;
197  std::cout << " ====== **** HitDigitizerFP420:processHit: start "
198  "CDrifterFP420 divide"
199  << std::endl;
200  }
201  //
202  // Fully process one SimHit
203  //
204 
205  // CDrifterFP420::ionization_type ion = theCDividerFP420->divide(hit,pitch);
207  //
208  // Compute the drift direction for this det
209  //
210 
211  // G4ThreeVector driftDir = DriftDirection(&det,bfield);
212  G4ThreeVector driftDir = DriftDirection(bfield, xytype, verbosity);
213  if (verbosity > 0) {
214  std::cout << " ====== **** HitDigitizerFP420:processHit: driftDir= " << driftDir << std::endl;
215  std::cout << " ====== **** HitDigitizerFP420:processHit: start "
216  "induce , CDrifterFP420 drift "
217  << std::endl;
218  }
219 
220  // if(driftDir.z() ==0.) {
221  // std::cout << " pxlx: drift in z is zero " << std::endl;
222  // } else
223  //
224 
225  return theIChargeFP420->induce(
226  theCDrifterFP420->drift(ion, driftDir, xytype), numStrips, pitch, numStripsW, pitchW, xytype, verbosity);
227 
228  //
229 }

References gather_cfg::cout, ctppsCommonDQMSource_cfi::verbosity, hit::x, and hit::y.

Referenced by FP420DigiMain::run().

◆ setChargeCollectionDrifter()

void HitDigitizerFP420::setChargeCollectionDrifter ( CDrifterFP420 cd)
inline

Definition at line 33 of file HitDigitizerFP420.h.

33  {
34  if (theCDrifterFP420)
35  delete theCDrifterFP420;
37  }

References hippyaddtobaddatafiles::cd(), and theCDrifterFP420.

◆ setChargeDivider()

void HitDigitizerFP420::setChargeDivider ( CDividerFP420 cd)
inline

Definition at line 28 of file HitDigitizerFP420.h.

28  {
29  if (theCDividerFP420)
30  delete theCDividerFP420;
32  }

References hippyaddtobaddatafiles::cd(), and theCDividerFP420.

◆ setInduceChargeOnElectrods()

void HitDigitizerFP420::setInduceChargeOnElectrods ( IChargeFP420 cd)
inline

Definition at line 38 of file HitDigitizerFP420.h.

38  {
39  if (theIChargeFP420)
40  delete theIChargeFP420;
42  }

References hippyaddtobaddatafiles::cd(), and theIChargeFP420.

Member Data Documentation

◆ appliedVoltage

double HitDigitizerFP420::appliedVoltage
private

Definition at line 61 of file HitDigitizerFP420.h.

◆ chargeDistributionRMS

double HitDigitizerFP420::chargeDistributionRMS
private

Definition at line 65 of file HitDigitizerFP420.h.

◆ chargeMobility

double HitDigitizerFP420::chargeMobility
private

Definition at line 62 of file HitDigitizerFP420.h.

◆ depletionVoltage

double HitDigitizerFP420::depletionVoltage
private

Definition at line 60 of file HitDigitizerFP420.h.

◆ gevperelectron

double HitDigitizerFP420::gevperelectron
private

Definition at line 66 of file HitDigitizerFP420.h.

◆ moduleThickness

double HitDigitizerFP420::moduleThickness
private

Definition at line 56 of file HitDigitizerFP420.h.

◆ noDiffusion

bool HitDigitizerFP420::noDiffusion
private

Definition at line 64 of file HitDigitizerFP420.h.

◆ tanLorentzAnglePerTesla

float HitDigitizerFP420::tanLorentzAnglePerTesla
private

Definition at line 72 of file HitDigitizerFP420.h.

◆ temperature

double HitDigitizerFP420::temperature
private

Definition at line 63 of file HitDigitizerFP420.h.

◆ theCDividerFP420

CDividerFP420* HitDigitizerFP420::theCDividerFP420
private

Definition at line 52 of file HitDigitizerFP420.h.

Referenced by setChargeDivider().

◆ theCDrifterFP420

CDrifterFP420* HitDigitizerFP420::theCDrifterFP420
private

Definition at line 53 of file HitDigitizerFP420.h.

Referenced by setChargeCollectionDrifter().

◆ theIChargeFP420

IChargeFP420* HitDigitizerFP420::theIChargeFP420
private

Definition at line 54 of file HitDigitizerFP420.h.

Referenced by setInduceChargeOnElectrods().

CBOLTZ
#define CBOLTZ
Definition: HitDigitizerFP420.cc:23
IChargeFP420::induce
virtual hit_map_type induce(const CDrifterFP420::collection_type &, int, double, int, double, int, int)=0
HitDigitizerFP420::DriftDirection
G4ThreeVector DriftDirection(const G4ThreeVector &, int, int)
Definition: HitDigitizerFP420.cc:231
ctppsCommonDQMSource_cfi.verbosity
verbosity
Definition: ctppsCommonDQMSource_cfi.py:14
e_SI
#define e_SI
Definition: HitDigitizerFP420.cc:24
HitDigitizerFP420::theCDividerFP420
CDividerFP420 * theCDividerFP420
Definition: HitDigitizerFP420.h:52
hit::y
double y
Definition: SiStripHitEffFromCalibTree.cc:90
CDrifterFP420::ionization_type
std::vector< EnergySegmentFP420 > ionization_type
Definition: CDrifterFP420.h:14
HitDigitizerFP420::depletionVoltage
double depletionVoltage
Definition: HitDigitizerFP420.h:60
gather_cfg.cout
cout
Definition: gather_cfg.py:144
HitDigitizerFP420::temperature
double temperature
Definition: HitDigitizerFP420.h:63
InduceChargeFP420
Definition: InduceChargeFP420.h:7
HitDigitizerFP420::gevperelectron
double gevperelectron
Definition: HitDigitizerFP420.h:66
HitDigitizerFP420::moduleThickness
double moduleThickness
Definition: HitDigitizerFP420.h:56
hit::x
double x
Definition: SiStripHitEffFromCalibTree.cc:89
CDividerFP420::divide
virtual ionization_type divide(const PSimHit &, const double &)=0
HitDigitizerFP420::chargeMobility
double chargeMobility
Definition: HitDigitizerFP420.h:62
HitDigitizerFP420::theCDrifterFP420
CDrifterFP420 * theCDrifterFP420
Definition: HitDigitizerFP420.h:53
HitDigitizerFP420::theIChargeFP420
IChargeFP420 * theIChargeFP420
Definition: HitDigitizerFP420.h:54
recoMuon::in
Definition: RecoMuonEnumerators.h:6
HitDigitizerFP420::chargeDistributionRMS
double chargeDistributionRMS
Definition: HitDigitizerFP420.h:65
HitDigitizerFP420::noDiffusion
bool noDiffusion
Definition: HitDigitizerFP420.h:64
ChargeDividerFP420
Definition: ChargeDividerFP420.h:13
HitDigitizerFP420::appliedVoltage
double appliedVoltage
Definition: HitDigitizerFP420.h:61
CDrifterFP420::drift
virtual collection_type drift(const ionization_type &, const G4ThreeVector &, const int &)=0
hippyaddtobaddatafiles.cd
def cd(newdir)
Definition: hippyaddtobaddatafiles.py:40
funct::pow
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29
ChargeDrifterFP420
Definition: ChargeDrifterFP420.h:7
hit
Definition: SiStripHitEffFromCalibTree.cc:88
HitDigitizerFP420::tanLorentzAnglePerTesla
float tanLorentzAnglePerTesla
Definition: HitDigitizerFP420.h:72