18 partitionName_(defaultPartitionName_),
21 forceVersions_(
false),
22 forceCurrentState_(
false),
32 runTableVersion_(0,0),
119 if (
this == &input ) {
return *
this; }
187 return !( *
this ==
input );
242 std::vector<uint32_t> tmp1(2,0);
252 std::vector<uint32_t> tmp2(2,0);
264 std::vector<std::string> tmp3(1,
"");
279 <<
"[SiStripPartition::" << __func__ <<
"]" 280 <<
" NULL pointer to SiStripConfigDb object!" 281 <<
" Aborting update...";
289 <<
"[SiStripPartition::" << __func__ <<
"]" 290 <<
" NULL pointer to DeviceFactory object!" 291 <<
" Aborting update...";
299 std::stringstream ss;
300 ss <<
"[SiStripPartition::" << __func__ <<
"]" 301 <<
" Updating description versions for partition \"" 315 tkStateVector states;
316 states = df->getCurrentStates();
317 tkStateVector::const_iterator istate = states.begin();
318 tkStateVector::const_iterator jstate = states.end();
319 while ( istate != jstate ) {
320 if ( *istate && partitionName_ == (*istate)->getPartitionName() ) {
break; }
325 if ( istate != states.end() ) {
329 cabVersion_.first = (*istate)->getConnectionVersionMajorId();
330 cabVersion_.second = (*istate)->getConnectionVersionMinorId();
334 fecVersion_.first = (*istate)->getFecVersionMajorId();
335 fecVersion_.second = (*istate)->getFecVersionMinorId();
339 fedVersion_.first = (*istate)->getFedVersionMajorId();
340 fedVersion_.second = (*istate)->getFedVersionMinorId();
344 dcuVersion_.first = (*istate)->getDcuInfoVersionMajorId();
345 dcuVersion_.second = (*istate)->getDcuInfoVersionMinorId();
349 psuVersion_.first = (*istate)->getDcuPsuMapVersionMajorId();
350 psuVersion_.second = (*istate)->getDcuPsuMapVersionMinorId();
356 maskVersion_.first = (*istate)->getMaskVersionMajorId();
357 maskVersion_.second = (*istate)->getMaskVersionMinorId();
368 HashMapAnalysisVersions local_versions = df->getLocalAnalysisVersions(
globalAnalysisV_ );
371 HashMapAnalysisVersions::const_iterator ivers = local_versions.begin();
372 HashMapAnalysisVersions::const_iterator jvers = local_versions.end();
373 for ( ; ivers != jvers; ++ivers ) {
374 if ( ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_FASTFEDCABLING ) {
377 }
else if ( ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_TIMING ) {
380 }
else if ( ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_OPTOSCAN ) {
383 }
else if ( ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_VPSPSCAN ) {
386 }
else if ( ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_CALIBRATION ) {
389 }
else if ( ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_PEDESTALS ) {
392 }
else if ( ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_PEDSFULLNOISE ) {
395 }
else if ( ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_APVLATENCY ) {
398 }
else if ( ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_FINEDELAY ) {
401 }
else if ( ivers->first == CommissioningAnalysisDescription::T_UNKNOWN ) {
402 std::stringstream ss;
404 <<
"[SiStripPartition::" << __func__ <<
"]" 405 <<
" Found UNKNOWN AnalysisType!";
408 std::stringstream ss;
410 <<
"[SiStripPartition::" << __func__ <<
"]" 411 <<
" Unable to match content to any AnalysisType!";
420 HashMapAnalysisVersions local_versions = df->getLocalAnalysisVersions(
globalAnalysisV_ );
423 HashMapAnalysisVersions::const_iterator ivers = local_versions.begin();
424 HashMapAnalysisVersions::const_iterator jvers = local_versions.end();
425 for ( ; ivers != jvers; ++ivers ) {
426 if ( ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_FASTFEDCABLING ) {
431 }
else if ( ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_TIMING ) {
436 }
else if ( ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_OPTOSCAN ) {
441 }
else if ( ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_VPSPSCAN ) {
446 }
else if ( ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_CALIBRATION ) {
451 }
else if ( ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_PEDESTALS ) {
456 }
else if ( ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_PEDSFULLNOISE ) {
461 }
else if ( ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_APVLATENCY ) {
466 }
else if ( ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_FINEDELAY ) {
471 }
else if ( ivers->first == CommissioningAnalysisDescription::T_UNKNOWN ) {
472 std::stringstream ss;
474 <<
"[SiStripPartition::" << __func__ <<
"]" 475 <<
" Found UNKNOWN AnalysisType!";
478 std::stringstream ss;
480 <<
"[SiStripPartition::" << __func__ <<
"]" 481 <<
" Unable to match content to any AnalysisType!";
489 std::stringstream ss;
491 <<
"[SiStripPartition::" << __func__ <<
"]" 492 <<
" Unable to find \"current state\" for partition \"" 493 << partitionName_ <<
"\"";
499 TkRun*
run =
nullptr;
500 if ( !
runNumber_ ) { run = df->getLastRun( partitionName_ ); }
501 else { run = df->getRun( partitionName_,
runNumber_ ); }
506 if ( run->getRunNumber() ) {
512 cabVersion_.first = run->getConnectionVersionMajorId();
513 cabVersion_.second = run->getConnectionVersionMinorId();
521 dcuVersion_.first = run->getDcuInfoVersionMajorId();
522 dcuVersion_.second = run->getDcuInfoVersionMinorId();
524 psuVersion_.first = run->getDcuPsuMapVersionMajorId();
525 psuVersion_.second = run->getDcuPsuMapVersionMinorId();
533 uint16_t
type = run->getModeId( run->getMode() );
557 else if ( type == 0 ) {
560 <<
"[SiStripPartition::" << __func__ <<
"]" 561 <<
" NULL run type returned!" 562 <<
" for partition \"" << partitionName_ <<
"\"";
566 <<
"[SiStripPartition::" << __func__ <<
"]" 567 <<
" UNKNOWN run type (" << type<<
") returned!" 568 <<
" for partition \"" << partitionName_ <<
"\"";
573 HashMapAnalysisVersions local_versions = df->getLocalAnalysisVersions(
globalAnalysisV_ );
574 HashMapAnalysisVersions::const_iterator ivers = local_versions.begin();
575 HashMapAnalysisVersions::const_iterator jvers = local_versions.end();
576 for ( ; ivers != jvers; ++ivers ) {
577 if ( ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_FASTFEDCABLING ) {
580 }
else if ( ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_TIMING ) {
583 }
else if ( ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_OPTOSCAN ) {
586 }
else if ( ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_VPSPSCAN ) {
589 }
else if ( ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_CALIBRATION ) {
592 }
else if ( ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_PEDESTALS ) {
595 }
else if ( ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_PEDSFULLNOISE ) {
598 }
else if ( ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_APVLATENCY ) {
601 }
else if ( ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_FINEDELAY ) {
604 }
else if ( ivers->first == CommissioningAnalysisDescription::T_UNKNOWN ) {
605 std::stringstream ss;
607 <<
"[SiStripPartition::" << __func__ <<
"]" 608 <<
" Found UNKNOWN AnalysisType!";
611 std::stringstream ss;
613 <<
"[SiStripPartition::" << __func__ <<
"]" 614 <<
" Unable to match content to any AnalysisType!";
625 CommissioningAnalysisDescription::commissioningType type = CommissioningAnalysisDescription::T_UNKNOWN;
640 HashMapRunVersion local_versions = df->getAnalysisHistory( partitionName_, type );
643 HashMapRunVersion::const_iterator ivers = local_versions.end();
644 if (
runNumber_ == 0 ) { ivers = --(local_versions.end()); }
645 else { ivers = local_versions.find(
runNumber_ ); }
648 if ( ivers != local_versions.end() ) {
649 if ( type == CommissioningAnalysisDescription::T_ANALYSIS_FASTFEDCABLING ) {
656 }
else if ( type == CommissioningAnalysisDescription::T_ANALYSIS_TIMING ) {
660 }
else if ( type == CommissioningAnalysisDescription::T_ANALYSIS_OPTOSCAN ) {
662 optoScanV_.first = ivers->second.back().first;
663 optoScanV_.second = ivers->second.back().second;
664 }
else if ( type == CommissioningAnalysisDescription::T_ANALYSIS_VPSPSCAN ) {
666 vpspScanV_.first = ivers->second.back().first;
667 vpspScanV_.second = ivers->second.back().second;
668 }
else if ( type == CommissioningAnalysisDescription::T_ANALYSIS_CALIBRATION ) {
670 apvCalibV_.first = ivers->second.back().first;
671 apvCalibV_.second = ivers->second.back().second;
672 }
else if ( type == CommissioningAnalysisDescription::T_ANALYSIS_PEDESTALS ) {
676 }
else if ( type == CommissioningAnalysisDescription::T_ANALYSIS_PEDSFULLNOISE ) {
680 }
else if ( type == CommissioningAnalysisDescription::T_ANALYSIS_APVLATENCY ) {
684 }
else if ( type == CommissioningAnalysisDescription::T_ANALYSIS_FINEDELAY ) {
688 }
else if ( type == CommissioningAnalysisDescription::T_UNKNOWN ) {
689 std::stringstream ss;
691 <<
"[SiStripPartition::" << __func__ <<
"]" 692 <<
" Found UNKNOWN AnalysisType!";
695 std::stringstream ss;
697 <<
"[SiStripPartition::" << __func__ <<
"]" 698 <<
" Unable to match content to any AnalysisType!";
702 std::stringstream ss;
704 <<
"[SiStripPartition::" << __func__ <<
"]" 705 <<
" Unable to find run number " <<
runNumber_ 706 <<
" in \"history\" hash map ";
714 <<
"[SiStripPartition::" << __func__ <<
"]" 715 <<
" Mismatch of run number requested (" 717 <<
") and received (" 718 << run->getRunNumber() <<
")" 719 <<
" to/from database for partition \"" 720 << partitionName_ <<
"\"";
725 <<
"[SiStripPartition::" << __func__ <<
"]" 726 <<
" NULL run number returned!" 727 <<
" for partition \"" << partitionName_ <<
"\"";
732 <<
"[SiStripPartition::" << __func__ <<
"]" 733 <<
" NULL pointer to TkRun object!" 734 <<
" Unable to retrieve versions for run number " 736 <<
". Run number may not be consistent with partition \"" 737 << partitionName_ <<
"\"!";
754 ss <<
" Run number : ";
755 if (
forceCurrentState_ ) { ss <<
"Forced \"current state\"! (equivalent to versions below)"; }
756 else if (
forceVersions_ ) { ss <<
"Forced versions specified below!"; }
784 ss <<
" Opto scan maj/min vers : " <<
optoScanV_.first <<
"." <<
optoScanV_.second << std::endl;
785 ss <<
" VPSP scan maj/min vers : " <<
vpspScanV_.first <<
"." <<
vpspScanV_.second << std::endl;
786 ss <<
" APV calib maj/min vers : " <<
apvCalibV_.first <<
"." <<
apvCalibV_.second << std::endl;
798 <<
" <= This \"state\" version overriden by \"history\" version " 800 <<
" for this FED cabling run!" << std::endl;
807 <<
" <= This \"state\" version overriden by \"history\" version " 809 <<
" for this APV timing run!" << std::endl;
813 ss <<
" Opto scan maj/min vers : " <<
optoScanV_.first <<
"." <<
optoScanV_.second << std::endl;
816 <<
" <= This \"state\" version overriden by \"history\" version " 818 <<
" for this opto scan run!" << std::endl;
822 ss <<
" VPSP scan maj/min vers : " <<
vpspScanV_.first <<
"." <<
vpspScanV_.second << std::endl;
825 <<
" <= This \"state\" version overriden by \"history\" version " 827 <<
" for this VPSP scan run!" << std::endl;
834 ss <<
" APV calib maj/min vers : " <<
apvCalibV_.first <<
"." <<
apvCalibV_.second << std::endl;
837 <<
" <= This \"state\" version overriden by \"history\" version " 839 <<
" for this APV calib run!" << std::endl;
846 <<
" <= This \"state\" version overriden by \"history\" version " 848 <<
" for this pedestals run!" << std::endl;
855 <<
" <= This \"state\" version overriden by \"history\" version " 857 <<
" for this pedestals run!" << std::endl;
864 <<
" <= This \"state\" version overriden by \"history\" version " 866 <<
" for this APV latency run!" << std::endl;
873 <<
" <= This \"state\" version overriden by \"history\" version " 875 <<
" for this fine delay run!" << std::endl;
884 <<
" Input \"fec.xml\" file(s) : ";
885 std::vector<std::string>::const_iterator ifec =
inputFecXml_.begin();
886 for ( ; ifec !=
inputFecXml_.end(); ifec++ ) { ss << *ifec <<
", "; }
888 ss <<
" Input \"fed.xml\" file(s) : ";
889 std::vector<std::string>::const_iterator ifed =
inputFedXml_.begin();
890 for ( ; ifed !=
inputFedXml_.end(); ifed++ ) { ss << *ifed <<
", "; }
900 std::stringstream ss;
909 std::vector<uint32_t>
input = _input;
910 if ( input.size() != 2 ) {
912 <<
"[SiStripPartition::" << __func__ <<
"]" 913 <<
" Unexpected size (" << input.size()
914 <<
") for vector containing version numbers (major,minor)!" 915 <<
" Resizing to 2 elements (default values will be 0,0)...";
918 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
std::pair< uint32_t, uint32_t > Versions
static std::string const input
static const char mlConfigDb_[]
std::ostream & operator<<(std::ostream &os, const SiStripPartition ¶ms)
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::string inputModuleXml_
Versions apvCalibVersion() const
std::vector< std::string > inputFecXml_
void update(const SiStripConfigDb *const )
bool operator==(const SiStripPartition &) const
std::vector< std::string > inputFedXml() const
Versions dcuVersion() const
bool forceVersions() const
Versions runTableVersion_
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