10 using namespace sistrip;
19 partitionName_(defaultPartitionName_),
22 forceVersions_(
false),
23 forceCurrentState_(
false),
33 runTableVersion_(0,0),
51 partitionName_(partition),
54 forceVersions_(
false),
55 forceCurrentState_(
false),
65 runTableVersion_(0,0),
85 partitionName_( input.partitionName() ),
88 forceVersions_( input.forceVersions() ),
89 forceCurrentState_( input.forceCurrentState() ),
90 cabVersion_( input.cabVersion() ),
91 fedVersion_( input.fedVersion() ),
92 fecVersion_( input.fecVersion() ),
93 dcuVersion_( input.dcuVersion() ),
94 psuVersion_( input.psuVersion() ),
96 maskVersion_( input.maskVersion() ),
98 globalAnalysisV_( input.globalAnalysisVersion() ),
99 runTableVersion_( input.runTableVersion() ),
100 fastCablingV_( input.fastCablingVersion() ),
101 apvTimingV_( input.apvTimingVersion() ),
102 optoScanV_( input.optoScanVersion() ),
103 vpspScanV_( input.vpspScanVersion() ),
104 apvCalibV_( input.apvCalibVersion() ),
105 pedestalsV_( input.pedestalsVersion() ),
106 apvLatencyV_( input.apvLatencyVersion() ),
107 fineDelayV_( input.fineDelayVersion() ),
108 inputModuleXml_( input.inputModuleXml() ),
109 inputDcuInfoXml_( input.inputDcuInfoXml() ),
110 inputFecXml_( input.inputFecXml() ),
111 inputFedXml_( input.inputFedXml() )
117 if (
this == &input ) {
return *
this; }
183 return !( *
this ==
input );
237 std::vector<uint32_t> tmp1(2,0);
247 std::vector<uint32_t> tmp2(2,0);
258 std::vector<std::string> tmp3(1,
"");
273 <<
"[SiStripPartition::" << __func__ <<
"]"
274 <<
" NULL pointer to SiStripConfigDb object!"
275 <<
" Aborting update...";
283 <<
"[SiStripPartition::" << __func__ <<
"]"
284 <<
" NULL pointer to DeviceFactory object!"
285 <<
" Aborting update...";
293 std::stringstream ss;
294 ss <<
"[SiStripPartition::" << __func__ <<
"]"
295 <<
" Updating description versions for partition \""
309 tkStateVector states;
310 states = df->getCurrentStates();
311 tkStateVector::const_iterator istate = states.begin();
312 tkStateVector::const_iterator jstate = states.end();
313 while ( istate != jstate ) {
314 if ( *istate && partitionName_ == (*istate)->getPartitionName() ) {
break; }
319 if ( istate != states.end() ) {
323 cabVersion_.first = (*istate)->getConnectionVersionMajorId();
324 cabVersion_.second = (*istate)->getConnectionVersionMinorId();
328 fecVersion_.first = (*istate)->getFecVersionMajorId();
329 fecVersion_.second = (*istate)->getFecVersionMinorId();
333 fedVersion_.first = (*istate)->getFedVersionMajorId();
334 fedVersion_.second = (*istate)->getFedVersionMinorId();
338 dcuVersion_.first = (*istate)->getDcuInfoVersionMajorId();
339 dcuVersion_.second = (*istate)->getDcuInfoVersionMinorId();
343 psuVersion_.first = (*istate)->getDcuPsuMapVersionMajorId();
344 psuVersion_.second = (*istate)->getDcuPsuMapVersionMinorId();
350 maskVersion_.first = (*istate)->getMaskVersionMajorId();
351 maskVersion_.second = (*istate)->getMaskVersionMinorId();
362 HashMapAnalysisVersions local_versions = df->getLocalAnalysisVersions(
globalAnalysisV_ );
365 HashMapAnalysisVersions::const_iterator ivers = local_versions.begin();
366 HashMapAnalysisVersions::const_iterator jvers = local_versions.end();
367 for ( ; ivers != jvers; ++ivers ) {
368 if ( ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_FASTFEDCABLING ) {
371 }
else if ( ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_TIMING ) {
374 }
else if ( ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_OPTOSCAN ) {
377 }
else if ( ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_VPSPSCAN ) {
380 }
else if ( ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_CALIBRATION ) {
383 }
else if ( ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_PEDESTALS ) {
386 }
else if ( ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_APVLATENCY ) {
389 }
else if ( ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_FINEDELAY ) {
392 }
else if ( ivers->first == CommissioningAnalysisDescription::T_UNKNOWN ) {
393 std::stringstream ss;
395 <<
"[SiStripPartition::" << __func__ <<
"]"
396 <<
" Found UNKNOWN AnalysisType!";
399 std::stringstream ss;
401 <<
"[SiStripPartition::" << __func__ <<
"]"
402 <<
" Unable to match content to any AnalysisType!";
411 HashMapAnalysisVersions local_versions = df->getLocalAnalysisVersions(
globalAnalysisV_ );
414 HashMapAnalysisVersions::const_iterator ivers = local_versions.begin();
415 HashMapAnalysisVersions::const_iterator jvers = local_versions.end();
416 for ( ; ivers != jvers; ++ivers ) {
417 if ( ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_FASTFEDCABLING ) {
422 }
else if ( ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_TIMING ) {
427 }
else if ( ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_OPTOSCAN ) {
432 }
else if ( ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_VPSPSCAN ) {
437 }
else if ( ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_CALIBRATION ) {
442 }
else if ( ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_PEDESTALS ) {
447 }
else if ( ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_APVLATENCY ) {
452 }
else if ( ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_FINEDELAY ) {
457 }
else if ( ivers->first == CommissioningAnalysisDescription::T_UNKNOWN ) {
458 std::stringstream ss;
460 <<
"[SiStripPartition::" << __func__ <<
"]"
461 <<
" Found UNKNOWN AnalysisType!";
464 std::stringstream ss;
466 <<
"[SiStripPartition::" << __func__ <<
"]"
467 <<
" Unable to match content to any AnalysisType!";
475 std::stringstream ss;
477 <<
"[SiStripPartition::" << __func__ <<
"]"
478 <<
" Unable to find \"current state\" for partition \""
479 << partitionName_ <<
"\"";
486 if ( !
runNumber_ ) { run = df->getLastRun( partitionName_ ); }
487 else { run = df->getRun( partitionName_,
runNumber_ ); }
492 if ( run->getRunNumber() ) {
498 cabVersion_.first = run->getConnectionVersionMajorId();
499 cabVersion_.second = run->getConnectionVersionMinorId();
507 dcuVersion_.first = run->getDcuInfoVersionMajorId();
508 dcuVersion_.second = run->getDcuInfoVersionMinorId();
510 psuVersion_.first = run->getDcuPsuMapVersionMajorId();
511 psuVersion_.second = run->getDcuPsuMapVersionMinorId();
519 uint16_t
type = run->getModeId( run->getMode() );
536 else if ( type == 0 ) {
539 <<
"[SiStripPartition::" << __func__ <<
"]"
540 <<
" NULL run type returned!"
541 <<
" for partition \"" << partitionName_ <<
"\"";
545 <<
"[SiStripPartition::" << __func__ <<
"]"
546 <<
" UNKNOWN run type (" << type<<
") returned!"
547 <<
" for partition \"" << partitionName_ <<
"\"";
552 HashMapAnalysisVersions local_versions = df->getLocalAnalysisVersions(
globalAnalysisV_ );
553 HashMapAnalysisVersions::const_iterator ivers = local_versions.begin();
554 HashMapAnalysisVersions::const_iterator jvers = local_versions.end();
555 for ( ; ivers != jvers; ++ivers ) {
556 if ( ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_FASTFEDCABLING ) {
559 }
else if ( ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_TIMING ) {
562 }
else if ( ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_OPTOSCAN ) {
565 }
else if ( ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_VPSPSCAN ) {
568 }
else if ( ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_CALIBRATION ) {
571 }
else if ( ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_PEDESTALS ) {
574 }
else if ( ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_APVLATENCY ) {
577 }
else if ( ivers->first == CommissioningAnalysisDescription::T_ANALYSIS_FINEDELAY ) {
580 }
else if ( ivers->first == CommissioningAnalysisDescription::T_UNKNOWN ) {
581 std::stringstream ss;
583 <<
"[SiStripPartition::" << __func__ <<
"]"
584 <<
" Found UNKNOWN AnalysisType!";
587 std::stringstream ss;
589 <<
"[SiStripPartition::" << __func__ <<
"]"
590 <<
" Unable to match content to any AnalysisType!";
601 CommissioningAnalysisDescription::commissioningType type = CommissioningAnalysisDescription::T_UNKNOWN;
612 HashMapRunVersion local_versions = df->getAnalysisHistory( partitionName_, type );
615 HashMapRunVersion::const_iterator ivers = local_versions.end();
616 if (
runNumber_ == 0 ) { ivers = --(local_versions.end()); }
617 else { ivers = local_versions.find(
runNumber_ ); }
620 if ( ivers != local_versions.end() ) {
621 if ( type == CommissioningAnalysisDescription::T_ANALYSIS_FASTFEDCABLING ) {
628 }
else if ( type == CommissioningAnalysisDescription::T_ANALYSIS_TIMING ) {
632 }
else if ( type == CommissioningAnalysisDescription::T_ANALYSIS_OPTOSCAN ) {
634 optoScanV_.first = ivers->second.back().first;
635 optoScanV_.second = ivers->second.back().second;
636 }
else if ( type == CommissioningAnalysisDescription::T_ANALYSIS_VPSPSCAN ) {
638 vpspScanV_.first = ivers->second.back().first;
639 vpspScanV_.second = ivers->second.back().second;
640 }
else if ( type == CommissioningAnalysisDescription::T_ANALYSIS_CALIBRATION ) {
642 apvCalibV_.first = ivers->second.back().first;
643 apvCalibV_.second = ivers->second.back().second;
644 }
else if ( type == CommissioningAnalysisDescription::T_ANALYSIS_PEDESTALS ) {
648 }
else if ( type == CommissioningAnalysisDescription::T_ANALYSIS_APVLATENCY ) {
652 }
else if ( type == CommissioningAnalysisDescription::T_ANALYSIS_FINEDELAY ) {
656 }
else if ( type == CommissioningAnalysisDescription::T_UNKNOWN ) {
657 std::stringstream ss;
659 <<
"[SiStripPartition::" << __func__ <<
"]"
660 <<
" Found UNKNOWN AnalysisType!";
663 std::stringstream ss;
665 <<
"[SiStripPartition::" << __func__ <<
"]"
666 <<
" Unable to match content to any AnalysisType!";
670 std::stringstream ss;
672 <<
"[SiStripPartition::" << __func__ <<
"]"
673 <<
" Unable to find run number " <<
runNumber_
674 <<
" in \"history\" hash map ";
682 <<
"[SiStripPartition::" << __func__ <<
"]"
683 <<
" Mismatch of run number requested ("
685 <<
") and received ("
686 << run->getRunNumber() <<
")"
687 <<
" to/from database for partition \""
688 << partitionName_ <<
"\"";
693 <<
"[SiStripPartition::" << __func__ <<
"]"
694 <<
" NULL run number returned!"
695 <<
" for partition \"" << partitionName_ <<
"\"";
700 <<
"[SiStripPartition::" << __func__ <<
"]"
701 <<
" NULL pointer to TkRun object!"
702 <<
" Unable to retrieve versions for run number "
704 <<
". Run number may not be consistent with partition \""
705 << partitionName_ <<
"\"!";
722 ss <<
" Run number : ";
723 if (
forceCurrentState_ ) { ss <<
"Forced \"current state\"! (equivalent to versions below)"; }
724 else if (
forceVersions_ ) { ss <<
"Forced versions specified below!"; }
752 ss <<
" Opto scan maj/min vers : " <<
optoScanV_.first <<
"." <<
optoScanV_.second << std::endl;
753 ss <<
" VPSP scan maj/min vers : " <<
vpspScanV_.first <<
"." <<
vpspScanV_.second << std::endl;
754 ss <<
" APV calib maj/min vers : " <<
apvCalibV_.first <<
"." <<
apvCalibV_.second << std::endl;
765 <<
" <= This \"state\" version overriden by \"history\" version "
767 <<
" for this FED cabling run!" << std::endl;
774 <<
" <= This \"state\" version overriden by \"history\" version "
776 <<
" for this APV timing run!" << std::endl;
780 ss <<
" Opto scan maj/min vers : " <<
optoScanV_.first <<
"." <<
optoScanV_.second << std::endl;
783 <<
" <= This \"state\" version overriden by \"history\" version "
785 <<
" for this opto scan run!" << std::endl;
789 ss <<
" VPSP scan maj/min vers : " <<
vpspScanV_.first <<
"." <<
vpspScanV_.second << std::endl;
792 <<
" <= This \"state\" version overriden by \"history\" version "
794 <<
" for this VPSP scan run!" << std::endl;
798 ss <<
" APV calib maj/min vers : " <<
apvCalibV_.first <<
"." <<
apvCalibV_.second << std::endl;
801 <<
" <= This \"state\" version overriden by \"history\" version "
803 <<
" for this APV calib run!" << std::endl;
810 <<
" <= This \"state\" version overriden by \"history\" version "
812 <<
" for this pedestals run!" << std::endl;
819 <<
" <= This \"state\" version overriden by \"history\" version "
821 <<
" for this APV latency run!" << std::endl;
828 <<
" <= This \"state\" version overriden by \"history\" version "
830 <<
" for this fine delay run!" << std::endl;
839 <<
" Input \"fec.xml\" file(s) : ";
840 std::vector<std::string>::const_iterator ifec =
inputFecXml_.begin();
841 for ( ; ifec !=
inputFecXml_.end(); ifec++ ) { ss << *ifec <<
", "; }
843 ss <<
" Input \"fed.xml\" file(s) : ";
844 std::vector<std::string>::const_iterator ifed =
inputFedXml_.begin();
845 for ( ; ifed !=
inputFedXml_.end(); ifed++ ) { ss << *ifed <<
", "; }
855 std::stringstream ss;
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 const char mlConfigDb_[]
static std::string runType(const sistrip::RunType &)
Versions apvTimingVersion() const
Versions apvLatencyVersion() const
void pset(const edm::ParameterSet &)
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
Versions versions(std::vector< uint32_t >)
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
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