RecombinationModels.cxx
Go to the documentation of this file.
2 
4 
5 #include <cmath>
6 
9 WIRECELL_FACTORY(BirksRecombination, WireCell::Gen::MipRecombination,
10  WireCell::IRecombinationModel, WireCell::IConfigurable)
11 WIRECELL_FACTORY(BoxRecombination, WireCell::Gen::MipRecombination,
12  WireCell::IRecombinationModel, WireCell::IConfigurable)
13 
14 
15 using namespace WireCell;
16 
17 /*
18  MIP recombination model
19 */
20 Gen::MipRecombination::MipRecombination(double Rmip, double Wi)
21  : m_rmip(Rmip)
22  , m_wi(Wi)
23 {
24 }
25 Gen::MipRecombination::~MipRecombination()
26 {
27 }
28 double Gen::MipRecombination::operator()(double dE, double dX)
29 {
30  return m_rmip*dE/m_wi;
31 }
33 {
34  m_rmip = get(config, "Rmip", m_rmip);
35  m_wi = get(config, "Wi", m_wi);
36 }
37 WireCell::Configuration Gen::MipRecombination::default_configuration() const
38 {
40  cfg["Rmip"] = m_rmip;
41  cfg["Wi"] = m_wi;
42  return cfg;
43 }
44 
45 
46 
47 /*
48  Birks Recombination Model
49  */
50 Gen::BirksRecombination::BirksRecombination(double Efield, double A3t, double k3t, double rho, double Wi)
51  : m_a3t(A3t), m_k3t(k3t), m_efield(Efield), m_rho(rho), m_wi(Wi)
52 {
53 }
55 {
56 }
57 double Gen::BirksRecombination::operator()(double dE, double dX)
58 {
59  const double R = m_a3t / (1 + (dE/dX)*m_k3t/(m_efield*m_rho));
60  return R*dE/m_wi;
61 }
63 {
64  m_a3t = get(config, "A3t", m_a3t);
65  m_k3t = get(config, "k3t", m_k3t);
66  m_efield = get(config, "Efield", m_efield);
67  m_rho = get(config, "rho", m_rho);
68  m_wi = get(config, "Wi", m_wi);
69 }
71 {
73  cfg["A3t"] = m_a3t;
74  cfg["k3t"] = m_k3t;
75  cfg["Efield"] = m_efield;
76  cfg["rho"] = m_rho;
77  cfg["Wi"] = m_wi;
78  return cfg;
79 }
80 
81 
82 
83 /*
84  Modified Box Model
85 */
86 Gen::BoxRecombination::BoxRecombination(double Efield, double A, double B, double rho, double Wi)
87  : m_efield(Efield)
88  , m_a(A)
89  , m_b(B)
90  , m_rho(rho)
91  , m_wi(Wi)
92 {
93 }
95 {
96 }
97 double Gen::BoxRecombination::operator()(double dE, double dX)
98 {
99  const double tmp = (dE/dX)*m_b/(m_efield*m_rho);
100  const double R = std::log(m_a + tmp)/ tmp;
101  return R*dE/m_wi;
102 }
104  {
105  m_efield = get(config, "Efield", m_efield);
106  m_a = get(config, "A", m_a);
107  m_b = get(config, "B", m_b);
108  m_rho = get(config, "rho", m_rho);
109  m_wi = get(config, "Wi", m_wi);
110  }
112  {
114  cfg["Efield"] = m_efield;
115  cfg["A"] = m_a;
116  cfg["B"] = m_b;
117  cfg["rho"] = m_rho;
118  cfg["Wi"] = m_wi;
119  return cfg;
120  }
Model for a MIP, dQ = (Rmip/Wi)*dE.
cfg
Definition: dbjson.py:29
virtual void configure(const WireCell::Configuration &config)
Accept a configuration.
def configure(cfg)
Definition: cuda.py:34
virtual void configure(const WireCell::Configuration &config)
Accept a configuration.
virtual double operator()(double dE, double dX=0.0)
static Config * config
Definition: config.cpp:1054
virtual double operator()(double dE, double dX=0.0)
string tmp
Definition: languages.py:63
virtual WireCell::Configuration default_configuration() const
Optional, override to return a hard-coded default configuration.
void log(source_loc source, level::level_enum lvl, const char *fmt, const Args &...args)
Definition: spdlog.h:165
Definition: Main.h:22
Json::Value Configuration
Definition: Configuration.h:50
BoxRecombination(double Efield=500 *units::volt/units::cm, double A=0.930, double B=0.212 *units::gram/(units::MeV *units::cm2)*(units::kilovolt/units::cm), double rho=1.396 *units::gram/units::cm3, double Wi=23.6 *units::eV/(-1 *units::eplus))
virtual WireCell::Configuration default_configuration() const
Optional, override to return a hard-coded default configuration.
WIRECELL_FACTORY(MipRecombination, WireCell::Gen::MipRecombination, WireCell::IRecombinationModel, WireCell::IConfigurable) WIRECELL_FACTORY(BirksRecombination