25 int main(
int argc,
char **argv)
33 typedef JRange<double> JRange_t;
38 double minDistanceHV = 2 * 3.14;
39 JRange_t rangeHV = JRange_t(-1500 + 1e-2,
53 JParser<> zap(
"Example program to interpolate high-voltage versus gain ASCII data.");
71 catch (
const exception& error) {
72 FATAL(error.what() << endl);
75 JHVGainGraph::setMinHVDistance(minDistanceHV);
76 JHVGainGraph::setHVRange (rangeHV);
77 JHVGainGraph::setGainRange (rangeGain);
79 JHVGainGraph graph(output.getObjectName(), loglog, base);
83 for (map_t::const_iterator i = input.cbegin(); i != input.cend(); ++i) {
85 const double HV = i->first;
86 const double gain = i->second.first;
87 const double gainError = i->second.second;
91 graph.AddPoint(HV, gain, gainError);
94 NOTICE(
FILL(100,
'-') <<
" Interpolated high-voltage" << setfill(
' ') << endl);
98 const double targetHV = graph.getTargetHV (targetGain);
99 const double targetHVError = graph.getTargetHVError(targetGain);
101 NOTICE(
FIXED(35,2) << right << targetHV <<
" +/- " <<
102 FIXED(8, 2) << left << targetHVError <<
103 FIXED(9, 2) << right << targetGain << endl);
105 catch (
const exception& error) {
106 FATAL(error.what() << endl);
109 TFile file(output.getFilename().c_str(),
"RECREATE");
Utility class to parse command line options.
int main(int argc, char *argv[])
Time calibration (including definition of sign of time offset).
#define gmake_property(A)
macro to convert (template) parameter to JPropertiesElement object
static const double FITTOT_GAIN_MAX
Default maximal gain.
static const double FITTOT_GAIN_MIN
Default minimal gain.
Utility class to parse parameter values.
Empty structure for specification of parser element that is initialised (i.e. does not require input)...
Dynamic ROOT object management.
Auxiliary data structure for floating point format specification.
Auxiliary data structure to store high-voltage versus gain data and interpolate the nominal high-volt...
I/O formatting auxiliaries.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
const double NOMINAL_GAIN
Specification for normalized gain corresponding to a one photo-electron pulse.
General purpose messaging.
Auxiliary data structure for sequence of same character.
then $JPP_DIR examples JDetector JToT o $OUTPUT_FILE n N $NPE P gain
Utility class to parse command line options.