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._TaskBase SequenceTypes.DummyBooleanModule SequenceTypes.DummyModule Types.EDAlias Types.PSet Types.SecSource Types.VPSet

Public Member Functions

def __str__ (self)
 
def dumpSequenceConfig (self)
 
def dumpSequencePython
 
def hasLabel_ (self)
 
def label (self)
 
def label_ (self)
 
def setLabel
 

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

Member Function Documentation

◆ __str__()

def Mixins._Labelable.__str__ (   self)

Definition at line 554 of file Mixins.py.

References Mixins._Labelable.__label, and str.

554  def __str__(self):
555  #this is probably a bad idea
556  # I added this so that when we ask a path to print
557  # we will see the label that has been assigned
558  return str(self.__label)
#define str(s)

◆ _findDependencies()

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

Definition at line 566 of file Mixins.py.

References MagneticFieldMapESProducer.label_, TrackerInteractionGeometryESProducer.label_, CTPPSPixelDAQMappingAnalyzer.label_, TestCUDAProducerCPU.label_, TestCUDAProducerGPU.label_, TestCUDAProducerGPUFirst.label_, SiPhase2OuterTrackerLorentzAngleReader.label_, TestCUDAAnalyzerGPU.label_, SiPhase2BadStripChannelReader.label_, mkfit::ReducedTrack.label_, SiStripLorentzAngleReader.label_, TestCUDAProducerGPUtoCPU.label_, edm::eventsetup::ComponentDescription.label_, TestCUDAProducerGPUEW.label_, pat::TriggerFilter.label_, XMLIdealMagneticFieldGeometryESProducer.label_, PythiaFilterHT.label_, WriteCTPPSTotemDAQMappingMask.label_, TestCUDAProducerGPUEWTask.label_, ESDigiToRaw.label_, WriteCTPPSPixelAnalysisMask.label_, WriteCTPPSPixelDAQMapping.label_, VertexCompositeCandidateCollectionSelector.label_, RetrieveCTPPSBeamParameters.label_, CTPPSPixelRawToDigi.label_, HistoProviderDQM.label_, SiStripDelayESProducer::TokenSign.label_, VertexMonitor.label_, PythiaMomDauFilter.label_, RandomEngineState.label_, edm::ConsumesInfo.label_, StripSubClusterShapeFilterBase.label_, edm::test::ProcessBlock.label_, SiPixelStatusManager.label_, edm::SecSourceAnalyzer.label_, edm::InputTag.label_, TPGCheck.label_, SiPixelStatusHarvester.label_, DDDetectorESProducer.label_, reco::Centrality.label_, edm::test::Run.label_, PPSPixelDigiAnalyzer.label_, edm::test::LuminosityBlock.label_, pat::TauJetCorrFactors.label_, edm::test::Event.label_, EffPurFromHistos2D.label_, EcalTrigPrimAnalyzer.label_, edm::DataMixingSiStripWorker.label_, edm::DataMixingSiPixelWorker.label_, edm::DataMixingPileupCopy.label_, StallStatistics.label_, SiPixelCalibDigiProducer.label_, edm::DataMixingSiStripRawWorker.label_, EffPurFromHistos.label_, TopSingleLepton_miniAOD::MonitorEnsemble.label_, SingleTopTChannelLepton_miniAOD::MonitorEnsemble.label_, edm::HiMixingWorkerBase.label_, npstat::UniformAxis.label_, edm::ParameterDescriptionBase.label_, edm::messagedrop::StringProducerWithPhase.label_, PileupJetIdAlgo::AlgoGBRForestsAndConstants.label_, edm::DataMixingEMWorker.label_, fwlite::ObjectCountSelector< Collection >.label_, edm::DataMixingHcalWorker.label_, pat::JetCorrFactors.label_, edm::DataMixingHcalDigiWorkerProd.label_, pat::JetCorrFactorsProducer.label_, TopSingleLepton::MonitorEnsemble.label_, edm::DataMixingMuonWorker.label_, npstat::NUHistoAxis.label_, pat::helper::AnyNumberAssociationAdaptor.label_, SingleTopTChannelLepton::MonitorEnsemble.label_, edm::DataMixingEMDigiWorker.label_, TopDiLeptonOffline::MonitorEnsemble.label_, edm::DataMixingHcalDigiWorker.label_, HLTObjectsMonitor.label_, npstat::GridAxis.label_, SummaryGenerator.label_, npstat::HistoAxis.label_, edm::GenericConsumer.label_, edm::service::RandomNumberGeneratorService::LabelAndEngine.label_, templateHelper::SiPixelTitles_Display< PayloadType, StoreType, TransientType >.label_, ALPAKA_ACCELERATOR_NAMESPACE::ProducerBaseAdaptor< TProducer, Tr >.label_, edm::MixingWorker< T >.label_, edm::DataMixingModule.label_, AlignPCLThresholdPlotHelper::AlignPCLThresholds_DisplayBase< PayloadType >.label_, templateHelper::SiPixelHeaderTable< PayloadType, StoreType, TransientType >.label_, mkfit::TrackBase.label_, gainCalibHelper::SiPixelGainCalibrationValues< myType, PayloadType >.label_, templateHelper::SiPixelIDs< PayloadType, myType >.label_, AlignPCLThresholdPlotHelper::AlignPCLThresholds_CompareBase< PayloadType, nIOVs, ntags >.label_, templateHelper::SiPixelFullPixelIDMap< PayloadType, StoreType, TransientType >.label_, SiPixelQualityBadFractionMap.label_, Mixins._Labelable.label_(), gainCalibHelper::SiPixelGainCalibrationValuesPerRegion< isBarrel, myType, PayloadType >.label_, fwlite::Scanner< Collection >.label_, gainCalibHelper::SiPixelGainCalibrationValuesComparisonPerRegion< isBarrel, myType, nIOVs, ntags, PayloadType >.label_, SiPixelDynamicInefficiencyFullPixelMap< theFactor >.label_, templateHelper::SiPixelTemplateHeaderInfo< PayloadType, StoreType, TransientType, myType, myParam >.label_, SiPixelDynamicInefficiencyPUPixelMaps.label_, gainCalibHelper::SiPixelGainCalibrationCorrelations< PayloadType >.label_, SiPixelLorentzAngleFullPixelMap.label_, gainCalibHelper::SiPixelGainCalibrationValuesByPart< myType, PayloadType >.label_, SiPixelDynamicInefficiencyPUParametrization.label_, PixelAlignmentComparisonMapBase< coord, ntags, nIOVs >.label_, SiPixelLorentzAngleFullMapCompareBase< nIOVs, ntags >.label_, gainCalibHelper::SiPixelGainCalibrationValueComparisonBase< myType, PayloadType >.label_, SiPixelDynamicInefficiencyPUParamComparisonBase< nIOVs, ntags >.label_, gainCalibHelper::SiPixelGainCalibDiffAndRatioBase< myType, nIOVs, ntags, PayloadType >.label_, gainCalibHelper::SiPixelGainCalibrationMap< myType, PayloadType, myDetType >.label_, gainCalibHelper::SiPixelGainCalibrationByRegionComparisonBase< myType, PayloadType, nIOVs, ntags >.label_, and str.

566  def _findDependencies(self,knownDeps,presentDeps):
567  #print 'in labelled'
568  myDeps=knownDeps.get(self.label_(),None)
569  if myDeps!=None:
570  if presentDeps != myDeps:
571  raise RuntimeError("the module "+self.label_()+" has two dependencies \n"
572  +str(presentDeps)+"\n"
573  +str(myDeps)+"\n"
574  +"Please modify sequences to rectify this inconsistency")
575  else:
576  myDeps=set(presentDeps)
577  knownDeps[self.label_()]=myDeps
578  presentDeps.add(self.label_())
579 
580 
#define str(s)

◆ dumpSequenceConfig()

def Mixins._Labelable.dumpSequenceConfig (   self)

Definition at line 559 of file Mixins.py.

References Mixins._Labelable.__label, and str.

559  def dumpSequenceConfig(self):
560  return str(self.__label)
#define str(s)

◆ dumpSequencePython()

def Mixins._Labelable.dumpSequencePython (   self,
  options 
)

Definition at line 561 of file Mixins.py.

References Mixins._Labelable.__label, and str.

561  def dumpSequencePython(self, options:PrintOptions=PrintOptions()):
562  if options.isCfg:
563  return 'process.'+str(self.__label)
564  else:
565  return str(self.__label)
#define str(s)

◆ hasLabel_()

def Mixins._Labelable.hasLabel_ (   self,
  bool 
)

◆ label()

def Mixins._Labelable.label (   self,
  str 
)

Definition at line 551 of file Mixins.py.

References Mixins._Labelable.__label.

551  def label(self) -> str:
552  #print "WARNING: _Labelable::label() needs to be changed to label_()"
553  return self.__label
char const * label

◆ label_()

def Mixins._Labelable.label_ (   self,
  str 
)

Definition at line 527 of file Mixins.py.

References Mixins._Labelable.__label.

Referenced by Modules.SwitchProducer.__addParameter(), SequenceTypes.DummyModule.__repr__(), Modules.SwitchProducer.__setattr__(), Mixins._Labelable._findDependencies(), and Mixins._Labelable.setLabel().

527  def label_(self) -> str:
528  if not hasattr(self, "_Labelable__label"):
529  raise RuntimeError("module has no label. Perhaps it wasn't inserted into the process?")
530  return self.__label

◆ setLabel()

def Mixins._Labelable.setLabel (   self,
  label 
)

Definition at line 533 of file Mixins.py.

References Mixins._Labelable.hasLabel_(), MagneticFieldMapESProducer.label_, TrackerInteractionGeometryESProducer.label_, CTPPSPixelDAQMappingAnalyzer.label_, TestCUDAProducerCPU.label_, TestCUDAProducerGPU.label_, TestCUDAProducerGPUFirst.label_, SiPhase2OuterTrackerLorentzAngleReader.label_, TestCUDAAnalyzerGPU.label_, SiPhase2BadStripChannelReader.label_, mkfit::ReducedTrack.label_, SiStripLorentzAngleReader.label_, TestCUDAProducerGPUtoCPU.label_, edm::eventsetup::ComponentDescription.label_, TestCUDAProducerGPUEW.label_, pat::TriggerFilter.label_, XMLIdealMagneticFieldGeometryESProducer.label_, PythiaFilterHT.label_, WriteCTPPSTotemDAQMappingMask.label_, TestCUDAProducerGPUEWTask.label_, ESDigiToRaw.label_, WriteCTPPSPixelAnalysisMask.label_, RetrieveCTPPSBeamParameters.label_, WriteCTPPSPixelDAQMapping.label_, VertexCompositeCandidateCollectionSelector.label_, CTPPSPixelRawToDigi.label_, HistoProviderDQM.label_, SiStripDelayESProducer::TokenSign.label_, VertexMonitor.label_, PythiaMomDauFilter.label_, RandomEngineState.label_, edm::ConsumesInfo.label_, StripSubClusterShapeFilterBase.label_, edm::test::ProcessBlock.label_, SiPixelStatusManager.label_, edm::SecSourceAnalyzer.label_, edm::InputTag.label_, SiPixelStatusHarvester.label_, TPGCheck.label_, DDDetectorESProducer.label_, reco::Centrality.label_, edm::test::Run.label_, PPSPixelDigiAnalyzer.label_, edm::test::LuminosityBlock.label_, pat::TauJetCorrFactors.label_, edm::test::Event.label_, EffPurFromHistos2D.label_, EcalTrigPrimAnalyzer.label_, edm::DataMixingSiStripWorker.label_, edm::DataMixingSiPixelWorker.label_, StallStatistics.label_, edm::DataMixingPileupCopy.label_, SiPixelCalibDigiProducer.label_, edm::DataMixingSiStripRawWorker.label_, EffPurFromHistos.label_, edm::HiMixingWorkerBase.label_, SingleTopTChannelLepton_miniAOD::MonitorEnsemble.label_, TopSingleLepton_miniAOD::MonitorEnsemble.label_, npstat::UniformAxis.label_, edm::ParameterDescriptionBase.label_, edm::messagedrop::StringProducerWithPhase.label_, PileupJetIdAlgo::AlgoGBRForestsAndConstants.label_, edm::DataMixingEMWorker.label_, edm::DataMixingHcalWorker.label_, fwlite::ObjectCountSelector< Collection >.label_, pat::JetCorrFactors.label_, edm::DataMixingHcalDigiWorkerProd.label_, pat::JetCorrFactorsProducer.label_, TopSingleLepton::MonitorEnsemble.label_, edm::DataMixingMuonWorker.label_, pat::helper::AnyNumberAssociationAdaptor.label_, npstat::NUHistoAxis.label_, SingleTopTChannelLepton::MonitorEnsemble.label_, edm::DataMixingEMDigiWorker.label_, TopDiLeptonOffline::MonitorEnsemble.label_, edm::DataMixingHcalDigiWorker.label_, HLTObjectsMonitor.label_, npstat::GridAxis.label_, SummaryGenerator.label_, npstat::HistoAxis.label_, edm::GenericConsumer.label_, edm::service::RandomNumberGeneratorService::LabelAndEngine.label_, templateHelper::SiPixelTitles_Display< PayloadType, StoreType, TransientType >.label_, ALPAKA_ACCELERATOR_NAMESPACE::ProducerBaseAdaptor< TProducer, Tr >.label_, edm::MixingWorker< T >.label_, edm::DataMixingModule.label_, AlignPCLThresholdPlotHelper::AlignPCLThresholds_DisplayBase< PayloadType >.label_, templateHelper::SiPixelHeaderTable< PayloadType, StoreType, TransientType >.label_, mkfit::TrackBase.label_, gainCalibHelper::SiPixelGainCalibrationValues< myType, PayloadType >.label_, templateHelper::SiPixelIDs< PayloadType, myType >.label_, AlignPCLThresholdPlotHelper::AlignPCLThresholds_CompareBase< PayloadType, nIOVs, ntags >.label_, templateHelper::SiPixelFullPixelIDMap< PayloadType, StoreType, TransientType >.label_, SiPixelQualityBadFractionMap.label_, Mixins._Labelable.label_(), gainCalibHelper::SiPixelGainCalibrationValuesPerRegion< isBarrel, myType, PayloadType >.label_, fwlite::Scanner< Collection >.label_, gainCalibHelper::SiPixelGainCalibrationValuesComparisonPerRegion< isBarrel, myType, nIOVs, ntags, PayloadType >.label_, SiPixelDynamicInefficiencyFullPixelMap< theFactor >.label_, templateHelper::SiPixelTemplateHeaderInfo< PayloadType, StoreType, TransientType, myType, myParam >.label_, gainCalibHelper::SiPixelGainCalibrationCorrelations< PayloadType >.label_, SiPixelDynamicInefficiencyPUPixelMaps.label_, SiPixelLorentzAngleFullPixelMap.label_, gainCalibHelper::SiPixelGainCalibrationValuesByPart< myType, PayloadType >.label_, SiPixelDynamicInefficiencyPUParametrization.label_, PixelAlignmentComparisonMapBase< coord, ntags, nIOVs >.label_, SiPixelLorentzAngleFullMapCompareBase< nIOVs, ntags >.label_, gainCalibHelper::SiPixelGainCalibrationValueComparisonBase< myType, PayloadType >.label_, SiPixelDynamicInefficiencyPUParamComparisonBase< nIOVs, ntags >.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__().

533  def setLabel(self,label:str):
534  if self.hasLabel_() :
535  if self.label_() != label and label is not None :
536  msg100 = "Attempting to change the label of a Labelable object, possibly an attribute of the Process\n"
537  msg101 = "Old label = "+self.label_()+" New label = "+label+"\n"
538  msg102 = "Type = "+str(type(self))+"\n"
539  msg103 = "Some possible solutions:\n"
540  msg104 = " 1. Clone modules instead of using simple assignment. Cloning is\n"
541  msg105 = " also preferred for other types when possible.\n"
542  msg106 = " 2. Declare new names starting with an underscore if they are\n"
543  msg107 = " for temporaries you do not want propagated into the Process. The\n"
544  msg108 = " underscore tells \"from x import *\" and process.load not to import\n"
545  msg109 = " the name.\n"
546  msg110 = " 3. Reorganize so the assigment is not necessary. Giving a second\n"
547  msg111 = " name to the same object usually causes confusion and problems.\n"
548  msg112 = " 4. Compose Sequences: newName = cms.Sequence(oldName)\n"
549  raise ValueError(msg100+msg101+msg102+msg103+msg104+msg105+msg106+msg107+msg108+msg109+msg110+msg111+msg112)
550  self.__label = label
#define str(s)

Member Data Documentation

◆ __label

Mixins._Labelable.__label
private