51 JParser<> zap(
"Program to create input data for HV-tuning.");
56 zap[
'f'] =
make_field(inputFiles,
"map of run numbers to file names (i.e. to the output of JFitToT)");
57 zap[
'a'] =
make_field(detectorFile,
"detector file");
63 catch(
const exception &error) {
64 FATAL(error.what() << endl);
82 const int runNr = fileIt->first;
84 NOTICE(
"Extracting Gain-/HV-data for run " << runNr << endl);
87 TFile fitData(fileIt->second.c_str(),
"READ");
90 ResultSet& rs =
getResultSet(getTable<JPMTHVRunSettings>(), selector);
94 const int domID =
detector.getModule(
JLocation(table.DUID, table.FLOORID)).getID();
95 const string pmtID =
MAKE_STRING(right << domID <<
'.' <<
FILL(2,
'0') << table.PMTINTID);
98 const TF1* f1 = (h1 != NULL ? h1->GetFunction(
FITTOT_FNAME.c_str()) : NULL);
106 const double gain = f1->GetParameter(Ngain);
107 const double gainError = f1->GetParError (Ngain);
109 interpolator.AddPoint(table.HV_VALUE, gain, gainError);
117 }
catch (
const exception& error) {
119 FATAL(error.what() << endl);
Utility class to parse command line options.
#define MAKE_CSTRING(A)
Make C-string.
then for HISTOGRAM in h0 h1
Auxiliary class for specifying selection of database data.
#define MAKE_STRING(A)
Make string.
static const std::string FITTOT_SUFFIX
JDetectorsHelper getDetector
Function object for mapping serial number to object identifier of detector and vice versa...
static const char * FITTOT_GAIN_PARNAME
Auxiliary class to manage set of compatible ROOT objects (e.g. histograms) using unique keys...
Logical location of module.
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
Auxiliary data structure for sequence of same character.
then $JPP_DIR examples JDetector JToT o $OUTPUT_FILE n N $NPE P gain
void load(const std::string &file_name, JDetector &detector)
Load detector from input file.
ResultSet & getResultSet(const std::string &query)
Get result set.
Object reading from a list of files.
do set_variable DETECTOR_TXT $WORKDIR detector
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY source JAcoustics sh $DETECTOR_ID CHECK_EXIT_CODE typeset A TRIPODS get_tripods $WORKDIR tripod txt TRIPODS for EMITTER in
Template definition for getting table specific selector.
static const std::string FITTOT_FNAME
bool putObject(TDirectory *dir, const T &object)
Write object to ROOT directory.