2485 fFTM.SetVerbose(!conf.
Get<
bool>(
"quiet"));
2486 fFTM.SetHexOutput(conf.
Get<
bool>(
"hex-out"));
2487 fFTM.SetDynamicOut(conf.
Get<
bool>(
"dynamic-out"));
2490 const vector<uint16_t>
freq = conf.
Vec<uint16_t>(
"clock-conditioner.frequency");
2492 T::Warn(
"No frequencies for the clock-conditioner defined.");
2494 T::Message(
"Defining clock conditioner frequencies");
2495 for (vector<uint16_t>::const_iterator it=freq.begin();
2496 it!=freq.end(); it++)
2500 T::Error(
"clock-conditioner frequency defined twice.");
2504 if (!conf.
HasDef(
"clock-conditioner.R0.", *it) ||
2505 !conf.
HasDef(
"clock-conditioner.R1.", *it) ||
2506 !conf.
HasDef(
"clock-conditioner.R8.", *it) ||
2507 !conf.
HasDef(
"clock-conditioner.R9.", *it) ||
2508 !conf.
HasDef(
"clock-conditioner.R11.", *it) ||
2509 !conf.
HasDef(
"clock-conditioner.R13.", *it) ||
2510 !conf.
HasDef(
"clock-conditioner.R14.", *it) ||
2511 !conf.
HasDef(
"clock-conditioner.R15.", *it))
2513 T::Error(
"clock-conditioner values incomplete.");
2529 out <<
" -> " << setw(4) << *it <<
"MHz:" << hex << setfill(
'0');
2530 for (
int i=0;
i<8;
i++)
2531 out <<
" " << setw(8) << arr[
i];
2532 T::Message(out.str());
2536 const vector<string> types = conf.
Vec<
string>(
"run-type");
2538 T::Warn(
"No run-types defined.");
2540 T::Message(
"Defining run-types");
2541 for (vector<string>::const_iterator it=types.begin();
2542 it!=types.end(); it++)
2544 T::Message(
" -> "+ *it);
2548 T::Error(
"Run-type "+*it+
" defined twice.");
2552 if (!conf.
HasDef(
"sampling-frequency.", *it))
2554 T::Error(
"Neither sampling-frequency."+*it+
" nor sampling-frequency.default found.");
2558 const uint16_t frq = conf.
GetDef<uint16_t>(
"sampling-frequency.", *it);
2565 if (!CheckConfigVal<bool> (conf,
true,
"trigger.enable-trigger.", *it) ||
2566 !CheckConfigVal<bool> (conf,
true,
"trigger.enable-external-1.", *it) ||
2567 !CheckConfigVal<bool> (conf,
true,
"trigger.enable-external-2.", *it) ||
2568 !CheckConfigVal<bool> (conf,
true,
"trigger.enable-veto.", *it) ||
2569 !CheckConfigVal<bool> (conf,
true,
"trigger.enable-clock-conditioner.", *it) ||
2570 !CheckConfigVal<bool> (conf,
true,
"light-pulser.external.enable-group1.", *it) ||
2571 !CheckConfigVal<bool> (conf,
true,
"light-pulser.external.enable-group2.", *it) ||
2572 !CheckConfigVal<bool> (conf,
true,
"light-pulser.internal.enable-group1.", *it) ||
2573 !CheckConfigVal<bool> (conf,
true,
"light-pulser.internal.enable-group2.", *it) ||
2574 !CheckConfigVal<uint16_t>(conf, data.kMaxSequence,
"trigger.sequence.pedestal.", *it) ||
2575 !CheckConfigVal<uint16_t>(conf, data.kMaxSequence,
"trigger.sequence.lp-ext.", *it) ||
2576 !CheckConfigVal<uint16_t>(conf, data.kMaxSequence,
"trigger.sequence.lp-int.", *it) ||
2577 !CheckConfigVal<uint16_t>(conf, data.kMaxTriggerInterval,
"trigger.sequence.interval.", *it) ||
2578 !CheckConfigVal<uint16_t>(conf, data.kMaxMultiplicity,
"trigger.multiplicity-physics.", *it) ||
2579 !CheckConfigVal<uint16_t>(conf, data.kMaxMultiplicity,
"trigger.multiplicity-calib.", *it) ||
2580 !CheckConfigVal<uint16_t>(conf, data.kMaxWindow,
"trigger.coincidence-window-physics.", *it) ||
2581 !CheckConfigVal<uint16_t>(conf, data.kMaxWindow,
"trigger.coincidence-window-calib.", *it) ||
2582 !CheckConfigVal<uint16_t>(conf, data.kMaxDeadTime,
"trigger.dead-time.", *it) ||
2583 !CheckConfigVal<uint16_t>(conf, data.kMaxDelayTrigger,
"trigger.delay.", *it) ||
2584 !CheckConfigVal<uint16_t>(conf, data.kMaxDelayTimeMarker,
"trigger.time-marker-delay.", *it) ||
2585 !CheckConfigVal<uint16_t>(conf, 0xffff,
"ftu-report-interval.", *it) ||
2586 !CheckConfigVal<uint16_t>(conf, data.kMaxIntensity,
"light-pulser.external.intensity.", *it) ||
2587 !CheckConfigVal<uint16_t>(conf, data.kMaxIntensity,
"light-pulser.internal.intensity.", *it) ||
2588 !CheckConfigVal<uint16_t>(conf, data.kMaxDAC,
"trigger.threshold.patch.", *it) ||
2589 !CheckConfigVal<uint16_t>(conf, data.kMaxDAC,
"trigger.threshold.logic.", *it) ||
2593 data.Enable(data.kTrigger, conf.
GetDef<
bool>(
"trigger.enable-trigger.", *it));
2594 data.Enable(data.kExt1, conf.
GetDef<
bool>(
"trigger.enable-external-1.", *it));
2595 data.Enable(data.kExt2, conf.
GetDef<
bool>(
"trigger.enable-external-2.", *it));
2596 data.Enable(data.kVeto, conf.
GetDef<
bool>(
"trigger.enable-veto.", *it));
2597 data.Enable(data.kClockConditioner, conf.
GetDef<
bool>(
"trigger.enable-clock-conditioner.", *it));
2599 data.EnableLPint(data.kGroup1, conf.
GetDef<
bool>(
"light-pulser.internal.enable-group1.", *it));
2600 data.EnableLPint(data.kGroup2, conf.
GetDef<
bool>(
"light-pulser.internal.enable-group2.", *it));
2601 data.EnableLPext(data.kGroup1, conf.
GetDef<
bool>(
"light-pulser.external.enable-group1.", *it));
2602 data.EnableLPext(data.kGroup2, conf.
GetDef<
bool>(
"light-pulser.external.enable-group2.", *it));
2605 data.fIntensityLPint = conf.
GetDef<uint16_t>(
"light-pulser.internal.intensity.", *it);
2606 data.fIntensityLPext = conf.
GetDef<uint16_t>(
"light-pulser.external.intensity.", *it);
2607 data.fTriggerInterval = conf.
GetDef<uint16_t>(
"trigger.sequence.interval.", *it);
2608 data.fMultiplicityPhysics = conf.
GetDef<uint16_t>(
"trigger.multiplicity-physics.", *it);
2609 data.fMultiplicityCalib = conf.
GetDef<uint16_t>(
"trigger.multiplicity-calib.", *it);
2610 data.fWindowPhysics = conf.
GetDef<uint16_t>(
"trigger.coincidence-window-physics.", *it);
2611 data.fWindowCalib = conf.
GetDef<uint16_t>(
"trigger.coincidence-window-calib.", *it);
2612 data.fDelayTrigger = conf.
GetDef<uint16_t>(
"trigger.delay.", *it);
2613 data.fDelayTimeMarker = conf.
GetDef<uint16_t>(
"trigger.time-marker-delay.", *it);
2614 data.fDeadTime = conf.
GetDef<uint16_t>(
"trigger.dead-time.", *it);
2616 data.SetPrescaling(conf.
GetDef<uint16_t>(
"ftu-report-interval.", *it));
2618 const uint16_t seqped = conf.
GetDef<uint16_t>(
"trigger.sequence.pedestal.", *it);
2619 const uint16_t seqint = conf.
GetDef<uint16_t>(
"trigger.sequence.lp-int.", *it);
2620 const uint16_t seqext = conf.
GetDef<uint16_t>(
"trigger.sequence.lp-ext.", *it);
2622 data.SetSequence(seqped, seqint, seqext);
2624 data.EnableAllFTU();
2625 data.EnableAllPixel();
2627 const vector<uint16_t> pat1 = conf.
Vec<uint16_t>(
"trigger.disable-patch.default");
2628 const vector<uint16_t> pat2 = conf.
Vec<uint16_t>(
"trigger.disable-patch."+*it);
2630 const vector<uint16_t> pix1 = conf.
Vec<uint16_t>(
"trigger.disable-pixel.default");
2631 const vector<uint16_t> pix2 = conf.
Vec<uint16_t>(
"trigger.disable-pixel."+*it);
2633 const vector<uint16_t> ftu1 = conf.
Vec<uint16_t>(
"disable-ftu.default");
2634 const vector<uint16_t> ftu2 = conf.
Vec<uint16_t>(
"disable-ftu."+*it);
2636 vector<uint16_t> ftu, pat, pix;
2637 ftu.insert(ftu.end(), ftu1.begin(), ftu1.end());
2638 ftu.insert(ftu.end(), ftu2.begin(), ftu2.end());
2639 pat.insert(pat.end(), pat1.begin(), pat1.end());
2640 pat.insert(pat.end(), pat2.begin(), pat2.end());
2641 pix.insert(pix.end(), pix1.begin(), pix1.end());
2642 pix.insert(pix.end(), pix2.begin(), pix2.end());
2644 for (vector<uint16_t>::const_iterator ip=ftu.begin(); ip!=ftu.end(); ip++)
2653 data.DisableFTU(*ip);
2655 for (vector<uint16_t>::const_iterator ip=pat.begin(); ip!=pat.end(); ip++)
2664 data.EnablePatch(*ip,
false);
2666 for (vector<uint16_t>::const_iterator ip=pix.begin(); ip!=pix.end(); ip++)
2675 data.EnablePixel(*ip,
false);
2678 const uint16_t th0 = conf.
GetDef<uint16_t>(
"trigger.threshold.patch.", *it);
2679 const uint16_t th1 = conf.
GetDef<uint16_t>(
"trigger.threshold.logic.", *it);
2681 for (
int i=0;
i<40;
i++)
2683 data[
i].fDAC[0] = th0;
2684 data[
i].fDAC[1] = th0;
2685 data[
i].fDAC[2] = th0;
2686 data[
i].fDAC[3] = th0;
2687 data[
i].fDAC[4] = th1;
T Get(const std::string &var)
void SetEndpoint(const string &url)
std::vector< T > Vec(const std::string &var)
T GetDef(const std::string &var, const S &val)
bool HasDef(const std::string &var, const T &val)
map< uint16_t, array< uint64_t, 8 > > fClockCondSetup