9 #include "dbclient/KM3NeTDBClient.h"
34 int main(
int argc,
char **argv)
52 JParser<> zap(
"Program to create input data for HV-tuning.");
58 zap[
'f'] =
make_field(inputFiles,
"map of run numbers to file names (i.e. to the output of JFitToT)");
59 zap[
'a'] =
make_field(detectorFile,
"detector file");
65 catch(
const exception &error) {
66 FATAL(error.what() << endl);
84 const int runNr = fileIt->first;
86 NOTICE(
"Extracting Gain-/HV-data for run " << runNr << endl);
89 TFile fitData(fileIt->second.c_str(),
"READ");
92 ResultSet& rs =
getResultSet(getTable<JPMTHVRunSettings>(), selector);
96 const int domID =
detector.getModule(
JLocation(table.DUID, table.FLOORID)).getID();
97 const string pmtID =
MAKE_STRING(right << domID <<
'.' <<
FILL(2,
'0') << table.CABLEPOS);
100 const TF1*
f1 = (h1 != NULL ? h1->GetFunction(
FITTOT_FNAME.c_str()) : NULL);
108 const double gain =
f1->GetParameter(Ngain);
109 const double gainError =
f1->GetParError (Ngain);
111 interpolator.
AddPoint(table.HV_VALUE, gain, gainError);
119 }
catch (
const exception& error) {
121 FATAL(error.what() << endl);
This file is automatically created by make.
Data structure for detector geometry and calibration.
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 MAKE_CSTRING(A)
Make C-string.
#define MAKE_STRING(A)
Make string.
Scanning of objects from a single file according a format that follows from the extension of each fil...
Auxiliary class for specifying selection of database data.
Logical location of module.
Utility class to parse command line options.
Auxiliary class to manage set of compatible ROOT objects (e.g. histograms) using unique keys.
Object reading from a list of files.
virtual bool hasNext() override
Check availability of next element.
const JPolynome f1(1.0, 2.0, 3.0)
Function.
static const std::string FITTOT_FNAME
static const std::string FITTOT_SUFFIX
static const char * FITTOT_GAIN_PARNAME
ResultSet & getResultSet(const std::string &query)
Get result set.
JDetectorsHelper & getDetector()
Auxiliary function for helper object initialisation.
std::vector< JServer > getServernames()
Get list of names of available database servers.
void load(const std::string &file_name, JDetector &detector)
Load detector from input file.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
bool putObject(TDirectory &dir, const TObject &object)
Write object to ROOT directory.
Auxiliary data structure for sequence of same character.
Auxiliary data structure to store high-voltage versus gain data and interpolate the nominal high-volt...
void AddPoint(Double_t HV, Double_t gain, Double_t gainError)
Add point to diagram.
Wrapper class for server name.
Template definition for getting table specific selector.