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 517 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 546 of file Mixins.py.

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

References Mixins._Labelable.__label, and str.

◆ _findDependencies()

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

Definition at line 558 of file Mixins.py.

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

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_, CTPPSPixelRawToDigi.label_, VertexCompositeCandidateCollectionSelector.label_, RetrieveCTPPSBeamParameters.label_, WriteCTPPSPixelAnalysisMask.label_, HistoProviderDQM.label_, WriteCTPPSPixelDAQMapping.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_, PPSPixelDigiAnalyzer.label_, edm::test::Run.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::SiPixelGainCalibrationMap< myType, PayloadType, myDetType >.label_, gainCalibHelper::SiPixelGainCalibrationByRegionComparisonBase< myType, PayloadType, nIOVs, ntags >.label_, and str.

◆ dumpSequenceConfig()

def Mixins._Labelable.dumpSequenceConfig (   self)

Reimplemented in SequenceTypes._ModuleSequenceType.

Definition at line 551 of file Mixins.py.

551  def dumpSequenceConfig(self):
552  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 553 of file Mixins.py.

553  def dumpSequencePython(self, options=PrintOptions()):
554  if options.isCfg:
555  return 'process.'+str(self.__label)
556  else:
557  return str(self.__label)

References Mixins._Labelable.__label, and str.

◆ hasLabel_()

def Mixins._Labelable.hasLabel_ (   self)

Definition at line 523 of file Mixins.py.

523  def hasLabel_(self):
524  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 543 of file Mixins.py.

543  def label(self):
544  #print "WARNING: _Labelable::label() needs to be changed to label_()"
545  return self.__label

References Mixins._Labelable.__label.

◆ label_()

def Mixins._Labelable.label_ (   self)

Definition at line 519 of file Mixins.py.

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

525  def setLabel(self,label):
526  if self.hasLabel_() :
527  if self.label_() != label and label is not None :
528  msg100 = "Attempting to change the label of a Labelable object, possibly an attribute of the Process\n"
529  msg101 = "Old label = "+self.label_()+" New label = "+label+"\n"
530  msg102 = "Type = "+str(type(self))+"\n"
531  msg103 = "Some possible solutions:\n"
532  msg104 = " 1. Clone modules instead of using simple assignment. Cloning is\n"
533  msg105 = " also preferred for other types when possible.\n"
534  msg106 = " 2. Declare new names starting with an underscore if they are\n"
535  msg107 = " for temporaries you do not want propagated into the Process. The\n"
536  msg108 = " underscore tells \"from x import *\" and process.load not to import\n"
537  msg109 = " the name.\n"
538  msg110 = " 3. Reorganize so the assigment is not necessary. Giving a second\n"
539  msg111 = " name to the same object usually causes confusion and problems.\n"
540  msg112 = " 4. Compose Sequences: newName = cms.Sequence(oldName)\n"
541  raise ValueError(msg100+msg101+msg102+msg103+msg104+msg105+msg106+msg107+msg108+msg109+msg110+msg111+msg112)
542  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_, CTPPSPixelRawToDigi.label_, RetrieveCTPPSBeamParameters.label_, VertexCompositeCandidateCollectionSelector.label_, WriteCTPPSPixelAnalysisMask.label_, HistoProviderDQM.label_, WriteCTPPSPixelDAQMapping.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_, 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_, 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::SiPixelGainCalibrationMap< myType, PayloadType, myDetType >.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:53
TriggerAnalyzer.__str__
def __str__(self)
Definition: TriggerAnalyzer.py:103
label
const char * label
Definition: PFTauDecayModeTools.cc:11