Skip to content

Commit

Permalink
Address PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcarcell committed Oct 30, 2023
1 parent 33ee52d commit bc2041f
Showing 4 changed files with 14 additions and 18 deletions.
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -33,7 +33,6 @@ find_package(k4FWCore REQUIRED)
find_package(Gaudi REQUIRED)
find_package(DD4hep REQUIRED)
find_package(k4SimGeant4 REQUIRED)
find_package(k4geo REQUIRED)

include(GNUInstallDirs)

3 changes: 0 additions & 3 deletions k4Reco/DDPlanarDigi/components/DDPlanarDigi.cpp
Original file line number Diff line number Diff line change
@@ -37,7 +37,6 @@
#include <random>
#include <sstream>

enum { hu = 0, hv, hT, hitE, hitsAccepted, diffu, diffv, diffT, hSize };

DDPlanarDigi::DDPlanarDigi(const std::string& name, ISvcLocator* svcLoc)
: MultiTransformer(name, svcLoc,
@@ -59,8 +58,6 @@ 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.resize(hSize);

m_histograms[hu].reset(new Gaudi::Accumulators::Histogram<1>{this, "hu", "smearing u", {50, -5., +5.}});
m_histograms[hv].reset(new Gaudi::Accumulators::Histogram<1>{this, "hv", "smearing v", {50, -5., +5.}});
m_histograms[hT].reset(new Gaudi::Accumulators::Histogram<1>{this, "hT", "smearing time", {50, -5., +5.}});
26 changes: 12 additions & 14 deletions k4Reco/DDPlanarDigi/components/DDPlanarDigi.h
Original file line number Diff line number Diff line change
@@ -70,22 +70,21 @@
* Originally in https://github.com/iLCSoft/MarlinTrkProcessors/blob/master/source/Digitisers/include/DDPlanarDigi.h
*/

using SimTrackerHitCollection = edm4hep::SimTrackerHitCollection;
using Header = edm4hep::EventHeaderCollection;

using TrackerHitPlaneColl = edm4hep::TrackerHitPlaneCollection;
using Association = edm4hep::MCRecoTrackerHitPlaneAssociationCollection;
enum { hu = 0, hv, hT, hitE, hitsAccepted, diffu, diffv, diffT, hSize };

struct DDPlanarDigi final
: Gaudi::Functional::MultiTransformer<
std::tuple<TrackerHitPlaneColl, Association>(const SimTrackerHitCollection&, const Header&), BaseClass_t> {
std::tuple<edm4hep::TrackerHitPlaneCollection, edm4hep::MCRecoTrackerHitPlaneAssociationCollection>(
const edm4hep::SimTrackerHitCollection&, const edm4hep::EventHeaderCollection&),
BaseClass_t> {
DDPlanarDigi(const std::string& name, ISvcLocator* svcLoc);

StatusCode initialize() override;
StatusCode finalize() override;

std::tuple<TrackerHitPlaneColl, Association> operator()(const SimTrackerHitCollection& simTrackerHits,
const Header& headers) const override;
std::tuple<edm4hep::TrackerHitPlaneCollection, edm4hep::MCRecoTrackerHitPlaneAssociationCollection> operator()(
const edm4hep::SimTrackerHitCollection& simTrackerHits,
const edm4hep::EventHeaderCollection& headers) const override;

private:
Gaudi::Property<std::string> m_subDetName{this, "SubDetectorName", "VXD", "Name of the subdetector"};
@@ -120,14 +119,13 @@ struct DDPlanarDigi final
Gaudi::Property<std::string> m_geoSvcName{this, "GeoSvcName", "GeoSvc", "The name of the GeoSvc instance"};
Gaudi::Property<int> m_maxTries{this, "MaxTries", 10, "Maximum number of tries to find a valid surface for a hit"};

Gaudi::Property<std::string> m_outputFileName{this, "OutputFileName", "planar_digi_histograms.root", "Output file name for the histograms"};
Gaudi::Property<std::string> m_outputFileName{this, "OutputFileName", "planar_digi_histograms.root",
"Output file name for the histograms"};

const dd4hep::rec::SurfaceMap* surfaceMap;
// std::vector<std::unique_ptr<Gaudi::Accumulators::Histogram<1>>> m_histograms;
std::vector<std::unique_ptr<Gaudi::Accumulators::Histogram<1>>> m_histograms;
std::string m_collName;
const dd4hep::rec::SurfaceMap* surfaceMap;
std::array<std::unique_ptr<Gaudi::Accumulators::Histogram<1>>, hSize> m_histograms;
std::string m_collName;

// inline static thread_local std::mt19937 m_engine;
inline static thread_local std::mt19937 m_engine;
SmartIF<IGeoSvc> m_geoSvc;
SmartIF<IUniqueIDGenSvc> m_uidSvc;
2 changes: 2 additions & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -17,3 +17,5 @@ See the License for the specific language governing permissions and
limitations under the License.
]]


find_package(k4geo REQUIRED)

0 comments on commit bc2041f

Please sign in to comment.