47 JParser<> zap(
"Auxiliary program to set PMT thresholds according DAQ configuration of a given data taking run.");
55 zap[
'P'] =
make_field(pmtFile,
"PMT parameters file") =
"";
56 zap[
'F'] =
make_field(formula,
"transfer function") =
"((x * 1.0)/255.0 * 1.6 + 0.8 - 0.989) / 0.44";
61 catch(
const exception& error) {
62 FATAL(error.what() << endl);
73 TF1 f1(
"user", formula.c_str());
76 FATAL(
"Formula <" << formula <<
"> invalid." << endl);
82 JPMTThreshold getPMTThreshold;
90 const int id = getDetector<int>(detid);
92 getPMTThreshold.configure(
id, run);
94 DEBUG(getPMTThreshold);
96 ResultSet& rs =
getResultSet(getTable<JDetectorIntegration>(), getSelector<JDetectorIntegration>(
id));
104 catch(
const exception& error) {
105 FATAL(error.what() << endl);
111 if (i->PMTID != -1) {
115 const JPMTThreshold::result_type threshold = getPMTThreshold(i->PMTUPI);
117 const double value = f1.Eval((
double) threshold.value);
121 cout <<
FILL(4,
'0') << i->DUID <<
FILL() <<
'.'
122 <<
FILL(2,
'0') << i->FLOORID <<
FILL() <<
'['
123 <<
FILL(2,
'0') << i->CABLEPOS <<
FILL() <<
']'
125 << setw(3) << threshold.value <<
' '
126 <<
FIXED(5,2) << value <<
' ';
128 if (threshold.is_default) {
129 cout <<
"* (" <<
FIXED(5,2) << JPMTParameters().threshold <<
")";
135 if (!threshold.is_default) {
137 const JPMTIdentifier id(i->DOMID, i->CABLEPOS);
139 parameters[id].threshold = value;
142 catch(
const exception& error) {
144 <<
FILL(4,
'0') << i->DUID <<
FILL() <<
'.'
145 <<
FILL(2,
'0') << i->FLOORID <<
FILL() <<
'['
146 <<
FILL(2,
'0') << i->CABLEPOS <<
FILL() <<
']'
148 << error.what() << endl);
155 parameters.comment.add(JMeta(argc, argv));
157 parameters.store(pmtFile.c_str());
161 cout << parameters << endl;
Utility class to parse command line options.
*fatal Wrong number of arguments esac JCookie sh typeset Z DETECTOR typeset Z SOURCE_RUN typeset Z TARGET_RUN set_variable PARAMETERS_FILE $WORKDIR parameters
Auxiliary data structure for floating point format specification.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Auxiliary data structure for sequence of same character.
static JStat getFileStatus
Function object for file status.
then usage $script< input_file >< detector_file > fi set_variable OUTPUT_DIR set_variable SELECTOR JDAQTimesliceL1 set_variable DEBUG case set_variable DEBUG
ResultSet & getResultSet(const std::string &query)
Get result set.
std::vector< JServer > getServernames()
Get list of names of available database servers.
do set_variable DETECTOR_TXT $WORKDIR detector