41 bool assert_flag =
false;
42 assert((assert_flag =
true, assert_flag));
44 std::cerr <<
"Assert is disabled" << std::endl;
52 art::ServiceHandle<detinfo::DetectorPropertiesService const>()->DataForJob();
56 std::cout <<
"Density = " << detprop.Density() <<
" g/cm^3" << std::endl;
57 std::cout <<
"Drift velocity = " << detprop.DriftVelocity() <<
" cm/usec" << std::endl;
58 std::cout <<
"Efield = " << detprop.Efield() <<
" kV/cm" << std::endl;
59 std::cout <<
"Temperature = " << detprop.Temperature() <<
" Kelvin" << std::endl;
60 std::cout <<
"Electron lifetime = " << detprop.ElectronLifetime() <<
" usec" << std::endl;
67 assert(detprop.Density() == detprop.Density(detprop.Temperature()));
68 assert(detprop.Density() != detprop.Density(detprop.Temperature() + 0.1));
69 assert(detprop.DriftVelocity() == detprop.DriftVelocity(detprop.Efield()));
70 assert(detprop.DriftVelocity() ==
71 detprop.DriftVelocity(detprop.Efield(), detprop.Temperature()));
75 std::cout <<
"\nDrift Velocity vs. Electric Field.\n"
76 <<
" E (kV/cm) v (cm/us)" << std::fixed << std::endl;
77 for (
int i = 0; i < 3; ++i) {
83 double v = detprop.DriftVelocity(e);
84 std::cout << std::setprecision(3) << std::setw(15) << e << std::setprecision(4)
85 << std::setw(15) << v << std::endl;
92 "http://pdg.lbl.gov/2011/AtomicNuclearProperties/MUON_ELOSS_TABLES/muonloss_289.dat\n"
95 double mass = 0.10565839;
97 1.0, 1.2, 1.4, 1.7, 2.0, 2.5, 3.0, 3.5, 4.0, 4.5, 5.0, 5.5, 6.0, 7.0, 8.0, 9.0};
99 std::ios_base::fmtflags flags =
std::cout.flags();
100 std::cout <<
" T p Ionization dE/dx|_R\n"
101 <<
" [MeV] [MeV/c] ---[MeV cm^2/g]----\n"
102 << std::scientific << std::setprecision(3);
106 for (
double tbase = 1.; tbase <= 1.e9; tbase *= 10.) {
107 for (
int i = 0; i < 16; ++i) {
111 double t = tbase * fact[i];
116 double p = std::sqrt(1.e-6 * t * t + 2.e-3 * t * mass);
120 double dedxr = detprop.Eloss(p, mass, 0.05) / detprop.Density();
121 double dedx = detprop.Eloss(p, mass, 0.) / detprop.Density();
122 std::cout << std::setw(10) << t << std::setw(10) << 1000. * p << std::setw(10) << dedx
123 << std::setw(10) << dedxr << std::endl;
BEGIN_PROLOG could also be cerr
virtual double RadiationLength() const =0
BEGIN_PROLOG could also be cout