Functions | Variables
test_recombinationmodels.cxx File Reference
#include "WireCellGen/RecombinationModels.h"
#include "WireCellUtil/Units.h"
#include "WireCellUtil/Testing.h"
#include <vector>
#include <iostream>

Go to the source code of this file.

Functions

void spin (IRecombinationModel &model, const std::string &label)
 
void test_larsoft ()
 
void test_mip ()
 
void test_birks ()
 
void test_box ()
 
int main ()
 

Variables

const std::vector< double > evec {0.0797872,0.0533235,0.000891013, 0.02}
 
const std::vector< double > svec {0.0208263, 0.0311329, 0.000947381, 0.01}
 
const std::vector< int > nvec {3380, 2259, 37, 847}
 

Function Documentation

int main ( void  )

Definition at line 69 of file test_recombinationmodels.cxx.

70 {
71  test_larsoft();
72  test_mip();
73  test_birks();
74  test_box();
75  return 0;
76 }
void test_mip()
void test_birks()
void test_larsoft()
void test_box()
void spin ( IRecombinationModel model,
const std::string label 
)

Definition at line 29 of file test_recombinationmodels.cxx.

30 {
31  cerr << "Model: " << label << endl;
32  for (size_t ind=0; ind<nvec.size(); ++ind) {
33  // values from larsoft dump
34  double lsenergy = evec[ind]*units::MeV;
35  double lsstep = svec[ind]*units::cm;
36  double lscharge = nvec[ind]*(-1.0*units::eplus);
37  double dEdX = lsenergy/lsstep;
38 
39  double gotcharge = model(lsenergy, lsstep);
40  cerr << "\tdE=" << lsenergy/units::keV << " keV, "
41  << "dX=" << lsstep/units::micrometer << " um, "
42  << "dE/dX=" << dEdX/(units::MeV/units::cm) << " MeV/cm, "
43  << "dQls=" << lscharge/(-1*units::eplus) << " ele, "
44  << "dQ=" << gotcharge/(-1*units::eplus) << " ele\n";
45  }
46 
47 }
static const double micrometer
Definition: Units.h:60
static const double keV
Definition: Units.h:129
static const double MeV
Definition: Units.h:130
const std::vector< int > nvec
const std::vector< double > svec
const std::vector< double > evec
static const double cm
Definition: Units.h:76
QTextStream & endl(QTextStream &s)
void test_birks ( )

Definition at line 58 of file test_recombinationmodels.cxx.

59 {
61  spin(model, "birks");
62 }
void spin(IRecombinationModel &model, const std::string &label)
void test_box ( )

Definition at line 63 of file test_recombinationmodels.cxx.

64 {
66  spin(model, "box");
67 }
void spin(IRecombinationModel &model, const std::string &label)
void test_larsoft ( )

Definition at line 48 of file test_recombinationmodels.cxx.

49 {
51  spin(model, "larsoft");
52 }
Model for a MIP, dQ = (Rmip/Wi)*dE.
void spin(IRecombinationModel &model, const std::string &label)
void test_mip ( )

Definition at line 53 of file test_recombinationmodels.cxx.

54 {
56  spin(model, "mip");
57 }
Model for a MIP, dQ = (Rmip/Wi)*dE.
void spin(IRecombinationModel &model, const std::string &label)

Variable Documentation

const std::vector<double> evec {0.0797872,0.0533235,0.000891013, 0.02}

Definition at line 25 of file test_recombinationmodels.cxx.

const std::vector<int> nvec {3380, 2259, 37, 847}

Definition at line 27 of file test_recombinationmodels.cxx.

const std::vector<double> svec {0.0208263, 0.0311329, 0.000947381, 0.01}

Definition at line 26 of file test_recombinationmodels.cxx.