CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
Modules.ESPrefer Class Reference
Inheritance diagram for Modules.ESPrefer:
Mixins._ConfigureComponent Mixins._TypedParameterizable Mixins._Unlabelable Mixins._Labelable Mixins._Parameterizable

Public Member Functions

def __init__
 
def copy (self)
 
def dumpPythonAs
 
def moduleLabel_
 
def nameInProcessDesc_
 
def targetLabel_ (self)
 
- Public Member Functions inherited from Mixins._TypedParameterizable
def __init__ (self, type_, arg, kargs)
 
def appendToProcessDescList_
 
def clone (self, args, params)
 
def copy (self)
 
def directDependencies (self)
 
def dumpConfig
 
def dumpPython
 
def dumpPythonAttributes
 
def insertInto
 
def moduleLabel_
 
def nameInProcessDesc_
 
def type_ (self)
 
- Public Member Functions inherited from Mixins._Parameterizable
def __delattr__
 
def __init__ (self, arg, kargs)
 
def __repr__ (self)
 
def __setattr__
 
def dumpPython
 
def getParameter (self, params)
 
def hasParameter (self, params)
 
def insertContentsInto (self, parameterSet)
 
def isFrozen (self)
 
def isModified (self)
 
def parameterNames_ (self)
 
def parameters_ (self)
 
def setIsFrozen (self)
 
- Public Member Functions inherited from Mixins._Labelable
def __str__ (self)
 
def dumpSequenceConfig (self)
 
def dumpSequencePython
 
def hasLabel_ (self)
 
def label (self)
 
def label_ (self)
 
def setLabel
 

Private Member Functions

def _placeImpl
 

Private Attributes

 _targetLabel
 

Detailed Description

Used to set which EventSetup provider should provide a particular data item
in the case where multiple providers are capable of delivering the data.
The first argument specifies the C++ class type of the prodiver.
If the provider has been given a label, you must specify that label as the second argument.
Additional 'vstring' arguments maybe used to specify exactly which EventSetup Records
are being preferred and optionally which data items within that Record.
E.g.,
    #prefer all data in record 'OrangeRecord' from 'juicer'
    ESPrefer("ESJuicerProd", OrangeRecord=cms.vstring())
or
    #prefer only "Orange" data in "OrangeRecord" from "juicer" 
    ESPrefer("ESJuicerProd", OrangeRecord=cms.vstring("ExtraPulp"))
or 
    #prefer only "Orange" data with label "ExtraPulp" in "OrangeRecord" from "juicer" 
    ESPrefer("ESJuicerProd", OrangeRecord=cms.vstring("Orange/ExtraPulp"))

Definition at line 73 of file Modules.py.

Constructor & Destructor Documentation

◆ __init__()

def Modules.ESPrefer.__init__ (   self,
  type_,
  targetLabel 
)

Definition at line 90 of file Modules.py.

90  def __init__(self,type_,targetLabel:str='',*arg,**kargs):
91  super(ESPrefer,self).__init__(type_,*arg,**kargs)
92  self._targetLabel = targetLabel
93  if targetLabel is None:
94  self._targetLabel = str('')
95  if kargs:
96  for k,v in kargs.items():
97  if not isinstance(v,vstring):
98  raise RuntimeError('ESPrefer only allows vstring attributes. "'+k+'" is a '+str(type(v)))
def __init__(self, dataset, job_number, job_id, job_name, isDA, isMC, applyBOWS, applyEXTRACOND, extraconditions, runboundary, lumilist, intlumi, maxevents, gt, allFromGT, alignmentDB, alignmentTAG, apeDB, apeTAG, bowDB, bowTAG, vertextype, tracktype, refittertype, ttrhtype, applyruncontrol, ptcut, CMSSW_dir, the_dir)
#define str(s)

Member Function Documentation

◆ _placeImpl()

def Modules.ESPrefer._placeImpl (   self,
  name 
)
private

Definition at line 99 of file Modules.py.

Referenced by SequenceTypes._ModuleSequenceType._place(), and Mixins._TypedParameterizable._place().

99  def _placeImpl(self,name:str,proc):
100  proc._placeESPrefer(name,self)

◆ copy()

def Modules.ESPrefer.copy (   self)

Definition at line 104 of file Modules.py.

References Modules.ESPrefer._targetLabel, MuonTypeByOrCut.type_, L1TMuonOverlapParams::Node.type_, edm::ObjectWithDict.type_, Histogram_TICLPFValidation.type_, FWJobMetadataManager::Data.type_, L1TTwinMuxParams::Node.type_, L1TMuonGlobalParams::Node.type_, L1TMuonGlobalParams_PUBLIC::Node.type_, CutBasedElectronID.type_, HcalSiPMParameter.type_, StringObjectFunction< T, DefaultLazyness >.type_, L1TMuonBarrelParams::Node.type_, StringCutObjectSelector< T, DefaultLazyness >.type_, OpticalAlignMeasurementInfo.type_, L1TMuonBarrelKalmanParams::Node.type_, l1t::CaloParams::Node.type_, ProcessCallGraph::NodeType.type_, edm::eventsetup::ComponentDescription.type_, l1t::CaloSpare.type_, reco::MuonMETCorrectionData.type_, omtf::RpcDataWord64::.type_, cond::hdf5::DataProduct.type_, omtf::RpcDataWord64.type_, edm::ESParentContext.type_, MuonIDFilterProducerForHLT.type_, HcalSiPMParametersGPU.type_, MuonRefProducer.type_, cms::cuda::host::impl::HostDeleter.type_, reco::DeDxHitInfo::DeDxHitInfoContainer.type_, HcalSiPMCharacteristics::PrecisionItem.type_, pftools::ParticleFiltrationDecision.type_, EcalDumpGeometry.type_, reco::TrackingRecHitInfo.type_, omtf::MuonDataWord64.type_, omtf::MuonDataWord64::.type_, pos::PixelTKFECParameters.type_, PGeometricTimingDet::Item.type_, pat::TriggerFilter.type_, TauDQMHistPlotter::cfgEntryProcess.type_, EleEnergyRetriever.type_, trklet::L1SimTrack.type_, NoProductErrorThrower.type_, pat::TriggerCondition.type_, edm::ParentContext.type_, MultShiftMETcorrInputProducer.type_, edm::ConsumesInfo.type_, omtf::DtDataWord64.type_, omtf::DtDataWord64::.type_, l1t::TkEtMiss.type_, DQMHcalIsoTrackAlCaReco.type_, DBReader.type_, omtf::CscDataWord64.type_, omtf::CscDataWord64::.type_, edm::ParameterWildcardBase.type_, edm::eventsetup::EventSetupRecordKey.type_, edm::AllowedLabelsDescriptionBase.type_, L1TUtmCondition.type_, NoBranchErrorThrower.type_, l1t::BlockHeader.type_, l1extra::L1EmParticle.type_, l1extra::L1JetParticle.type_, reco::PUSubMETCandInfo.type_, edm::InputSource::ItemTypeInfo.type_, fwlite::internal::DataKey.type_, edm::eventsetup::DataKey.type_, l1t::EtSum.type_, PPSFastLocalSimulation::Distribution.type_, HDF5ProductResolver.type_, jsoncollector::Json::Reader::Token.type_, OpticalAlignInfo.type_, L1TUtmScale.type_, pat::JetCorrFactorsProducer.type_, ProductBranch.type_, Entry.type_, edm::ParameterDescriptionBase.type_, pos::PixelPortCardConfig.type_, l1extra::L1EtMissParticle.type_, pat::helper::AnyNumberAssociationAdaptor.type_, edm::Handle< GenericObject >.type_, edm::Handle< FWGenericObject >.type_, edm::PileUp.type_, L1GctInternHFData.type_, L1TUtmObject.type_, tt::SensorModule.type_, BeamSpotObjects.type_, edm::test::TestProcessorConfig::ProduceEntry.type_, L1GctInternEtSum.type_, reco::PFBlockElement.type_, L1GctInternHtMiss.type_, L1GctInternJetData.type_, l1t::MuonStub.type_, TrackerGeometryCompare.type_, reco::BeamSpot.type_, ScoutingMuon.type_, funct::RootIntegrator.type_, GeometricTimingDet.type_, SiStripConfigDb::Run.type_, GeometricDet.type_, edm::Entry.type_, TrackerDpgAnalysis.type_, ConfigurableHisto.type_, Run3ScoutingMuon.type_, CandMCMatchTableProducer.type_, CSCCorrelatedLCTDigi.type_, reco::Muon.type_, Mixins._TypedParameterizable.type_(), jsoncollector::Json::Value.type_, edm::IndexIntoFile::IndexIntoFileItrImpl.type_, Config.SubProcess.type_(), and Config.ProcessAccelerator.type_().

Referenced by SequenceTypes._TaskBase.copyAndAdd().

104  def copy(self):
105  returnValue = ESPrefer.__new__(type(self))
106  returnValue.__init__(self.type_(), self._targetLabel)
107  return returnValue

◆ dumpPythonAs()

def Modules.ESPrefer.dumpPythonAs (   self,
  label,
  options 
)

Definition at line 112 of file Modules.py.

References Modules.ESPrefer._targetLabel, Mixins._Parameterizable.parameterNames_(), MuonTypeByOrCut.type_, L1TMuonOverlapParams::Node.type_, edm::ObjectWithDict.type_, Histogram_TICLPFValidation.type_, FWJobMetadataManager::Data.type_, L1TTwinMuxParams::Node.type_, L1TMuonGlobalParams::Node.type_, L1TMuonGlobalParams_PUBLIC::Node.type_, CutBasedElectronID.type_, HcalSiPMParameter.type_, StringObjectFunction< T, DefaultLazyness >.type_, L1TMuonBarrelParams::Node.type_, StringCutObjectSelector< T, DefaultLazyness >.type_, OpticalAlignMeasurementInfo.type_, l1t::CaloParams::Node.type_, L1TMuonBarrelKalmanParams::Node.type_, ProcessCallGraph::NodeType.type_, edm::eventsetup::ComponentDescription.type_, l1t::CaloSpare.type_, reco::MuonMETCorrectionData.type_, omtf::RpcDataWord64.type_, omtf::RpcDataWord64::.type_, cond::hdf5::DataProduct.type_, HcalSiPMParametersGPU.type_, edm::ESParentContext.type_, MuonIDFilterProducerForHLT.type_, MuonRefProducer.type_, cms::cuda::host::impl::HostDeleter.type_, HcalSiPMCharacteristics::PrecisionItem.type_, reco::DeDxHitInfo::DeDxHitInfoContainer.type_, reco::TrackingRecHitInfo.type_, pftools::ParticleFiltrationDecision.type_, EcalDumpGeometry.type_, omtf::MuonDataWord64.type_, omtf::MuonDataWord64::.type_, pat::TriggerFilter.type_, PGeometricTimingDet::Item.type_, pos::PixelTKFECParameters.type_, TauDQMHistPlotter::cfgEntryProcess.type_, trklet::L1SimTrack.type_, EleEnergyRetriever.type_, NoProductErrorThrower.type_, pat::TriggerCondition.type_, edm::ParentContext.type_, MultShiftMETcorrInputProducer.type_, edm::ConsumesInfo.type_, omtf::DtDataWord64.type_, omtf::DtDataWord64::.type_, l1t::TkEtMiss.type_, DQMHcalIsoTrackAlCaReco.type_, DBReader.type_, omtf::CscDataWord64.type_, omtf::CscDataWord64::.type_, edm::ParameterWildcardBase.type_, edm::eventsetup::EventSetupRecordKey.type_, edm::AllowedLabelsDescriptionBase.type_, L1TUtmCondition.type_, NoBranchErrorThrower.type_, l1t::BlockHeader.type_, l1extra::L1EmParticle.type_, l1extra::L1JetParticle.type_, reco::PUSubMETCandInfo.type_, edm::InputSource::ItemTypeInfo.type_, fwlite::internal::DataKey.type_, edm::eventsetup::DataKey.type_, l1t::EtSum.type_, PPSFastLocalSimulation::Distribution.type_, HDF5ProductResolver.type_, jsoncollector::Json::Reader::Token.type_, OpticalAlignInfo.type_, pat::JetCorrFactorsProducer.type_, L1TUtmScale.type_, Entry.type_, ProductBranch.type_, pos::PixelPortCardConfig.type_, edm::ParameterDescriptionBase.type_, l1extra::L1EtMissParticle.type_, pat::helper::AnyNumberAssociationAdaptor.type_, edm::Handle< GenericObject >.type_, edm::Handle< FWGenericObject >.type_, edm::PileUp.type_, BeamSpotObjects.type_, L1GctInternHFData.type_, tt::SensorModule.type_, L1TUtmObject.type_, edm::test::TestProcessorConfig::ProduceEntry.type_, L1GctInternEtSum.type_, reco::PFBlockElement.type_, L1GctInternHtMiss.type_, L1GctInternJetData.type_, l1t::MuonStub.type_, TrackerGeometryCompare.type_, reco::BeamSpot.type_, ScoutingMuon.type_, funct::RootIntegrator.type_, GeometricTimingDet.type_, SiStripConfigDb::Run.type_, GeometricDet.type_, edm::Entry.type_, TrackerDpgAnalysis.type_, ConfigurableHisto.type_, Run3ScoutingMuon.type_, CandMCMatchTableProducer.type_, CSCCorrelatedLCTDigi.type_, reco::Muon.type_, Mixins._TypedParameterizable.type_(), jsoncollector::Json::Value.type_, edm::IndexIntoFile::IndexIntoFileItrImpl.type_, Config.SubProcess.type_(), and Config.ProcessAccelerator.type_().

112  def dumpPythonAs(self, label, options:PrintOptions=PrintOptions()) -> str:
113  result = options.indentation()
114  basename = self._targetLabel
115  if basename == '':
116  basename = self.type_()
117  if options.isCfg:
118  # do either type or label
119  result += 'process.prefer("'+basename+'"'
120  if self.parameterNames_():
121  result += ",\n"+_Parameterizable.dumpPython(self,options)+options.indentation()
122  result +=')\n'
123  else:
124  # use the base class Module
125  result += 'es_prefer_'+basename+' = cms.ESPrefer("'+self.type_()+'"'
126  if self._targetLabel != '':
127  result += ',"'+self._targetLabel+'"'
128  if self.parameterNames_():
129  result += ",\n"+_Parameterizable.dumpPython(self,options)+options.indentation()
130  result += ')\n'
131  return result
132 

◆ moduleLabel_()

def Modules.ESPrefer.moduleLabel_ (   self,
  myname 
)

Definition at line 108 of file Modules.py.

References Modules.ESPrefer._targetLabel.

Referenced by ExternalGeneratorFilter.ExternalGeneratorFilter.insertInto().

108  def moduleLabel_(self, myname:str) -> str:
109  return self._targetLabel

◆ nameInProcessDesc_()

def Modules.ESPrefer.nameInProcessDesc_ (   self,
  myname 
)

Definition at line 101 of file Modules.py.

References Modules.ESPrefer._targetLabel, MuonTypeByOrCut.type_, L1TMuonOverlapParams::Node.type_, edm::ObjectWithDict.type_, Histogram_TICLPFValidation.type_, FWJobMetadataManager::Data.type_, L1TTwinMuxParams::Node.type_, L1TMuonGlobalParams::Node.type_, L1TMuonGlobalParams_PUBLIC::Node.type_, CutBasedElectronID.type_, HcalSiPMParameter.type_, StringObjectFunction< T, DefaultLazyness >.type_, L1TMuonBarrelParams::Node.type_, StringCutObjectSelector< T, DefaultLazyness >.type_, OpticalAlignMeasurementInfo.type_, L1TMuonBarrelKalmanParams::Node.type_, l1t::CaloParams::Node.type_, ProcessCallGraph::NodeType.type_, edm::eventsetup::ComponentDescription.type_, l1t::CaloSpare.type_, reco::MuonMETCorrectionData.type_, omtf::RpcDataWord64::.type_, cond::hdf5::DataProduct.type_, omtf::RpcDataWord64.type_, edm::ESParentContext.type_, MuonIDFilterProducerForHLT.type_, HcalSiPMParametersGPU.type_, MuonRefProducer.type_, cms::cuda::host::impl::HostDeleter.type_, reco::DeDxHitInfo::DeDxHitInfoContainer.type_, HcalSiPMCharacteristics::PrecisionItem.type_, pftools::ParticleFiltrationDecision.type_, EcalDumpGeometry.type_, reco::TrackingRecHitInfo.type_, omtf::MuonDataWord64.type_, omtf::MuonDataWord64::.type_, pos::PixelTKFECParameters.type_, PGeometricTimingDet::Item.type_, pat::TriggerFilter.type_, TauDQMHistPlotter::cfgEntryProcess.type_, EleEnergyRetriever.type_, trklet::L1SimTrack.type_, NoProductErrorThrower.type_, pat::TriggerCondition.type_, edm::ParentContext.type_, MultShiftMETcorrInputProducer.type_, edm::ConsumesInfo.type_, omtf::DtDataWord64.type_, omtf::DtDataWord64::.type_, l1t::TkEtMiss.type_, DQMHcalIsoTrackAlCaReco.type_, DBReader.type_, omtf::CscDataWord64.type_, omtf::CscDataWord64::.type_, edm::ParameterWildcardBase.type_, edm::eventsetup::EventSetupRecordKey.type_, edm::AllowedLabelsDescriptionBase.type_, L1TUtmCondition.type_, NoBranchErrorThrower.type_, l1t::BlockHeader.type_, l1extra::L1EmParticle.type_, l1extra::L1JetParticle.type_, reco::PUSubMETCandInfo.type_, edm::InputSource::ItemTypeInfo.type_, fwlite::internal::DataKey.type_, edm::eventsetup::DataKey.type_, l1t::EtSum.type_, PPSFastLocalSimulation::Distribution.type_, HDF5ProductResolver.type_, jsoncollector::Json::Reader::Token.type_, OpticalAlignInfo.type_, L1TUtmScale.type_, pat::JetCorrFactorsProducer.type_, ProductBranch.type_, Entry.type_, edm::ParameterDescriptionBase.type_, pos::PixelPortCardConfig.type_, l1extra::L1EtMissParticle.type_, pat::helper::AnyNumberAssociationAdaptor.type_, edm::Handle< GenericObject >.type_, edm::Handle< FWGenericObject >.type_, edm::PileUp.type_, L1GctInternHFData.type_, L1TUtmObject.type_, tt::SensorModule.type_, BeamSpotObjects.type_, edm::test::TestProcessorConfig::ProduceEntry.type_, L1GctInternEtSum.type_, reco::PFBlockElement.type_, L1GctInternHtMiss.type_, L1GctInternJetData.type_, l1t::MuonStub.type_, TrackerGeometryCompare.type_, reco::BeamSpot.type_, ScoutingMuon.type_, funct::RootIntegrator.type_, GeometricTimingDet.type_, SiStripConfigDb::Run.type_, GeometricDet.type_, edm::Entry.type_, TrackerDpgAnalysis.type_, ConfigurableHisto.type_, Run3ScoutingMuon.type_, CandMCMatchTableProducer.type_, CSCCorrelatedLCTDigi.type_, reco::Muon.type_, Mixins._TypedParameterizable.type_(), jsoncollector::Json::Value.type_, edm::IndexIntoFile::IndexIntoFileItrImpl.type_, Config.SubProcess.type_(), and Config.ProcessAccelerator.type_().

Referenced by Types.EDAlias.appendToProcessDescList_(), ExternalGeneratorFilter.ExternalGeneratorFilter.insertInto(), and Types.EDAlias.insertInto().

101  def nameInProcessDesc_(self, myname:str) -> str:
102  # the C++ parser can give it a name like "label@prefer". Get rid of that.
103  return "esprefer_" + self.type_() + "@" + self._targetLabel

◆ targetLabel_()

def Modules.ESPrefer.targetLabel_ (   self,
  str 
)

Definition at line 110 of file Modules.py.

References Modules.ESPrefer._targetLabel.

110  def targetLabel_(self) -> str:
111  return self._targetLabel

Member Data Documentation

◆ _targetLabel

Modules.ESPrefer._targetLabel
private