Public Member Functions | |
def | __init__ (self, caseFunctionDict, kargs) |
def | __setattr__ (self, name, value) |
def | appendToProcessDescLists_ (self, modules, aliases, myname) |
def | caseLabel_ (self, name, case) |
def | clone (self, params) |
def | directDependencies (self) |
def | dumpPython (self, options=PrintOptions()) |
def | insertInto (self, parameterSet, myname, accelerators) |
def | moduleLabel_ (self, myname) |
def | modulesForConditionalTask_ (self) |
def | nameInProcessDesc_ (self, myname) |
def | setLabel (self, label) |
Public Member Functions inherited from Modules.EDProducer | |
def | __init__ (self, type_, arg, kargs) |
Public Member Functions inherited from Modules._Module | |
def | __init__ (self, type_, arg, kargs) |
def | insertInto (self, parameterSet, myname) |
def | setPrerequisites (self, libs) |
Public Member Functions inherited from Mixins._TypedParameterizable | |
def | __init__ (self, type_, arg, kargs) |
def | appendToProcessDescList_ (self, lst, myname) |
def | clone (self, args, params) |
def | copy (self) |
def | directDependencies (self) |
def | dumpConfig (self, options=PrintOptions()) |
def | dumpPython (self, options=PrintOptions()) |
def | dumpPythonAttributes (self, myname, options) |
def | insertInto (self, parameterSet, myname) |
def | moduleLabel_ (self, myname) |
def | nameInProcessDesc_ (self, myname) |
def | type_ (self) |
Public Member Functions inherited from Mixins._Parameterizable | |
def | __delattr__ (self, name) |
def | __init__ (self, arg, kargs) |
def | __repr__ (self) |
def | __setattr__ (self, name, value) |
def | dumpPython (self, options=PrintOptions()) |
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 (self, options=PrintOptions()) |
def | hasLabel_ (self) |
def | label (self) |
def | label_ (self) |
def | setLabel (self, label) |
Public Member Functions inherited from SequenceTypes._SequenceLeaf | |
def | __init__ (self) |
def | isLeaf (self) |
Public Member Functions inherited from SequenceTypes._Sequenceable | |
def | __add__ (self, rhs) |
def | __init__ (self) |
def | __invert__ (self) |
def | __mul__ (self, rhs) |
def | isLeaf (self) |
def | isOperation (self) |
def | resolve (self, processDict, keepIfCannotResolve=False) |
def | visitNode (self, visitor) |
Static Public Member Functions | |
def | getCpu () |
Private Member Functions | |
def | __addParameter (self, name, value) |
def | __setParameters (self, parameters) |
def | _chooseCase (self, accelerators) |
def | _clonesequence (self, lookuptable) |
def | _errorstr (self) |
def | _getProducer (self, accelerators) |
def | _placeImpl (self, name, proc) |
Static Private Member Functions | |
def | __typeIsValid (typ) |
Private Attributes | |
_caseFunctionDict | |
_isModified | |
This purpose class is to provide a switch of EDProducers for a single module/product label. The decision is done at the time when the python configuration is translated to C++. This class is generic, and intended to be inherited for concrete switches. Example: class SwitchProducerFoo(SwitchProducer): def __init__(self, **kargs): super(SwitchProducerFoo,self).__init__( dict(case1 = case1Func, case2 = case2Func), **kargs ) foo = SwitchProducerFoo( case1 = EDProducer("Producer1"), case2 = EDProducer("Producer2") ) Here case1Func and case2Func are functions that return a (bool, int) tuple, where the bool tells whether that case is enabled or not, and the int tells the priority of that case. The case with the highest priority among those that are enabled will get chosen. The end result is that the product(s) labeled as "foo" will be produced with one of the producers. It would be good if their output product types and instance names would be the same (or very close).
Definition at line 220 of file Modules.py.
def Modules.SwitchProducer.__init__ | ( | self, | |
caseFunctionDict, | |||
kargs | |||
) |
Definition at line 249 of file Modules.py.
|
private |
Definition at line 288 of file Modules.py.
References Modules.SwitchProducer.__typeIsValid(), Modules.SwitchProducer._caseFunctionDict, Mixins._ParameterTypeBase._isModified, Mixins._SimpleParameterTypeBase._isModified, Mixins._Parameterizable._isModified, mps_setup.append, Modules.SwitchProducer.caseLabel_(), Mixins._ParameterTypeBase.dumpPython(), Mixins.UsingBlock.dumpPython(), Mixins._Parameterizable.dumpPython(), Config.Process.dumpPython(), Config.SubProcess.dumpPython(), Config.ProcessAccelerator.dumpPython(), Mixins._Labelable.hasLabel_(), join(), relativeConstraints.keys, 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_, TestCUDAProducerGPUEWTask.label_, ESDigiToRaw.label_, CTPPSPixelRawToDigi.label_, WriteCTPPSPixelAnalysisMask.label_, RetrieveCTPPSBeamParameters.label_, VertexCompositeCandidateCollectionSelector.label_, WriteCTPPSPixelDAQMapping.label_, HistoProviderDQM.label_, SiStripDelayESProducer::TokenSign.label_, VertexMonitor.label_, PythiaMomDauFilter.label_, RandomEngineState.label_, StripSubClusterShapeFilterBase.label_, edm::ConsumesInfo.label_, edm::test::ProcessBlock.label_, SiPixelStatusManager.label_, edm::SecSourceAnalyzer.label_, edm::InputTag.label_, TPGCheck.label_, SiPixelStatusHarvester.label_, reco::Centrality.label_, DDDetectorESProducer.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_, EffPurFromHistos.label_, edm::DataMixingSiStripRawWorker.label_, edm::HiMixingWorkerBase.label_, TopSingleLepton_miniAOD::MonitorEnsemble.label_, SingleTopTChannelLepton_miniAOD::MonitorEnsemble.label_, npstat::UniformAxis.label_, edm::ParameterDescriptionBase.label_, PileupJetIdAlgo::AlgoGBRForestsAndConstants.label_, edm::messagedrop::StringProducerWithPhase.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_, pat::helper::AnyNumberAssociationAdaptor.label_, npstat::NUHistoAxis.label_, edm::DataMixingEMDigiWorker.label_, SingleTopTChannelLepton::MonitorEnsemble.label_, TopDiLeptonOffline::MonitorEnsemble.label_, edm::DataMixingHcalDigiWorker.label_, HLTObjectsMonitor.label_, npstat::GridAxis.label_, SummaryGenerator.label_, npstat::HistoAxis.label_, edm::service::RandomNumberGeneratorService::LabelAndEngine.label_, templateHelper::SiPixelTitles_Display< PayloadType, StoreType, TransientType >.label_, edm::MixingWorker< T >.label_, edm::DataMixingModule.label_, templateHelper::SiPixelHeaderTable< PayloadType, StoreType, TransientType >.label_, mkfit::TrackBase.label_, gainCalibHelper::SiPixelGainCalibrationValues< myType, PayloadType >.label_, templateHelper::SiPixelIDs< PayloadType, myType >.label_, templateHelper::SiPixelFullPixelIDMap< PayloadType, StoreType, TransientType >.label_, Mixins._Labelable.label_(), gainCalibHelper::SiPixelGainCalibrationValuesPerRegion< isBarrel, myType, PayloadType >.label_, fwlite::Scanner< Collection >.label_, gainCalibHelper::SiPixelGainCalibrationValuesComparisonPerRegion< isBarrel, myType, nIOVs, ntags, PayloadType >.label_, gainCalibHelper::SiPixelGainCalibrationCorrelations< PayloadType >.label_, SiPixelLorentzAngleFullPixelMap.label_, gainCalibHelper::SiPixelGainCalibrationValuesByPart< myType, PayloadType >.label_, SiPixelLorentzAngleFullMapCompareBase< nIOVs, ntags >.label_, gainCalibHelper::SiPixelGainCalibrationValueComparisonBase< myType, PayloadType >.label_, gainCalibHelper::SiPixelGainCalibDiffAndRatioBase< myType, nIOVs, ntags, PayloadType >.label_, gainCalibHelper::SiPixelGainCalibrationMap< myType, PayloadType, myDetType >.label_, and gainCalibHelper::SiPixelGainCalibrationByRegionComparisonBase< myType, PayloadType, nIOVs, ntags >.label_.
def Modules.SwitchProducer.__setattr__ | ( | self, | |
name, | |||
value | |||
) |
Definition at line 308 of file Modules.py.
References Mixins._Parameterizable.__addParameter(), Modules.SwitchProducer.__typeIsValid(), Mixins._ParameterTypeBase._isModified, Mixins._SimpleParameterTypeBase._isModified, Mixins._Parameterizable._isModified, Modules.SwitchProducer.caseLabel_(), Mixins._ParameterTypeBase.dumpPython(), Mixins.UsingBlock.dumpPython(), Mixins._Parameterizable.dumpPython(), Config.Process.dumpPython(), Config.SubProcess.dumpPython(), Config.ProcessAccelerator.dumpPython(), Mixins._Labelable.hasLabel_(), Mixins._ParameterTypeBase.isFrozen(), Mixins._Parameterizable.isFrozen(), MagneticFieldMapESProducer.label_, TrackerInteractionGeometryESProducer.label_, CTPPSPixelDAQMappingAnalyzer.label_, TestCUDAProducerCPU.label_, TestCUDAProducerGPU.label_, TestCUDAProducerGPUFirst.label_, SiPhase2OuterTrackerLorentzAngleReader.label_, TestCUDAAnalyzerGPU.label_, SiPhase2BadStripChannelReader.label_, mkfit::ReducedTrack.label_, TestCUDAProducerGPUtoCPU.label_, SiStripLorentzAngleReader.label_, edm::eventsetup::ComponentDescription.label_, TestCUDAProducerGPUEW.label_, pat::TriggerFilter.label_, XMLIdealMagneticFieldGeometryESProducer.label_, PythiaFilterHT.label_, TestCUDAProducerGPUEWTask.label_, ESDigiToRaw.label_, CTPPSPixelRawToDigi.label_, WriteCTPPSPixelAnalysisMask.label_, RetrieveCTPPSBeamParameters.label_, WriteCTPPSPixelDAQMapping.label_, VertexCompositeCandidateCollectionSelector.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_, reco::Centrality.label_, DDDetectorESProducer.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_, edm::HiMixingWorkerBase.label_, SingleTopTChannelLepton_miniAOD::MonitorEnsemble.label_, TopSingleLepton_miniAOD::MonitorEnsemble.label_, edm::ParameterDescriptionBase.label_, npstat::UniformAxis.label_, PileupJetIdAlgo::AlgoGBRForestsAndConstants.label_, edm::messagedrop::StringProducerWithPhase.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::service::RandomNumberGeneratorService::LabelAndEngine.label_, templateHelper::SiPixelTitles_Display< PayloadType, StoreType, TransientType >.label_, edm::MixingWorker< T >.label_, edm::DataMixingModule.label_, templateHelper::SiPixelHeaderTable< PayloadType, StoreType, TransientType >.label_, mkfit::TrackBase.label_, gainCalibHelper::SiPixelGainCalibrationValues< myType, PayloadType >.label_, templateHelper::SiPixelIDs< PayloadType, myType >.label_, templateHelper::SiPixelFullPixelIDMap< PayloadType, StoreType, TransientType >.label_, Mixins._Labelable.label_(), gainCalibHelper::SiPixelGainCalibrationValuesPerRegion< isBarrel, myType, PayloadType >.label_, fwlite::Scanner< Collection >.label_, gainCalibHelper::SiPixelGainCalibrationValuesComparisonPerRegion< isBarrel, myType, nIOVs, ntags, PayloadType >.label_, gainCalibHelper::SiPixelGainCalibrationCorrelations< PayloadType >.label_, SiPixelLorentzAngleFullPixelMap.label_, gainCalibHelper::SiPixelGainCalibrationValuesByPart< myType, PayloadType >.label_, SiPixelLorentzAngleFullMapCompareBase< nIOVs, ntags >.label_, gainCalibHelper::SiPixelGainCalibrationValueComparisonBase< myType, PayloadType >.label_, gainCalibHelper::SiPixelGainCalibDiffAndRatioBase< myType, nIOVs, ntags, PayloadType >.label_, gainCalibHelper::SiPixelGainCalibrationMap< myType, PayloadType, myDetType >.label_, and gainCalibHelper::SiPixelGainCalibrationByRegionComparisonBase< myType, PayloadType, nIOVs, ntags >.label_.
Referenced by GenObject.GenObject.setValue().
|
private |
Definition at line 304 of file Modules.py.
References Mixins._Parameterizable.__addParameter().
|
staticprivate |
Definition at line 285 of file Modules.py.
Referenced by Modules.SwitchProducer.__addParameter(), and Modules.SwitchProducer.__setattr__().
|
private |
Returns the name of the chosen case.
Definition at line 268 of file Modules.py.
References Modules.SwitchProducer._caseFunctionDict, Mixins._Parameterizable.parameterNames_(), and str.
Referenced by Modules.SwitchProducer._getProducer(), and Modules.SwitchProducer.insertInto().
|
private |
Definition at line 428 of file Modules.py.
References Modules._Module._errorstr(), and l1ctLayer2EG_cff.id.
|
private |
Definition at line 433 of file Modules.py.
|
private |
Returns the EDroducer of the chosen case
Definition at line 280 of file Modules.py.
References Modules.SwitchProducer._chooseCase().
|
private |
Definition at line 413 of file Modules.py.
Referenced by SequenceTypes._ModuleSequenceType._place(), and Mixins._TypedParameterizable._place().
def Modules.SwitchProducer.appendToProcessDescLists_ | ( | self, | |
modules, | |||
aliases, | |||
myname | |||
) |
Definition at line 391 of file Modules.py.
References Modules.SwitchProducer.caseLabel_(), and Mixins._Parameterizable.parameterNames_().
def Modules.SwitchProducer.caseLabel_ | ( | self, | |
name, | |||
case | |||
) |
Definition at line 381 of file Modules.py.
Referenced by Modules.SwitchProducer.__addParameter(), Modules.SwitchProducer.__setattr__(), Modules.SwitchProducer.appendToProcessDescLists_(), Modules.SwitchProducer.insertInto(), and Modules.SwitchProducer.setLabel().
def Modules.SwitchProducer.clone | ( | self, | |
params | |||
) |
Definition at line 335 of file Modules.py.
References Mixins._Parameterizable.parameterNames_(), and Mixins.saveOrigin().
def Modules.SwitchProducer.directDependencies | ( | self | ) |
Definition at line 373 of file Modules.py.
def Modules.SwitchProducer.dumpPython | ( | self, | |
options = PrintOptions() |
|||
) |
Definition at line 358 of file Modules.py.
References __class__< T >.__class__(), and Mixins._Parameterizable.parameterNames_().
Referenced by Types._AllowedParameterTypes.__init__().
|
static |
Returns a function that returns the priority for a CPU "computing device". Intended to be used by deriving classes.
Definition at line 264 of file Modules.py.
def Modules.SwitchProducer.insertInto | ( | self, | |
parameterSet, | |||
myname, | |||
accelerators | |||
) |
Definition at line 401 of file Modules.py.
References Modules.SwitchProducer._chooseCase(), Modules.SwitchProducer.caseLabel_(), edm::ModuleProcessName.moduleLabel_, FWJobMetadataManager::Data.moduleLabel_, PFMatchedCandidateRefExtractor.moduleLabel_, edm::ModuleLabelMatch.moduleLabel_, HPSPFTauProducer.moduleLabel_, GBRForestWriter.moduleLabel_, edm::BranchKey.moduleLabel_, MuonMETcorrInputProducer.moduleLabel_, SysShiftMETcorrInputProducer.moduleLabel_, Type0PFMETcorrInputProducer.moduleLabel_, ShiftedJetProducerByMatchedObjectT< T >.moduleLabel_, NoPileUpPFMEtProducer.moduleLabel_, PFCandMETcorrInputProducer.moduleLabel_, ShiftedPFCandidateProducerForPFMVAMEt.moduleLabel_, PFchsMETcorrInputProducer.moduleLabel_, ShiftedParticleProducer.moduleLabel_, MultShiftMETcorrInputProducer.moduleLabel_, edm::ESTagGetter::Info.moduleLabel_, ShiftedPFCandidateProducerForPFNoPUMEt.moduleLabel_, MultShiftMETcorrDBInputProducer.moduleLabel_, NoPileUpPFMEtDataProducer.moduleLabel_, TauDiscriminantCutMultiplexerT< TauType, TauTypeRef, ParentClass >.moduleLabel_, RecoTauGenericJetRegionProducer< JetType, CandType >.moduleLabel_, GenericBoostedTauSeedsProducer< JetType, CandType >.moduleLabel_, TauDiscriminationAgainstElectronDeadECAL< TauType, TauDiscriminator >.moduleLabel_, SubjetFilterAlgorithm.moduleLabel_, edm::ESConsumesInfoEntry.moduleLabel_, pat::TauJetCorrFactorsProducer.moduleLabel_, TauDiscriminationAgainstElectronMVA6< TauType, TauDiscriminator, ElectronType >.moduleLabel_, PFRecoTauChargedHadronProducer.moduleLabel_, JetIdSelector< T >.moduleLabel_, edm::ModuleDescription.moduleLabel_, edm::ProductSelectorRules::Rule.moduleLabel_, MinMETProducerT< T >.moduleLabel_, ObjectViewMatcher< T1, T2 >.moduleLabel_, TauTagValidation.moduleLabel_, PFRecoTauDiscriminationAgainstMuon2.moduleLabel_, ObjectViewCleaner< T >.moduleLabel_, PFRecoTauDiscriminationAgainstMuon2Container.moduleLabel_, PFRecoTauDiscriminationAgainstMuonSimple.moduleLabel_, ShiftedParticleProducerT< T >.moduleLabel_, PFRecoTauDiscriminationAgainstMuonMVA.moduleLabel_, TauDiscriminationProducerBase< TauType, TauDiscriminator, TauDiscriminatorDataType, ConsumeType >.moduleLabel_, HLTMuonMatchAndPlot.moduleLabel_, PFRecoTauDiscriminationByIsolationMVA2.moduleLabel_, edm::test::TestProcessorConfig::ProduceEntry.moduleLabel_, reco::tau::PFRecoTauDiscriminationByMVAIsolationRun2.moduleLabel_, reco::tau::PATTauDiscriminationByMVAIsolationRun2.moduleLabel_, VirtualJetProducer.moduleLabel_, ShiftedJetProducerT< T, Textractor >.moduleLabel_, CaloJetMETcorrInputProducerT< T, Textractor >.moduleLabel_, PFRecoTauDiscriminationByIsolation.moduleLabel_, JetCleanerForType1METT< T, Textractor >.moduleLabel_, edm::PoolOutputModule.moduleLabel_, edm::BranchDescription.moduleLabel_, PFRecoTauDiscriminationByIsolationContainer.moduleLabel_, edm::ProductResolverIndexHelper::Item.moduleLabel_, Mixins._TypedParameterizable.moduleLabel_(), Mixins._TypedParameterizable.nameInProcessDesc_(), Config.SubProcess.nameInProcessDesc_(), and Mixins._Parameterizable.parameterNames_().
def Modules.SwitchProducer.moduleLabel_ | ( | self, | |
myname | |||
) |
Definition at line 379 of file Modules.py.
Referenced by ExternalGeneratorFilter.ExternalGeneratorFilter.insertInto().
def Modules.SwitchProducer.modulesForConditionalTask_ | ( | self | ) |
Definition at line 383 of file Modules.py.
References Mixins._Parameterizable.parameterNames_().
def Modules.SwitchProducer.nameInProcessDesc_ | ( | self, | |
myname | |||
) |
Definition at line 377 of file Modules.py.
Referenced by Types.EDAlias.appendToProcessDescList_(), ExternalGeneratorFilter.ExternalGeneratorFilter.insertInto(), and Types.EDAlias.insertInto().
def Modules.SwitchProducer.setLabel | ( | self, | |
label | |||
) |
Definition at line 255 of file Modules.py.
References Modules.SwitchProducer.caseLabel_(), and Mixins._Parameterizable.parameterNames_().
|
private |
Definition at line 251 of file Modules.py.
Referenced by Modules.SwitchProducer.__addParameter(), and Modules.SwitchProducer._chooseCase().
|
private |
Definition at line 253 of file Modules.py.