Changeset 00b14d5 in git for external/TrackCovariance
- Timestamp:
- Feb 22, 2022, 2:56:43 PM (3 years ago)
- Branches:
- master
- Children:
- 56fb0be
- Parents:
- 5c03893
- Location:
- external/TrackCovariance
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
external/TrackCovariance/ObsTrk.cc
r5c03893 r00b14d5 134 134 Double_t ZinNeg = fG->GetZminNeg(); 135 135 Bool_t inside = TrkUtil::IsInside(fGenX, Rin, ZinNeg, ZinPos); // Check if in inner box 136 SolTrack* trk = new SolTrack(fGenX, fGenP, fG); 137 Double_t Xfirst, Yfirst, Zfirst; 138 Int_t iLay = trk->FirstHit(Xfirst, Yfirst, Zfirst); 139 TVector3 fXfirst(Xfirst, Yfirst, Zfirst); 136 140 if (inside) 137 141 { … … 147 151 //std::cout<<"ObsTrk:: outside: x= "<<fGenX(0)<<", y= "<<fGenX(1) 148 152 // <<", z= "<<fGenX(2)<<std::endl; 149 SolTrack* trk = new SolTrack(fGenX, fGenP, fG);150 153 Bool_t Res = kTRUE; Bool_t MS = kTRUE; 151 154 trk->CovCalc(Res, MS); // Calculate covariance matrix 152 Cov = trk->Cov(); // Track covariance153 delete trk;154 }155 Cov = trk->Cov(); 156 } // Track covariance 157 delete trk; 155 158 // 156 159 fCov = Cov; -
external/TrackCovariance/ObsTrk.h
r5c03893 r00b14d5 46 46 TMatrixDSym fCovILC; // Covariance of track parameters in ILC format 47 47 // (d0, phi0, w, z0, tan(lambda)) 48 TVector3 fXfirst; // x,y,z of first track hit 48 49 // 49 50 // Service routines … … 89 90 TMatrixDSym GetCovMm() { return fCov; } // in mm 90 91 TMatrixDSym GetCovACTS(){ return fCovACTS; } 91 TMatrixDSym GetCovILC(){ return fCovILC; } 92 // 92 TMatrixDSym GetCovILC() { return fCovILC; } 93 // First hit 94 TVector3 GetFirstHit() { return fXfirst; } 93 95 }; 94 96 -
external/TrackCovariance/SolTrack.cc
r5c03893 r00b14d5 232 232 // 233 233 return kmh; 234 } 235 // 236 Int_t SolTrack::FirstHit(Double_t &Xfirst, Double_t &Yfirst, Double_t &Zfirst) 237 { 238 Int_t iFirst = -1; 239 Int_t iFirstLay = -1; // Default return with no hits 240 Xfirst = 0.; 241 Yfirst = 0.; 242 Zfirst = 0.; 243 Int_t Nmh = nmHit(); // # measurement hits 244 if(Nmh > 0){ 245 Int_t *ih = new Int_t [Nmh]; 246 Double_t *Xh = new Double_t[Nmh]; 247 Double_t *Yh = new Double_t[Nmh]; 248 Double_t *Zh = new Double_t[Nmh]; 249 Double_t *dh = new Double_t[Nmh]; 250 // 251 Int_t n = HitListXYZ(ih, Xh, Yh, Zh); 252 // 253 for(Int_t i=0; i<Nmh; i++){ 254 Double_t rr = TMath::Sqrt(Xh[i]*Xh[i]+Yh[i]*Yh[i]); // Hit radius 255 dh[i] = TMath::ASin(C() * TMath::Sqrt((rr * rr - D() * D()) / (1. + 2 * C() * D()))) / C(); // Arc length traveled 256 } 257 // 258 Int_t *hord = new Int_t[Nmh]; // hit order by increasing arc length 259 TMath::Sort(Nmh, dh, hord, kFALSE); // Order by increasing arc length 260 iFirst = hord[0]; // First hit pointer 261 Xfirst = Xh[iFirst]; 262 Yfirst = Yh[iFirst]; 263 Zfirst = Zh[iFirst]; 264 iFirstLay = ih[iFirst]; 265 // 266 // Clean 267 delete [] ih; 268 delete [] Xh; 269 delete [] Yh; 270 delete [] Zh; 271 delete [] dh; 272 delete [] hord; 273 } 274 // 275 return iFirstLay; // Return first hit layer number 234 276 } 235 277 // -
external/TrackCovariance/SolTrack.h
r5c03893 r00b14d5 73 73 Int_t HitList(Int_t *&ihh, Double_t *&rhh, Double_t *&zhh); 74 74 Int_t HitListXYZ(Int_t *&ihh, Double_t *&Xh, Double_t *&Yh, Double_t *&Zh); 75 Int_t FirstHit(Double_t &Xfirst, Double_t &Yfirst, Double_t &Zfirst); // First hit position 75 76 // 76 77 // Track graph
Note:
See TracChangeset
for help on using the changeset viewer.