diff --git a/converter/src/DelphesEDM4HepConverter.cc b/converter/src/DelphesEDM4HepConverter.cc index 3955ef1..ddd8de6 100644 --- a/converter/src/DelphesEDM4HepConverter.cc +++ b/converter/src/DelphesEDM4HepConverter.cc @@ -47,7 +47,7 @@ namespace k4SimDelphes { void sortBranchesProcessingOrder(std::vector& branches, std::array const& processingOrder); - edm4hep::MutableTrack convertTrack(Track const* cand, const double magFieldBz); + edm4hep::MutableTrack convertTrack(Track const* cand); void setMotherDaughterRelations(GenParticle const* delphesCand, edm4hep::MutableMCParticle particle, edm4hep::MCParticleCollection& mcParticles); @@ -224,7 +224,7 @@ namespace k4SimDelphes { for (auto iCand = 0; iCand < delphesCollection->GetEntries(); ++iCand) { auto* delphesCand = static_cast(delphesCollection->At(iCand)); - auto track = convertTrack(delphesCand, m_magneticFieldBz); + auto track = convertTrack(delphesCand); // this is the position/time at the IP auto trackerHit0 = trackerHitColl->create(); @@ -540,7 +540,7 @@ namespace k4SimDelphes { }); } - edm4hep::MutableTrack convertTrack(Track const* cand, const double magFieldBz) { + edm4hep::MutableTrack convertTrack(Track const* cand) { edm4hep::MutableTrack track; // Delphes does not really provide any information that would go into the // track itself. But some information can be used to at least partially @@ -556,17 +556,6 @@ namespace k4SimDelphes { trackState.phi = cand->Phi; // Same thing under different name in Delphes trackState.tanLambda = cand->CtgTheta; - // Only do omega when there is actually a magnetic field. - double varOmega = 0; - if (magFieldBz) { - // conversion to have omega in [1/mm] - constexpr double a = c_light * 1e3 * 1e-15; - - trackState.omega = a * magFieldBz / cand->PT * std::copysign(1.0, cand->Charge); - // calculate variation using simple error propagation, assuming - // constant B-field -> relative error on pT is relative error on omega - varOmega = cand->ErrorPT * cand->ErrorPT / cand->PT / cand->PT * trackState.omega * trackState.omega; - } // fill the covariance matrix. There is a conversion of units // because the covariance matrix in delphes is with the original units @@ -579,6 +568,8 @@ namespace k4SimDelphes { // relating to curvature (index 2) double scale2 = -2.; // CAREFUL: DELPHES USES THE HALF-CURVATURE + trackState.omega = cand->C * scale2; + covMatrix[0] = covaFB(0, 0); covMatrix[1] = covaFB(1, 0); diff --git a/converter/src/delphesHelpers.h b/converter/src/delphesHelpers.h index f63aed9..737a564 100644 --- a/converter/src/delphesHelpers.h +++ b/converter/src/delphesHelpers.h @@ -11,8 +11,6 @@ #include namespace k4SimDelphes { - // TODO: If CLHEP ever gets part of edm4hep, take this from there. - static constexpr double c_light = 2.99792458e+8; using LorentzVectorT = ROOT::Math::PxPyPzEVector;