9 using namespace sistrip;
18 : partitionName_(defaultPartitionName_),
21 forceVersions_(
false),
22 forceCurrentState_(
false),
32 runTableVersion_(0, 0),
39 pedsFullNoiseV_(0, 0),
52 : partitionName_(partition),
55 forceVersions_(
false),
56 forceCurrentState_(
false),
66 runTableVersion_(0, 0),
73 pedsFullNoiseV_(0, 0),
88 : partitionName_(input.partitionName()),
91 forceVersions_(input.forceVersions()),
92 forceCurrentState_(input.forceCurrentState()),
93 cabVersion_(input.cabVersion()),
94 fedVersion_(input.fedVersion()),
95 fecVersion_(input.fecVersion()),
96 dcuVersion_(input.dcuVersion()),
97 psuVersion_(input.psuVersion()),
99 maskVersion_(input.maskVersion()),
101 globalAnalysisV_(input.globalAnalysisVersion()),
102 runTableVersion_(input.runTableVersion()),
103 fastCablingV_(input.fastCablingVersion()),
104 apvTimingV_(input.apvTimingVersion()),
105 optoScanV_(input.optoScanVersion()),
106 vpspScanV_(input.vpspScanVersion()),
107 apvCalibV_(input.apvCalibVersion()),
108 pedestalsV_(input.pedestalsVersion()),
109 pedsFullNoiseV_(input.pedsFullNoiseVersion()),
110 apvLatencyV_(input.apvLatencyVersion()),
111 fineDelayV_(input.fineDelayVersion()),
112 inputModuleXml_(input.inputModuleXml()),
113 inputDcuInfoXml_(input.inputDcuInfoXml()),
114 inputFecXml_(input.inputFecXml()),
115 inputFedXml_(input.inputFedXml()) {
122 if (
this == &input) {
233 std::vector<uint32_t> tmp1(2, 0);
243 std::vector<uint32_t> tmp2(2, 0);
255 std::vector<std::string> tmp3(1,
"");
268 <<
" NULL pointer to SiStripConfigDb object!"
269 <<
" Aborting update...";
277 <<
" NULL pointer to DeviceFactory object!"
278 <<
" Aborting update...";
288 std::stringstream
ss;
289 ss <<
"[SiStripPartition::" << __func__ <<
"]"
290 <<
" Updating description versions for partition \"" <<
partitionName_ <<
"\"...";
300 tkStateVector states;
301 states = df->getCurrentStates();
302 tkStateVector::const_iterator istate = states.begin();
303 tkStateVector::const_iterator jstate = states.end();
304 while (istate != jstate) {
305 if (*istate && partitionName_ == (*istate)->getPartitionName()) {
312 if (istate != states.end()) {
314 cabVersion_.first = (*istate)->getConnectionVersionMajorId();
315 cabVersion_.second = (*istate)->getConnectionVersionMinorId();
318 fecVersion_.first = (*istate)->getFecVersionMajorId();
319 fecVersion_.second = (*istate)->getFecVersionMinorId();
322 fedVersion_.first = (*istate)->getFedVersionMajorId();
323 fedVersion_.second = (*istate)->getFedVersionMinorId();
326 dcuVersion_.first = (*istate)->getDcuInfoVersionMajorId();
327 dcuVersion_.second = (*istate)->getDcuInfoVersionMinorId();
330 psuVersion_.first = (*istate)->getDcuPsuMapVersionMajorId();
331 psuVersion_.second = (*istate)->getDcuPsuMapVersionMinorId();
335 maskVersion_.first = (*istate)->getMaskVersionMajorId();
336 maskVersion_.second = (*istate)->getMaskVersionMinorId();
349 HashMapAnalysisVersions local_versions = df->getLocalAnalysisVersions(
globalAnalysisV_);
352 HashMapAnalysisVersions::const_iterator ivers = local_versions.begin();
353 HashMapAnalysisVersions::const_iterator jvers = local_versions.end();
354 for (; ivers != jvers; ++ivers) {
355 if (ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_FASTFEDCABLING) {
358 }
else if (ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_TIMING) {
361 }
else if (ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_OPTOSCAN) {
364 }
else if (ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_VPSPSCAN) {
367 }
else if (ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_CALIBRATION) {
370 }
else if (ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_PEDESTALS) {
373 }
else if (ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_PEDSFULLNOISE) {
376 }
else if (ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_APVLATENCY) {
379 }
else if (ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_FINEDELAY) {
382 }
else if (ivers->first == CommissioningAnalysisDescription::T_UNKNOWN) {
383 std::stringstream
ss;
385 <<
" Found UNKNOWN AnalysisType!";
388 std::stringstream
ss;
390 <<
" Unable to match content to any AnalysisType!";
399 HashMapAnalysisVersions local_versions = df->getLocalAnalysisVersions(
globalAnalysisV_);
402 HashMapAnalysisVersions::const_iterator ivers = local_versions.begin();
403 HashMapAnalysisVersions::const_iterator jvers = local_versions.end();
404 for (; ivers != jvers; ++ivers) {
405 if (ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_FASTFEDCABLING) {
410 }
else if (ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_TIMING) {
415 }
else if (ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_OPTOSCAN) {
420 }
else if (ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_VPSPSCAN) {
425 }
else if (ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_CALIBRATION) {
430 }
else if (ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_PEDESTALS) {
435 }
else if (ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_PEDSFULLNOISE) {
440 }
else if (ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_APVLATENCY) {
445 }
else if (ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_FINEDELAY) {
450 }
else if (ivers->first == CommissioningAnalysisDescription::T_UNKNOWN) {
451 std::stringstream
ss;
453 <<
" Found UNKNOWN AnalysisType!";
456 std::stringstream
ss;
458 <<
" Unable to match content to any AnalysisType!";
465 std::stringstream
ss;
467 <<
" Unable to find \"current state\" for partition \"" << partitionName_ <<
"\"";
473 TkRun*
run =
nullptr;
475 run = df->getLastRun(partitionName_);
482 if (run->getRunNumber()) {
488 cabVersion_.first = run->getConnectionVersionMajorId();
489 cabVersion_.second = run->getConnectionVersionMinorId();
497 dcuVersion_.first = run->getDcuInfoVersionMajorId();
498 dcuVersion_.second = run->getDcuInfoVersionMinorId();
500 psuVersion_.first = run->getDcuPsuMapVersionMajorId();
501 psuVersion_.second = run->getDcuPsuMapVersionMinorId();
509 uint16_t
type = run->getModeId(run->getMode());
512 }
else if (type == 2) {
514 }
else if (type == 3) {
516 }
else if (type == 4) {
518 }
else if (type == 5) {
520 }
else if (type == 6) {
522 }
else if (type == 7) {
524 }
else if (type == 8) {
526 }
else if (type == 10) {
528 }
else if (type == 12) {
530 }
else if (type == 13) {
532 }
else if (type == 14) {
534 }
else if (type == 15) {
536 }
else if (type == 16) {
538 }
else if (type == 17) {
540 }
else if (type == 18) {
542 }
else if (type == 19) {
544 }
else if (type == 20) {
546 }
else if (type == 21) {
548 }
else if (type == 22) {
550 }
else if (type == 23) {
552 }
else if (type == 24) {
554 }
else if (type == 33) {
556 }
else if (type == 0) {
559 <<
" NULL run type returned!"
560 <<
" for partition \"" << partitionName_ <<
"\"";
564 <<
" UNKNOWN run type (" << type <<
") returned!"
565 <<
" for partition \"" << partitionName_ <<
"\"";
570 HashMapAnalysisVersions local_versions = df->getLocalAnalysisVersions(
globalAnalysisV_);
571 HashMapAnalysisVersions::const_iterator ivers = local_versions.begin();
572 HashMapAnalysisVersions::const_iterator jvers = local_versions.end();
573 for (; ivers != jvers; ++ivers) {
574 if (ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_FASTFEDCABLING) {
577 }
else if (ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_TIMING) {
580 }
else if (ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_OPTOSCAN) {
583 }
else if (ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_VPSPSCAN) {
586 }
else if (ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_CALIBRATION) {
589 }
else if (ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_PEDESTALS) {
592 }
else if (ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_PEDSFULLNOISE) {
595 }
else if (ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_APVLATENCY) {
598 }
else if (ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_FINEDELAY) {
601 }
else if (ivers->first == CommissioningAnalysisDescription::T_UNKNOWN) {
602 std::stringstream
ss;
604 <<
" Found UNKNOWN AnalysisType!";
607 std::stringstream
ss;
609 <<
" Unable to match content to any AnalysisType!";
618 CommissioningAnalysisDescription::commissioningType type = CommissioningAnalysisDescription::T_UNKNOWN;
620 type = CommissioningAnalysisDescription::T_ANALYSIS_FASTFEDCABLING;
622 type = CommissioningAnalysisDescription::T_ANALYSIS_TIMING;
624 type = CommissioningAnalysisDescription::T_ANALYSIS_OPTOSCAN;
626 type = CommissioningAnalysisDescription::T_ANALYSIS_VPSPSCAN;
628 type = CommissioningAnalysisDescription::T_ANALYSIS_CALIBRATION;
630 type = CommissioningAnalysisDescription::T_ANALYSIS_CALIBRATION;
632 type = CommissioningAnalysisDescription::T_ANALYSIS_CALIBRATION;
634 type = CommissioningAnalysisDescription::T_ANALYSIS_CALIBRATION;
636 type = CommissioningAnalysisDescription::T_ANALYSIS_PEDESTALS;
638 type = CommissioningAnalysisDescription::T_ANALYSIS_PEDSFULLNOISE;
640 type = CommissioningAnalysisDescription::T_ANALYSIS_APVLATENCY;
642 type = CommissioningAnalysisDescription::T_ANALYSIS_FINEDELAY;
646 HashMapRunVersion local_versions = df->getAnalysisHistory(partitionName_, type);
649 HashMapRunVersion::const_iterator ivers = local_versions.end();
651 ivers = --(local_versions.end());
657 if (ivers != local_versions.end()) {
658 if (type == CommissioningAnalysisDescription::T_ANALYSIS_FASTFEDCABLING) {
665 }
else if (type == CommissioningAnalysisDescription::T_ANALYSIS_TIMING) {
669 }
else if (type == CommissioningAnalysisDescription::T_ANALYSIS_OPTOSCAN) {
671 optoScanV_.first = ivers->second.back().first;
672 optoScanV_.second = ivers->second.back().second;
673 }
else if (type == CommissioningAnalysisDescription::T_ANALYSIS_VPSPSCAN) {
675 vpspScanV_.first = ivers->second.back().first;
676 vpspScanV_.second = ivers->second.back().second;
677 }
else if (type == CommissioningAnalysisDescription::T_ANALYSIS_CALIBRATION) {
679 apvCalibV_.first = ivers->second.back().first;
680 apvCalibV_.second = ivers->second.back().second;
681 }
else if (type == CommissioningAnalysisDescription::T_ANALYSIS_PEDESTALS) {
685 }
else if (type == CommissioningAnalysisDescription::T_ANALYSIS_PEDSFULLNOISE) {
689 }
else if (type == CommissioningAnalysisDescription::T_ANALYSIS_APVLATENCY) {
693 }
else if (type == CommissioningAnalysisDescription::T_ANALYSIS_FINEDELAY) {
697 }
else if (type == CommissioningAnalysisDescription::T_UNKNOWN) {
698 std::stringstream
ss;
700 <<
" Found UNKNOWN AnalysisType!";
703 std::stringstream
ss;
705 <<
" Unable to match content to any AnalysisType!";
709 std::stringstream
ss;
711 <<
"[SiStripPartition::" << __func__ <<
"]"
712 <<
" Unable to find run number " <<
runNumber_ <<
" in \"history\" hash map ";
719 <<
" Mismatch of run number requested (" <<
runNumber_ <<
") and received ("
720 << run->getRunNumber() <<
")"
721 <<
" to/from database for partition \"" << partitionName_ <<
"\"";
726 <<
" NULL run number returned!"
727 <<
" for partition \"" << partitionName_ <<
"\"";
732 <<
" NULL pointer to TkRun object!"
733 <<
" Unable to retrieve versions for run number " <<
runNumber_
734 <<
". Run number may not be consistent with partition \"" << partitionName_
750 ss <<
" Run number : ";
752 ss <<
"Forced \"current state\"! (equivalent to versions below)";
754 ss <<
"Forced versions specified below!";
782 ss <<
" Opto scan maj/min vers : " <<
optoScanV_.first <<
"." <<
optoScanV_.second << std::endl;
783 ss <<
" VPSP scan maj/min vers : " <<
vpspScanV_.first <<
"." <<
vpspScanV_.second << std::endl;
784 ss <<
" APV calib maj/min vers : " <<
apvCalibV_.first <<
"." <<
apvCalibV_.second << std::endl;
796 <<
" <= This \"state\" version overriden by \"history\" version " <<
fastCablingV_.first <<
"."
797 <<
fastCablingV_.second <<
" for this FED cabling run!" << std::endl;
804 <<
" <= This \"state\" version overriden by \"history\" version " <<
apvTimingV_.first <<
"."
805 <<
apvTimingV_.second <<
" for this APV timing run!" << std::endl;
809 ss <<
" Opto scan maj/min vers : " <<
optoScanV_.first <<
"." <<
optoScanV_.second << std::endl;
812 <<
" <= This \"state\" version overriden by \"history\" version " <<
optoScanV_.first <<
"."
813 <<
optoScanV_.second <<
" for this opto scan run!" << std::endl;
817 ss <<
" VPSP scan maj/min vers : " <<
vpspScanV_.first <<
"." <<
vpspScanV_.second << std::endl;
820 <<
" <= This \"state\" version overriden by \"history\" version " <<
vpspScanV_.first <<
"."
821 <<
vpspScanV_.second <<
" for this VPSP scan run!" << std::endl;
826 ss <<
" APV calib maj/min vers : " <<
apvCalibV_.first <<
"." <<
apvCalibV_.second << std::endl;
829 <<
" <= This \"state\" version overriden by \"history\" version " <<
apvCalibV_.first <<
"."
830 <<
apvCalibV_.second <<
" for this APV calib run!" << std::endl;
837 <<
" <= This \"state\" version overriden by \"history\" version " <<
pedestalsV_.first <<
"."
838 <<
pedestalsV_.second <<
" for this pedestals run!" << std::endl;
846 <<
" <= This \"state\" version overriden by \"history\" version " <<
pedsFullNoiseV_.first <<
"."
854 <<
" <= This \"state\" version overriden by \"history\" version " <<
apvLatencyV_.first <<
"."
855 <<
apvLatencyV_.second <<
" for this APV latency run!" << std::endl;
862 <<
" <= This \"state\" version overriden by \"history\" version " <<
fineDelayV_.first <<
"."
863 <<
fineDelayV_.second <<
" for this fine delay run!" << std::endl;
870 <<
" Input \"fec.xml\" file(s) : ";
871 std::vector<std::string>::const_iterator ifec =
inputFecXml_.begin();
876 ss <<
" Input \"fed.xml\" file(s) : ";
877 std::vector<std::string>::const_iterator ifed =
inputFedXml_.begin();
888 std::stringstream
ss;
897 std::vector<uint32_t>
input = _input;
898 if (input.size() != 2) {
900 <<
" Unexpected size (" << input.size()
901 <<
") for vector containing version numbers (major,minor)!"
902 <<
" Resizing to 2 elements (default values will be 0,0)...";
905 return std::make_pair(input[0], input[1]);
static const char runNumber_[]
sistrip::RunType runType_
T getUntrackedParameter(std::string const &, T const &) const
static const std::string defaultPartitionName_
Versions maskVersion() const
Versions pedestalsVersion() const
Versions vpspScanVersion() const
DeviceFactory *const deviceFactory(std::string method_name="") const
Versions fineDelayVersion() const
Versions optoScanVersion() const
std::string partitionName() const
void handleException(const std::string &method_name, const std::string &extra_info="") const
bool operator!=(const SiStripPartition &) const
std::string partitionName_
uint32_t runNumber() const
uint32_t globalAnalysisVersion() const
void print(std::stringstream &, bool using_db=false) const
Log< level::Error, false > LogError
std::ostream & operator<<(std::ostream &out, const ALILine &li)
void update(const SiStripConfigDb *const)
static std::string const input
static const char mlConfigDb_[]
static std::string runType(const sistrip::RunType &)
Versions apvTimingVersion() const
Versions apvLatencyVersion() const
void pset(const edm::ParameterSet &)
Versions versions(const std::vector< uint32_t > &)
An interface class to the DeviceFactory.
Container class for database partition parameters.
std::vector< std::string > inputFedXml_
Versions runTableVersion() const
std::vector< std::string > inputFecXml() const
bool forceCurrentState() const
Versions pedsFullNoiseVersion() const
std::string inputDcuInfoXml_
std::pair< uint32_t, uint32_t > Versions
std::string inputModuleXml_
Versions apvCalibVersion() const
std::vector< std::string > inputFecXml_
bool operator==(const SiStripPartition &) const
std::vector< std::string > inputFedXml() const
Versions dcuVersion() const
bool forceVersions() const
Versions runTableVersion_
Log< level::Warning, false > LogWarning
SiStripPartition & operator=(const SiStripPartition &)
Versions psuVersion() const
sistrip::RunType runType() const
Versions fecVersion() const
Versions cabVersion() const
Versions fedVersion() const
std::string inputDcuInfoXml() const
uint32_t globalAnalysisV_
std::string inputModuleXml() const
Versions fastCablingVersion() const