58 main(
int argc,
char const** argv)
72 std::cerr <<
"FHiCL configuration file path required as first argument!" << std::endl;
82 if (++iParam < argc) {
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!"; }
Base class for objects initializing a geometry.
Prov const * Provider() const
Return the specified provider (throws if not available)
BEGIN_PROLOG could also be cerr
Helper functions for support of LArPropertiesService in LArSoft tests.
Class for approximate comparisons.
virtual double DriftVelocity(double efield=0., double temperature=0.) const =0
Helper functions for support of DetectorClocksService in LArSoft tests.
Access the description of detector geometry.
Prov * SimpleProviderSetup()
Oversimplified provider setup.
Environment for a geometry test.
process_name tightIsolTest check
Helpers for support of DetectorPropertiesService in LArSoft tests.
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.
void SetConfigurationPath(std::string path)
Sets the path to the configuration file.
Interface to algorithm class for a specific detector channel mapping.
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.
constexpr bool equal(Value_t a, Value_t b) const
Returns whether a and b are no farther than the threshold.
int main(int argc, char **argv)
double sampling_rate(DetectorClocksData const &data)
Returns the period of the TPC readout electronics clock.
void SetServiceParameterSetPath(std::string service_name, std::string path)
Sets the FHiCL path for the configuration of a test algorithm.
void SetMainTesterParameterSetPath(std::string path)
Sets the FHiCL path for the configuration of the main test algorithm.