File indexing completed on 2025-08-06 08:19:26
0001
0002
0003
0004 #ifndef G4MICROMEGAS_PHG4MICROMEGASHITRECO_H
0005 #define G4MICROMEGAS_PHG4MICROMEGASHITRECO_H
0006
0007
0008
0009
0010
0011
0012 #include <phparameter/PHParameterInterface.h>
0013
0014 #include <fun4all/SubsysReco.h>
0015
0016 #include <gsl/gsl_rng.h>
0017 #include <memory>
0018 #include <string>
0019 #include <utility>
0020 #include <vector>
0021
0022 class ActsGeometry;
0023
0024 class CylinderGeomMicromegas;
0025 class PHCompositeNode;
0026 class PHG4Hit;
0027 class TVector2;
0028
0029 class PHG4MicromegasHitReco : public SubsysReco, public PHParameterInterface
0030 {
0031 public:
0032 explicit PHG4MicromegasHitReco(const std::string& name = "PHG4MicromegasHitReco");
0033
0034
0035 int InitRun(PHCompositeNode*) override;
0036
0037
0038 int process_event(PHCompositeNode*) override;
0039
0040
0041 void SetDefaultParameters() override;
0042
0043 private:
0044
0045 std::string full_geonodename() const
0046 {
0047 return "CYLINDERGEOM_MICROMEGAS_FULL";
0048 }
0049
0050
0051
0052 uint get_primary_electrons(PHG4Hit*) const;
0053
0054
0055 uint get_single_electron_amplification() const;
0056
0057
0058 using charge_pair_t = std::pair<int, double>;
0059
0060
0061 using charge_list_t = std::vector<charge_pair_t>;
0062
0063
0064 charge_list_t distribute_charge(CylinderGeomMicromegas*, uint tileid, const TVector2& local_position, double sigma) const;
0065
0066
0067 ActsGeometry* m_acts_geometry = nullptr;
0068
0069
0070 double m_tmin = -20;
0071
0072
0073 double m_tmax = 800;
0074
0075
0076 double m_electrons_per_gev = 0;
0077
0078
0079 double m_gain = 0;
0080
0081
0082 double m_cloud_sigma = 0.04;
0083
0084
0085 double m_diffusion_trans = 0.03;
0086
0087
0088
0089 double m_added_smear_sigma_z = 0;
0090 double m_added_smear_sigma_rphi = 0;
0091
0092
0093 class Deleter
0094 {
0095 public:
0096
0097 void operator()(gsl_rng* rng) const { gsl_rng_free(rng); }
0098 };
0099
0100
0101
0102 std::unique_ptr<gsl_rng, Deleter> m_rng;
0103 };
0104
0105 #endif