@@ -39,23 +39,17 @@ class GPUTRDRecoParam
3939
4040#if !defined(GPUCA_GPUCODE_DEVICE)
4141 // / Recalculate tracklet covariance based on phi angle of related track
42- GPUd () void recalcTrkltCov(const float tilt, const float snp, const float rowSize, std::array<float , 3 >& cov) const
42+ GPUd () void recalcTrkltCov(const float tilt, const float snp, const float rowSize, std::array<float , 3 >& cov, const float pull = 0 ., const int occupancy = 0 ) const
4343 {
44- recalcTrkltCov (tilt, snp, rowSize, cov.data ());
44+ recalcTrkltCov (tilt, snp, rowSize, cov.data (), pull, occupancy );
4545 }
4646#endif
47- GPUd () void recalcTrkltCov (const float tilt, const float snp, const float rowSize, float * cov) const ;
48-
49- // / Get tracklet r-phi resolution for given phi angle
50- // / Resolution depends on the track angle sin(phi) = snp and is approximated by the formula
51- // / sigma_y(snp) = sqrt(a^2 + c^2 * (snp - b)^2)
52- // / more details are given in http://cds.cern.ch/record/2724259 in section 5.3.3
53- // / \param phi angle of related track
54- // / \return sigma_y^2 of tracklet
55- GPUd () float getRPhiRes (float snp) const { return (mRPhiA2 + mRPhiC2 * (snp - mLorentzAngle ) * (snp - mLorentzAngle )); }
56- GPUd () float getDyRes (float snp) const { return mDyA2 + mDyC2 * (snp - mLorentzAngle ) * (snp - mLorentzAngle ); } // a^2 + c^2 * (snp - b)^2
57- GPUd () float convertAngleToDy (float snp) const { return 3 .f * snp / CAMath::Sqrt (1 - snp * snp); } // when calibrated, sin(phi) = (dy / xDrift) / sqrt(1+(dy/xDrift)^2) works well
58- GPUd () float getCorrYDy (float snp) const { return mCorrYDyA + mCorrYDyC * (snp - mLorentzAngle ) * (snp - mLorentzAngle ); } // a + c * (snp - b)^2
47+ GPUd () void recalcTrkltCov (const float tilt, const float snp, const float rowSize, float * cov, const float pull = 0 ., const int occupancy = 0 ) const ;
48+
49+ GPUd () float getRPhiRes (float snp, float pull = 0 .f, int occupancy = 0 ) const ;
50+ GPUd () float getDyRes (float snp, int occupancy = 0 ) const { return mDyA2 + mDyC2 * (snp - mLorentzAngle ) * (snp - mLorentzAngle ) + mOccDyA * occupancy; } // a^2 + c^2 * (snp - b)^2
51+ GPUd () float convertAngleToDy (float snp) const { return 3 .f * snp / CAMath::Sqrt (1 - snp * snp); } // when calibrated, sin(phi) = (dy / xDrift) / sqrt(1+(dy/xDrift)^2) works well
52+ GPUd () float getCorrYDy () const { return mCorrYDy ; }
5953 GPUd () float getPileUpProbTracklet (int nBC, bool withChargeInfo, bool Q0 = true , bool Q1 = true ) const ;
6054 GPUd () float getPileUpProbTrack (int nBC, std::array<int , 6 > Q0 , std::array<int , 6 > Q1 ) const ;
6155
@@ -70,14 +64,21 @@ class GPUTRDRecoParam
7064 // tracklet error parameterization depends on the magnetic field
7165 float mLorentzAngle {0 .f };
7266 // rphi
73- float mRPhiA2 {1 .f }; // /< parameterization for tracklet position resolution
74- float mRPhiC2 {0 .f }; // /< parameterization for tracklet position resolution
67+ float mRPhiA {1 .f }; // /< parameterization for tracklet position resolution
68+ float mRPhiATgp {1 .f }; // /< parameterization for tracklet position resolution
69+ float mRPhiC2 {0 .f }; // /< parameterization for tracklet position resolution
7570 // angle
7671 float mDyA2 {1 .225e-3f }; // /< parameterization for tracklet angular resolution
7772 float mDyC2 {0 .f }; // /< parameterization for tracklet angular resolution
78- // correlation coefficient between y residual and dy residual
79- float mCorrYDyA {0 .f };
80- float mCorrYDyC {0 .f };
73+ // variation in y when dy variates by one sigma (= cov / sigma_dy = corr * sigma_y) (valid within 2sigma of dy)
74+ float mCorrYDy {0 .13f };
75+ // error parametrization vs angular pull (pol2)
76+ float mPullA {6 .8e-3f };
77+ float mPullB {0 .049f };
78+ // error parametrization of y position vs occupancy defined as ntracklets within chamber (prop to sqrt(occupancy))
79+ float mOccA {3 .3e-4f };
80+ // error parametrization for dy vs occupancy defined as ntracklets within chamber (prop to sqrt(occupancy))
81+ float mOccDyA {2 .5e-4f };
8182
8283 float mZCorrCoefNRC {1 .4f }; // /< tracklet z-position depends linearly on track dip angle
8384
@@ -106,6 +107,26 @@ class GPUTRDRecoParam
106107 ClassDefNV (GPUTRDRecoParam, 4 );
107108};
108109
110+ // / Get tracklet r-phi resolution for given phi angle
111+ // / Resolution depends on the track angle sin(phi) = snp and is approximated by the formula
112+ // / sigma_y(snp) = sqrt(a^2 + c^2 * (snp - b)^2)
113+ // / more details are given in http://cds.cern.ch/record/2724259 in section 5.3.3
114+ // / \param phi angle of related track
115+ // / \return sigma_y^2 of tracklet
116+ // / also depend on absolute pull and on chamber occupancy
117+ GPUdi () float GPUTRDRecoParam::getRPhiRes (float snp, float pull, int occupancy) const {
118+ // flat uncertainty + radial-alignment uncertainty depending on tan(phi)
119+ float tgp = (CAMath::Abs (snp) < 0 .99999f ) ? CAMath::Abs (snp) / CAMath::Sqrt (1 - snp * snp) : 1e6 ;
120+ float resIdeal = mRPhiA + mRPhiATgp * tgp;
121+ if (pull > 10 ) {
122+ // parametrization does not really work well for such large pull values
123+ pull = 10 .f ;
124+ }
125+ float resPull = mPullA * pull * pull + mPullB * pull; // parametrization as pol2 summed in quadrature
126+ float resOccupancy = mOccA * occupancy; // parametrization as sqrt() summed in quadrature
127+ return (resIdeal * resIdeal + mRPhiC2 * (snp - mLorentzAngle ) * (snp - mLorentzAngle ) + resPull * resPull + resOccupancy);
128+ }
129+
109130GPUdi () float GPUTRDRecoParam::getPileUpProbTracklet (int nBC, bool withChargeInfo, bool Q0 , bool Q1 ) const
110131{
111132 // get the probability that the tracklet with charges Q0 and Q1 belongs to a given BC, with a (signed) distance nBC from the TRD-triggered BC
0 commit comments