Fork me on GitHub

source: git/external/TrackCovariance/VertexFit.h@ db316cd

Last change on this file since db316cd was 53f4746, checked in by Franco BEDESCHI <bed@…>, 4 years ago

Cluster counting example and VertexFit update

  • Property mode set to 100644
File size: 3.2 KB
Line 
1//
2#ifndef G__VERTEXFIT_H
3#define G__VERTEXFIT_H
4//
5#include <TMath.h>
6#include <TVectorD.h>
7#include <TMatrixDSym.h>
8#include "ObsTrk.h"
9#include <vector>
10#include <iostream>
11//
12// Class for vertex fitting
13
14class VertexFit {
15 //
16 // Vertex fitting with track parameters steering
17 // Author: F. Bedeschi, INFN-Pisa, Italy
18 // February 10, 2021
19 //
20private:
21 //
22 // Inputs
23 Int_t fNtr; // Number of tracks
24 std::vector<TVectorD*> fPar; // Input parameter array
25 std::vector<TVectorD*> fParNew; // Updated parameter array
26 std::vector<TMatrixDSym*> fCov; // Input parameter covariances
27 std::vector<TMatrixDSym*> fCovNew; // Updated parameter covariances
28 // Constraints
29 Bool_t fVtxCst; // Vertex constraint flag
30 TVectorD fxCst; // Constraint value
31 TMatrixDSym fCovCst; // Constraint
32 TMatrixDSym fCovCstInv; // Inverse of constraint covariance
33 //
34 // Results
35 Bool_t fVtxDone; // Flag vertex fit completed
36 Double_t fRold; // Current value of vertex radius
37 TVectorD fXv; // Found vertex
38 TMatrixDSym fcovXv; // Vertex covariance
39 Double_t fChi2; // Vertex fit Chi2
40 TVectorD fChi2List; // List of Chi2 contributions
41 //
42 // Work arrays
43 std::vector<Double_t> ffi; // Fit phases
44 std::vector<TVectorD*> fx0i; // Track expansion points
45 std::vector<TVectorD*> fai; // dx/dphi
46 std::vector<TVectorD*> fdi; // x-shift
47 std::vector<Double_t> fa2i; // a'Wa
48 std::vector<TMatrixD*> fAti; // A transposed
49 std::vector<TMatrixDSym*> fDi; // W-WBW
50 std::vector<TMatrixDSym*> fWi; // (ACA')^-1
51 std::vector<TMatrixDSym*> fWinvi; // ACA'
52 //
53 // Service routines
54 //void InitWrkArrays(); // Initializations
55 void ResetWrkArrays(); // Clear work arrays
56 Double_t StartRadius(); // Starting vertex radius determination
57 Double_t FastRv(TVectorD p1, TVectorD p2); // Fast vertex radius determination
58 TMatrixDSym RegInv(TMatrixDSym& Smat0); // Regularized 3D matrix inversion
59 TMatrixD Fill_A(TVectorD par, Double_t phi); // Derivative of track position wrt track parameters
60 TVectorD Fill_a(TVectorD par, Double_t phi); // Derivative of track position wrt track phase
61 TVectorD Fill_x0(TVectorD par); // Track position at dma to z-axis
62 TVectorD Fill_x(TVectorD par, Double_t phi); // Track position at given phase
63 void UpdateTrkArrays(Int_t i); // Fill track realted arrays
64 void VertexFitter(); // Vertex finder routine
65public:
66 //
67 // Constructors
68 VertexFit(); // Initialize waiting for tracks
69 VertexFit(Int_t Ntr, ObsTrk** tracks); // Initialize with ObsTrk tracks
70 VertexFit(Int_t Ntr, TVectorD** trkPar, TMatrixDSym** trkCov); // Initialize with parameters and covariances
71 // Destructor
72 ~VertexFit();
73 //
74 // Accessors also trigger calculations when needed
75 Int_t GetNtrk() { return fNtr; };
76 TVectorD GetVtx();
77 TMatrixDSym GetVtxCov();
78 Double_t GetVtxChi2();
79 TVectorD GetVtxChi2List();
80 //
81 // Handle tracks/constraints
82 void AddVtxConstraint(TVectorD xv, TMatrixDSym cov); // Add gaussian vertex constraint
83 void AddTrk(TVectorD *par, TMatrixDSym *Cov); // Add track to input list
84 void RemoveTrk(Int_t iTrk); // Remove iTrk track
85 //
86};
87
88#endif
Note: See TracBrowser for help on using the repository browser.