CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 Types.EDAlias Types.PSet Types.SecSource Types.VPSet

Public Member Functions

def __str__
 
def dumpSequenceConfig
 
def dumpSequencePython
 
def hasLabel_
 
def label
 
def label_
 
def setLabel
 

Private Member Functions

def _findDependencies
 

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

Member Function Documentation

def Mixins._Labelable.__str__ (   self)

Definition at line 427 of file Mixins.py.

References Mixins._Labelable.__label.

428  def __str__(self):
429  #this is probably a bad idea
430  # I added this so that when we ask a path to print
431  # we will see the label that has been assigned
return str(self.__label)
def Mixins._Labelable._findDependencies (   self,
  knownDeps,
  presentDeps 
)
private

Definition at line 436 of file Mixins.py.

References WriteOneGeometryFromXML.label_, RPCRecoIdealDBLoader.label_, CSCRecoIdealDBLoader.label_, DTRecoIdealDBLoader.label_, evf::EvFRecordUnpacker.label_, evf::EvFRecordInserter.label_, Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigFolder.label_(), MCPdgIndexFilter.label_, edm::eventsetup::ComponentDescription.label_, SiStripLorentzAngleReader.label_, PythiaFilterEMJet.label_, PythiaFilterZgamma.label_, PythiaFilterGammaJet.label_, PythiaFilterGammaJetWithBg.label_, PythiaFilterGammaJetWithOutBg.label_, PythiaFilterZJet.label_, PythiaFilterZJetWithOutBg.label_, PythiaFilterGammaJetIsoPi0.label_, PixelClusterSelectorTopBottom.label_, XMLIdealMagneticFieldGeometryESProducer.label_, StripClusterSelectorTopBottom.label_, StripSubClusterShapeFilterBase.label_, pat::TriggerFilter.label_, HistoProviderDQM.label_, PythiaFilterEMJetHeep.label_, MCSmartSingleParticleFilter.label_, MCDijetResonance.label_, MCZll.label_, MuonNumberingInitialization.label_, JetFlavourCutFilter.label_, JetFlavourFilter.label_, MCDecayingPionKaonFilter.label_, PythiaDauVFilter.label_, MCProcessFilter.label_, MCProcessRangeFilter.label_, MCSingleParticleFilter.label_, RawEventOutputModuleForBU< Consumer >.label_, PythiaFilter.label_, PythiaHLTSoupFilter.label_, HZZ4lFilter.label_, edm::ESOutlet< T, TRec >::Getter.label_, PythiaDauFilter.label_, FourLepFilter.label_, MCParticlePairFilter.label_, EcalTrigPrimProducer.label_, ZgMassFilter.label_, DJpsiFilter.label_, VertexMonitor.label_, reco::Centrality.label_, ZgammaMassFilter.label_, RandomEngineState.label_, HerwigMaxPtPartonFilter.label_, ESDigiToRaw.label_, edm::ConsumesInfo.label_, edm::SecSourceAnalyzer.label_, BsJpsiPhiFilter.label_, XMLIdealGeometryESProducer.label_, EcalTrigPrimAnalyzer.label_, TPGCheck.label_, edm::InputTag.label_, BdecayFilter.label_, PythiaFilterTTBar.label_, pat::TauJetCorrFactors.label_, edm::DataMixingPileupCopy.label_, edm::DataMixingSiPixelWorker.label_, edm::DataMixingSiStripWorker.label_, edm::DataMixingSiStripRawWorker.label_, SiPixelCalibDigiProducer.label_, edm::HiMixingWorkerBase.label_, fwlite::ObjectCountSelector< Collection >.label_, HLTOfflineDQMTopSingleLepton::MonitorSingleLepton.label_, npstat::UniformAxis.label_, HLTOfflineDQMTopDiLepton::MonitorDiLepton.label_, pat::JetCorrFactors.label_, edm::DataMixingHcalWorker.label_, edm::DataMixingHcalDigiWorkerProd.label_, edm::DataMixingEcalDigiWorkerProd.label_, edm::DataMixingEMWorker.label_, pat::JetCorrFactorsProducer.label_, edm::ParameterDescriptionBase.label_, EcalDigiToRaw.label_, edm::DataMixingMuonWorker.label_, edm::DataMixingHcalDigiWorker.label_, edm::DataMixingEMDigiWorker.label_, EffPurFromHistos.label_, edm::DataMixingSiStripMCDigiWorker.label_, npstat::NUHistoAxis.label_, TopSingleLepton::MonitorEnsemble.label_, SingleTopTChannelLepton::MonitorEnsemble.label_, AlgoImpl.label_, edm::messagedrop::StringProducerWithPhase.label_, edm::DataMixingSiPixelMCDigiWorker.label_, npstat::GridAxis.label_, SummaryGenerator.label_, TopDiLeptonOffline::MonitorEnsemble.label_, npstat::HistoAxis.label_, edm::service::RandomNumberGeneratorService::LabelAndEngine.label_, edm::MixingWorker< T >.label_, edm::DataMixingModule.label_, Mixins._Labelable.label_(), and fwlite::Scanner< Collection >.label_.

437  def _findDependencies(self,knownDeps,presentDeps):
438  #print 'in labelled'
439  myDeps=knownDeps.get(self.label_(),None)
440  if myDeps!=None:
441  if presentDeps != myDeps:
442  raise RuntimeError("the module "+self.label_()+" has two dependencies \n"
443  +str(presentDeps)+"\n"
444  +str(myDeps)+"\n"
445  +"Please modify sequences to rectify this inconsistency")
446  else:
447  myDeps=set(presentDeps)
448  knownDeps[self.label_()]=myDeps
449  presentDeps.add(self.label_())
450 
def _findDependencies
Definition: Mixins.py:436
def Mixins._Labelable.dumpSequenceConfig (   self)

Definition at line 432 of file Mixins.py.

References Mixins._Labelable.__label.

433  def dumpSequenceConfig(self):
return str(self.__label)
def dumpSequenceConfig
Definition: Mixins.py:432
def Mixins._Labelable.dumpSequencePython (   self)

Definition at line 434 of file Mixins.py.

References Mixins._Labelable.__label.

435  def dumpSequencePython(self):
return 'process.'+str(self.__label)
def dumpSequencePython
Definition: Mixins.py:434
def Mixins._Labelable.hasLabel_ (   self)

Definition at line 404 of file Mixins.py.

References Mixins._Labelable.__label.

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

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

Definition at line 424 of file Mixins.py.

References Mixins._Labelable.__label.

425  def label(self):
426  #print "WARNING: _Labelable::label() needs to be changed to label_()"
return self.__label
def Mixins._Labelable.label_ (   self)

Definition at line 400 of file Mixins.py.

References Mixins._Labelable.__label.

Referenced by Mixins._Labelable._findDependencies(), Mixins._TypedParameterizable.dumpPython(), and Mixins._Labelable.setLabel().

401  def label_(self):
402  if not hasattr(self, "_Labelable__label"):
403  raise RuntimeError("module has no label. Perhaps it wasn't inserted into the process?")
return self.__label
def Mixins._Labelable.setLabel (   self,
  label 
)

Definition at line 406 of file Mixins.py.

References Mixins._Labelable.hasLabel_(), WriteOneGeometryFromXML.label_, RPCRecoIdealDBLoader.label_, DTRecoIdealDBLoader.label_, CSCRecoIdealDBLoader.label_, evf::EvFRecordUnpacker.label_, evf::EvFRecordInserter.label_, Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigFolder.label_(), MCPdgIndexFilter.label_, edm::eventsetup::ComponentDescription.label_, SiStripLorentzAngleReader.label_, PythiaFilterEMJet.label_, PythiaFilterZgamma.label_, PythiaFilterGammaJet.label_, PythiaFilterGammaJetWithBg.label_, PythiaFilterGammaJetWithOutBg.label_, PythiaFilterZJet.label_, PythiaFilterZJetWithOutBg.label_, PythiaFilterGammaJetIsoPi0.label_, PixelClusterSelectorTopBottom.label_, XMLIdealMagneticFieldGeometryESProducer.label_, StripClusterSelectorTopBottom.label_, StripSubClusterShapeFilterBase.label_, pat::TriggerFilter.label_, HistoProviderDQM.label_, PythiaFilterEMJetHeep.label_, MCSmartSingleParticleFilter.label_, MCDijetResonance.label_, MCZll.label_, MuonNumberingInitialization.label_, JetFlavourFilter.label_, MCDecayingPionKaonFilter.label_, JetFlavourCutFilter.label_, PythiaDauVFilter.label_, MCProcessFilter.label_, MCSingleParticleFilter.label_, MCProcessRangeFilter.label_, PythiaFilter.label_, RawEventOutputModuleForBU< Consumer >.label_, PythiaHLTSoupFilter.label_, HZZ4lFilter.label_, edm::ESOutlet< T, TRec >::Getter.label_, PythiaDauFilter.label_, DJpsiFilter.label_, FourLepFilter.label_, EcalTrigPrimProducer.label_, MCParticlePairFilter.label_, ZgMassFilter.label_, VertexMonitor.label_, reco::Centrality.label_, ZgammaMassFilter.label_, RandomEngineState.label_, HerwigMaxPtPartonFilter.label_, ESDigiToRaw.label_, edm::ConsumesInfo.label_, edm::SecSourceAnalyzer.label_, XMLIdealGeometryESProducer.label_, edm::InputTag.label_, BsJpsiPhiFilter.label_, TPGCheck.label_, EcalTrigPrimAnalyzer.label_, BdecayFilter.label_, PythiaFilterTTBar.label_, pat::TauJetCorrFactors.label_, edm::DataMixingPileupCopy.label_, edm::DataMixingSiPixelWorker.label_, edm::DataMixingSiStripWorker.label_, edm::DataMixingSiStripRawWorker.label_, SiPixelCalibDigiProducer.label_, edm::HiMixingWorkerBase.label_, fwlite::ObjectCountSelector< Collection >.label_, HLTOfflineDQMTopSingleLepton::MonitorSingleLepton.label_, npstat::UniformAxis.label_, HLTOfflineDQMTopDiLepton::MonitorDiLepton.label_, pat::JetCorrFactors.label_, edm::DataMixingHcalDigiWorkerProd.label_, edm::DataMixingHcalWorker.label_, edm::DataMixingEMWorker.label_, edm::DataMixingEcalDigiWorkerProd.label_, pat::JetCorrFactorsProducer.label_, edm::ParameterDescriptionBase.label_, EcalDigiToRaw.label_, edm::DataMixingMuonWorker.label_, edm::DataMixingEMDigiWorker.label_, edm::DataMixingHcalDigiWorker.label_, EffPurFromHistos.label_, edm::DataMixingSiStripMCDigiWorker.label_, npstat::NUHistoAxis.label_, TopSingleLepton::MonitorEnsemble.label_, SingleTopTChannelLepton::MonitorEnsemble.label_, AlgoImpl.label_, edm::messagedrop::StringProducerWithPhase.label_, npstat::GridAxis.label_, edm::DataMixingSiPixelMCDigiWorker.label_, SummaryGenerator.label_, TopDiLeptonOffline::MonitorEnsemble.label_, npstat::HistoAxis.label_, edm::service::RandomNumberGeneratorService::LabelAndEngine.label_, edm::MixingWorker< T >.label_, edm::DataMixingModule.label_, Mixins._Labelable.label_(), and fwlite::Scanner< Collection >.label_.

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

407  def setLabel(self,label):
408  if self.hasLabel_() :
409  if self.label_() != label and label is not None :
410  msg100 = "Attempting to change the label of a Labelable object, possibly an attribute of the Process\n"
411  msg101 = "Old label = "+self.label_()+" New label = "+label+"\n"
412  msg102 = "Type = "+str(type(self))+"\n"
413  msg103 = "Some possible solutions:\n"
414  msg104 = " 1. Clone modules instead of using simple assignment. Cloning is\n"
415  msg105 = " also preferred for other types when possible.\n"
416  msg106 = " 2. Declare new names starting with an underscore if they are\n"
417  msg107 = " for temporaries you do not want propagated into the Process. The\n"
418  msg108 = " underscore tells \"from x import *\" and process.load not to import\n"
419  msg109 = " the name.\n"
420  msg110 = " 3. Reorganize so the assigment is not necessary. Giving a second\n"
421  msg111 = " name to the same object usually causes confusion and problems.\n"
422  msg112 = " 4. Compose Sequences: newName = cms.Sequence(oldName)\n"
423  raise ValueError(msg100+msg101+msg102+msg103+msg104+msg105+msg106+msg107+msg108+msg109+msg110+msg111+msg112)
self.__label = label

Member Data Documentation

Mixins._Labelable.__label
private

Definition at line 423 of file Mixins.py.

Referenced by Mixins._Labelable.__str__(), Mixins._ValidatingListBase._labelIfAny(), Mixins._Labelable.dumpSequenceConfig(), Mixins._Labelable.dumpSequencePython(), SequenceVisitors.PathValidator.enter(), SequenceVisitors.EndPathValidator.enter(), Mixins._Labelable.hasLabel_(), Mixins._Labelable.label(), Mixins._Labelable.label_(), SequenceVisitors.PathValidator.setLabel(), and SequenceVisitors.EndPathValidator.setLabel().