1 |
paus |
1.1 |
#include "MitEdm/VertexFitInterface/interface/MvfInterface.h"
|
2 |
bendavid |
1.2 |
#include "MitEdm/DataFormats/interface/Types.h"
|
3 |
|
|
#include "TMath.h"
|
4 |
|
|
#include "TMatrixDSym.h"
|
5 |
|
|
#include "TVectorD.h"
|
6 |
paus |
1.1 |
|
7 |
paus |
1.4 |
using namespace TMath;
|
8 |
paus |
1.1 |
using namespace reco;
|
9 |
|
|
using namespace mitedm;
|
10 |
|
|
|
11 |
|
|
const int cms2GenMap[5] = { 1, 0, 4, 3, 2 }; // parameter map: transfer CMS to generic coordinates
|
12 |
|
|
|
13 |
|
|
MvfInterface::MvfInterface(MultiVertexFitter *fitter) :
|
14 |
|
|
_mvf (fitter),
|
15 |
|
|
_fCurv0(0.5 * 0.0029979),
|
16 |
|
|
_fCurv (_fCurv0 * fitter->bField())
|
17 |
|
|
{
|
18 |
|
|
}
|
19 |
|
|
|
20 |
|
|
bool MvfInterface::addTrack(const reco::Track* trk, const int id, const float mass,
|
21 |
|
|
MultiVertexFitter::vertexNumber jv)
|
22 |
|
|
{
|
23 |
|
|
// Fill the parameters and matrix compliant with the generic fitter this involves remapping and a
|
24 |
|
|
// simple parameter transformation
|
25 |
bendavid |
1.2 |
TVectorD params(5); // track parameters
|
26 |
paus |
1.4 |
FiveMatrix dPidPj;
|
27 |
bendavid |
1.2 |
TMatrixDSym covmat(5);
|
28 |
|
|
|
29 |
paus |
1.4 |
params[0] = 1.0/Tan(PiOver2() - trk->lambda()); //cotTheta
|
30 |
|
|
params[1] = _fCurv*trk->qoverp()/Cos(trk->lambda()); //curvature
|
31 |
|
|
params[2] = trk->dsz()/Cos(trk->lambda()); //z0
|
32 |
bendavid |
1.3 |
params[3] = -trk->dxy(); //d0
|
33 |
|
|
params[4] = trk->phi(); //phi0
|
34 |
bendavid |
1.2 |
|
35 |
paus |
1.4 |
// dPidPj(i,j) gives partial dx_i/dy_j where x are the new parameters and y are the old ones
|
36 |
|
|
dPidPj(0,0) = 0;
|
37 |
|
|
dPidPj(0,1) = -1.0/(Sin(PiOver2() - trk->lambda())*Sin(PiOver2() - trk->lambda()));
|
38 |
|
|
dPidPj(0,2) = 0;
|
39 |
|
|
dPidPj(0,3) = 0;
|
40 |
|
|
dPidPj(0,4) = 0;
|
41 |
|
|
dPidPj(1,0) = _fCurv/Cos(trk->lambda());
|
42 |
|
|
dPidPj(1,1) = _fCurv*Abs(trk->qoverp())*Tan(trk->lambda())/Cos(trk->lambda());
|
43 |
|
|
dPidPj(1,2) = 0;
|
44 |
|
|
dPidPj(1,3) = 0;
|
45 |
|
|
dPidPj(1,4) = 0;
|
46 |
|
|
dPidPj(2,0) = 0;
|
47 |
|
|
dPidPj(2,1) = -trk->dsz()*Tan(trk->lambda())/Cos(trk->lambda());
|
48 |
|
|
dPidPj(2,2) = 0;
|
49 |
|
|
dPidPj(2,3) = 0;
|
50 |
|
|
dPidPj(2,4) = 1.0/Cos(trk->lambda());
|
51 |
|
|
dPidPj(3,0) = 0;
|
52 |
|
|
dPidPj(3,1) = 0;
|
53 |
|
|
dPidPj(3,2) = 0;
|
54 |
|
|
dPidPj(3,3) = -1.0;
|
55 |
|
|
dPidPj(3,4) = 0;
|
56 |
|
|
dPidPj(4,0) = 0;
|
57 |
|
|
dPidPj(4,1) = 0;
|
58 |
|
|
dPidPj(4,2) = 1.0;
|
59 |
|
|
dPidPj(4,3) = 0;
|
60 |
|
|
dPidPj(4,4) = 0;
|
61 |
bendavid |
1.2 |
|
62 |
|
|
for (Int_t i=0; i<5; i++)
|
63 |
|
|
for (Int_t j=0; j<5; j++) {
|
64 |
|
|
covmat(i,j)=0;
|
65 |
|
|
for (Int_t k=0; k<5; k++)
|
66 |
|
|
for (Int_t l=0; l<5; l++)
|
67 |
paus |
1.4 |
covmat(i,j) += dPidPj(i,k)*dPidPj(j,l)*trk->covariance(k,l);
|
68 |
paus |
1.1 |
}
|
69 |
bendavid |
1.2 |
|
70 |
paus |
1.1 |
return (_mvf->addTrack(params,covmat,id,mass,jv));
|
71 |
|
|
}
|