From efe646eb42c9b0dd264b109c8da7304d38474eec Mon Sep 17 00:00:00 2001 From: Thomas Madlener Date: Tue, 16 Jul 2024 16:48:51 +0200 Subject: [PATCH] Put dNdx information into dedicated collection (#121) --- converter/src/DelphesEDM4HepConverter.cc | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/converter/src/DelphesEDM4HepConverter.cc b/converter/src/DelphesEDM4HepConverter.cc index fa58609..3656c7d 100644 --- a/converter/src/DelphesEDM4HepConverter.cc +++ b/converter/src/DelphesEDM4HepConverter.cc @@ -9,6 +9,7 @@ #include "edm4hep/MCParticleCollection.h" #include "edm4hep/MCRecoParticleAssociationCollection.h" #include "edm4hep/ParticleIDCollection.h" +#include "edm4hep/RecDqdxCollection.h" #include "edm4hep/ReconstructedParticleCollection.h" #include "edm4hep/TrackCollection.h" #if __has_include("edm4hep/TrackerHit3DCollection.h") @@ -26,8 +27,6 @@ namespace edm4hep { #include #include -#include -#include namespace k4SimDelphes { @@ -217,6 +216,7 @@ namespace k4SimDelphes { void DelphesEDM4HepConverter::processTracks(const TClonesArray* delphesCollection, std::string const& branch) { auto* particleCollection = getCollection(m_recoCollName); auto* trackCollection = createCollection(branch); + auto* dqdxCollection = createCollection(branch + "_dNdx"); //UserData for overflowing information auto* pathLengthCollection = createCollection>(branch + "_L"); @@ -232,6 +232,7 @@ namespace k4SimDelphes { auto* delphesCand = static_cast(delphesCollection->At(iCand)); auto track = convertTrack(delphesCand); + trackCollection->push_back(track); // this is the position/time at the IP auto trackerHit0 = trackerHitColl->create(); @@ -253,14 +254,11 @@ namespace k4SimDelphes { trackerHit2.setPosition(position2); track.addToTrackerHits(trackerHit2); - trackCollection->push_back(track); pathLengthCollection->push_back(delphesCand->L); - edm4hep::Quantity dxQuantities{}; - dxQuantities.type = 0; - dxQuantities.value = delphesCand->dNdx; - - track.addToDxQuantities(dxQuantities); + auto dndx = dqdxCollection->create(); + dndx.getDQdx().value = delphesCand->dNdx; + dndx.setTrack(track); auto id = idCollection->create();