- Timestamp:
- Feb 23, 2022, 4:24:07 PM (3 years ago)
- Branches:
- master
- Children:
- 3a105e5
- Parents:
- dd263e4 (diff), 00b14d5 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - git-author:
- Michele Selvaggi <michele.selvaggi@…> (02/23/22 16:24:07)
- git-committer:
- GitHub <noreply@…> (02/23/22 16:24:07)
- Location:
- external/TrackCovariance
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
external/TrackCovariance/ObsTrk.cc
rdd263e4 r56fb0be 74 74 fCovILC.ResizeTo(5, 5); 75 75 fGenPar = XPtoPar(fGenX, fGenP, Q); 76 fGenParMm = ParToMm(fGenPar); 76 77 fGenParACTS = ParToACTS(fGenPar); 77 78 fGenParILC = ParToILC(fGenPar); 78 79 // 79 80 fObsPar = GenToObsPar(fGenPar); 81 fObsParMm = ParToMm(fObsPar); 80 82 fObsParACTS = ParToACTS(fObsPar); 81 83 fObsParILC = ParToILC(fObsPar); … … 83 85 fObsP = ParToP(fObsPar); 84 86 fObsQ = ParToQ(fObsPar); 87 fCovMm = CovToMm(fCov); 85 88 fCovACTS = CovToACTS(fObsPar, fCov); 86 89 fCovILC = CovToILC(fCov); … … 131 134 Double_t ZinNeg = fG->GetZminNeg(); 132 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); 133 140 if (inside) 134 141 { … … 144 151 //std::cout<<"ObsTrk:: outside: x= "<<fGenX(0)<<", y= "<<fGenX(1) 145 152 // <<", z= "<<fGenX(2)<<std::endl; 146 SolTrack* trk = new SolTrack(fGenX, fGenP, fG);147 153 Bool_t Res = kTRUE; Bool_t MS = kTRUE; 148 154 trk->CovCalc(Res, MS); // Calculate covariance matrix 149 Cov = trk->Cov(); // Track covariance150 delete trk;151 }155 Cov = trk->Cov(); 156 } // Track covariance 157 delete trk; 152 158 // 153 159 fCov = Cov; -
external/TrackCovariance/ObsTrk.h
rdd263e4 r56fb0be 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
rdd263e4 r56fb0be 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
rdd263e4 r56fb0be 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 -
external/TrackCovariance/VertexFit.cc
rdd263e4 r56fb0be 17 17 { 18 18 fNtr = 0; 19 fR old= -1.0;19 fRstart = -1.0; 20 20 fVtxDone = kFALSE; 21 21 fVtxCst = kFALSE; … … 31 31 { 32 32 fNtr = Ntr; 33 fR old= -1.0;33 fRstart = -1.0; 34 34 fVtxDone = kFALSE; 35 35 fVtxCst = kFALSE; … … 55 55 { 56 56 fNtr = Ntr; 57 fR old= -1.0;57 fRstart = -1.0; 58 58 fVtxDone = kFALSE; 59 59 fVtxCst = kFALSE; … … 220 220 std::vector<TVectorD*> x0i; // Tracks at ma 221 221 std::vector<TVectorD*> ni; // Track derivative wrt phase 222 std::vector<TMatrixDSym*> Ci; // Position error matrix at fixed phase222 std::vector<TMatrixDSym*> Ci; // Position error matrix at fixed phase 223 223 std::vector<TVectorD*> wi; // Ci*ni 224 std::vector<Double_t> s_in; // Starting phase 225 // 226 // 224 227 // 225 228 // Track loop 226 229 for (Int_t i = 0; i < fNtr; i++) 227 230 { 228 Double_t s = 0.;229 231 TVectorD par = *fPar[i]; 230 232 TMatrixDSym Cov = *fCov[i]; 231 x0i.push_back(new TVectorD(Fill_x0(par))); 233 Double_t s = 0.; 234 // Case when starting radius is provided 235 if(fRstart > TMath::Abs(par(0))){ 236 s = 2.*TMath::ASin(par(2)*TMath::Sqrt((fRstart*fRstart-par(0)*par(0))/(1.+2.*par(2)*par(0)))); 237 } 238 // 239 x0i.push_back(new TVectorD(Fill_x(par, s))); 232 240 ni.push_back(new TVectorD(derXds(par, s))); 233 241 TMatrixD A = derXdPar(par, s); … … 235 243 TMatrixDSym Cinv = RegInv(*Ci[i]); 236 244 wi.push_back(new TVectorD(Cinv * (*ni[i]))); 245 s_in.push_back(s); 237 246 } 238 247 //std::cout << "Vtx init completed. fNtr = "<<fNtr << std::endl; … … 262 271 for (Int_t i = 0; i < fNtr; i++){ 263 272 Double_t si = Dot(*wi[i], fXv - (*x0i[i])) / Ci[i]->Similarity(*wi[i]); 264 ffi.push_back(si );273 ffi.push_back(si+s_in[i]); 265 274 //TVectorD xvi = Fill_x(*fPar[i],si); 266 275 //std::cout << "Fast vertex "<<i<<": xvi = "<<xvi(0)<<", "<<xvi(1)<<", "<<xvi(2) … … 280 289 Ci.clear(); 281 290 wi.clear(); 291 s_in.clear(); 282 292 } 283 293 // … … 402 412 // 403 413 fVtxDone = kTRUE; // Set fit completion flag 404 fRold= TMath::Sqrt(fXv(0)*fXv(0) + fXv(1)*fXv(1)); // Store fit414 //fRstart = TMath::Sqrt(fXv(0)*fXv(0) + fXv(1)*fXv(1)); // Store fit 405 415 //std::cout << "Found vertex " << fXv(0) << ", " << fXv(1) << ", " << fXv(2) 406 416 // << ", after "<<Ntry<<" iterations"<<std::endl; -
external/TrackCovariance/VertexFit.h
rdd263e4 r56fb0be 36 36 // Results 37 37 Bool_t fVtxDone; // Flag vertex fit completed 38 Double_t fR old; // Current value of vertex radius38 Double_t fRstart; // Starting value of vertex radius (0 = none) 39 39 TVectorD fXv; // Found vertex 40 40 TMatrixDSym fcovXv; // Vertex covariance … … 83 83 // Handle tracks/constraints 84 84 void AddVtxConstraint(TVectorD xv, TMatrixDSym cov); // Add gaussian vertex constraint 85 void AddTrk(TVectorD *par, TMatrixDSym *Cov); // Add track to input list 86 void RemoveTrk(Int_t iTrk); // Remove iTrk track 85 void AddTrk(TVectorD *par, TMatrixDSym *Cov); // Add track to input list 86 void RemoveTrk(Int_t iTrk); // Remove iTrk track 87 void SetStartR(Double_t R) { fRstart = R; }; // Set starting radius 87 88 // 88 89 };
Note:
See TracChangeset
for help on using the changeset viewer.