9 using namespace sistrip;
18 partitionName_(defaultPartitionName_),
21 forceVersions_(
false),
22 forceCurrentState_(
false),
32 runTableVersion_(0,0),
50 partitionName_(partition),
53 forceVersions_(
false),
54 forceCurrentState_(
false),
64 runTableVersion_(0,0),
84 partitionName_( input.partitionName() ),
87 forceVersions_( input.forceVersions() ),
88 forceCurrentState_( input.forceCurrentState() ),
89 cabVersion_( input.cabVersion() ),
90 fedVersion_( input.fedVersion() ),
91 fecVersion_( input.fecVersion() ),
92 dcuVersion_( input.dcuVersion() ),
93 psuVersion_( input.psuVersion() ),
95 maskVersion_( input.maskVersion() ),
97 globalAnalysisV_( input.globalAnalysisVersion() ),
98 runTableVersion_( input.runTableVersion() ),
99 fastCablingV_( input.fastCablingVersion() ),
100 apvTimingV_( input.apvTimingVersion() ),
101 optoScanV_( input.optoScanVersion() ),
102 vpspScanV_( input.vpspScanVersion() ),
103 apvCalibV_( input.apvCalibVersion() ),
104 pedestalsV_( input.pedestalsVersion() ),
105 apvLatencyV_( input.apvLatencyVersion() ),
106 fineDelayV_( input.fineDelayVersion() ),
107 inputModuleXml_( input.inputModuleXml() ),
108 inputDcuInfoXml_( input.inputDcuInfoXml() ),
109 inputFecXml_( input.inputFecXml() ),
110 inputFedXml_( input.inputFedXml() )
116 if (
this == &input ) {
return *
this; }
182 return !( *
this ==
input );
236 std::vector<uint32_t> tmp1(2,0);
246 std::vector<uint32_t> tmp2(2,0);
257 std::vector<std::string> tmp3(1,
"");
272 <<
"[SiStripPartition::" << __func__ <<
"]"
273 <<
" NULL pointer to SiStripConfigDb object!"
274 <<
" Aborting update...";
282 <<
"[SiStripPartition::" << __func__ <<
"]"
283 <<
" NULL pointer to DeviceFactory object!"
284 <<
" Aborting update...";
292 std::stringstream ss;
293 ss <<
"[SiStripPartition::" << __func__ <<
"]"
294 <<
" Updating description versions for partition \""
308 tkStateVector states;
309 states = df->getCurrentStates();
310 tkStateVector::const_iterator istate = states.begin();
311 tkStateVector::const_iterator jstate = states.end();
312 while ( istate != jstate ) {
313 if ( *istate && partitionName_ == (*istate)->getPartitionName() ) {
break; }
318 if ( istate != states.end() ) {
322 cabVersion_.first = (*istate)->getConnectionVersionMajorId();
323 cabVersion_.second = (*istate)->getConnectionVersionMinorId();
327 fecVersion_.first = (*istate)->getFecVersionMajorId();
328 fecVersion_.second = (*istate)->getFecVersionMinorId();
332 fedVersion_.first = (*istate)->getFedVersionMajorId();
333 fedVersion_.second = (*istate)->getFedVersionMinorId();
337 dcuVersion_.first = (*istate)->getDcuInfoVersionMajorId();
338 dcuVersion_.second = (*istate)->getDcuInfoVersionMinorId();
342 psuVersion_.first = (*istate)->getDcuPsuMapVersionMajorId();
343 psuVersion_.second = (*istate)->getDcuPsuMapVersionMinorId();
349 maskVersion_.first = (*istate)->getMaskVersionMajorId();
350 maskVersion_.second = (*istate)->getMaskVersionMinorId();
361 HashMapAnalysisVersions local_versions = df->getLocalAnalysisVersions(
globalAnalysisV_ );
364 HashMapAnalysisVersions::const_iterator ivers = local_versions.begin();
365 HashMapAnalysisVersions::const_iterator jvers = local_versions.end();
366 for ( ; ivers != jvers; ++ivers ) {
367 if ( ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_FASTFEDCABLING ) {
370 }
else if ( ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_TIMING ) {
373 }
else if ( ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_OPTOSCAN ) {
376 }
else if ( ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_VPSPSCAN ) {
379 }
else if ( ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_CALIBRATION ) {
382 }
else if ( ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_PEDESTALS ) {
385 }
else if ( ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_APVLATENCY ) {
388 }
else if ( ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_FINEDELAY ) {
391 }
else if ( ivers->first == CommissioningAnalysisDescription::T_UNKNOWN ) {
392 std::stringstream ss;
394 <<
"[SiStripPartition::" << __func__ <<
"]"
395 <<
" Found UNKNOWN AnalysisType!";
398 std::stringstream ss;
400 <<
"[SiStripPartition::" << __func__ <<
"]"
401 <<
" Unable to match content to any AnalysisType!";
410 HashMapAnalysisVersions local_versions = df->getLocalAnalysisVersions(
globalAnalysisV_ );
413 HashMapAnalysisVersions::const_iterator ivers = local_versions.begin();
414 HashMapAnalysisVersions::const_iterator jvers = local_versions.end();
415 for ( ; ivers != jvers; ++ivers ) {
416 if ( ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_FASTFEDCABLING ) {
421 }
else if ( ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_TIMING ) {
426 }
else if ( ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_OPTOSCAN ) {
431 }
else if ( ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_VPSPSCAN ) {
436 }
else if ( ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_CALIBRATION ) {
441 }
else if ( ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_PEDESTALS ) {
446 }
else if ( ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_APVLATENCY ) {
451 }
else if ( ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_FINEDELAY ) {
456 }
else if ( ivers->first == CommissioningAnalysisDescription::T_UNKNOWN ) {
457 std::stringstream ss;
459 <<
"[SiStripPartition::" << __func__ <<
"]"
460 <<
" Found UNKNOWN AnalysisType!";
463 std::stringstream ss;
465 <<
"[SiStripPartition::" << __func__ <<
"]"
466 <<
" Unable to match content to any AnalysisType!";
474 std::stringstream ss;
476 <<
"[SiStripPartition::" << __func__ <<
"]"
477 <<
" Unable to find \"current state\" for partition \""
478 << partitionName_ <<
"\"";
485 if ( !
runNumber_ ) { run = df->getLastRun( partitionName_ ); }
486 else { run = df->getRun( partitionName_,
runNumber_ ); }
491 if ( run->getRunNumber() ) {
497 cabVersion_.first = run->getConnectionVersionMajorId();
498 cabVersion_.second = run->getConnectionVersionMinorId();
506 dcuVersion_.first = run->getDcuInfoVersionMajorId();
507 dcuVersion_.second = run->getDcuInfoVersionMinorId();
509 psuVersion_.first = run->getDcuPsuMapVersionMajorId();
510 psuVersion_.second = run->getDcuPsuMapVersionMinorId();
518 uint16_t
type = run->getModeId( run->getMode() );
535 else if ( type == 0 ) {
538 <<
"[SiStripPartition::" << __func__ <<
"]"
539 <<
" NULL run type returned!"
540 <<
" for partition \"" << partitionName_ <<
"\"";
544 <<
"[SiStripPartition::" << __func__ <<
"]"
545 <<
" UNKNOWN run type (" << type<<
") returned!"
546 <<
" for partition \"" << partitionName_ <<
"\"";
551 HashMapAnalysisVersions local_versions = df->getLocalAnalysisVersions(
globalAnalysisV_ );
552 HashMapAnalysisVersions::const_iterator ivers = local_versions.begin();
553 HashMapAnalysisVersions::const_iterator jvers = local_versions.end();
554 for ( ; ivers != jvers; ++ivers ) {
555 if ( ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_FASTFEDCABLING ) {
558 }
else if ( ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_TIMING ) {
561 }
else if ( ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_OPTOSCAN ) {
564 }
else if ( ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_VPSPSCAN ) {
567 }
else if ( ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_CALIBRATION ) {
570 }
else if ( ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_PEDESTALS ) {
573 }
else if ( ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_APVLATENCY ) {
576 }
else if ( ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_FINEDELAY ) {
579 }
else if ( ivers->first == CommissioningAnalysisDescription::T_UNKNOWN ) {
580 std::stringstream ss;
582 <<
"[SiStripPartition::" << __func__ <<
"]"
583 <<
" Found UNKNOWN AnalysisType!";
586 std::stringstream ss;
588 <<
"[SiStripPartition::" << __func__ <<
"]"
589 <<
" Unable to match content to any AnalysisType!";
600 CommissioningAnalysisDescription::commissioningType type = CommissioningAnalysisDescription::T_UNKNOWN;
611 HashMapRunVersion local_versions = df->getAnalysisHistory( partitionName_, type );
614 HashMapRunVersion::const_iterator ivers = local_versions.end();
615 if (
runNumber_ == 0 ) { ivers = --(local_versions.end()); }
616 else { ivers = local_versions.find(
runNumber_ ); }
619 if ( ivers != local_versions.end() ) {
620 if ( type == CommissioningAnalysisDescription::T_ANALYSIS_FASTFEDCABLING ) {
627 }
else if ( type == CommissioningAnalysisDescription::T_ANALYSIS_TIMING ) {
631 }
else if ( type == CommissioningAnalysisDescription::T_ANALYSIS_OPTOSCAN ) {
633 optoScanV_.first = ivers->second.back().first;
634 optoScanV_.second = ivers->second.back().second;
635 }
else if ( type == CommissioningAnalysisDescription::T_ANALYSIS_VPSPSCAN ) {
637 vpspScanV_.first = ivers->second.back().first;
638 vpspScanV_.second = ivers->second.back().second;
639 }
else if ( type == CommissioningAnalysisDescription::T_ANALYSIS_CALIBRATION ) {
641 apvCalibV_.first = ivers->second.back().first;
642 apvCalibV_.second = ivers->second.back().second;
643 }
else if ( type == CommissioningAnalysisDescription::T_ANALYSIS_PEDESTALS ) {
647 }
else if ( type == CommissioningAnalysisDescription::T_ANALYSIS_APVLATENCY ) {
651 }
else if ( type == CommissioningAnalysisDescription::T_ANALYSIS_FINEDELAY ) {
655 }
else if ( type == CommissioningAnalysisDescription::T_UNKNOWN ) {
656 std::stringstream ss;
658 <<
"[SiStripPartition::" << __func__ <<
"]"
659 <<
" Found UNKNOWN AnalysisType!";
662 std::stringstream ss;
664 <<
"[SiStripPartition::" << __func__ <<
"]"
665 <<
" Unable to match content to any AnalysisType!";
669 std::stringstream ss;
671 <<
"[SiStripPartition::" << __func__ <<
"]"
672 <<
" Unable to find run number " <<
runNumber_
673 <<
" in \"history\" hash map ";
681 <<
"[SiStripPartition::" << __func__ <<
"]"
682 <<
" Mismatch of run number requested ("
684 <<
") and received ("
685 << run->getRunNumber() <<
")"
686 <<
" to/from database for partition \""
687 << partitionName_ <<
"\"";
692 <<
"[SiStripPartition::" << __func__ <<
"]"
693 <<
" NULL run number returned!"
694 <<
" for partition \"" << partitionName_ <<
"\"";
699 <<
"[SiStripPartition::" << __func__ <<
"]"
700 <<
" NULL pointer to TkRun object!"
701 <<
" Unable to retrieve versions for run number "
703 <<
". Run number may not be consistent with partition \""
704 << partitionName_ <<
"\"!";
721 ss <<
" Run number : ";
722 if (
forceCurrentState_ ) { ss <<
"Forced \"current state\"! (equivalent to versions below)"; }
723 else if (
forceVersions_ ) { ss <<
"Forced versions specified below!"; }
751 ss <<
" Opto scan maj/min vers : " <<
optoScanV_.first <<
"." <<
optoScanV_.second << std::endl;
752 ss <<
" VPSP scan maj/min vers : " <<
vpspScanV_.first <<
"." <<
vpspScanV_.second << std::endl;
753 ss <<
" APV calib maj/min vers : " <<
apvCalibV_.first <<
"." <<
apvCalibV_.second << std::endl;
764 <<
" <= This \"state\" version overriden by \"history\" version "
766 <<
" for this FED cabling run!" << std::endl;
773 <<
" <= This \"state\" version overriden by \"history\" version "
775 <<
" for this APV timing run!" << std::endl;
779 ss <<
" Opto scan maj/min vers : " <<
optoScanV_.first <<
"." <<
optoScanV_.second << std::endl;
782 <<
" <= This \"state\" version overriden by \"history\" version "
784 <<
" for this opto scan run!" << std::endl;
788 ss <<
" VPSP scan maj/min vers : " <<
vpspScanV_.first <<
"." <<
vpspScanV_.second << std::endl;
791 <<
" <= This \"state\" version overriden by \"history\" version "
793 <<
" for this VPSP scan run!" << std::endl;
797 ss <<
" APV calib maj/min vers : " <<
apvCalibV_.first <<
"." <<
apvCalibV_.second << std::endl;
800 <<
" <= This \"state\" version overriden by \"history\" version "
802 <<
" for this APV calib run!" << std::endl;
809 <<
" <= This \"state\" version overriden by \"history\" version "
811 <<
" for this pedestals run!" << std::endl;
818 <<
" <= This \"state\" version overriden by \"history\" version "
820 <<
" for this APV latency run!" << std::endl;
827 <<
" <= This \"state\" version overriden by \"history\" version "
829 <<
" for this fine delay run!" << std::endl;
838 <<
" Input \"fec.xml\" file(s) : ";
839 std::vector<std::string>::const_iterator ifec =
inputFecXml_.begin();
840 for ( ; ifec !=
inputFecXml_.end(); ifec++ ) { ss << *ifec <<
", "; }
842 ss <<
" Input \"fed.xml\" file(s) : ";
843 std::vector<std::string>::const_iterator ifed =
inputFedXml_.begin();
844 for ( ; ifed !=
inputFedXml_.end(); ifed++ ) { ss << *ifed <<
", "; }
854 std::stringstream ss;
863 std::vector<uint32_t>
input = _input;
864 if ( input.size() != 2 ) {
866 <<
"[SiStripPartition::" << __func__ <<
"]"
867 <<
" Unexpected size (" << input.size()
868 <<
") for vector containing version numbers (major,minor)!"
869 <<
" Resizing to 2 elements (default values will be 0,0)...";
872 return std::make_pair( input[0], input[1] );
static std::string defaultPartitionName_
static const char runNumber_[]
sistrip::RunType runType_
T getUntrackedParameter(std::string const &, T const &) const
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::ostream & operator<<(std::ostream &out, const ALILine &li)
std::pair< uint32_t, uint32_t > Versions
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
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
volatile std::atomic< bool > shutdown_flag false
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