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

Member Function Documentation

def Mixins._Labelable.__str__ (   self)

Definition at line 478 of file Mixins.py.

References Mixins._Labelable.__label, and str.

478  def __str__(self):
479  #this is probably a bad idea
480  # I added this so that when we ask a path to print
481  # we will see the label that has been assigned
482  return str(self.__label)
def __str__(self)
Definition: Mixins.py:478
#define str(s)
def Mixins._Labelable._findDependencies (   self,
  knownDeps,
  presentDeps 
)
private

Definition at line 487 of file Mixins.py.

References CTPPSPixelDAQMappingAnalyzer.label_, XMLIdealGeometryESProducer.label_, Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigFolder.label_(), edm::eventsetup::ComponentDescription.label_, SiStripLorentzAngleReader.label_, XMLIdealMagneticFieldGeometryESProducer.label_, StripSubClusterShapeFilterBase.label_, ESDigiToRaw.label_, pat::TriggerFilter.label_, HistoProviderDQM.label_, CTPPSPixelRawToDigi.label_, VertexCompositeCandidateCollectionSelector.label_, WriteCTPPSPixelAnalysisMask.label_, WriteCTPPSPixelDAQMapping.label_, MuonNumberingInitialization.label_, VertexMonitor.label_, RawEventOutputModuleForBU< Consumer >.label_, edm::ESOutlet< T, TRec >::Getter.label_, PythiaFilterHT.label_, SiPixelStatusHarvester.label_, EffPurFromHistos2D.label_, reco::Centrality.label_, PythiaMomDauFilter.label_, RandomEngineState.label_, edm::ConsumesInfo.label_, edm::InputTag.label_, SiPixelStatusManager.label_, edm::SecSourceAnalyzer.label_, pat::helper::AnyNumberAssociationAdaptor.label_, TPGCheck.label_, EcalTrigPrimAnalyzer.label_, EffPurFromHistos.label_, pat::TauJetCorrFactors.label_, edm::test::Event.label_, edm::DataMixingSiPixelWorker.label_, edm::DataMixingSiStripWorker.label_, edm::DataMixingPileupCopy.label_, edm::DataMixingSiStripRawWorker.label_, SiPixelCalibDigiProducer.label_, StallStatistics.label_, edm::HiMixingWorkerBase.label_, HLTOfflineDQMTopSingleLepton::MonitorSingleLepton.label_, fwlite::ObjectCountSelector< Collection >.label_, npstat::UniformAxis.label_, pat::JetCorrFactors.label_, HLTOfflineDQMTopDiLepton::MonitorDiLepton.label_, edm::DataMixingHcalDigiWorkerProd.label_, edm::DataMixingHcalWorker.label_, TopSingleLepton_miniAOD::MonitorEnsemble.label_, SingleTopTChannelLepton_miniAOD::MonitorEnsemble.label_, edm::DataMixingEMWorker.label_, PileupJetIdAlgo::AlgoGBRForestsAndConstants.label_, pat::JetCorrFactorsProducer.label_, edm::ParameterDescriptionBase.label_, EcalDigiToRaw.label_, edm::DataMixingMuonWorker.label_, edm::DataMixingEMDigiWorker.label_, npstat::NUHistoAxis.label_, edm::DataMixingHcalDigiWorker.label_, TopSingleLepton::MonitorEnsemble.label_, SingleTopTChannelLepton::MonitorEnsemble.label_, edm::messagedrop::StringProducerWithPhase.label_, HLTObjectsMonitor.label_, npstat::GridAxis.label_, SummaryGenerator.label_, edm::service::RandomNumberGeneratorService::LabelAndEngine.label_, TopDiLeptonOffline::MonitorEnsemble.label_, npstat::HistoAxis.label_, edm::MixingWorker< T >.label_, edm::DataMixingModule.label_, Mixins._Labelable.label_(), fwlite::Scanner< Collection >.label_, and str.

487  def _findDependencies(self,knownDeps,presentDeps):
488  #print 'in labelled'
489  myDeps=knownDeps.get(self.label_(),None)
490  if myDeps!=None:
491  if presentDeps != myDeps:
492  raise RuntimeError("the module "+self.label_()+" has two dependencies \n"
493  +str(presentDeps)+"\n"
494  +str(myDeps)+"\n"
495  +"Please modify sequences to rectify this inconsistency")
496  else:
497  myDeps=set(presentDeps)
498  knownDeps[self.label_()]=myDeps
499  presentDeps.add(self.label_())
500 
501 
def label_(self)
Definition: Mixins.py:451
def _findDependencies(self, knownDeps, presentDeps)
Definition: Mixins.py:487
#define str(s)
def Mixins._Labelable.dumpSequenceConfig (   self)

Definition at line 483 of file Mixins.py.

References Mixins._Labelable.__label, and str.

484  return str(self.__label)
def dumpSequenceConfig(self)
Definition: Mixins.py:483
#define str(s)
def Mixins._Labelable.dumpSequencePython (   self,
  options = PrintOptions() 
)

Definition at line 485 of file Mixins.py.

References Mixins._Labelable.__label, and str.

485  def dumpSequencePython(self, options=PrintOptions()):
486  return 'process.'+str(self.__label)
#define str(s)
def dumpSequencePython(self, options=PrintOptions())
Definition: Mixins.py:485
def Mixins._Labelable.hasLabel_ (   self)

Definition at line 455 of file Mixins.py.

References Mixins._Labelable.__label.

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

455  def hasLabel_(self):
456  return hasattr(self, "_Labelable__label") and self.__label is not None
def hasLabel_(self)
Definition: Mixins.py:455
def Mixins._Labelable.label (   self)

Definition at line 475 of file Mixins.py.

References Mixins._Labelable.__label.

475  def label(self):
476  #print "WARNING: _Labelable::label() needs to be changed to label_()"
477  return self.__label
def label(self)
Definition: Mixins.py:475
def Mixins._Labelable.label_ (   self)

Definition at line 451 of file Mixins.py.

References Mixins._Labelable.__label.

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

451  def label_(self):
452  if not hasattr(self, "_Labelable__label"):
453  raise RuntimeError("module has no label. Perhaps it wasn't inserted into the process?")
454  return self.__label
def label_(self)
Definition: Mixins.py:451
def Mixins._Labelable.setLabel (   self,
  label 
)

Definition at line 457 of file Mixins.py.

References Mixins._Labelable.hasLabel_(), CTPPSPixelDAQMappingAnalyzer.label_, XMLIdealGeometryESProducer.label_, Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigFolder.label_(), edm::eventsetup::ComponentDescription.label_, SiStripLorentzAngleReader.label_, XMLIdealMagneticFieldGeometryESProducer.label_, StripSubClusterShapeFilterBase.label_, ESDigiToRaw.label_, pat::TriggerFilter.label_, HistoProviderDQM.label_, CTPPSPixelRawToDigi.label_, VertexCompositeCandidateCollectionSelector.label_, WriteCTPPSPixelAnalysisMask.label_, WriteCTPPSPixelDAQMapping.label_, MuonNumberingInitialization.label_, edm::ESOutlet< T, TRec >::Getter.label_, VertexMonitor.label_, RawEventOutputModuleForBU< Consumer >.label_, PythiaFilterHT.label_, SiPixelStatusHarvester.label_, EffPurFromHistos2D.label_, reco::Centrality.label_, PythiaMomDauFilter.label_, RandomEngineState.label_, edm::ConsumesInfo.label_, edm::InputTag.label_, SiPixelStatusManager.label_, edm::SecSourceAnalyzer.label_, pat::helper::AnyNumberAssociationAdaptor.label_, EcalTrigPrimAnalyzer.label_, TPGCheck.label_, EffPurFromHistos.label_, pat::TauJetCorrFactors.label_, edm::test::Event.label_, edm::DataMixingSiPixelWorker.label_, edm::DataMixingSiStripWorker.label_, edm::DataMixingPileupCopy.label_, edm::DataMixingSiStripRawWorker.label_, StallStatistics.label_, SiPixelCalibDigiProducer.label_, edm::HiMixingWorkerBase.label_, HLTOfflineDQMTopSingleLepton::MonitorSingleLepton.label_, fwlite::ObjectCountSelector< Collection >.label_, npstat::UniformAxis.label_, pat::JetCorrFactors.label_, HLTOfflineDQMTopDiLepton::MonitorDiLepton.label_, edm::DataMixingHcalDigiWorkerProd.label_, edm::DataMixingHcalWorker.label_, TopSingleLepton_miniAOD::MonitorEnsemble.label_, SingleTopTChannelLepton_miniAOD::MonitorEnsemble.label_, edm::DataMixingEMWorker.label_, PileupJetIdAlgo::AlgoGBRForestsAndConstants.label_, pat::JetCorrFactorsProducer.label_, edm::ParameterDescriptionBase.label_, EcalDigiToRaw.label_, edm::DataMixingMuonWorker.label_, edm::DataMixingEMDigiWorker.label_, npstat::NUHistoAxis.label_, edm::DataMixingHcalDigiWorker.label_, SingleTopTChannelLepton::MonitorEnsemble.label_, TopSingleLepton::MonitorEnsemble.label_, edm::messagedrop::StringProducerWithPhase.label_, HLTObjectsMonitor.label_, npstat::GridAxis.label_, SummaryGenerator.label_, edm::service::RandomNumberGeneratorService::LabelAndEngine.label_, TopDiLeptonOffline::MonitorEnsemble.label_, npstat::HistoAxis.label_, edm::MixingWorker< T >.label_, edm::DataMixingModule.label_, Mixins._Labelable.label_(), fwlite::Scanner< Collection >.label_, and str.

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

457  def setLabel(self,label):
458  if self.hasLabel_() :
459  if self.label_() != label and label is not None :
460  msg100 = "Attempting to change the label of a Labelable object, possibly an attribute of the Process\n"
461  msg101 = "Old label = "+self.label_()+" New label = "+label+"\n"
462  msg102 = "Type = "+str(type(self))+"\n"
463  msg103 = "Some possible solutions:\n"
464  msg104 = " 1. Clone modules instead of using simple assignment. Cloning is\n"
465  msg105 = " also preferred for other types when possible.\n"
466  msg106 = " 2. Declare new names starting with an underscore if they are\n"
467  msg107 = " for temporaries you do not want propagated into the Process. The\n"
468  msg108 = " underscore tells \"from x import *\" and process.load not to import\n"
469  msg109 = " the name.\n"
470  msg110 = " 3. Reorganize so the assigment is not necessary. Giving a second\n"
471  msg111 = " name to the same object usually causes confusion and problems.\n"
472  msg112 = " 4. Compose Sequences: newName = cms.Sequence(oldName)\n"
473  raise ValueError(msg100+msg101+msg102+msg103+msg104+msg105+msg106+msg107+msg108+msg109+msg110+msg111+msg112)
474  self.__label = label
def label_(self)
Definition: Mixins.py:451
def setLabel(self, label)
Definition: Mixins.py:457
def hasLabel_(self)
Definition: Mixins.py:455
#define str(s)

Member Data Documentation

Mixins._Labelable.__label
private