Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /EICrecon/src/algorithms/digi/MPGDTrackerDigi.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // SPDX-License-Identifier: LGPL-3.0-or-later
0002 // Copyright (C) 2022 - 2025 Whitney Armstrong, Wouter Deconinck, Sylvester Joosten, Dmitry Romanov, Yann Bedfer
0003 
0004 #pragma once
0005 
0006 #include <DD4hep/Detector.h>
0007 #include <DD4hep/Segmentations.h>
0008 #include <TRandomGen.h>
0009 #include <algorithms/algorithm.h>
0010 #include <edm4eic/MCRecoTrackerHitAssociationCollection.h>
0011 #include <edm4eic/RawTrackerHitCollection.h>
0012 #include <edm4hep/SimTrackerHitCollection.h>
0013 #include <functional>
0014 #include <string>
0015 #include <string_view>
0016 
0017 #include "MPGDTrackerDigiConfig.h"
0018 #include "algorithms/interfaces/WithPodConfig.h"
0019 
0020 namespace eicrecon {
0021 
0022 using MPGDTrackerDigiAlgorithm =
0023     algorithms::Algorithm<algorithms::Input<edm4hep::SimTrackerHitCollection>,
0024                           algorithms::Output<edm4eic::RawTrackerHitCollection,
0025                                              edm4eic::MCRecoTrackerHitAssociationCollection>>;
0026 
0027 class MPGDTrackerDigi : public MPGDTrackerDigiAlgorithm,
0028                            public WithPodConfig<MPGDTrackerDigiConfig> {
0029 
0030 public:
0031   MPGDTrackerDigi(std::string_view name)
0032       : MPGDTrackerDigiAlgorithm{name,
0033                                     {"inputHitCollection"},
0034                                     {"outputRawHitCollection", "outputHitAssociations"},
0035                                     "2D-strip segmentation, apply threshold, digitize within ADC range, "
0036                                     "convert time with smearing resolution."} {}
0037 
0038   void init() final;
0039   void process(const Input&, const Output&) const final;
0040 
0041 private:
0042   /** Random number generation*/
0043   TRandomMixMax m_random;
0044   std::function<double()> m_gauss;
0045   // FIXME replace with standard random engine
0046   // std::default_random_engine generator; // TODO: need something more appropriate here
0047   // std::normal_distribution<double> m_normDist; // defaults to mean=0, sigma=1
0048 
0049   // algorithms::Generator m_rng = algorithms::RandomSvc::instance().generator();
0050 
0051   /** Segmentation */
0052   const dd4hep::Detector* m_detector{nullptr};
0053   dd4hep::Segmentation m_seg;
0054 };
0055 
0056 } // namespace eicrecon