{
KDetector det;
det.SStep=1; // this variable determines the precision of your stepping
det.nx=1000; // number of nodes in x
det.ny=50; // number of nodes in y
det.nz=1; // for 2D simulations no. of z nodes =1
Float_t dimX=1000; //dimension in [um] in x
Float_t dimY=50; // in y
//init geometry
det.EG=new TH3I("EG","EG",det.nx,0,dimX,det.ny,0,dimY,det.nz,0,1);
det.EG->GetXaxis()->SetTitle("x [#mum]");
det.EG->GetYaxis()->SetTitle("y [#mum]");
det.EG->GetZaxis()->SetTitle("z [#mum]");
//init material
det.DM=new TH3I("DM","DM",det.nx,0,dimX,det.ny,0,dimY,det.nz,0,1);
det.DM->GetXaxis()->SetTitle("x [#mum]");
det.DM->GetYaxis()->SetTitle("y [#mum]");
det.DM->GetZaxis()->SetTitle("z [#mum]");
//init space charge histo
det.NeffH=new TH3F("Neff","Neff",det.nx,0,dimX,det.ny,0,dimY,det.nz,0,1);
det.NeffH->GetXaxis()->SetTitle("x [#mum]");
det.NeffH->GetYaxis()->SetTitle("y [#mum]");
det.NeffH->GetZaxis()->SetTitle("z [#mum]");
// SetUpMaterial
for(int j=0;j<=det.ny;j++)
for(int i=0;i<=det.nx;i++)
{
det->DM->SetBinContent(i,j,1,0);
//the material is all being set to 0? Is 0 silicon? Are the electrodes made of silicon as well? Also what is 1 here?
//--->>> The electrodes are poly-Si or Al - however what really determines them is selecting them as
// electrodes in the sense of Ramo's concept of induced charge.
det->NeffH->SetBinContent(i,j,1,0.1); // very high resistivity Neff=1e11 cm-3
//what is 0.1? /--->>> 0.1 is Neff measured in [cm^-3], so 0.1 is 5e11 cm-3. The sign of that parameter determines the sign of the space charge.
}
// Collection electrode
Float_t BackPos[3]={500,1,0.5}; //Why don't we set the electrode exactly at the edge of the boundary? Does that cause weird end effects?
// --->>> this is for back electrode, z=0.5 and y=1 are purely technical - which has to
// do with setting the mesh for calculation
Float_t BackSiz[3]={500,0.5,0.5};
det.ElRectangle(BackPos,BackSiz,2,1); //position, size, weighting, material
//What is the collection electrode? Why is the weighting field set to 16385, and what material is 0?
//--->>> The collection electrode is set by proper weighting potential. I selected the strip in the center
// When you setup electrode you can use 0 - not an electrode
// 1 - GND electrode
// 2 - HV electrode (not that you can use many voltages as for SDD,
// but I guess this is not your case
det.Voltage=-200.; //--->>> you have to set the HV - in this case -200 V at the back
// Area definitions
Float_t StripPos[3]={50,50,0}; //--->>> definition of strip positions in x,y,z
Float_t StripSiz[3]={12,0.5,0}; //--->>> definition of the oxide (as example) trenches position in x,y,z i
Float_t OxSiz[3]={20,4,0}; //--->>> definition of the oxide (as example) trenches size in x,y,z
Float_t SideWall1Size[]={20,20,0}; //--->>> definition of the sidewals
Float_t SideWall2Size[]={40,6,0}; //--->>> definition of the sidewalls - I had to compose them of
// two to make it look like on you plot
Float_t SideWallPos[3]; //--->>> sidewall positions
// definition of voltages to be applied to the field strips
int Wpval=1; ////--->>> variable for weighting potential
for(int i=0; i<=8; i++) //loop 9 strips
{
if(i==4) Wpval=16385; else Wpval=1; //--->>> signal strip is strip #4
StripPos[0]=i*80+180; //--->>> positioning of the strips (80 microns pitch, 24 microns implant width,
// 1 um implant depth)- see the definition of the strip
StripPos[1]=49;
det.ElRectangle(StripPos,StripSiz,Wpval,1); //det->SetElecVolt(i) what is this doing, how do we set the weighting field for the strip?
////--->>> this is generation for Silicon Drift Detectors (SDD), it doesn't apply to you, I guess
StripPos[1]=46; //--->>> trench position in y
StripPos[0]=i*80+180+40; //--->>> trench position in x
if(i!=8)
{
det.ElRectangle(StripPos,OxSiz,0,2); //--->>> select "no electrode"=0 and "material"=2
det.ElRectangle(StripPos,OxSiz,det.NeffH,5); //--->>> setting oxide charge concentration to 5e12 cm-3
}
}
//positioning of the walls
SideWallPos[0]=100; SideWallPos[1]=30; det.ElRectangle(SideWallPos,SideWall1Size,0,20);
SideWallPos[0]=900; SideWallPos[1]=30; det.ElRectangle(SideWallPos,SideWall1Size,0,20);
SideWallPos[0]=40; SideWallPos[1]=44; det.ElRectangle(SideWallPos,SideWall2Size,0,20);
SideWallPos[0]=960; SideWallPos[1]=44; det.ElRectangle(SideWallPos,SideWall2Size,0,20);
SideWall1Size[0]=60; SideWall1Size[1]=25; SideWall1Size[2]=0;
SideWallPos[0]=60; SideWallPos[1]=25; det.ElRectangle(SideWallPos,SideWall1Size,det.NeffH,0);
SideWallPos[0]=940; SideWallPos[1]=25; det.ElRectangle(SideWallPos,SideWall1Size,det.NeffH,0);
det.SetBoundaryConditions(); //Is there any way to change the boundary conditions? Or is the V always 0 at the boundaries?
//--->>> boundary condition is always reflective (no field lines can escape the simulation volume, derivative of the potential normal to surface =0) where there are no electrodes and with fixed potential at the place of the electrodes. This is commonly used set of boundary conditions in almost all simulators including TCAD.
//calculation of the fields, weighting and electric
det.CalField(0);
det.CalField(1);
det.SetEntryPoint(500,1,0.5);
det.SetExitPoint(500,50,0.5); //Does this always have to be a straight line?
//--->>> no, not at all, this is most commonly used distribution, but you can design any deposition you like.
// so, photo-electron, e.g. I use short line in chosen direction, but you can use any pattern you like.
// Absorption of visible light in silicon e.g. uses exponential decay in intensity.
det.SetDriftHisto(10e-9); //What does this parameter do?
// --->>> this sets the range of current histogram - now I changed it to 0-5ns
det.SetPrecision(1e-10); //What does the precision control in calculating the fields and the MIP?
// this is the precision of tracking in terms of time
det.diff=1; //our diff=0
// --->>>diffusion on = 1, diffusion off=0
det. ShowMipIR(300); //what is the difference between ShowMipIR and MipIR?
// ShowMipIR is for visualisation only, while MipIR does proper calculation of the current.
TCanvas Show;
Show.Divide(2,2);
Show.cd(1);
// Draw electric potential [V]
det.Draw("EP").Draw("COLZ");
Show.cd(2);
// Draw weighting potential (no units)
det.Draw("WP").Draw("COLZ");
Show.cd(3);
// Draw absolute value of electric field [V/um]
det.Draw("EF").Draw("COLZ");
Show.cd(4);
// Draw material (red = air, white=silicon, violet=electrode Al, Blue=oxide);
det.Draw("M").Draw("COLZ");
// SIMULATION OF INDUCED CURRENT ON SIGNAL STRIP FOR HIT STRIP
TCanvas Drift;
Drift.Divide(2,3);
Drift.cd(1);
// Draw mip track
det.ShowMipIR(20); // B=0; 30 e-h pair buckets along the track generated
det.diff=1; // diffusion is on
Drift.cd(2);
det.MipIR(50); //simulation of drift for 50 buckets along the particle track
det.sum.DrawCopy(); // total induced current
det.neg.SetLineColor(4); //elecrons are blue
det.pos.SetLineColor(2); // holes are red
det.neg.DrawCopy("SAME");
det.pos.DrawCopy("SAME");
// Draw mip track
// SIMULATION OF INDUCED CURRENT ON SIGNAL STRIP FOR HIT NEIGHBOUR
Drift.cd(3);
det.SetEntryPoint(420,1,0.5);
det.SetExitPoint(420,50,0.5);
det.ShowMipIR(20); // B=0; 30 e-h pair buckets along the track generated
det.diff=1; // diffusion is on
Drift.cd(4);
det.MipIR(50); //simulation of drift for 50 buckets along the particle track
det.sum.DrawCopy(); // total induced current
det.neg.SetLineColor(4); //elecrons are blue
det.pos.SetLineColor(2); // holes are red
det.neg.DrawCopy("SAME");
det.pos.DrawCopy("SAME");
// SIMULATION OF INDUCED CURRENT ON SIGNAL STRIP FOR
det.SetEntryPoint(380,35,0.5);
det.SetExitPoint(400,28,0.5);
Drift.cd(5);
// Draw mip track
det.ShowMipIR(20); // B=0; 30 e-h pair buckets along the track generated
det.diff=1; // diffusion je on
Drift.cd(6);
det.MipIR(50); //simulation of drift for 50 buckets along the particle track
det.sum.DrawCopy(); // total induced current
det.neg.SetLineColor(4); //electrons are blue
det.pos.SetLineColor(2); // holes are red
det.neg.DrawCopy("SAME");
det.pos.DrawCopy("SAME");
// Draw mip track
}