BOSS 7.0.4
BESIII Offline Software System
Loading...
Searching...
No Matches
BesMdcCalTransfer.cc
Go to the documentation of this file.
1//---------------------------------------------------------------------------//
2// BOOST --- BESIII Object_Oriented Simulation Tool //
3//---------------------------------------------------------------------------//
4//Description:
5//Author: Yuan Ye([email protected])
6//Created: Oct.26, 2004
7//Modified:
8//Comment:
9//---------------------------------------------------------------------------//
10
11#include "BesMdcCalTransfer.hh"
12#include "G4ios.hh"
13#include "GaudiKernel/Bootstrap.h"
14#include "GaudiKernel/IService.h"
15#include "GaudiKernel/ISvcLocator.h"
16
18 StatusCode sc= Gaudi::svcLocator()->service("MdcCalibFunSvc",mdcCalFunSvc);
19 if (!sc.isSuccess())
20 std::cout <<" MdcCal::Could not open Cal Service"<<std::endl;
21}
22
24
26 layerId = hit->GetLayerNo();
27 cellId = hit->GetCellNo();
28 driftD = hit->GetDriftD();
29 edep = hit->GetEdep();
30 theta = hit->GetTheta();
31 enterAngle = hit->GetEnterAngle();
32 posFlag = hit->GetPosFlag();
33 z = hit->GetPos().z();
34}
35
36void BesMdcCalTransfer::GetSigma(double& sigma1, double& sigma2,double& f){
37 sigma1 = mdcCalFunSvc->getSigma1(layerId, posFlag, driftD,
38 enterAngle, theta, z, edep);
39 sigma2 = mdcCalFunSvc->getSigma2(layerId, posFlag, driftD,
40 enterAngle, theta, z, edep);
41 f = mdcCalFunSvc->getF(layerId, posFlag, driftD,
42 enterAngle, theta, z, edep);
43
44 /*
45 if(layerId<8){
46 if(driftD<0.5){
47 sigma1=0.112784; sigma2=0.229274; f=0.666;
48 }else if(driftD<1.){
49 sigma1=0.103123; sigma2=0.269797; f=0.934;
50 }else if(driftD<1.5){
51 sigma1=0.08276; sigma2=0.17493; f=0.89;
52 }else if(driftD<2.){
53 sigma1=0.070109; sigma2=0.149859; f=0.89;
54 }else if(driftD<2.5){
55 sigma1=0.064453; sigma2=0.130149; f=0.886;
56 }else if(driftD<3.){
57 sigma1=0.062383; sigma2=0.138806; f=0.942;
58 }else if(driftD<3.5){
59 sigma1=0.061873; sigma2=0.145696; f=0.946;
60 }else if(driftD<4.){
61 sigma1=0.061236; sigma2=0.119584; f=0.891;
62 }else if(driftD<4.5){
63 sigma1=0.066292; sigma2=0.148426; f=0.917;
64 }else if(driftD<5.){
65 sigma1=0.078074; sigma2=0.188148; f=0.911;
66 }else if(driftD<5.5){
67 sigma1=0.088657; sigma2=0.27548; f=0.838;
68 }else{
69 sigma1=0.093089; sigma2=0.115556; f=0.367;
70 }
71 }else{
72 if(driftD<0.5){
73 sigma1=0.112433; sigma2=0.327548; f=0.645;
74 }else if(driftD<1.){
75 sigma1=0.096703; sigma2=0.305206; f=0.897;
76 }else if(driftD<1.5){
77 sigma1=0.082518; sigma2=0.248913; f= 0.934;
78 }else if(driftD<2.){
79 sigma1=0.072501; sigma2=0.153868; f= 0.899;
80 }else if(driftD<2.5){
81 sigma1= 0.065535; sigma2=0.14246; f=0.914;
82 }else if(driftD<3.){
83 sigma1=0.060497; sigma2=0.126489; f=0.918;
84 }else if(driftD<3.5){
85 sigma1=0.057643; sigma2= 0.112927; f=0.892;
86 }else if(driftD<4.){
87 sigma1=0.055266; sigma2=0.094833; f=0.887;
88 }else if(driftD<4.5){
89 sigma1=0.056263; sigma2=0.124419; f= 0.932;
90 }else if(driftD<5.){
91 sigma1=0.056599; sigma2=0.124248; f=0.923;
92 }else if(driftD<5.5){
93 sigma1= 0.061377; sigma2=0.146147; f=0.964;
94 }else if(driftD<6.){
95 sigma1=0.063978; sigma2=0.150591; f=0.942;
96 }else if(driftD<6.5){
97 sigma1=0.072951; sigma2=0.15685; f=0.913;
98 }else if(driftD<7.){
99 sigma1=0.085438; sigma2=0.255109; f=0.931;
100 }else if(driftD<7.5){
101 sigma1=0.101635; sigma2=0.315529; f=0.878;
102 }else{
103 sigma1=0.149529; sigma2=0.374697; f=0.89;
104 }
105 }
106 */
107}
108
109double BesMdcCalTransfer::D2T(double driftDNew){
110 double driftT;
111 driftT= mdcCalFunSvc->distToDriftTime(driftDNew, layerId, cellId, posFlag, enterAngle);
112 // driftT = driftD/40.*1000;
113 /*
114 G4double c[8],x1;
115 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;
116 driftT=0.;
117 if(driftD<x1){
118 for(int i=0;i<7;i++){
119 driftT+=c[i]*driftD;
120 }
121 }else{
122 for(int i=0;i<8;i++){
123 driftT+=c[i]*driftD;
124 }
125 }
126 */
127 return driftT;
128}
129
131 return mdcCalFunSvc->getT0(layerId, cellId);
132}
133
135 return mdcCalFunSvc->getTimeWalk(layerId, edep);
136}
137
139 // return mdcCalFunSvc->getEff(layerId, cellId);
140 return 1.;
141}
142
143
double D2T(double driftDNew)
void SetHitPointer(BesMdcHit *hit)
double GetTimeWalk(void)
void GetSigma(double &sigma1, double &sigma2, double &f)
virtual double getF(int layid, int lr, double dist, double entrance=0.0, double tanlam=0.0, double z=0.0, double Q=1000.0) const =0
virtual double getSigma2(int layid, int lr, double dist, double entrance=0.0, double tanlam=0.0, double z=0.0, double Q=1000.0) const =0
virtual double distToDriftTime(double dist, int layid, int cellid, int lr, double entrance=0.0) const =0
virtual double getSigma1(int layid, int lr, double dist, double entrance=0.0, double tanlam=0.0, double z=0.0, double Q=1000.0) const =0
virtual double getT0(int layid, int cellid) const =0
virtual double getTimeWalk(int layid, double Q) const =0
TFile f("ana_bhabha660a_dqa_mcPat_zy_old.root")