28int main(
int argc,
char **argv)
41 double minDistanceHV = 2 * 3.14;
42 JRange_t rangeHV = JRange_t(-1500 + 1e-2,
44 JRange_t rangeGain = JRange_t(FITTOT_GAIN_MIN + 1e-2,
45 FITTOT_GAIN_MAX - 1e-2);
46 double targetGain = NOMINAL_GAIN;
52 JParser<> zap(
"Example program to interpolate high-voltage versus gain ASCII data.");
68 catch (
const exception& error) {
69 FATAL(error.what() << endl);
72 JHVInterpolator::setMinHVDistance(minDistanceHV);
73 JHVInterpolator::setHVRange (rangeHV);
74 JHVInterpolator::setGainRange (rangeGain);
81 for (map_t::const_iterator i = input.cbegin(); i != input.cend(); ++i) {
83 const double HV = i->first;
84 const double gain = i->second.first;
85 const double gainError = i->second.second;
89 interpolator.
AddPoint(HV, gain, gainError);
92 TFile file(output.
getFilename().c_str(),
"RECREATE");
94 putObject(file,
JMeta(argc, argv));
100 NOTICE(
FILL(100,
'-') <<
" Interpolated high-voltage" << setfill(
' ') << endl);
106 const double targetHV = interpolator.
getHV ();
107 const double targetHVError = interpolator.
getHVError();
109 NOTICE(
FIXED(35,2) << right << -targetHV <<
" +/- " <<
110 FIXED(8, 2) << left << targetHVError <<
111 FIXED(9, 2) << right << targetGain << endl);
113 catch (
const exception& error) {
114 FATAL(error.what() << endl);
Time calibration (including definition of sign of time offset).
int main(int argc, char **argv)
Dynamic ROOT object management.
General purpose messaging.
Utility class to parse command line options.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
I/O formatting auxiliaries.
#define gmake_property(A)
macros to convert (template) parameter to JPropertiesElement object
Utility class to parse parameter values.
Auxiliary class to handle file name, ROOT directory and object name.
TString getObjectName() const
Get object name.
const std::string & getFilename() const
Get file name.
Utility class to parse command line options.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Auxiliary data structure for sequence of same character.
Auxiliary data structure for floating point format specification.
Auxiliary data structure to store high-voltage versus gain data and interpolate the nominal high-volt...
double getHVError() const
Get error estimate on interpolated high-voltage.
double getHV() const
Get interpolated high-voltage.
bool interpolateHV(const double gainTarget)
Inter-/Extrapolate the high-voltage value corresponding to the target gain value.
void AddPoint(Double_t HV, Double_t gain, Double_t gainError)
Add point to diagram.
Empty structure for specification of parser element that is initialised (i.e. does not require input)...
Auxiliary data structure for alignment of data.