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 511 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 540 of file Mixins.py.

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

References Mixins._Labelable.__label, and str.

◆ _findDependencies()

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

Definition at line 552 of file Mixins.py.

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

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_, StripSubClusterShapeFilterBase.label_, VertexCompositeCandidateCollectionSelector.label_, WriteCTPPSPixelAnalysisMask.label_, WriteCTPPSPixelDAQMapping.label_, HistoProviderDQM.label_, SiStripDelayESProducer::TokenSign.label_, RandomEngineState.label_, PythiaMomDauFilter.label_, VertexMonitor.label_, edm::ConsumesInfo.label_, edm::test::ProcessBlock.label_, SiPixelStatusManager.label_, edm::SecSourceAnalyzer.label_, edm::InputTag.label_, TPGCheck.label_, SiPixelStatusHarvester.label_, DDDetectorESProducer.label_, reco::Centrality.label_, L1TkEmParticleProducer.label_, PPSPixelDigiAnalyzer.label_, edm::test::Run.label_, edm::test::LuminosityBlock.label_, pat::TauJetCorrFactors.label_, EcalTrigPrimAnalyzer.label_, edm::test::Event.label_, EffPurFromHistos2D.label_, edm::DataMixingSiStripWorker.label_, edm::DataMixingSiPixelWorker.label_, StallStatistics.label_, edm::DataMixingPileupCopy.label_, SiPixelCalibDigiProducer.label_, EffPurFromHistos.label_, edm::DataMixingSiStripRawWorker.label_, edm::HiMixingWorkerBase.label_, SingleTopTChannelLepton_miniAOD::MonitorEnsemble.label_, TopSingleLepton_miniAOD::MonitorEnsemble.label_, edm::ParameterDescriptionBase.label_, npstat::UniformAxis.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_, edm::DataMixingEMDigiWorker.label_, TopSingleLepton::MonitorEnsemble.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_, edm::MixingWorker< T >.label_, edm::DataMixingModule.label_, gainCalibHelper::SiPixelGainCalibrationValues< myType, PayloadType >.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_, 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 545 of file Mixins.py.

545  def dumpSequenceConfig(self):
546  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 547 of file Mixins.py.

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

References Mixins._Labelable.__label, and str.

◆ hasLabel_()

def Mixins._Labelable.hasLabel_ (   self)

Definition at line 517 of file Mixins.py.

517  def hasLabel_(self):
518  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 537 of file Mixins.py.

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

References Mixins._Labelable.__label.

◆ label_()

def Mixins._Labelable.label_ (   self)

Definition at line 513 of file Mixins.py.

513  def label_(self):
514  if not hasattr(self, "_Labelable__label"):
515  raise RuntimeError("module has no label. Perhaps it wasn't inserted into the process?")
516  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 519 of file Mixins.py.

519  def setLabel(self,label):
520  if self.hasLabel_() :
521  if self.label_() != label and label is not None :
522  msg100 = "Attempting to change the label of a Labelable object, possibly an attribute of the Process\n"
523  msg101 = "Old label = "+self.label_()+" New label = "+label+"\n"
524  msg102 = "Type = "+str(type(self))+"\n"
525  msg103 = "Some possible solutions:\n"
526  msg104 = " 1. Clone modules instead of using simple assignment. Cloning is\n"
527  msg105 = " also preferred for other types when possible.\n"
528  msg106 = " 2. Declare new names starting with an underscore if they are\n"
529  msg107 = " for temporaries you do not want propagated into the Process. The\n"
530  msg108 = " underscore tells \"from x import *\" and process.load not to import\n"
531  msg109 = " the name.\n"
532  msg110 = " 3. Reorganize so the assigment is not necessary. Giving a second\n"
533  msg111 = " name to the same object usually causes confusion and problems.\n"
534  msg112 = " 4. Compose Sequences: newName = cms.Sequence(oldName)\n"
535  raise ValueError(msg100+msg101+msg102+msg103+msg104+msg105+msg106+msg107+msg108+msg109+msg110+msg111+msg112)
536  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_, StripSubClusterShapeFilterBase.label_, VertexCompositeCandidateCollectionSelector.label_, WriteCTPPSPixelAnalysisMask.label_, WriteCTPPSPixelDAQMapping.label_, HistoProviderDQM.label_, SiStripDelayESProducer::TokenSign.label_, RandomEngineState.label_, PythiaMomDauFilter.label_, VertexMonitor.label_, edm::ConsumesInfo.label_, edm::test::ProcessBlock.label_, SiPixelStatusManager.label_, edm::SecSourceAnalyzer.label_, edm::InputTag.label_, TPGCheck.label_, DDDetectorESProducer.label_, SiPixelStatusHarvester.label_, reco::Centrality.label_, L1TkEmParticleProducer.label_, PPSPixelDigiAnalyzer.label_, edm::test::Run.label_, edm::test::LuminosityBlock.label_, pat::TauJetCorrFactors.label_, EcalTrigPrimAnalyzer.label_, edm::test::Event.label_, EffPurFromHistos2D.label_, edm::DataMixingSiStripWorker.label_, edm::DataMixingSiPixelWorker.label_, StallStatistics.label_, edm::DataMixingPileupCopy.label_, SiPixelCalibDigiProducer.label_, EffPurFromHistos.label_, edm::DataMixingSiStripRawWorker.label_, edm::HiMixingWorkerBase.label_, TopSingleLepton_miniAOD::MonitorEnsemble.label_, SingleTopTChannelLepton_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_, edm::DataMixingEMDigiWorker.label_, TopSingleLepton::MonitorEnsemble.label_, edm::DataMixingMuonWorker.label_, pat::helper::AnyNumberAssociationAdaptor.label_, npstat::NUHistoAxis.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_, edm::MixingWorker< T >.label_, edm::DataMixingModule.label_, gainCalibHelper::SiPixelGainCalibrationValues< myType, PayloadType >.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_, 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:51
TriggerAnalyzer.__str__
def __str__(self)
Definition: TriggerAnalyzer.py:103
label
const char * label
Definition: PFTauDecayModeTools.cc:11