/home/bes3soft/bes3soft/Boss/7.0.2/dist/7.0.2/Simulation/BOOST/MdcSim/MdcSim-00-00-73/src/BesMdcCalTransfer.cc

Go to the documentation of this file.
00001 //---------------------------------------------------------------------------//
00002 //      BOOST --- BESIII Object_Oriented Simulation Tool                     //
00003 //---------------------------------------------------------------------------//
00004 //Description:
00005 //Author: Yuan Ye(yuany@mail.ihep.ac.cn)
00006 //Created:  Oct.26, 2004
00007 //Modified:
00008 //Comment:
00009 //---------------------------------------------------------------------------//
00010 
00011 #include "BesMdcCalTransfer.hh"
00012 #include "G4ios.hh"
00013 #include "GaudiKernel/Bootstrap.h"
00014 #include "GaudiKernel/IService.h"
00015 #include "GaudiKernel/ISvcLocator.h"
00016 
00017 BesMdcCalTransfer::BesMdcCalTransfer(){
00018   StatusCode sc= Gaudi::svcLocator()->service("MdcCalibFunSvc",mdcCalFunSvc);
00019   if (!sc.isSuccess())
00020     std::cout <<" MdcCal::Could not open Cal Service"<<std::endl;
00021 }
00022 
00023 BesMdcCalTransfer::~BesMdcCalTransfer(){}
00024 
00025 void BesMdcCalTransfer::SetHitPointer(BesMdcHit* hit){
00026       layerId = hit->GetLayerNo();
00027       cellId = hit->GetCellNo();
00028       driftD = hit->GetDriftD();
00029       edep = hit->GetEdep();
00030       theta = hit->GetTheta();
00031       enterAngle = hit->GetEnterAngle();
00032       posFlag = hit->GetPosFlag();
00033       z = hit->GetPos().z();
00034 }
00035 
00036 void BesMdcCalTransfer::GetSigma(double& sigma1, double& sigma2,double& f){
00037   sigma1 = mdcCalFunSvc->getSigma1(layerId, posFlag, driftD,
00038                                    enterAngle, theta, z, edep);
00039   sigma2 = mdcCalFunSvc->getSigma2(layerId, posFlag, driftD,
00040                                    enterAngle, theta, z, edep);
00041   f = mdcCalFunSvc->getF(layerId, posFlag, driftD,
00042                          enterAngle, theta, z, edep);
00043 
00044  /*
00045   if(layerId<8){
00046     if(driftD<0.5){
00047       sigma1=0.112784;      sigma2=0.229274;      f=0.666;
00048     }else if(driftD<1.){
00049       sigma1=0.103123;      sigma2=0.269797;      f=0.934;
00050     }else if(driftD<1.5){
00051       sigma1=0.08276;        sigma2=0.17493;      f=0.89;
00052     }else if(driftD<2.){
00053       sigma1=0.070109;      sigma2=0.149859;      f=0.89;
00054     }else if(driftD<2.5){
00055       sigma1=0.064453;      sigma2=0.130149;      f=0.886;
00056     }else if(driftD<3.){
00057       sigma1=0.062383;      sigma2=0.138806;      f=0.942;
00058     }else if(driftD<3.5){
00059       sigma1=0.061873;      sigma2=0.145696;      f=0.946;
00060     }else if(driftD<4.){
00061       sigma1=0.061236;      sigma2=0.119584;      f=0.891;
00062     }else if(driftD<4.5){
00063       sigma1=0.066292;      sigma2=0.148426;      f=0.917;
00064     }else if(driftD<5.){
00065       sigma1=0.078074;      sigma2=0.188148;      f=0.911;
00066     }else if(driftD<5.5){
00067       sigma1=0.088657;      sigma2=0.27548;      f=0.838;
00068     }else{
00069       sigma1=0.093089;      sigma2=0.115556;      f=0.367;
00070     }
00071   }else{
00072    if(driftD<0.5){
00073       sigma1=0.112433;      sigma2=0.327548;      f=0.645;
00074     }else if(driftD<1.){
00075       sigma1=0.096703;      sigma2=0.305206;      f=0.897;
00076     }else if(driftD<1.5){
00077       sigma1=0.082518;      sigma2=0.248913;      f= 0.934;
00078     }else if(driftD<2.){
00079       sigma1=0.072501;      sigma2=0.153868;      f= 0.899;
00080     }else if(driftD<2.5){
00081       sigma1= 0.065535;     sigma2=0.14246;       f=0.914;
00082     }else if(driftD<3.){
00083       sigma1=0.060497;      sigma2=0.126489;      f=0.918;
00084     }else if(driftD<3.5){
00085       sigma1=0.057643;      sigma2= 0.112927;     f=0.892;
00086     }else if(driftD<4.){
00087       sigma1=0.055266;      sigma2=0.094833;      f=0.887;
00088     }else if(driftD<4.5){
00089       sigma1=0.056263;      sigma2=0.124419;      f= 0.932;
00090     }else if(driftD<5.){
00091       sigma1=0.056599;      sigma2=0.124248;      f=0.923;
00092     }else if(driftD<5.5){
00093       sigma1= 0.061377;     sigma2=0.146147;      f=0.964;
00094     }else if(driftD<6.){
00095       sigma1=0.063978;      sigma2=0.150591;      f=0.942;
00096     }else if(driftD<6.5){
00097       sigma1=0.072951;      sigma2=0.15685;       f=0.913;
00098     }else if(driftD<7.){
00099       sigma1=0.085438;      sigma2=0.255109;      f=0.931;
00100     }else if(driftD<7.5){
00101       sigma1=0.101635;      sigma2=0.315529;      f=0.878;
00102     }else{
00103       sigma1=0.149529;      sigma2=0.374697;      f=0.89;
00104     }
00105   }
00106   */
00107 }
00108 
00109 double BesMdcCalTransfer::D2T(double driftDNew){
00110   double driftT;
00111   driftT= mdcCalFunSvc->distToDriftTime(driftDNew, layerId, cellId, posFlag, enterAngle);
00112     //  driftT  = driftD/40.*1000;
00113   /*
00114   G4double c[8],x1;
00115   c[0]=0.; c[1]=1.96061432e01.;c[2]=2.31378106.; c[3]=3.59120632e-1; c[0]=0.;c[0]=0.;c[0]=0.;c[0]=0.;x1=5.924711;
00116   driftT=0.;
00117   if(driftD<x1){
00118     for(int i=0;i<7;i++){
00119       driftT+=c[i]*driftD;
00120     }
00121   }else{
00122     for(int i=0;i<8;i++){
00123       driftT+=c[i]*driftD;
00124     }
00125   }
00126   */
00127   return driftT;
00128 }
00129 
00130 double BesMdcCalTransfer::GetT0(){
00131   return mdcCalFunSvc->getT0(layerId, cellId);
00132 }
00133 
00134 double BesMdcCalTransfer::GetTimeWalk(){
00135   return mdcCalFunSvc->getTimeWalk(layerId, edep);
00136 }
00137 
00138 double BesMdcCalTransfer::GetEff(){
00139   //  return mdcCalFunSvc->getEff(layerId, cellId);
00140   return 1.;
00141 }
00142 
00143 

Generated on Tue Nov 29 23:14:26 2016 for BOSS_7.0.2 by  doxygen 1.4.7