Changeset 177 in Idarraga for allpix


Ignore:
Timestamp:
Apr 24, 2011, 10:16:36 AM (13 years ago)
Author:
benoit
Message:

SLim edges and Radiation damage

Location:
allpix
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • allpix/include/AllPixFEI3StandardDigitizer.hh

    r142 r177  
    6464  G4double electricFieldY;
    6565  G4double electricFieldZ;
     66  G4double depletionVoltage;
     67  G4double depletedDepth;
     68  G4double resistivity;
     69  G4bool   bulkType;
     70  G4double b;
     71  G4double c;
    6672
    6773  G4double detectorThickness;
  • allpix/src/AllPixFEI3StandardDigitizer.cc

    r152 r177  
    4242        //////////////////////////
    4343
    44         biasVoltage=150.0; //[V]
     44        biasVoltage=600.0; //[V]
    4545        Temperature = 300.0;
    4646        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
    5053
    5154        ////////////////////////////////
     
    5760        nPixY= gD->GetNPixelsY();
    5861
    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
    6664
    6765
     
    9189
    9290
    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
    94132
    95133
     
    98136        //////////////////////
    99137
    100         doTrapping =false;
     138        doTrapping =true;
    101139        doFullField = false;
    102140
     
    130168        case 3 :
    131169                MipTOT=60;
    132                 MipCharge=20000;
     170                MipCharge=21000;
    133171                CounterDepth=255;
    134172                Lv1Unit = 25*ns;
    135173                chipNoise = 300*elec;
    136                 m_digitIn.thl = 2500*elec;
     174                m_digitIn.thl = 3500*elec;
     175                chargeSharingConstant =0.02;
     176                break;
     177
    137178
    138179        case 4 :
     
    144185                m_digitIn.thl = 2000*elec;
    145186                chargeSharingConstant =0.02;
     187                break;
    146188
    147189
     
    154196                m_digitIn.thl = 800*elec;
    155197                chargeSharingConstant =0.01;
     198                break;
    156199
    157200
     
    165208                chargeSharingConstant =0.01;
    166209
    167 
    168 
    169210        }
    170211
     
    188229
    189230        case 1 :
    190                 doSlimEdge=false;
     231                doSlimEdge=true;
    191232                GRShift =250*um;
     233                break;
    192234        case 2 :
    193235                doSlimEdge=true;
    194236                GRShift =250*um;
     237                break;
    195238        case 3 :
    196239                doSlimEdge=true;
    197240                GRShift =500*um;
     241                break;
    198242        case 4 :
    199243                doSlimEdge=true;
    200244                GRShift =500*um;
     245                break;
    201246        case 5 :
    202247                doSlimEdge=true;
    203248                GRShift =250*um;
     249                break;
    204250
    205251        default :
     
    207253                GRShift =0*um;
    208254
     255
     256                //fix me !!
     257
    209258        }
     259
     260                mobility = MobilityElectron(0,0,0);
    210261
    211262
     
    281332                        Electron_Saturation_Velocity,Electron_Beta))),1.0/Electron_Beta);
    282333        return mobilite;
    283         //cout << mobilite << " " << parElectricField << endl;
     334        //cout << "!!!!!!!!!" << mobilite << " " << parElectricField*cm << endl;
    284335
    285336}
     
    304355        //G4cout << "Hit position with respect to pixel (um) "<< (a_hit->GetPosWithRespectToPixel().z() + detectorThickness/2.0)/um  <<endl;
    305356        //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;
    308360}
    309361
     
    369421
    370422                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
    371428                G4double ypos = (*hitsCollection)[itr]->GetPosWithRespectToPixel().y();
    372429                G4double zpos = (*hitsCollection)[itr]->GetPosWithRespectToPixel().z();
     
    374431                G4double eHit = elec*CLHEP::RandGauss::shoot((*hitsCollection)[itr]->GetEdep()/elec,TMath::Sqrt((*hitsCollection)[itr]->GetEdep()/elec)*0.118);
    375432
    376 
    377 
    378                 if(doSlimEdge){
     433                //under-depletion
     434                eHit = eHit*depletedDepth/detectorThickness;
     435
     436
     437                //if(doSlimEdge){
    379438                        if (isSlimEdge(tempPixel.first,tempPixel.second)) eHit = SlimEdgeEffect(tempPixel.first,xpos,eHit);
    380                 }
     439                //}
    381440
    382441
     
    386445                         driftTime = ComputeDriftTimeUniformField((*hitsCollection)[itr]);
    387446                         sigma = ComputeDiffusionRMS(driftTime);
     447                         //cout << TString::Format("!!!!!!!!! vd/vdep : %f drift time : %f sigma : %f",depletedDepth/detectorThickness,driftTime,sigma) << endl;
    388448                }
    389449                else{
     
    403463                //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;
    404464                //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) ){
    406467
    407468//              if( (fabs(xpos) >= pitchX/2.-3*sigma || fabs(ypos) >=pitchY/2.-3*sigma) ){
     
    668729        G4double Etemp;
    669730
     731        double xpix= xpos + pitchX/2;
     732        //cout << "!!!!!!!!!SLIMEDGES!!!!!!!!!!! " << MipCharge << " " << xpix << endl;
     733
     734
    670735        if(nX==0)
    671736        {
    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                }
    673742                else{eEdge=eHit;};
    674743                Etemp=eEdge;
     744
    675745                }
    676746
    677747        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                }
    679753                else{eEdge=eHit;};
    680754                Etemp=eEdge;
    681755
     756
    682757        }
    683758
Note: See TracChangeset for help on using the changeset viewer.