28 int main(
int argc,
char **argv)
36 typedef JRange<double> JRange_t;
41 double minDistanceHV = 2 * 3.14;
42 JRange_t rangeHV = JRange_t(-1500 + 1e-2,
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);
76 TMultiGraph graph (output.getObjectName(), NULL);
77 JHVInterpolator interpolator(graph);
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");
100 NOTICE(
FILL(100,
'-') <<
" Interpolated high-voltage" << setfill(
' ') << endl);
104 const double targetHV = interpolator.getTargetHV (targetGain);
105 const double targetHVError = interpolator.getTargetHVError(targetGain);
107 NOTICE(
FIXED(35,2) << right << -targetHV <<
" +/- " <<
108 FIXED(8, 2) << left << targetHVError <<
109 FIXED(9, 2) << right << targetGain << endl);
111 catch (
const exception& error) {
112 FATAL(error.what() << endl);
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)...
then usage $script< string identifier >< detectorfile > input file(toashort file)+" "\nNote that the input files and toashort files should be one-to-one related." fi if (( $
Dynamic ROOT object management.
Auxiliary data structure for floating point format specification.
I/O formatting auxiliaries.
Auxiliary data structure to store high-voltage versus gain data and interpolate the nominal high-volt...
#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.
bool putObject(TDirectory *dir, const T &object)
Write object to ROOT directory.