- Timestamp:
- Apr 24, 2011, 3:40:54 PM (13 years ago)
- Location:
- allpix
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
allpix/include/AllPixFEI3StandardDigitizer.hh
r177 r178 56 56 G4double SlimEdgeEffect(G4int nX,G4double xpos,G4double eHit); 57 57 G4bool isSlimEdge(G4int nX, G4int nY); 58 void Efield1D(G4double z); 58 59 G4double elec; 59 60 … … 70 71 G4double b; 71 72 G4double c; 73 G4double Neff; 72 74 73 75 G4double detectorThickness; … … 114 116 G4bool doSlimEdge; 115 117 118 G4double epsilon; 119 G4double echarge; 120 G4int precision; 121 116 122 117 123 ////////////////////////////////////////////////////// -
allpix/src/AllPixFEI3StandardDigitizer.cc
r177 r178 13 13 #include "TF1.h" 14 14 #include "CLHEP/Random/RandGauss.h" 15 #include "CLHEP/Random/RandFlat.h" 15 16 16 17 //#include "SystemOfUnits.h" … … 42 43 ////////////////////////// 43 44 44 biasVoltage= 600.0; //[V]45 biasVoltage=1000.0; //[V] 45 46 Temperature = 300.0; 46 47 detectorThickness = gD->GetSensorZ(); … … 98 99 ////////////////////// 99 100 100 fluence = 1e15/cm2; 101 fluence = 0.0/cm2; 102 //Beta_electrons = 5e-16*cm2/ns; 101 103 Beta_electrons = 5e-16*cm2/ns; 102 104 b=7.94e-3/cm; … … 104 106 trappingTime = 1.0/(Beta_electrons*fluence); 105 107 106 doubleecharge = 1.60217646e-19;107 doubleepsilon = 11.8*8.854187817e-12/m;108 109 doubleNeff=0;108 echarge = 1.60217646e-19; 109 epsilon = 11.8*8.854187817e-12/m; 110 111 Neff=0; 110 112 double Neff0=0; 111 113 if(bulkType) Neff0=-1.0/(resistivity*Default_Hole_Mobility*(s/cm2)*echarge*cm3); 112 114 else Neff0=1.0/(resistivity*Default_Electron_Mobility*(s/cm2)*echarge*cm3); 113 115 114 if(!bulkType)Neff=Neff *TMath::Exp(-c*fluence)-b*fluence;116 if(!bulkType)Neff=Neff0*TMath::Exp(-c*fluence)-b*fluence; 115 117 else Neff=Neff0-b*fluence; 116 118 … … 118 120 depletedDepth=TMath::Sqrt(2*epsilon*biasVoltage/(echarge*TMath::Abs(Neff))); 119 121 if(depletedDepth>detectorThickness)depletedDepth=detectorThickness; 120 electricField Y= biasVoltage/depletedDepth; // V/um122 electricFieldZ = biasVoltage/depletedDepth; // V/um 121 123 electricFieldX = 0; // V/um 122 electricField Z= 0; // V/um124 electricFieldY = 0; // V/um 123 125 124 126 G4cout << "!!!!!!!Radiation Damage Report !!!!!!!!" << endl … … 137 139 138 140 doTrapping =true; 139 doFullField = false;141 doFullField = true; 140 142 141 143 … … 148 150 dtIni = 0.01*ns; 149 151 152 precision = 5; 153 150 154 151 155 ///////////////////////////// … … 168 172 case 3 : 169 173 MipTOT=60; 170 MipCharge=2 1000;174 MipCharge=22000; 171 175 CounterDepth=255; 172 176 Lv1Unit = 25*ns; … … 229 233 230 234 case 1 : 231 doSlimEdge= true;235 doSlimEdge=false; 232 236 GRShift =250*um; 233 237 break; … … 294 298 G4double ytemp=y; 295 299 G4double ztemp=z; 296 300 //cout << "z : " << z/um << endl; 297 301 vector<G4double> step; 298 while(z>0 && z<detectorThickness){ 302 int counter=0; 303 while( ztemp>0 && ztemp<detectorThickness){ 299 304 300 305 driftTime+=dt; 301 step=RKF5Integration(x ,y,z,dt);306 step=RKF5Integration(xtemp,ytemp,ztemp,dt); 302 307 xtemp+=step[0]; 303 308 ytemp+=step[1]; 304 309 ztemp+=step[2]; 305 SetDt(dt,step[3]); 310 if(GetElectricFieldNorm(xtemp,ytemp,ztemp)==0)ztemp=detectorThickness; 311 dt=SetDt(dt,step[3]); 312 counter++; 313 //cout << "!!!!!! Drifting youhou! !!!!! " << TString::Format("dt: %f z : %f drift : %f Ez : %f",dt/ns,ztemp/um,driftTime/ns,electricFieldZ*cm) << endl; 306 314 } 307 315 … … 316 324 317 325 318 void AllPixFEI3StandardDigitizer::ComputeElectricField(G4double /*x*/, G4double /*y*/, G4double /*z*/){} 326 void AllPixFEI3StandardDigitizer::ComputeElectricField(G4double /*x*/, G4double /*y*/, G4double z){ 327 328 Efield1D(z); 329 } 319 330 320 331 … … 327 338 328 339 //ComputeElectricField(x,y,z); 329 G4double parElectricField = electricField Y;//GetElectricFieldNorm(x,y,z);340 G4double parElectricField = electricFieldZ;//GetElectricFieldNorm(x,y,z); 330 341 G4double mobilite = Default_Electron_Mobility* 331 342 TMath::Power((1.0/(1.+ TMath::Power((Default_Electron_Mobility*parElectricField)/ … … 355 366 //G4cout << "Hit position with respect to pixel (um) "<< (a_hit->GetPosWithRespectToPixel().z() + detectorThickness/2.0)/um <<endl; 356 367 //return (a_hit->GetPosWithRespectToPixel().z() + detectorThickness/2.0 ) /(mobility*electricFieldY); 357 double drift = ( CLHEP::RandGauss::shoot((depletedDepth/detectorThickness)*detectorThickness/2,(depletedDepth/detectorThickness)*detectorThickness/4)) /(mobility*electricField Y);368 double drift = ( CLHEP::RandGauss::shoot((depletedDepth/detectorThickness)*detectorThickness/2,(depletedDepth/detectorThickness)*detectorThickness/4)) /(mobility*electricFieldZ); 358 369 //cout << "drift: " << mobility*s/cm2 << endl; 359 370 return drift; … … 384 395 } 385 396 397 398 void AllPixFEI3StandardDigitizer::Efield1D(G4double z){ 399 400 401 electricFieldZ=(detectorThickness-z)*biasVoltage/depletedDepth; 402 if(z>depletedDepth){ 403 electricFieldZ=0; 404 //cout << "bip" << endl; 405 } 406 407 } 408 409 410 411 386 412 /** 387 413 * Digitizer for FEI3Standard … … 415 441 for(G4int itr = 0 ; itr < nEntries ; itr++) { 416 442 443 G4double eHitTotal = elec*CLHEP::RandGauss::shoot((*hitsCollection)[itr]->GetEdep()/elec,TMath::Sqrt((*hitsCollection)[itr]->GetEdep()/elec)*0.118); 444 445 //under-depletion 446 eHitTotal = eHitTotal*depletedDepth/detectorThickness; 447 448 for(G4int nQ = 0 ; nQ < precision ; nQ++) { 449 450 double eHit = double(eHitTotal)/precision; 417 451 // Hit Info 418 452 … … 427 461 428 462 G4double ypos = (*hitsCollection)[itr]->GetPosWithRespectToPixel().y(); 429 G4double zpos = (*hitsCollection)[itr]->GetPosWithRespectToPixel().z(); 430 431 G4double eHit = elec*CLHEP::RandGauss::shoot((*hitsCollection)[itr]->GetEdep()/elec,TMath::Sqrt((*hitsCollection)[itr]->GetEdep()/elec)*0.118); 432 433 //under-depletion 434 eHit = eHit*depletedDepth/detectorThickness; 463 //G4double zpos = (*hitsCollection)[itr]->GetPosWithRespectToPixel().z(); 464 G4double zpos = CLHEP::RandFlat::shoot()*depletedDepth; 465 435 466 436 467 … … 448 479 } 449 480 else{ 481 482 // Until we get out position 450 483 vector<G4double> data = ComputeDriftTimeFullField(xpos,ypos,zpos); 451 484 driftTime = data[3]; … … 569 602 } 570 603 604 571 605 // Now create digits. One per pixel 572 606 map<pair<G4int, G4int>, G4double >::iterator pCItr = pixelsContent.begin(); … … 599 633 } 600 634 635 } 636 601 637 G4int dc_entries = m_digitsCollection->entries(); 602 638 if(dc_entries > 0){ … … 693 729 694 730 //______________________________________________________________________________ 695 G4double AllPixFEI3StandardDigitizer::SetDt(G4double Dt, G4double ErreurMoy) 696 { 697 731 G4double AllPixFEI3StandardDigitizer::SetDt(G4double dt, G4double ErreurMoy) 732 { 733 734 double Dt=dt; 698 735 if(isnan(ErreurMoy)){Dt=tup;} 699 736 else if(ErreurMoy > Target){ Dt*=0.9;}
Note: See TracChangeset
for help on using the changeset viewer.