//#include "AthenaKernel/IAtRndmGenSvc.h" #include "CLHEP/Random/RandFlat.h" #include "CLHEP/Random/RandGauss.h" #include "SCT2/MySCTcharge_v2.h" #include ///////////////////////////////////////---------------- MySCTcharge::MySCTcharge(const std::string& name, ISvcLocator* pSvcLocator) : AthAlgorithm(name, pSvcLocator), m_rndmSvc("AtRndmGenSvc",name), m_rndmEngineName("MySCTcharge") // Algorithm(name, pSvcLocator),m_analysisTools( "AnalysisTools", this ) // , m_rndmEngineName(0) { //---------------setting basic parameters--------------------------- declareProperty("EfieldModel", m_model = 2); // model=2 for FEM field model declareProperty("DepletionVoltage_VD", m_VD = 70.); // [Volt] declareProperty("BiasVoltage_VB", m_VB = 150.); // [Volt] declareProperty("MagneticField_B", m_B = -2.0); // [Tesla] declareProperty("Temperature_T", m_T = 273.15); declareProperty("TransportTimeStep", m_transportTimeStep = 0.25 ); declareProperty("TransportTimeMax", m_transportTimeMax = 25.0 ); declareProperty("X0", m_x0 = 5.0) ; // [micron] declareProperty("Y0", m_y0 = 20.0) ; // [micron] declareProperty("CoutLevel", m_coutLevel = 0); // specify printout level //------------------usually fixed------------------------------------- declareProperty("BulkDepth", m_bulk_depth = 0.0285); // in [cm] declareProperty("StripPitch", m_strip_pitch = 0.0080); // in [cm] } /////////////////////////////////////////////////////////////////////////////// MySCTcharge::~MySCTcharge() {} ////////////////////////////////////////////////////////////////////////////// StatusCode MySCTcharge::initialize() { //////////////////////////////////////////////////////////// std::cout<<"================ input parameters=================="<= 100) break; double response = Amp_response(timeAmp) * delta_q; double crosstalk = Amp_crosstalk(timeAmp) * delta_q; Pulse[istrip][itime] += response; if( istrip > 0) Pulse[istrip-1][itime] += crosstalk; if( istrip < 3) Pulse[istrip+1][itime] += crosstalk; } } } // print out Pulse std::cout<< std::setprecision(4)<(" <(" < m_bulk_depth) return 0; double xc = m_strip_pitch * (istrip + 0.5); double dx = fabs( x-xc ); int ix = int( dx / deltax ); if ( ix > 80 ) return 0.; int iy = int( y / deltay ); double fx = (dx - ix*deltax) / deltax; double fy = ( y - iy*deltay) / deltay; int ix1 = ix + 1; int iy1 = iy + 1; double P = m_PotentialValue[ix][iy] *(1.-fx)*(1.-fy) + m_PotentialValue[ix1][iy] *fx*(1.-fy) + m_PotentialValue[ix][iy1] *(1.-fx)*fy + m_PotentialValue[ix1][iy1] *fx*fy ; // cout <<"x,y,iy="< xhalfpitch ) Ex = -Ex; Ey = Ey00*(1.-fx)*(1.-fy) + Ey10*fx*(1.-fy) + Ey01*(1.-fx)*fy + Ey11*fx*fy ; return; } //---------- case for uniform electriv field ------------------------ if( m_model ==0 ) { Ey = m_VB / m_depletion_depth ; return; } //---------- case for flat diode model ------------------------------ if(m_model==1) { if(m_VB > m_VD) Ey = (m_VB+m_VD)/m_depletion_depth - 2.*m_VD*(m_bulk_depth-y)/(m_bulk_depth*m_bulk_depth); else { double Emax = 2.* m_depletion_depth * m_VD / (m_bulk_depth*m_bulk_depth); Ey = Emax*(1-(m_bulk_depth-y)/m_depletion_depth); } return; } return; } //------------------------------------------------------------ // initialization of e/h transport programme //----------------------------------------------------------- void MySCTcharge::initTransport() { //------------------------ initialize subfunctions ------------ init_mud_h(m_T) ; init_mud_e(m_T) ; initExEyArray(); initPotentialValue(); //---------------------------------------------------------------- m_kB = 1.38E-23; // [m^2*kg/s^2/K] m_e = 1.602E-19; // [Coulomb] //------------ find delepletion deph for model=0 and 1 ------------- std::cout<<" model= "<< m_model<<" VB= "<< m_VB <<" B= "<< m_B << std::endl; m_depletion_depth = m_bulk_depth; if (m_VB < m_VD) m_depletion_depth = sqrt(m_VB/m_VD) * m_bulk_depth; // ----------- find for the case of model = 2---------------- if (m_model == 2) { double Ex, Ey; for ( double y = 0.; y < 0.0285 ; y += 0.00025 ) { EField(0., y, Ex, Ey); if ( Ey > 0.1 ) continue; m_depletion_depth = m_bulk_depth - y; } } m_y_origin_min = m_bulk_depth - m_depletion_depth; std::cout<<"------ initialization of e-h transport ------"<