#include <iostream>
#include <string>
#include <memory>
#include <utility>
#include <map>
#include <type_traits>
#include <stdexcept>
#include "larcorealg/TestUtils/unit_test_base.h"
#include "CLHEP/Random/JamesRandom.h"
#include "sbndcode/CRT/CRTSimulation/CRTDetSimAlg.h"
#include "sbndcode/CRT/CRTSimulation/CRTDetSimParams.h"
Go to the source code of this file.
|
constexpr long | SEED = 0 |
| Basic unit tests for the CRT detector simulation. More...
|
|
Parameters get_parameters |
( |
int |
argc, |
|
|
char const ** |
argv |
|
) |
| |
Definition at line 24 of file crt_detsimalg_test.cxx.
29 std::string config_path;
30 if (++iParam < argc) config_path = argv[iParam];
33 char const* fhicl_env = getenv(
"FHICL_FILE_PATH");
34 std::string search_path = fhicl_env? std::string(fhicl_env) +
":":
".:";
37 fhicl::intermediate_table table;
38 table = fhicl::parse_document(argv[iParam], policy);
41 fhicl::ParameterSet params;
42 params = fhicl::ParameterSet::make(table);
44 fhicl::ParameterSet
p = params.get<fhicl::ParameterSet>(
"testcrtsim");
48 Parameters detsim_params(p.template get<fhicl::ParameterSet>(
"DetSimParams"));
fhicl::Table< sbnd::crt::CRTDetSimParams > Parameters
int main |
( |
int |
argc, |
|
|
char const ** |
argv |
|
) |
| |
Definition at line 53 of file crt_detsimalg_test.cxx.
66 CLHEP::HepJamesRandom engine(
SEED);
75 uint32_t ts = detsim_alg.getChannelTriggerTicks(10000,
92 detsim_alg.ChargeResponse(1.5*1
e-3,
101 <<
"\nq1 " << q1 << std::endl;
103 if (q0 == detsim_alg.Params().AdcSaturation() or q1 == detsim_alg.Params().AdcSaturation()) {
104 std::cout <<
"Signal saturated with a 1.5 MeV deposited energy?" << std::endl;
108 if (q0 < 0 or q1 < 0) {
109 std::cout <<
"Predicted ADCs are negative?" << std::endl;
118 double original_adc = 2000;
119 uint16_t adc = detsim_alg.WaveformEmulation(10,
122 std::cout <<
"original_adc " << original_adc
123 <<
"\nadc " << adc << std::endl;
125 if (adc > static_cast<uint16_t>(original_adc)) {
126 std::cout <<
"ADC value after waveform emulation is larger?" << std::endl;
Parameters get_parameters(int argc, char const **argv)
fhicl::Table< sbnd::crt::CRTDetSimParams > Parameters
constexpr long SEED
Basic unit tests for the CRT detector simulation.
BEGIN_PROLOG could also be cout
Basic unit tests for the CRT detector simulation.
- Author
- Marco Del Tutto
Definition at line 20 of file crt_detsimalg_test.cxx.