CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
Mixins._Labelable Class Reference
Inheritance diagram for Mixins._Labelable:
Modules._Module Modules.ESPrefer Modules.ESProducer Modules.ESSource SequenceTypes._ModuleSequenceType SequenceTypes.DummyBooleanModule SequenceTypes.DummyModule SequenceTypes.Task Types.EDAlias Types.PSet Types.SecSource Types.VPSet

Public Member Functions

def __str__ (self)
 
def dumpSequenceConfig (self)
 
def dumpSequencePython (self, options=PrintOptions())
 
def hasLabel_ (self)
 
def label (self)
 
def label_ (self)
 
def setLabel (self, label)
 

Private Member Functions

def _findDependencies (self, knownDeps, presentDeps)
 

Private Attributes

 __label
 

Detailed Description

A 'mixin' used to denote that the class can be paired with a label (e.g. an EDProducer)

Definition at line 513 of file Mixins.py.

Member Function Documentation

◆ __str__()

def Mixins._Labelable.__str__ (   self)

Reimplemented in SequenceTypes.Task, Types.PSet, Types.SecSource, and SequenceTypes._ModuleSequenceType.

Definition at line 542 of file Mixins.py.

542  def __str__(self):
543  #this is probably a bad idea
544  # I added this so that when we ask a path to print
545  # we will see the label that has been assigned
546  return str(self.__label)

References Mixins._Labelable.__label, and str.

◆ _findDependencies()

def Mixins._Labelable._findDependencies (   self,
  knownDeps,
  presentDeps 
)
private

Definition at line 554 of file Mixins.py.

554  def _findDependencies(self,knownDeps,presentDeps):
555  #print 'in labelled'
556  myDeps=knownDeps.get(self.label_(),None)
557  if myDeps!=None:
558  if presentDeps != myDeps:
559  raise RuntimeError("the module "+self.label_()+" has two dependencies \n"
560  +str(presentDeps)+"\n"
561  +str(myDeps)+"\n"
562  +"Please modify sequences to rectify this inconsistency")
563  else:
564  myDeps=set(presentDeps)
565  knownDeps[self.label_()]=myDeps
566  presentDeps.add(self.label_())
567 
568 

References CTPPSPixelDAQMappingAnalyzer.label_, TestCUDAProducerCPU.label_, TestCUDAProducerGPU.label_, TestCUDAProducerGPUFirst.label_, TestCUDAAnalyzerGPU.label_, TestCUDAProducerGPUtoCPU.label_, edm::eventsetup::ComponentDescription.label_, TestCUDAProducerGPUEW.label_, SiStripLorentzAngleReader.label_, pat::TriggerFilter.label_, XMLIdealMagneticFieldGeometryESProducer.label_, ESDigiToRaw.label_, PythiaFilterHT.label_, TestCUDAProducerGPUEWTask.label_, RetrieveCTPPSBeamParameters.label_, CTPPSPixelRawToDigi.label_, VertexCompositeCandidateCollectionSelector.label_, WriteCTPPSPixelAnalysisMask.label_, WriteCTPPSPixelDAQMapping.label_, HistoProviderDQM.label_, SiStripDelayESProducer::TokenSign.label_, RandomEngineState.label_, PythiaMomDauFilter.label_, StripSubClusterShapeFilterBase.label_, VertexMonitor.label_, edm::ConsumesInfo.label_, edm::test::ProcessBlock.label_, SiPixelStatusManager.label_, edm::SecSourceAnalyzer.label_, edm::InputTag.label_, TPGCheck.label_, SiPixelStatusHarvester.label_, reco::Centrality.label_, DDDetectorESProducer.label_, L1TkEmParticleProducer.label_, edm::test::Run.label_, PPSPixelDigiAnalyzer.label_, edm::test::LuminosityBlock.label_, pat::TauJetCorrFactors.label_, EcalTrigPrimAnalyzer.label_, edm::test::Event.label_, EffPurFromHistos2D.label_, edm::DataMixingSiStripWorker.label_, StallStatistics.label_, edm::DataMixingSiPixelWorker.label_, edm::DataMixingPileupCopy.label_, SiPixelCalibDigiProducer.label_, EffPurFromHistos.label_, edm::DataMixingSiStripRawWorker.label_, edm::HiMixingWorkerBase.label_, SingleTopTChannelLepton_miniAOD::MonitorEnsemble.label_, TopSingleLepton_miniAOD::MonitorEnsemble.label_, npstat::UniformAxis.label_, edm::ParameterDescriptionBase.label_, PileupJetIdAlgo::AlgoGBRForestsAndConstants.label_, edm::messagedrop::StringProducerWithPhase.label_, edm::DataMixingEMWorker.label_, fwlite::ObjectCountSelector< Collection >.label_, edm::DataMixingHcalWorker.label_, edm::DataMixingHcalDigiWorkerProd.label_, pat::JetCorrFactors.label_, pat::JetCorrFactorsProducer.label_, TopSingleLepton::MonitorEnsemble.label_, edm::DataMixingEMDigiWorker.label_, edm::DataMixingMuonWorker.label_, npstat::NUHistoAxis.label_, pat::helper::AnyNumberAssociationAdaptor.label_, SingleTopTChannelLepton::MonitorEnsemble.label_, edm::DataMixingHcalDigiWorker.label_, TopDiLeptonOffline::MonitorEnsemble.label_, HLTObjectsMonitor.label_, npstat::GridAxis.label_, SummaryGenerator.label_, npstat::HistoAxis.label_, edm::service::RandomNumberGeneratorService::LabelAndEngine.label_, templateHelper::SiPixelTitles_Display< PayloadType, StoreType, TransientType >.label_, edm::MixingWorker< T >.label_, edm::DataMixingModule.label_, templateHelper::SiPixelHeaderTable< PayloadType, StoreType, TransientType >.label_, gainCalibHelper::SiPixelGainCalibrationValues< myType, PayloadType >.label_, templateHelper::SiPixelIDs< PayloadType, myType >.label_, templateHelper::SiPixelFullPixelIDMap< PayloadType, StoreType, TransientType >.label_, Mixins._Labelable.label_(), gainCalibHelper::SiPixelGainCalibrationValuesPerRegion< isBarrel, myType, PayloadType >.label_, fwlite::Scanner< Collection >.label_, gainCalibHelper::SiPixelGainCalibrationValuesComparisonPerRegion< isBarrel, myType, nIOVs, ntags, PayloadType >.label_, gainCalibHelper::SiPixelGainCalibrationCorrelations< PayloadType >.label_, SiPixelLorentzAngleFullPixelMap.label_, gainCalibHelper::SiPixelGainCalibrationValuesByPart< myType, PayloadType >.label_, gainCalibHelper::SiPixelGainCalibrationValueComparisonBase< myType, PayloadType >.label_, gainCalibHelper::SiPixelGainCalibDiffAndRatioBase< myType, nIOVs, ntags, PayloadType >.label_, gainCalibHelper::SiPixelGainCalibrationBPIXMap< myType, PayloadType >.label_, gainCalibHelper::SiPixelGainCalibrationFPIXMap< myType, PayloadType >.label_, gainCalibHelper::SiPixelGainCalibrationByRegionComparisonBase< myType, PayloadType, nIOVs, ntags >.label_, and str.

◆ dumpSequenceConfig()

def Mixins._Labelable.dumpSequenceConfig (   self)

Reimplemented in SequenceTypes._ModuleSequenceType.

Definition at line 547 of file Mixins.py.

547  def dumpSequenceConfig(self):
548  return str(self.__label)

References Mixins._Labelable.__label, and str.

◆ dumpSequencePython()

def Mixins._Labelable.dumpSequencePython (   self,
  options = PrintOptions() 
)

Reimplemented in SequenceTypes._ModuleSequenceType.

Definition at line 549 of file Mixins.py.

549  def dumpSequencePython(self, options=PrintOptions()):
550  if options.isCfg:
551  return 'process.'+str(self.__label)
552  else:
553  return str(self.__label)

References Mixins._Labelable.__label, and str.

◆ hasLabel_()

def Mixins._Labelable.hasLabel_ (   self)

Definition at line 519 of file Mixins.py.

519  def hasLabel_(self):
520  return hasattr(self, "_Labelable__label") and self.__label is not None

References Mixins._Labelable.__label.

Referenced by SequenceTypes._ModuleSequenceType.dumpSequenceConfig(), SequenceTypes._ModuleSequenceType.dumpSequencePython(), SequenceTypes.Task.fillContents(), and Mixins._Labelable.setLabel().

◆ label()

def Mixins._Labelable.label (   self)

Definition at line 539 of file Mixins.py.

539  def label(self):
540  #print "WARNING: _Labelable::label() needs to be changed to label_()"
541  return self.__label

References Mixins._Labelable.__label.

◆ label_()

def Mixins._Labelable.label_ (   self)

Definition at line 515 of file Mixins.py.

515  def label_(self):
516  if not hasattr(self, "_Labelable__label"):
517  raise RuntimeError("module has no label. Perhaps it wasn't inserted into the process?")
518  return self.__label

References Mixins._Labelable.__label.

Referenced by SequenceTypes.DummyModule.__repr__(), Mixins._Labelable._findDependencies(), and Mixins._Labelable.setLabel().

◆ setLabel()

def Mixins._Labelable.setLabel (   self,
  label 
)

Definition at line 521 of file Mixins.py.

521  def setLabel(self,label):
522  if self.hasLabel_() :
523  if self.label_() != label and label is not None :
524  msg100 = "Attempting to change the label of a Labelable object, possibly an attribute of the Process\n"
525  msg101 = "Old label = "+self.label_()+" New label = "+label+"\n"
526  msg102 = "Type = "+str(type(self))+"\n"
527  msg103 = "Some possible solutions:\n"
528  msg104 = " 1. Clone modules instead of using simple assignment. Cloning is\n"
529  msg105 = " also preferred for other types when possible.\n"
530  msg106 = " 2. Declare new names starting with an underscore if they are\n"
531  msg107 = " for temporaries you do not want propagated into the Process. The\n"
532  msg108 = " underscore tells \"from x import *\" and process.load not to import\n"
533  msg109 = " the name.\n"
534  msg110 = " 3. Reorganize so the assigment is not necessary. Giving a second\n"
535  msg111 = " name to the same object usually causes confusion and problems.\n"
536  msg112 = " 4. Compose Sequences: newName = cms.Sequence(oldName)\n"
537  raise ValueError(msg100+msg101+msg102+msg103+msg104+msg105+msg106+msg107+msg108+msg109+msg110+msg111+msg112)
538  self.__label = label

References Mixins._Labelable.hasLabel_(), CTPPSPixelDAQMappingAnalyzer.label_, TestCUDAProducerCPU.label_, TestCUDAProducerGPU.label_, TestCUDAProducerGPUFirst.label_, TestCUDAAnalyzerGPU.label_, TestCUDAProducerGPUtoCPU.label_, edm::eventsetup::ComponentDescription.label_, TestCUDAProducerGPUEW.label_, SiStripLorentzAngleReader.label_, pat::TriggerFilter.label_, XMLIdealMagneticFieldGeometryESProducer.label_, ESDigiToRaw.label_, PythiaFilterHT.label_, TestCUDAProducerGPUEWTask.label_, RetrieveCTPPSBeamParameters.label_, CTPPSPixelRawToDigi.label_, VertexCompositeCandidateCollectionSelector.label_, WriteCTPPSPixelDAQMapping.label_, WriteCTPPSPixelAnalysisMask.label_, HistoProviderDQM.label_, SiStripDelayESProducer::TokenSign.label_, RandomEngineState.label_, PythiaMomDauFilter.label_, StripSubClusterShapeFilterBase.label_, VertexMonitor.label_, edm::ConsumesInfo.label_, edm::test::ProcessBlock.label_, SiPixelStatusManager.label_, edm::SecSourceAnalyzer.label_, edm::InputTag.label_, SiPixelStatusHarvester.label_, TPGCheck.label_, reco::Centrality.label_, DDDetectorESProducer.label_, L1TkEmParticleProducer.label_, edm::test::Run.label_, PPSPixelDigiAnalyzer.label_, edm::test::LuminosityBlock.label_, pat::TauJetCorrFactors.label_, EcalTrigPrimAnalyzer.label_, edm::test::Event.label_, EffPurFromHistos2D.label_, edm::DataMixingSiStripWorker.label_, StallStatistics.label_, edm::DataMixingSiPixelWorker.label_, edm::DataMixingPileupCopy.label_, SiPixelCalibDigiProducer.label_, EffPurFromHistos.label_, edm::DataMixingSiStripRawWorker.label_, edm::HiMixingWorkerBase.label_, SingleTopTChannelLepton_miniAOD::MonitorEnsemble.label_, TopSingleLepton_miniAOD::MonitorEnsemble.label_, npstat::UniformAxis.label_, edm::ParameterDescriptionBase.label_, PileupJetIdAlgo::AlgoGBRForestsAndConstants.label_, edm::messagedrop::StringProducerWithPhase.label_, edm::DataMixingEMWorker.label_, fwlite::ObjectCountSelector< Collection >.label_, edm::DataMixingHcalWorker.label_, edm::DataMixingHcalDigiWorkerProd.label_, pat::JetCorrFactors.label_, pat::JetCorrFactorsProducer.label_, TopSingleLepton::MonitorEnsemble.label_, edm::DataMixingEMDigiWorker.label_, edm::DataMixingMuonWorker.label_, npstat::NUHistoAxis.label_, pat::helper::AnyNumberAssociationAdaptor.label_, SingleTopTChannelLepton::MonitorEnsemble.label_, edm::DataMixingHcalDigiWorker.label_, TopDiLeptonOffline::MonitorEnsemble.label_, HLTObjectsMonitor.label_, npstat::GridAxis.label_, SummaryGenerator.label_, npstat::HistoAxis.label_, edm::service::RandomNumberGeneratorService::LabelAndEngine.label_, templateHelper::SiPixelTitles_Display< PayloadType, StoreType, TransientType >.label_, edm::MixingWorker< T >.label_, edm::DataMixingModule.label_, templateHelper::SiPixelHeaderTable< PayloadType, StoreType, TransientType >.label_, gainCalibHelper::SiPixelGainCalibrationValues< myType, PayloadType >.label_, templateHelper::SiPixelIDs< PayloadType, myType >.label_, templateHelper::SiPixelFullPixelIDMap< PayloadType, StoreType, TransientType >.label_, Mixins._Labelable.label_(), gainCalibHelper::SiPixelGainCalibrationValuesPerRegion< isBarrel, myType, PayloadType >.label_, fwlite::Scanner< Collection >.label_, gainCalibHelper::SiPixelGainCalibrationValuesComparisonPerRegion< isBarrel, myType, nIOVs, ntags, PayloadType >.label_, gainCalibHelper::SiPixelGainCalibrationCorrelations< PayloadType >.label_, SiPixelLorentzAngleFullPixelMap.label_, gainCalibHelper::SiPixelGainCalibrationValuesByPart< myType, PayloadType >.label_, gainCalibHelper::SiPixelGainCalibrationValueComparisonBase< myType, PayloadType >.label_, gainCalibHelper::SiPixelGainCalibDiffAndRatioBase< myType, nIOVs, ntags, PayloadType >.label_, gainCalibHelper::SiPixelGainCalibrationBPIXMap< myType, PayloadType >.label_, gainCalibHelper::SiPixelGainCalibrationFPIXMap< myType, PayloadType >.label_, gainCalibHelper::SiPixelGainCalibrationByRegionComparisonBase< myType, PayloadType, nIOVs, ntags >.label_, and str.

Referenced by SequenceTypes.DummyModule.__init__(), and SequenceTypes.DummyBooleanModule.__init__().

Member Data Documentation

◆ __label

Mixins._Labelable.__label
private
str
#define str(s)
Definition: TestProcessor.cc:52
TriggerAnalyzer.__str__
def __str__(self)
Definition: TriggerAnalyzer.py:103
label
const char * label
Definition: PFTauDecayModeTools.cc:11