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() );
550 else if ( type == 0 ) {
553 <<
"[SiStripPartition::" << __func__ <<
"]" 554 <<
" NULL run type returned!" 555 <<
" for partition \"" << partitionName_ <<
"\"";
559 <<
"[SiStripPartition::" << __func__ <<
"]" 560 <<
" UNKNOWN run type (" << type<<
") returned!" 561 <<
" for partition \"" << partitionName_ <<
"\"";
566 HashMapAnalysisVersions local_versions = df->getLocalAnalysisVersions(
globalAnalysisV_ );
567 HashMapAnalysisVersions::const_iterator ivers = local_versions.begin();
568 HashMapAnalysisVersions::const_iterator jvers = local_versions.end();
569 for ( ; ivers != jvers; ++ivers ) {
570 if ( ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_FASTFEDCABLING ) {
573 }
else if ( ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_TIMING ) {
576 }
else if ( ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_OPTOSCAN ) {
579 }
else if ( ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_VPSPSCAN ) {
582 }
else if ( ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_CALIBRATION ) {
585 }
else if ( ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_PEDESTALS ) {
588 }
else if ( ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_PEDSFULLNOISE ) {
591 }
else if ( ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_APVLATENCY ) {
594 }
else if ( ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_FINEDELAY ) {
597 }
else if ( ivers->first == CommissioningAnalysisDescription::T_UNKNOWN ) {
598 std::stringstream ss;
600 <<
"[SiStripPartition::" << __func__ <<
"]" 601 <<
" Found UNKNOWN AnalysisType!";
604 std::stringstream ss;
606 <<
"[SiStripPartition::" << __func__ <<
"]" 607 <<
" Unable to match content to any AnalysisType!";
618 CommissioningAnalysisDescription::commissioningType type = CommissioningAnalysisDescription::T_UNKNOWN;
630 HashMapRunVersion local_versions = df->getAnalysisHistory( partitionName_, type );
633 HashMapRunVersion::const_iterator ivers = local_versions.end();
634 if (
runNumber_ == 0 ) { ivers = --(local_versions.end()); }
635 else { ivers = local_versions.find(
runNumber_ ); }
638 if ( ivers != local_versions.end() ) {
639 if ( type == CommissioningAnalysisDescription::T_ANALYSIS_FASTFEDCABLING ) {
646 }
else if ( type == CommissioningAnalysisDescription::T_ANALYSIS_TIMING ) {
650 }
else if ( type == CommissioningAnalysisDescription::T_ANALYSIS_OPTOSCAN ) {
652 optoScanV_.first = ivers->second.back().first;
653 optoScanV_.second = ivers->second.back().second;
654 }
else if ( type == CommissioningAnalysisDescription::T_ANALYSIS_VPSPSCAN ) {
656 vpspScanV_.first = ivers->second.back().first;
657 vpspScanV_.second = ivers->second.back().second;
658 }
else if ( type == CommissioningAnalysisDescription::T_ANALYSIS_CALIBRATION ) {
660 apvCalibV_.first = ivers->second.back().first;
661 apvCalibV_.second = ivers->second.back().second;
662 }
else if ( type == CommissioningAnalysisDescription::T_ANALYSIS_PEDESTALS ) {
666 }
else if ( type == CommissioningAnalysisDescription::T_ANALYSIS_PEDSFULLNOISE ) {
670 }
else if ( type == CommissioningAnalysisDescription::T_ANALYSIS_APVLATENCY ) {
674 }
else if ( type == CommissioningAnalysisDescription::T_ANALYSIS_FINEDELAY ) {
678 }
else if ( type == CommissioningAnalysisDescription::T_UNKNOWN ) {
679 std::stringstream ss;
681 <<
"[SiStripPartition::" << __func__ <<
"]" 682 <<
" Found UNKNOWN AnalysisType!";
685 std::stringstream ss;
687 <<
"[SiStripPartition::" << __func__ <<
"]" 688 <<
" Unable to match content to any AnalysisType!";
692 std::stringstream ss;
694 <<
"[SiStripPartition::" << __func__ <<
"]" 695 <<
" Unable to find run number " <<
runNumber_ 696 <<
" in \"history\" hash map ";
704 <<
"[SiStripPartition::" << __func__ <<
"]" 705 <<
" Mismatch of run number requested (" 707 <<
") and received (" 708 << run->getRunNumber() <<
")" 709 <<
" to/from database for partition \"" 710 << partitionName_ <<
"\"";
715 <<
"[SiStripPartition::" << __func__ <<
"]" 716 <<
" NULL run number returned!" 717 <<
" for partition \"" << partitionName_ <<
"\"";
722 <<
"[SiStripPartition::" << __func__ <<
"]" 723 <<
" NULL pointer to TkRun object!" 724 <<
" Unable to retrieve versions for run number " 726 <<
". Run number may not be consistent with partition \"" 727 << partitionName_ <<
"\"!";
744 ss <<
" Run number : ";
745 if (
forceCurrentState_ ) { ss <<
"Forced \"current state\"! (equivalent to versions below)"; }
746 else if (
forceVersions_ ) { ss <<
"Forced versions specified below!"; }
774 ss <<
" Opto scan maj/min vers : " <<
optoScanV_.first <<
"." <<
optoScanV_.second << std::endl;
775 ss <<
" VPSP scan maj/min vers : " <<
vpspScanV_.first <<
"." <<
vpspScanV_.second << std::endl;
776 ss <<
" APV calib maj/min vers : " <<
apvCalibV_.first <<
"." <<
apvCalibV_.second << std::endl;
788 <<
" <= This \"state\" version overriden by \"history\" version " 790 <<
" for this FED cabling run!" << std::endl;
797 <<
" <= This \"state\" version overriden by \"history\" version " 799 <<
" for this APV timing run!" << std::endl;
803 ss <<
" Opto scan maj/min vers : " <<
optoScanV_.first <<
"." <<
optoScanV_.second << std::endl;
806 <<
" <= This \"state\" version overriden by \"history\" version " 808 <<
" for this opto scan run!" << std::endl;
812 ss <<
" VPSP scan maj/min vers : " <<
vpspScanV_.first <<
"." <<
vpspScanV_.second << std::endl;
815 <<
" <= This \"state\" version overriden by \"history\" version " 817 <<
" for this VPSP scan run!" << std::endl;
821 ss <<
" APV calib maj/min vers : " <<
apvCalibV_.first <<
"." <<
apvCalibV_.second << std::endl;
824 <<
" <= This \"state\" version overriden by \"history\" version " 826 <<
" for this APV calib run!" << std::endl;
833 <<
" <= This \"state\" version overriden by \"history\" version " 835 <<
" for this pedestals run!" << std::endl;
842 <<
" <= This \"state\" version overriden by \"history\" version " 844 <<
" for this pedestals run!" << std::endl;
851 <<
" <= This \"state\" version overriden by \"history\" version " 853 <<
" for this APV latency run!" << std::endl;
860 <<
" <= This \"state\" version overriden by \"history\" version " 862 <<
" for this fine delay run!" << std::endl;
871 <<
" Input \"fec.xml\" file(s) : ";
872 std::vector<std::string>::const_iterator ifec =
inputFecXml_.begin();
873 for ( ; ifec !=
inputFecXml_.end(); ifec++ ) { ss << *ifec <<
", "; }
875 ss <<
" Input \"fed.xml\" file(s) : ";
876 std::vector<std::string>::const_iterator ifed =
inputFedXml_.begin();
877 for ( ; ifed !=
inputFedXml_.end(); ifed++ ) { ss << *ifed <<
", "; }
887 std::stringstream ss;
896 std::vector<uint32_t>
input = _input;
897 if ( input.size() != 2 ) {
899 <<
"[SiStripPartition::" << __func__ <<
"]" 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
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