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

534  def __str__(self):
535  #this is probably a bad idea
536  # I added this so that when we ask a path to print
537  # we will see the label that has been assigned
538  return str(self.__label)

References Mixins._Labelable.__label, and str.

◆ _findDependencies()

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

Definition at line 546 of file Mixins.py.

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

References CTPPSPixelDAQMappingAnalyzer.label_, TestCUDAProducerCPU.label_, TestCUDAProducerGPU.label_, TestCUDAProducerGPUFirst.label_, TestCUDAAnalyzerGPU.label_, SiStripLorentzAngleReader.label_, TestCUDAProducerGPUtoCPU.label_, edm::eventsetup::ComponentDescription.label_, TestCUDAProducerGPUEW.label_, XMLIdealMagneticFieldGeometryESProducer.label_, pat::TriggerFilter.label_, CTPPSPixelRawToDigi.label_, ESDigiToRaw.label_, PythiaFilterHT.label_, TestCUDAProducerGPUEWTask.label_, RetrieveCTPPSBeamParameters.label_, StripSubClusterShapeFilterBase.label_, VertexCompositeCandidateCollectionSelector.label_, edm::ESOutlet< T, TRec >::Getter.label_, WriteCTPPSPixelAnalysisMask.label_, RawEventOutputModuleForBU< Consumer >.label_, WriteCTPPSPixelDAQMapping.label_, HistoProviderDQM.label_, SiStripDelayESProducer::TokenSign.label_, RandomEngineState.label_, PythiaMomDauFilter.label_, VertexMonitor.label_, edm::ConsumesInfo.label_, SiPixelStatusManager.label_, edm::SecSourceAnalyzer.label_, edm::InputTag.label_, EcalTrigPrimAnalyzer.label_, TPGCheck.label_, DDDetectorESProducer.label_, reco::Centrality.label_, SiPixelStatusHarvester.label_, L1TkEmParticleProducer.label_, PPSPixelDigiAnalyzer.label_, edm::test::Run.label_, edm::test::LuminosityBlock.label_, pat::TauJetCorrFactors.label_, edm::test::Event.label_, EffPurFromHistos2D.label_, edm::DataMixingSiStripWorker.label_, edm::DataMixingSiPixelWorker.label_, StallStatistics.label_, edm::DataMixingPileupCopy.label_, EffPurFromHistos.label_, SiPixelCalibDigiProducer.label_, edm::HiMixingWorkerBase.label_, edm::DataMixingSiStripRawWorker.label_, SingleTopTChannelLepton_miniAOD::MonitorEnsemble.label_, TopSingleLepton_miniAOD::MonitorEnsemble.label_, edm::ParameterDescriptionBase.label_, npstat::UniformAxis.label_, PileupJetIdAlgo::AlgoGBRForestsAndConstants.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::messagedrop::StringProducerWithPhase.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_, gainCalibHelper::SiPixelGainCalibrationValuesPerRegion< isBarrel, myType, PayloadType >.label_, Mixins._Labelable.label_(), gainCalibHelper::SiPixelGainCalibrationValuesComparisonPerRegion< isBarrel, myType, nIOVs, ntags, PayloadType >.label_, fwlite::Scanner< Collection >.label_, gainCalibHelper::SiPixelGainCalibrationCorrelations< PayloadType >.label_, gainCalibHelper::SiPixelGainCalibrationValuesByPart< myType, PayloadType >.label_, gainCalibHelper::SiPixelGainCalibrationValueComparisonBase< myType, PayloadType >.label_, gainCalibHelper::SiPixelGainCalibrationBPIXMap< myType, PayloadType >.label_, gainCalibHelper::SiPixelGainCalibrationFPIXMap< myType, PayloadType >.label_, gainCalibHelper::SiPixelGainCalibrationByRegionComparisonBase< myType, PayloadType >.label_, and str.

◆ dumpSequenceConfig()

def Mixins._Labelable.dumpSequenceConfig (   self)

Reimplemented in SequenceTypes._ModuleSequenceType.

Definition at line 539 of file Mixins.py.

539  def dumpSequenceConfig(self):
540  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 541 of file Mixins.py.

541  def dumpSequencePython(self, options=PrintOptions()):
542  if options.isCfg:
543  return 'process.'+str(self.__label)
544  else:
545  return str(self.__label)

References Mixins._Labelable.__label, and str.

◆ hasLabel_()

def Mixins._Labelable.hasLabel_ (   self)

Definition at line 511 of file Mixins.py.

511  def hasLabel_(self):
512  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 531 of file Mixins.py.

531  def label(self):
532  #print "WARNING: _Labelable::label() needs to be changed to label_()"
533  return self.__label

References Mixins._Labelable.__label.

◆ label_()

def Mixins._Labelable.label_ (   self)

Definition at line 507 of file Mixins.py.

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

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

References Mixins._Labelable.hasLabel_(), CTPPSPixelDAQMappingAnalyzer.label_, TestCUDAProducerCPU.label_, TestCUDAProducerGPU.label_, TestCUDAProducerGPUFirst.label_, TestCUDAAnalyzerGPU.label_, SiStripLorentzAngleReader.label_, TestCUDAProducerGPUtoCPU.label_, edm::eventsetup::ComponentDescription.label_, TestCUDAProducerGPUEW.label_, XMLIdealMagneticFieldGeometryESProducer.label_, pat::TriggerFilter.label_, CTPPSPixelRawToDigi.label_, ESDigiToRaw.label_, PythiaFilterHT.label_, TestCUDAProducerGPUEWTask.label_, RetrieveCTPPSBeamParameters.label_, StripSubClusterShapeFilterBase.label_, VertexCompositeCandidateCollectionSelector.label_, edm::ESOutlet< T, TRec >::Getter.label_, WriteCTPPSPixelAnalysisMask.label_, WriteCTPPSPixelDAQMapping.label_, RawEventOutputModuleForBU< Consumer >.label_, HistoProviderDQM.label_, SiStripDelayESProducer::TokenSign.label_, RandomEngineState.label_, PythiaMomDauFilter.label_, VertexMonitor.label_, edm::ConsumesInfo.label_, SiPixelStatusManager.label_, edm::SecSourceAnalyzer.label_, edm::InputTag.label_, EcalTrigPrimAnalyzer.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_, edm::test::Event.label_, EffPurFromHistos2D.label_, edm::DataMixingSiStripWorker.label_, edm::DataMixingSiPixelWorker.label_, StallStatistics.label_, edm::DataMixingPileupCopy.label_, EffPurFromHistos.label_, SiPixelCalibDigiProducer.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::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::messagedrop::StringProducerWithPhase.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_, gainCalibHelper::SiPixelGainCalibrationValuesPerRegion< isBarrel, myType, PayloadType >.label_, Mixins._Labelable.label_(), gainCalibHelper::SiPixelGainCalibrationValuesComparisonPerRegion< isBarrel, myType, nIOVs, ntags, PayloadType >.label_, fwlite::Scanner< Collection >.label_, gainCalibHelper::SiPixelGainCalibrationCorrelations< PayloadType >.label_, gainCalibHelper::SiPixelGainCalibrationValuesByPart< myType, PayloadType >.label_, gainCalibHelper::SiPixelGainCalibrationValueComparisonBase< myType, PayloadType >.label_, gainCalibHelper::SiPixelGainCalibrationBPIXMap< myType, PayloadType >.label_, gainCalibHelper::SiPixelGainCalibrationFPIXMap< myType, PayloadType >.label_, gainCalibHelper::SiPixelGainCalibrationByRegionComparisonBase< myType, PayloadType >.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:48
TriggerAnalyzer.__str__
def __str__(self)
Definition: TriggerAnalyzer.py:103
label
const char * label
Definition: PFTauDecayModeTools.cc:11