CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 17 of file HitDigitizerFP420.h.

Member Typedef Documentation

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

Definition at line 20 of file HitDigitizerFP420.h.

Constructor & Destructor Documentation

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

Definition at line 28 of file HitDigitizerFP420.cc.

References CBOLTZ, gather_cfg::cout, e_SI, recoMuon::in, and funct::pow().

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

Definition at line 102 of file HitDigitizerFP420.cc.

102  {
103  delete theCDividerFP420;
104  delete theCDrifterFP420;
105  delete theIChargeFP420;
106 }
CDrifterFP420 * theCDrifterFP420
IChargeFP420 * theIChargeFP420
CDividerFP420 * theCDividerFP420

Member Function Documentation

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

Definition at line 192 of file HitDigitizerFP420.cc.

References gather_cfg::cout.

192  {
193 
194  // LOCAL hit: exchange xytype: 1 <-> 2
195 
196  // Frame detFrame(_detp->surface().position(),_detp->surface().rotation());
197  // G4ThreeVector Bfield=detFrame.toLocal(_bfield);
198  G4ThreeVector Bfield=_bfield;
199  float dir_x, dir_y, dir_z;
200  // this lines with dir_... have to be specified(sign?) in dependence of field direction:
201  /*
202  float dir_x = tanLorentzAnglePerTesla * Bfield.y();
203  float dir_y = -tanLorentzAnglePerTesla * Bfield.x();
204  float dir_z = 1.; // if E field is in z direction
205  */
206  // for electrons:
207  // E field is either in X or Y direction with change vector to opposite
208 
209  // global Y or localX
210  // E field is in Xlocal direction with change vector to opposite
211  if(xytype == 2) {
212  dir_x = 1.; // E field in Xlocal direction
213  dir_y = +tanLorentzAnglePerTesla * Bfield.z();
214  dir_z = -tanLorentzAnglePerTesla * Bfield.y();
215  }
216  // global X
217  // E field is in Ylocal direction with change vector to opposite
218  else if(xytype == 1) {
219  dir_x = +tanLorentzAnglePerTesla * Bfield.z();
220  dir_y = 1.; // E field in Ylocal direction
221  dir_z = -tanLorentzAnglePerTesla * Bfield.x();
222  }
223  else{
224  dir_x = 0.;
225  dir_y = 0.;
226  dir_z = 0.;
227  std::cout << "HitDigitizerFP420: ERROR - wrong xytype=" << xytype << std::endl;
228  }
229 
230 
231  // G4ThreeVector theDriftDirection = LocalVector(dir_x,dir_y,dir_z);
232  G4ThreeVector theDriftDirection(dir_x,dir_y,dir_z);
233  // Local3DPoint EntryPo(aHit->getEntry().x(),aHit->getEntry().y(),aHit->getEntry().z());
234  if(verbosity>0) {
235  std::cout << "HitDigitizerFP420:DriftDirection tanLorentzAnglePerTesla= " << tanLorentzAnglePerTesla << std::endl;
236  std::cout << "HitDigitizerFP420:DriftDirection The drift direction in local coordinate is " << theDriftDirection << std::endl;
237  }
238 
239  return theDriftDirection;
240 
241 }
tuple cout
Definition: gather_cfg.py:121
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 110 of file HitDigitizerFP420.cc.

References gather_cfg::cout, PSimHit::entryPoint(), PSimHit::exitPoint(), PFRecoTauDiscriminationAgainstMuon2_cfi::verbosity, PV3DBase< T, PVType, FrameType >::x(), and PV3DBase< T, PVType, FrameType >::y().

Referenced by FP420DigiMain::run().

110  {
111 
112  // use chargePosition just for cross-check in "induce" method
113  // hit center in 3D-detector r.f.
114 
115  float middlex = (hit.exitPoint().x() + hit.entryPoint().x() )/2.;
116  float middley = (hit.exitPoint().y() + hit.entryPoint().y() )/2.;
117 
118 
119  float chargePosition= -100.;
120  // Y:
121  if(xytype == 1) {
122  // chargePosition = fabs(-numStrips/2. - ( int(middle.x()/pitch) +1.) );
123  //chargePosition = fabs(int(middle.x()/pitch+0.5*(numStrips+1)) + 1.);
124  // chargePosition = fabs(int(middle.y()/pitch+0.5*(numStrips+1)) + 1.);
125  // local and global reference frames are rotated in 90 degree, so global X and local Y are collinear
126  // chargePosition = int(fabs(middle.x()/pitch + 0.5*numStrips + 1.));// charge in strip coord
127  chargePosition = 0.5*(numStrips) + middlex/pitch ;// charge in strip coord 0 - numStrips-1
128 
129 
130  }
131  // X:
132  else if(xytype == 2) {
133  // chargePosition = fabs(-numStrips/2. - ( int(middle.y()/pitch) +1.) );
134  //chargePosition = fabs(int(middle.y()/pitch+0.5*(numStrips+1)) + 1.);
135  // chargePosition = fabs(int(middle.x()/pitch+0.5*(numStrips+1)) + 1.);
136  // local and global reference frames are rotated in 90 degree, so global X and local Y are collinear
137  // chargePosition = int(fabs(middle.y()/pitch + 0.5*numStrips + 1.));
138  chargePosition = 0.5*(numStrips) + middley/pitch ;// charge in strip coord 0 - numStrips-1
139 
140  // std::cout << " chargePosition SiHitDi... = " << chargePosition << std::endl;
141  }
142  else {
143  std::cout <<"================================================================"<<std::endl;
144  std::cout << "**** HitDigitizerFP420: !!! ERROR: you have not to be here !!! xytype=" << xytype << std::endl;
145  // std::cout << "**** HitDigitizerFP420: !!! ERROR: you have not to be here !!! xytype=" << xytype << std::endl;
146 
147 
148  // break;
149  }
150  // if(chargePosition > numStrips || chargePosition<1) {
151  if(chargePosition > numStrips || chargePosition < 0) {
152  std::cout << "**** HitDigitizerFP420: !!! ERROR: check correspondence of XY detector dimensions in XML and here !!! chargePosition = " << chargePosition << std::endl;
153  // break;
154  }
155 
156  if(verbosity>0) {
157  std::cout << " ====== **** HitDigitizerFP420: !!! processHit !!! : input: xytype=" << xytype << " numStrips= " << numStrips << " pitch= " << pitch << " Calculated chargePosition= " << chargePosition << std::endl;
158  std::cout << "The middle of hit point on input was: middlex = " << middlex << std::endl;
159  std::cout << "The middle of hit point on input was: middley = " << middley << std::endl;
160  // std::cout << "For checks: hit point Entry = " << hit.getEntry() << std::endl;
161  std::cout << " ====== **** HitDigitizerFP420:processHit: start CDrifterFP420 divide" << std::endl;
162  }
163  //
164  // Fully process one SimHit
165  //
166 
167  // CDrifterFP420::ionization_type ion = theCDividerFP420->divide(hit,pitch);
169  //
170  // Compute the drift direction for this det
171  //
172 
173  // G4ThreeVector driftDir = DriftDirection(&det,bfield);
174  G4ThreeVector driftDir = DriftDirection(bfield,xytype,verbosity);
175  if(verbosity>0) {
176  std::cout << " ====== **** HitDigitizerFP420:processHit: driftDir= " << driftDir << std::endl;
177  std::cout << " ====== **** HitDigitizerFP420:processHit: start induce , CDrifterFP420 drift " << std::endl;
178  }
179 
180  // if(driftDir.z() ==0.) {
181  // std::cout << " pxlx: drift in z is zero " << std::endl;
182  // } else
183  //
184 
185  return theIChargeFP420->induce(theCDrifterFP420->drift(ion,driftDir,xytype), numStrips, pitch, numStripsW, pitchW, xytype, verbosity);
186 
187  //
188 }
virtual collection_type drift(const ionization_type &, const G4ThreeVector &, const int &)=0
virtual hit_map_type induce(const CDrifterFP420::collection_type &, int, double, int, double, int, int)=0
G4ThreeVector DriftDirection(const G4ThreeVector &, int, int)
T y() const
Definition: PV3DBase.h:63
Local3DPoint exitPoint() const
Exit point in the local Det frame.
Definition: PSimHit.h:38
std::vector< EnergySegmentFP420 > ionization_type
Definition: CDrifterFP420.h:15
CDrifterFP420 * theCDrifterFP420
IChargeFP420 * theIChargeFP420
virtual ionization_type divide(const PSimHit &, const double &)=0
tuple cout
Definition: gather_cfg.py:121
CDividerFP420 * theCDividerFP420
T x() const
Definition: PV3DBase.h:62
Local3DPoint entryPoint() const
Entry point in the local Det frame.
Definition: PSimHit.h:35
void HitDigitizerFP420::setChargeCollectionDrifter ( CDrifterFP420 cd)
inline

Definition at line 33 of file HitDigitizerFP420.h.

References theCDrifterFP420.

33  {
35  theCDrifterFP420 = cd;
36  }
CDrifterFP420 * theCDrifterFP420
void HitDigitizerFP420::setChargeDivider ( CDividerFP420 cd)
inline

Definition at line 29 of file HitDigitizerFP420.h.

References theCDividerFP420.

29  {
31  theCDividerFP420 = cd;
32  }
CDividerFP420 * theCDividerFP420
void HitDigitizerFP420::setInduceChargeOnElectrods ( IChargeFP420 cd)
inline

Definition at line 37 of file HitDigitizerFP420.h.

References theIChargeFP420.

37  {
38  if (theIChargeFP420) delete theIChargeFP420;
39  theIChargeFP420 = cd;
40  }
IChargeFP420 * theIChargeFP420

Member Data Documentation

double HitDigitizerFP420::appliedVoltage
private

Definition at line 59 of file HitDigitizerFP420.h.

double HitDigitizerFP420::chargeDistributionRMS
private

Definition at line 63 of file HitDigitizerFP420.h.

double HitDigitizerFP420::chargeMobility
private

Definition at line 60 of file HitDigitizerFP420.h.

double HitDigitizerFP420::depletionVoltage
private

Definition at line 58 of file HitDigitizerFP420.h.

double HitDigitizerFP420::gevperelectron
private

Definition at line 64 of file HitDigitizerFP420.h.

double HitDigitizerFP420::moduleThickness
private

Definition at line 54 of file HitDigitizerFP420.h.

bool HitDigitizerFP420::noDiffusion
private

Definition at line 62 of file HitDigitizerFP420.h.

float HitDigitizerFP420::tanLorentzAnglePerTesla
private

Definition at line 70 of file HitDigitizerFP420.h.

double HitDigitizerFP420::temperature
private

Definition at line 61 of file HitDigitizerFP420.h.

CDividerFP420* HitDigitizerFP420::theCDividerFP420
private

Definition at line 50 of file HitDigitizerFP420.h.

Referenced by setChargeDivider().

CDrifterFP420* HitDigitizerFP420::theCDrifterFP420
private

Definition at line 51 of file HitDigitizerFP420.h.

Referenced by setChargeCollectionDrifter().

IChargeFP420* HitDigitizerFP420::theIChargeFP420
private

Definition at line 52 of file HitDigitizerFP420.h.

Referenced by setInduceChargeOnElectrods().