Runs the test.
The arguments in argv are: 0. name of the executable ("DetectorPropertiesStandard_test")
70 config.SetConfigurationPath(argv[iParam]);
72 std::cerr <<
"FHiCL configuration file path required as first argument!" << std::endl;
78 if (++iParam < argc) config.SetMainTesterParameterSetPath(argv[iParam]);
82 if (++iParam < argc) {
83 config.SetServiceParameterSetPath(
"DetectorPropertiesService", argv[iParam]);
119 unsigned int const nWaveformTicks = detp.NumberTimeSamples();
120 unsigned int const nReadoutWindowTicks = detp.ReadOutWindowSize();
122 mf::LogVerbatim(
"detp_test") <<
"Electric field in the active volume: " << detp.Efield()
124 <<
"\nSampling rate: " << TDCtick <<
" ns"
125 <<
"\nArgon temperature: " << detp.Temperature() <<
" K"
126 <<
"\nArgon density: " << detp.Density() <<
" kg/dm^3 (at " << detp.Temperature() <<
" K)"
127 <<
"\nArgon density: " << detp.Density(87.0) <<
" kg/dm^3 (at 87 K)"
128 <<
"\nDrift velocity: " << driftVelocity <<
" cm/us"
129 <<
"\nReadout window: " << nReadoutWindowTicks <<
" ticks ("
130 << (nReadoutWindowTicks * TDCtick / 1000) <<
" us)"
131 <<
"\nTPC waveform length: " << nWaveformTicks <<
" ticks ("
132 << (nWaveformTicks * TDCtick / 1000) <<
" us)";
135 unsigned int headerColWidth = 0U;
136 for (
auto planeID : geom.IteratePlaneIDs()) {
137 auto const l = std::string(planeID).length();
138 if (headerColWidth < l) headerColWidth = l;
143 bool allSameDrift =
true;
145 auto driftDistances = geom.makeTPCData<
double>();
146 for (
auto const&
TPC : geom.IterateTPCs()) {
147 auto const driftDistance =
TPC.DriftDistance();
148 driftDistances[
TPC.ID()] = driftDistance;
149 allSameDrift = allSameDrift &
check.equal(driftDistance, driftDistances.first());
154 auto const driftDistance = driftDistances.first();
155 auto const driftTime = driftDistance / driftVelocity;
156 mf::LogVerbatim(
"detp_test") <<
"Drift distance: " << driftDistance <<
" cm"
157 <<
"\nDrift time: " << driftTime <<
" us, "
158 << (driftTime / (TDCtick / 1000.)) <<
" ticks";
162 mf::LogVerbatim log(
"detp_test");
163 std::array<unsigned int, 4U>
const columnSizes = {{headerColWidth, 9U, 13U, 7U}};
164 log << std::setw(columnSizes[0]) <<
"Drift:"
165 <<
" | " << std::setw(columnSizes[1]) <<
"time [us]"
166 <<
" | " << std::setw(columnSizes[2]) <<
"distance [cm]"
167 <<
" | " << std::setw(columnSizes[3]) <<
"ticks";
170 for (
auto const&
TPCID : geom.IterateTPCIDs()) {
171 auto const driftDistance = driftDistances[
TPCID];
172 auto const driftTime = driftDistance / driftVelocity;
174 << std::setw(columnSizes[0]) <<
TPCID <<
" | " << std::setw(columnSizes[1]) << driftTime
175 <<
" | " << std::setw(columnSizes[2]) << driftDistance <<
" | "
176 << std::setw(columnSizes[3]) << (driftTime / (TDCtick / 1000.));
181 if (nErrors > 0) { mf::LogError(
"detp_test") << nErrors <<
" errors detected!"; }
BEGIN_PROLOG could also be cerr
virtual double DriftVelocity(double efield=0., double temperature=0.) const =0
process_name tightIsolTest check
Description of geometry of one entire detector.
Class used for the conversion of times between different formats and references.
A test environment with some support for service providers.
Properties related to liquid argon environment in the detector.
Implementation of detinfo::DetectorClocks interface with fixed settings from configuration.
IDparameter< geo::TPCID > TPCID
Member type of validated geo::TPCID parameter.
double sampling_rate(DetectorClocksData const &data)
Returns the period of the TPC readout electronics clock.