58 JParser<> zap(
"Program to create input data for HV-tuning.");
63 zap[
'f'] =
make_field(inputFiles,
"map of run numbers to file names (i.e. to the output of JFitToT)");
64 zap[
'a'] =
make_field(detectorFile,
"detector file");
71 catch(
const exception &error) {
72 FATAL(error.what() << endl);
90 const int runNr = fileIt->first;
92 NOTICE(
"Extracting Gain-/HV-data for run " << runNr << endl);
95 TFile fitData(fileIt->second.c_str(),
"READ");
98 ResultSet& rs =
getResultSet(getTable<JPMTHVRunSettings>(), selector);
102 const int domID =
detector.getModule(
JLocation(table.DUID, table.FLOORID)).getID();
103 const string pmtID =
MAKE_STRING(right << domID <<
'.' <<
FILL(2,
'0') << table.PMTINTID);
106 const TF1* f1 = (h1 != NULL ? h1->GetFunction(
FITTOT_FNAME.c_str()) : NULL);
114 const double gain = f1->GetParameter(Ngain);
115 const double gainError = f1->GetParError (Ngain);
117 HVGainData->
AddPoint(table.HV_VALUE, gain, gainError);
125 }
catch (
const exception& error) {
127 FATAL(error.what() << endl);
Utility class to parse command line options.
#define gmake_property(A)
macro to convert (template) parameter to JPropertiesElement object
Utility class to parse parameter values.
#define MAKE_CSTRING(A)
Make C-string.
then for HISTOGRAM in h0 h1
Empty structure for specification of parser element that is initialised (i.e. does not require input)...
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 data structure to store high-voltage versus gain data and interpolate the nominal high-volt...
Auxiliary class to manage set of compatible ROOT objects (e.g. histograms) using unique keys...
Logical location of module.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
void AddPoint(Double_t HV, Double_t gain, Double_t gainError)
Add point to diagram.
static const std::string HVGAINGRAPH_SUFFIX
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.
do set_variable DETECTOR_TXT $WORKDIR detector
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.