diff --git a/analyzers/dataframe/FCCAnalyses/JetConstituentsUtils.h b/analyzers/dataframe/FCCAnalyses/JetConstituentsUtils.h index 7d2f40a878..0f7e218f3d 100644 --- a/analyzers/dataframe/FCCAnalyses/JetConstituentsUtils.h +++ b/analyzers/dataframe/FCCAnalyses/JetConstituentsUtils.h @@ -4,6 +4,15 @@ #include "ROOT/RVec.hxx" #include "edm4hep/ReconstructedParticle.h" #include "edm4hep/MCParticle.h" +#if __has_include("edm4hep/TrackerHit3DData.h") +#include "edm4hep/TrackerHit3DData.h" +#else +#include "edm4hep/TrackerHitData.h" +namespace edm4hep { + using TrackerHit3DData = edm4hep::TrackerHitData; +} +#endif + #include "fastjet/JetDefinition.hh" #include "TMath.h" @@ -195,7 +204,7 @@ namespace FCCAnalyses { rv::RVec get_mtof(const rv::RVec& jcs, const rv::RVec& track_L, const rv::RVec& trackdata, - const rv::RVec& trackerhits, + const rv::RVec& trackerhits, const rv::RVec& gammadata, const rv::RVec& nhdata, const rv::RVec& calohits, diff --git a/analyzers/dataframe/FCCAnalyses/ReconstructedParticle2Track.h b/analyzers/dataframe/FCCAnalyses/ReconstructedParticle2Track.h index 48f76453c0..d090e77ec3 100644 --- a/analyzers/dataframe/FCCAnalyses/ReconstructedParticle2Track.h +++ b/analyzers/dataframe/FCCAnalyses/ReconstructedParticle2Track.h @@ -10,7 +10,14 @@ #include "edm4hep/ReconstructedParticleData.h" #include "edm4hep/TrackData.h" #include "edm4hep/TrackState.h" +#if __has_include("edm4hep/TrackerHit3DData.h") +#include "edm4hep/TrackerHit3DData.h" +#else #include "edm4hep/TrackerHitData.h" +namespace edm4hep { + using TrackerHit3DData = edm4hep::TrackerHitData; +} +#endif #include #include #include diff --git a/analyzers/dataframe/FCCAnalyses/ReconstructedTrack.h b/analyzers/dataframe/FCCAnalyses/ReconstructedTrack.h index 1a65a02ad9..ce64ca4e83 100644 --- a/analyzers/dataframe/FCCAnalyses/ReconstructedTrack.h +++ b/analyzers/dataframe/FCCAnalyses/ReconstructedTrack.h @@ -7,7 +7,15 @@ #include "edm4hep/Quantity.h" #include "edm4hep/TrackData.h" #include "edm4hep/TrackState.h" + +#if __has_include("edm4hep/TrackerHit3DData.h") +#include "edm4hep/TrackerHit3DData.h" +#else #include "edm4hep/TrackerHitData.h" +namespace edm4hep { + using TrackerHit3DData = edm4hep::TrackerHitData; +} +#endif namespace FCCAnalyses { @@ -53,13 +61,13 @@ tracks_length(const ROOT::VecOps::RVec &some_tracks, ROOT::VecOps::RVec tracks_TOF( const ROOT::VecOps::RVec &track_indices, const ROOT::VecOps::RVec &trackdata, // Eflowtrack - const ROOT::VecOps::RVec &trackerhits); + const ROOT::VecOps::RVec &trackerhits); ROOT::VecOps::RVec tracks_TOF( const ROOT::VecOps::RVec &some_tracks, const ROOT::VecOps::RVec &FullTracks, const ROOT::VecOps::RVec &trackdata, // Eflowtrack - const ROOT::VecOps::RVec &trackerhits); + const ROOT::VecOps::RVec &trackerhits); /// the dndx values ROOT::VecOps::RVec tracks_dNdx( diff --git a/analyzers/dataframe/FCCAnalyses/SmearObjects.h b/analyzers/dataframe/FCCAnalyses/SmearObjects.h index eb2d2e498c..a6656f6ec2 100644 --- a/analyzers/dataframe/FCCAnalyses/SmearObjects.h +++ b/analyzers/dataframe/FCCAnalyses/SmearObjects.h @@ -70,11 +70,11 @@ struct SmearedTracksTOF { TRandom m_random; float m_scale; SmearedTracksTOF(float m_scale, bool debug); - ROOT::VecOps::RVec + ROOT::VecOps::RVec operator()(const ROOT::VecOps::RVec &allRecoParticles, const ROOT::VecOps::RVec &trackdata, - const ROOT::VecOps::RVec &trackerhits, + const ROOT::VecOps::RVec &trackerhits, const ROOT::VecOps::RVec &length, const ROOT::VecOps::RVec &RP2MC_indices, const ROOT::VecOps::RVec &mcParticles); diff --git a/analyzers/dataframe/src/JetConstituentsUtils.cc b/analyzers/dataframe/src/JetConstituentsUtils.cc index f339920219..b921127e18 100644 --- a/analyzers/dataframe/src/JetConstituentsUtils.cc +++ b/analyzers/dataframe/src/JetConstituentsUtils.cc @@ -4,7 +4,6 @@ #include "FCCAnalyses/ReconstructedParticle2MC.h" #include "edm4hep/MCParticleData.h" #include "edm4hep/Track.h" -#include "edm4hep/TrackerHitData.h" #include "edm4hep/TrackData.h" #include "edm4hep/Cluster.h" #include "edm4hep/ClusterData.h" @@ -754,7 +753,7 @@ namespace FCCAnalyses rv::RVec get_mtof(const rv::RVec &jcs, const rv::RVec &track_L, const rv::RVec &trackdata, - const rv::RVec &trackerhits, + const rv::RVec &trackerhits, const rv::RVec &gammadata, const rv::RVec &nhdata, const rv::RVec &calohits, diff --git a/analyzers/dataframe/src/ReconstructedTrack.cc b/analyzers/dataframe/src/ReconstructedTrack.cc index 058e6bcf1a..417b395feb 100644 --- a/analyzers/dataframe/src/ReconstructedTrack.cc +++ b/analyzers/dataframe/src/ReconstructedTrack.cc @@ -159,7 +159,7 @@ ROOT::VecOps::RVec tracks_length( ROOT::VecOps::RVec tracks_TOF( const ROOT::VecOps::RVec &track_indices, const ROOT::VecOps::RVec &trackdata, // Eflowtrack - const ROOT::VecOps::RVec &trackerhits) { + const ROOT::VecOps::RVec &trackerhits) { ROOT::VecOps::RVec results; for (int i = 0; i < track_indices.size(); i++) { @@ -179,7 +179,7 @@ ROOT::VecOps::RVec tracks_TOF( float tof = -1; if (tk_jdx >= 0) { int idx_tout = trackdata[tk_jdx].trackerHits_end - 1; // at calo - edm4hep::TrackerHitData thits_2 = trackerhits.at(idx_tout); + edm4hep::TrackerHit3DData thits_2 = trackerhits.at(idx_tout); float hit_time = thits_2.time; // in s tof = hit_time * 1e12; // in ps } @@ -193,7 +193,7 @@ ROOT::VecOps::RVec tracks_TOF( const ROOT::VecOps::RVec &some_tracks, const ROOT::VecOps::RVec &FullTracks, const ROOT::VecOps::RVec &trackdata, // Eflowtrack - const ROOT::VecOps::RVec &trackerhits) { + const ROOT::VecOps::RVec &trackerhits) { ROOT::VecOps::RVec indices = get_indices(some_tracks, FullTracks); return tracks_TOF(indices, trackdata, trackerhits); } diff --git a/analyzers/dataframe/src/SmearObjects.cc b/analyzers/dataframe/src/SmearObjects.cc index c335e02d3e..28543a8166 100644 --- a/analyzers/dataframe/src/SmearObjects.cc +++ b/analyzers/dataframe/src/SmearObjects.cc @@ -390,11 +390,11 @@ SmearedTracksTOF::SmearedTracksTOF(float scale, bool debug = false) { m_debug = debug; } -ROOT::VecOps::RVec SmearedTracksTOF::operator()( +ROOT::VecOps::RVec SmearedTracksTOF::operator()( const ROOT::VecOps::RVec &allRecoParticles, const ROOT::VecOps::RVec &trackdata, - const ROOT::VecOps::RVec &trackerhits, + const ROOT::VecOps::RVec &trackerhits, const ROOT::VecOps::RVec &length, const ROOT::VecOps::RVec &RP2MC_indices, const ROOT::VecOps::RVec &mcParticles) { @@ -403,8 +403,8 @@ ROOT::VecOps::RVec SmearedTracksTOF::operator()( // retrieve the MC particle that is associated to a track, and builds a "track // state" out of the MC particle and regenerates a new value of the dNdx - ROOT::VecOps::RVec result; - edm4hep::TrackerHitData dummy; + ROOT::VecOps::RVec result; + edm4hep::TrackerHit3DData dummy; int ntracks = length.size(); int nhits = trackerhits.size(); // 3x size of tracks since 3 hits per track @@ -415,8 +415,8 @@ ROOT::VecOps::RVec SmearedTracksTOF::operator()( float c_light = 2.99792458e+8; float mm_to_sec = 1e-03 / c_light; - edm4hep::TrackerHitData thits_0, thits_1, thits_2; - edm4hep::TrackerHitData smeared_thits_0, smeared_thits_1, smeared_thits_2; + edm4hep::TrackerHit3DData thits_0, thits_1, thits_2; + edm4hep::TrackerHit3DData smeared_thits_0, smeared_thits_1, smeared_thits_2; for (int itrack = 0; itrack < ntracks; itrack++) {