Skip to content

Commit 940cec3

Browse files
gganisvvolkl
authored andcommitted
Fixing curvature units and other cosmetics
1 parent 362e70b commit 940cec3

1 file changed

Lines changed: 11 additions & 10 deletions

File tree

Sim/SimDelphesInterface/src/DelphesSaveChargedParticles.cpp

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,22 @@
1515
#include "TObjArray.h"
1616
#include <TMatrixD.h>
1717

18-
18+
static const double defaultMagneticField = 2.;
19+
static const double mTommConversionFactor = 1000.;
1920

2021
// Covariance conversion to ACTS format
21-
TMatrixDSym CovToACTS(TMatrixDSym Cov, double ct /*cot(theta)*/, double C /*half curvature*/, double fB=2. /*magnetic field in T*/)
22+
TMatrixDSym CovToACTS(TMatrixDSym Cov, double ct /*cot(theta)*/, double C /*half curvature*/,
23+
double fB=defaultMagneticField /*magnetic field in T*/)
2224
{
2325
TMatrixDSym cACTS(6); cACTS.Zero();
24-
Double_t b = -0.29988*fB / 2.;
26+
Double_t b = -0.29979 * fB / 2. / mTommConversionFactor;
2527
//
2628
// Fill derivative matrix
2729
TMatrixD A(5, 5); A.Zero();
28-
A(0, 0) = 1000.; // D-D conversion to mm
30+
A(0, 0) = mTommConversionFactor; // D-D conversion to mm
2931
A(1, 2) = 1.0; // phi0-phi0
3032
A(2, 4) = 1.0/(TMath::Sqrt(1.0 + ct*ct) * b); // q/p-C
31-
A(3, 1) = 1000.; // z0-z0 conversion to mm
33+
A(3, 1) = mTommConversionFactor; // z0-z0 conversion to mm
3234
A(4, 3) = -1.0 / (1.0 + ct*ct); // theta - cot(theta)
3335
A(4, 4) = -C*ct / (b*pow(1.0 + ct*ct,3.0/2.0)); // q/p-cot(theta)
3436
//
@@ -91,15 +93,14 @@ StatusCode DelphesSaveChargedParticles::saveOutput(Delphes& delphes, const fcc::
9193
auto cand = static_cast<Candidate*>(delphesColl->At(j));
9294
auto particle = colParticles->create();
9395

94-
9596
if (m_saveTrkCov) {
9697
auto cov_d = CovToACTS(cand->TrackCovariance, cand->CtgTheta, cand->C);
9798
auto t = colParticles_trkCov->create();
98-
t.d0(1000* cand->D0);
99-
t.z0(1000* cand->DZ);
99+
t.d0(mTommConversionFactor * cand->D0);
100+
t.z0(mTommConversionFactor * cand->DZ);
100101
t.phi(cand->Phi);
101-
t.theta(TMath::ATan2(1.0, cand->CtgTheta));
102-
Double_t b = -0.29988*2.0 / 2.; //mag field
102+
t.theta(TMath::ATan2(1.0, cand->CtgTheta));
103+
Double_t b = -0.29979 * defaultMagneticField / 2. / mTommConversionFactor; //mag field in T
103104
t.qOverP(cand->C / (b*TMath::Sqrt(1 + cand->CtgTheta*cand->CtgTheta)));
104105
std::array<float,15> t_c;
105106
// save upper right triangle, row first

0 commit comments

Comments
 (0)