diff --git a/k4Reco/DDPlanarDigi/components/DDPlanarDigi.cpp b/k4Reco/DDPlanarDigi/components/DDPlanarDigi.cpp index c3f6d70..8b3a5b6 100644 --- a/k4Reco/DDPlanarDigi/components/DDPlanarDigi.cpp +++ b/k4Reco/DDPlanarDigi/components/DDPlanarDigi.cpp @@ -53,16 +53,16 @@ DDPlanarDigi::DDPlanarDigi(const std::string& name, ISvcLocator* svcLoc) throw std::runtime_error("DDPlanarDigi: Inconsistent number of resolutions given for U and V coordinate"); } - m_histograms[hu].reset(new Gaudi::Accumulators::RootHistogram<1>{this, "hu", "smearing u", {50, -5., +5.}}); - m_histograms[hv].reset(new Gaudi::Accumulators::RootHistogram<1>{this, "hv", "smearing v", {50, -5., +5.}}); - m_histograms[hT].reset(new Gaudi::Accumulators::RootHistogram<1>{this, "hT", "smearing time", {50, -5., +5.}}); + m_histograms[hu].reset(new Gaudi::Accumulators::StaticRootHistogram<1>{this, "hu", "smearing u", {50, -5., +5.}}); + m_histograms[hv].reset(new Gaudi::Accumulators::StaticRootHistogram<1>{this, "hv", "smearing v", {50, -5., +5.}}); + m_histograms[hT].reset(new Gaudi::Accumulators::StaticRootHistogram<1>{this, "hT", "smearing time", {50, -5., +5.}}); - m_histograms[diffu].reset(new Gaudi::Accumulators::RootHistogram<1>{this, "diffu", "diff u", {1000, -.1, +.1}}); - m_histograms[diffv].reset(new Gaudi::Accumulators::RootHistogram<1>{this, "diffv", "diff v", {1000, -.1, +.1}}); - m_histograms[diffT].reset(new Gaudi::Accumulators::RootHistogram<1>{this, "diffT", "diff time", {1000, -5., +5.}}); + m_histograms[diffu].reset(new Gaudi::Accumulators::StaticRootHistogram<1>{this, "diffu", "diff u", {1000, -.1, +.1}}); + m_histograms[diffv].reset(new Gaudi::Accumulators::StaticRootHistogram<1>{this, "diffv", "diff v", {1000, -.1, +.1}}); + m_histograms[diffT].reset(new Gaudi::Accumulators::StaticRootHistogram<1>{this, "diffT", "diff time", {1000, -5., +5.}}); - m_histograms[hitE].reset(new Gaudi::Accumulators::RootHistogram<1>{this, "hitE", "hitEnergy in keV", {1000, 0, 200}}); - m_histograms[hitsAccepted].reset(new Gaudi::Accumulators::RootHistogram<1>{ + m_histograms[hitE].reset(new Gaudi::Accumulators::StaticRootHistogram<1>{this, "hitE", "hitEnergy in keV", {1000, 0, 200}}); + m_histograms[hitsAccepted].reset(new Gaudi::Accumulators::StaticRootHistogram<1>{ this, "hitsAccepted", "Fraction of accepted hits [%]", {201, 0, 100.5}}); m_geoSvc = serviceLocator()->service(m_geoSvcName); diff --git a/k4Reco/DDPlanarDigi/components/DDPlanarDigi.h b/k4Reco/DDPlanarDigi/components/DDPlanarDigi.h index fa3675e..48ff41e 100644 --- a/k4Reco/DDPlanarDigi/components/DDPlanarDigi.h +++ b/k4Reco/DDPlanarDigi/components/DDPlanarDigi.h @@ -38,6 +38,14 @@ #include #include +#include "GAUDI_VERSION.h" + +#if GAUDI_MAJOR_VERSION < 39 +namespace Gaudi::Accumulators { + using StaticRootHistogram = Gaudi::Accumulators::RootHistogram; +} +#endif + /** ======= DDPlanarDigi ==========
* Creates TrackerHits from SimTrackerHits, smearing them according to the input parameters. * The positions of "digitized" TrackerHits are obtained by gaussian smearing positions @@ -119,12 +127,15 @@ struct DDPlanarDigi final "Output file name for the histograms"}; const dd4hep::rec::SurfaceMap* surfaceMap; - std::array>, hSize> m_histograms; + std::array>, hSize> m_histograms; std::string m_collName; inline static thread_local TRandom2 m_engine; SmartIF m_geoSvc; SmartIF m_uidSvc; + +public: + void registerCallBack(Gaudi::StateMachine::Transition, std::function) {} }; DECLARE_COMPONENT(DDPlanarDigi)