- Timestamp:
- Apr 24, 2011, 10:16:36 AM (13 years ago)
- Location:
- allpix
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
allpix/include/AllPixFEI3StandardDigitizer.hh
r142 r177 64 64 G4double electricFieldY; 65 65 G4double electricFieldZ; 66 G4double depletionVoltage; 67 G4double depletedDepth; 68 G4double resistivity; 69 G4bool bulkType; 70 G4double b; 71 G4double c; 66 72 67 73 G4double detectorThickness; -
allpix/src/AllPixFEI3StandardDigitizer.cc
r152 r177 42 42 ////////////////////////// 43 43 44 biasVoltage= 150.0; //[V]44 biasVoltage=600.0; //[V] 45 45 Temperature = 300.0; 46 46 detectorThickness = gD->GetSensorZ(); 47 electricFieldY = biasVoltage/detectorThickness; // V/um 48 electricFieldX = 0; // V/um 49 electricFieldZ = 0; // V/um 47 resistivity=5000; 48 49 // true = p-type 50 // false = n-type 51 bulkType =false; 52 50 53 51 54 //////////////////////////////// … … 57 60 nPixY= gD->GetNPixelsY(); 58 61 59 ////////////////////// 60 // Radiation damage // 61 ////////////////////// 62 63 fluence = 5e1/cm2; 64 Beta_electrons = 5e-16*cm2/ns; 65 trappingTime = 1.0/(Beta_electrons*fluence); 62 //cout << TString::Format("Lx=%f Ly=%f npixX=%d npixY=%d",pitchX,pitchY,nPixX,nPixY) << endl; 63 66 64 67 65 … … 91 89 92 90 93 mobility = MobilityElectron(0,0,0); 91 92 93 94 95 96 ////////////////////// 97 // Radiation damage // 98 ////////////////////// 99 100 fluence = 1e15/cm2; 101 Beta_electrons = 5e-16*cm2/ns; 102 b=7.94e-3/cm; 103 c=3.54e-13*cm2; 104 trappingTime = 1.0/(Beta_electrons*fluence); 105 106 double echarge = 1.60217646e-19; 107 double epsilon = 11.8*8.854187817e-12/m; 108 109 double Neff=0; 110 double Neff0=0; 111 if(bulkType) Neff0=-1.0/(resistivity*Default_Hole_Mobility*(s/cm2)*echarge*cm3); 112 else Neff0=1.0/(resistivity*Default_Electron_Mobility*(s/cm2)*echarge*cm3); 113 114 if(!bulkType)Neff=Neff*TMath::Exp(-c*fluence)-b*fluence; 115 else Neff=Neff0-b*fluence; 116 117 depletionVoltage=echarge*TMath::Abs(Neff)*detectorThickness*detectorThickness/(2*epsilon); 118 depletedDepth=TMath::Sqrt(2*epsilon*biasVoltage/(echarge*TMath::Abs(Neff))); 119 if(depletedDepth>detectorThickness)depletedDepth=detectorThickness; 120 electricFieldY = biasVoltage/depletedDepth; // V/um 121 electricFieldX = 0; // V/um 122 electricFieldZ = 0; // V/um 123 124 G4cout << "!!!!!!!Radiation Damage Report !!!!!!!!" << endl 125 << TString::Format("depletionVoltage : %f depleted Depth : %f",depletionVoltage,depletedDepth/um) << endl 126 << TString::Format("Neff : %e Neff0 : %e ",Neff*cm3,Neff0*cm3); 127 if(bulkType==false && Neff<0) cout << "Bulk inverted" << endl; 128 129 130 131 94 132 95 133 … … 98 136 ////////////////////// 99 137 100 doTrapping = false;138 doTrapping =true; 101 139 doFullField = false; 102 140 … … 130 168 case 3 : 131 169 MipTOT=60; 132 MipCharge=2 0000;170 MipCharge=21000; 133 171 CounterDepth=255; 134 172 Lv1Unit = 25*ns; 135 173 chipNoise = 300*elec; 136 m_digitIn.thl = 2500*elec; 174 m_digitIn.thl = 3500*elec; 175 chargeSharingConstant =0.02; 176 break; 177 137 178 138 179 case 4 : … … 144 185 m_digitIn.thl = 2000*elec; 145 186 chargeSharingConstant =0.02; 187 break; 146 188 147 189 … … 154 196 m_digitIn.thl = 800*elec; 155 197 chargeSharingConstant =0.01; 198 break; 156 199 157 200 … … 165 208 chargeSharingConstant =0.01; 166 209 167 168 169 210 } 170 211 … … 188 229 189 230 case 1 : 190 doSlimEdge= false;231 doSlimEdge=true; 191 232 GRShift =250*um; 233 break; 192 234 case 2 : 193 235 doSlimEdge=true; 194 236 GRShift =250*um; 237 break; 195 238 case 3 : 196 239 doSlimEdge=true; 197 240 GRShift =500*um; 241 break; 198 242 case 4 : 199 243 doSlimEdge=true; 200 244 GRShift =500*um; 245 break; 201 246 case 5 : 202 247 doSlimEdge=true; 203 248 GRShift =250*um; 249 break; 204 250 205 251 default : … … 207 253 GRShift =0*um; 208 254 255 256 //fix me !! 257 209 258 } 259 260 mobility = MobilityElectron(0,0,0); 210 261 211 262 … … 281 332 Electron_Saturation_Velocity,Electron_Beta))),1.0/Electron_Beta); 282 333 return mobilite; 283 //cout << mobilite << " " << parElectricField<< endl;334 //cout << "!!!!!!!!!" << mobilite << " " << parElectricField*cm << endl; 284 335 285 336 } … … 304 355 //G4cout << "Hit position with respect to pixel (um) "<< (a_hit->GetPosWithRespectToPixel().z() + detectorThickness/2.0)/um <<endl; 305 356 //return (a_hit->GetPosWithRespectToPixel().z() + detectorThickness/2.0 ) /(mobility*electricFieldY); 306 return ( detectorThickness) /(mobility*electricFieldY); 307 357 double drift = ( CLHEP::RandGauss::shoot((depletedDepth/detectorThickness)*detectorThickness/2,(depletedDepth/detectorThickness)*detectorThickness/4)) /(mobility*electricFieldY); 358 //cout << "drift: " << mobility*s/cm2 << endl; 359 return drift; 308 360 } 309 361 … … 369 421 370 422 G4double xpos = (*hitsCollection)[itr]->GetPosWithRespectToPixel().x(); 423 424 //Ugly Hack !!! 425 if(xpos>0)xpos=-pitchX/2+xpos; 426 else xpos=pitchX/2+xpos; 427 371 428 G4double ypos = (*hitsCollection)[itr]->GetPosWithRespectToPixel().y(); 372 429 G4double zpos = (*hitsCollection)[itr]->GetPosWithRespectToPixel().z(); … … 374 431 G4double eHit = elec*CLHEP::RandGauss::shoot((*hitsCollection)[itr]->GetEdep()/elec,TMath::Sqrt((*hitsCollection)[itr]->GetEdep()/elec)*0.118); 375 432 376 377 378 if(doSlimEdge){ 433 //under-depletion 434 eHit = eHit*depletedDepth/detectorThickness; 435 436 437 //if(doSlimEdge){ 379 438 if (isSlimEdge(tempPixel.first,tempPixel.second)) eHit = SlimEdgeEffect(tempPixel.first,xpos,eHit); 380 }439 //} 381 440 382 441 … … 386 445 driftTime = ComputeDriftTimeUniformField((*hitsCollection)[itr]); 387 446 sigma = ComputeDiffusionRMS(driftTime); 447 //cout << TString::Format("!!!!!!!!! vd/vdep : %f drift time : %f sigma : %f",depletedDepth/detectorThickness,driftTime,sigma) << endl; 388 448 } 389 449 else{ … … 403 463 //G4cout << TString::Format("[MC Truth] Hit Energy=%f, x=%f, y=%f pixel(%i,%i)",eHitTruth/elec,xpos/um,ypos/um,tempPixel.first,tempPixel.second) << endl; 404 464 //if(fabs(xpos)>=pitchX/2.-10*sigma && fabs(ypos)>pitchY/2.0-10*sigma){ 405 if( (fabs(xpos) >= pitchX/2.-3*sigma || fabs(ypos) >=pitchY/2.-3*sigma) ){ 465 466 if( (fabs(xpos) >= pitchX/2.-6*sigma || fabs(ypos) >=pitchY/2.-6*sigma) ){ 406 467 407 468 // if( (fabs(xpos) >= pitchX/2.-3*sigma || fabs(ypos) >=pitchY/2.-3*sigma) ){ … … 668 729 G4double Etemp; 669 730 731 double xpix= xpos + pitchX/2; 732 //cout << "!!!!!!!!!SLIMEDGES!!!!!!!!!!! " << MipCharge << " " << xpix << endl; 733 734 670 735 if(nX==0) 671 736 { 672 if((xpos+pitchX/2. < GRShift))eEdge = eHit*(1-0.5*(xpos+pitchX/2)/(100*um)); 737 if((xpix < GRShift)){ 738 eEdge = eHit*(1-(GRShift-xpix)/(300*um)); 739 //cout << TString::Format("!!!!!!SLIM EDGES!!!!!!!! left nX:%d xpos:%f xpix:%f before:%f after:%f, R:%f",nX,xpos,xpix,eHit,Etemp,eHit*(1-(GRShift-xpix)/(GRShift))) << endl; 740 741 } 673 742 else{eEdge=eHit;}; 674 743 Etemp=eEdge; 744 675 745 } 676 746 677 747 else if(nX==(nPixX-1)){ 678 if((pitchX/2.-xpos < GRShift))eEdge = eHit*(1-0.5*(pitchX/2.-xpos)/(100*um)); 748 if(xpix > pitchX-GRShift){ 749 eEdge = eHit*(1-(xpix-(pitchX-GRShift))/(300*um)); 750 //cout << TString::Format("!!!!!!SLIM EDGES!!!!!!!! right NX:%d xpos:%f xpix:%f before:%f after:%f R:%f",nX,xpos,xpix,eHit,Etemp,eHit*(1-(xpix-(pitchX-GRShift))/(GRShift))) << endl; 751 752 } 679 753 else{eEdge=eHit;}; 680 754 Etemp=eEdge; 681 755 756 682 757 } 683 758
Note: See TracChangeset
for help on using the changeset viewer.