Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2026-10-16 08:30:14

0001 // Tell emacs that this is a C++ source
0002 // -*- C++ -*-.
0003 #ifndef G4TPC_TPCPRIMARYIONIZATIONMODEL_H
0004 #define G4TPC_TPCPRIMARYIONIZATIONMODEL_H
0005 
0006 #include <vector>
0007 
0008 /**
0009  * Fast, path-length-based, MIP-calibrated TPC primary-ionization model for
0010  * non-electron charged particles. PHG4TpcElectronDrift retains its established
0011  * energy-deposit response for electrons and positrons.
0012  *
0013  * The model supplies the mean primary-cluster density for a gas mixture and
0014  * samples the number of electrons in one primary cluster. Random-number
0015  * generation remains the responsibility of the caller so that this class is
0016  * deterministic and independently testable.
0017  */
0018 class TpcPrimaryIonizationModel
0019 {
0020  public:
0021   struct GasFractions
0022   {
0023     double argon{0.0};
0024     double cf4{0.0};
0025     double isobutane{0.0};
0026   };
0027 
0028   static constexpr unsigned int maximum_cluster_size = 384;
0029 
0030   explicit TpcPrimaryIonizationModel(const GasFractions &fractions);
0031 
0032   [[nodiscard]] double primary_clusters_per_cm() const
0033   {
0034     return m_primaryClustersPerCm;
0035   }
0036 
0037   [[nodiscard]] double mean_primary_clusters(const double path_length_cm) const;
0038   [[nodiscard]] unsigned int sample_cluster_size(const double uniform_01) const;
0039   [[nodiscard]] double mean_cluster_size() const;
0040 
0041  private:
0042   double m_primaryClustersPerCm{0.0};
0043   std::vector<double> m_clusterSizeCdf;
0044 };
0045 
0046 #endif  // G4TPC_TPCPRIMARYIONIZATIONMODEL_H