StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StiChairs.cxx
1 #include "TMath.h"
2 #include "StarChairDefs.h"
3 #include "St_db_Maker/St_db_Maker.h"
4 #include "StDetectorDbMaker/StiHitErrorCalculator.h"
5 ClassImp(StiHitErrorCalculator);
6 //________________________________________________________________________________
7 void StiHitErrorCalculator::calculateError(Double_t _z, Double_t _eta, Double_t _tanl, Double_t &ecross, Double_t &edip, Double_t fudgeCactor) const {
8  static const Double_t tenMicrons = 1e-3;
9  static const Double_t min2Err = tenMicrons*tenMicrons;
10  static const Double_t max2Err = 1.;
11  static const Double_t scale = 1.;
12  const Double_t *Coeff = ((StiHitErrorCalculator *) this)->coeff();
13 #if 0
14  Double_t dz = (200.-TMath::Abs(_z+100))/100.; // Local z
15 #else
16  Double_t dz = (200.-TMath::Abs(_z))/100.; // Global z
17 #endif
18  if (dz < 0) dz = 0;
19 #if 0
20  Int_t sec = TMath::Nint(_eta*TMath::RadToDeg()/30);
21  Double_t Phi = _eta - TMath::DegToRad()*30*sec;
22 #else
23  Double_t Phi = _eta;
24 #endif
25  Double_t cosCA = TMath::Cos(Phi);
26  Double_t sinCA = TMath::Sin(Phi);
27  if (TMath::Abs(cosCA)<0.01) cosCA=0.01;
28  Double_t tanCA = sinCA/cosCA;
29  ecross=scale*fudgeCactor*fudgeCactor*(Coeff[0]+Coeff[1]*dz/(cosCA*cosCA) +Coeff[2]*tanCA*tanCA);
30  if (ecross< min2Err) ecross = min2Err;
31  if (ecross> max2Err) ecross = max2Err;
32  Double_t tanDip=_tanl;
33  Double_t cosDipInv2=1+tanDip*tanDip;
34  edip=scale*fudgeCactor*fudgeCactor*(Coeff[3]+Coeff[4]*dz*cosDipInv2+Coeff[5]*tanDip*tanDip);
35  if (edip< min2Err) edip = min2Err;
36  if (edip> max2Err) edip = max2Err;
37 // Temporary hack for Gene. Increase prompt hit errors
38 // if (fabs(_z) >200) {ecross*=10; edip*=10;}
39 
40 
41 }
42 //________________________________________________________________________________
43 #include "StiTrackingParameters.h"
44 ClassImp(StiTrackingParameters)
45 #include "StiDefaultTrackingParameters.h"
46 MakeChairInstance2(TrackingParameters,StiDefaultTrackingParameters,Calibrations/tracker/DefaultTrackingParameters);
47 #include "StiLocalTrackSeedFinderParameters.h"
48 MakeChairInstance2(LocalTrackSeedFinder,StiLocalTrackSeedFinderParameters,Calibrations/tracker/LocalTrackSeedFinder);
49 #include "StiKalmanTrackFitterParameters.h"
50 MakeChairInstance2(KalmanTrackFitterParameters,StiKalmanTrackFitterParameters,Calibrations/tracker/KalmanTrackFitterParameters);
51 #include "StiKalmanTrackFinderParameters.h"
52 MakeChairInstance2(KalmanTrackFinderParameters,StiKalmanTrackFinderParameters,Calibrations/tracker/KalmanTrackFinderParameters);
53 #include "StiTpcHitErrorMDF4.h"
54 //________________________________________________________________________________
55 void StiTpcHitErrorMDF4::convert(Double_t _z, Double_t _eta, Double_t _tanl, Double_t AdcL) {
56  fxx[0] = 1. - TMath::Abs(_z)/207.707; // Z
57  Double_t y = TMath::Tan(_eta);
58  fxx[1] = y*y; // tanP**2
59  fxx[2] = _tanl*_tanl; // tanL**2
60  fxx[3] = AdcL; // AdcL
61 }
62 //________________________________________________________________________________
63 void StiTpcHitErrorMDF4::calculateError(Double_t _z, Double_t _eta, Double_t _tanl,
64  Double_t &ecross, Double_t &edip,
65  Double_t fudgeFactor, Double_t AdcL,
66  Double_t *dZ, Double_t *dX) {
67  static const Double_t tenMicrons = 1e-3;
68  static const Double_t min2Err = tenMicrons*tenMicrons;
69  static const Double_t max2Err = 1.;
70  static const Double_t scale = 1.;
71  convert(_z, _eta, _tanl, AdcL);
72  Double_t dPadSigmaSQ = Eval( 0, fxx);
73  Double_t dTimeSigmaSQ = Eval( 2, fxx);
74  ecross = scale*padPitch() *padPitch() *dPadSigmaSQ * fudgeFactor;
75  edip = scale*timePitch()*timePitch()*dTimeSigmaSQ * fudgeFactor;
76  Int_t fail = 0;
77  if (ecross< min2Err) {ecross = min2Err; fail++;}
78  if (ecross> max2Err) {ecross = max2Err; fail++;}
79  if (edip< min2Err) {edip = min2Err; fail++;}
80  if (edip> max2Err) {edip = max2Err; fail++;}
81  if (dZ) {
82  if (fail) *dZ = 0;
83  else {
84  Double_t dTime = Eval( 3, fxx);
85  *dZ = - timePitch()*dTime * TMath::Sign(1., _z);
86  }
87  }
88  if (dX) {
89  if (fail) *dX = 0;
90  else {
91  Double_t dPad = Eval( 1, fxx);
92  *dX = - padPitch()*dPad;
93  }
94  }
95 }
96 MakeChairInstance2(MDFCorrection4,StiTpcInnerHitErrorMDF4,Calibrations/tracker/TpcInnerHitErrorMDF4);
97 MakeChairInstance2(MDFCorrection4,StiTpcOuterHitErrorMDF4,Calibrations/tracker/TpcOuterHitErrorMDF4);
virtual void calculateError(Double_t _z, Double_t _eta, Double_t _tanl, Double_t &ecross, Double_t &edip, Double_t fudgeFactor=1) const
coeff[6] = 0:intrinsicY 1: driftY 2: crossY 3:intrinsicZ 4: driftZ 5: crossZ
Definition: StiChairs.cxx:7