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) |
def | moduleLabel_ (self, myname) |
def | nameInProcessDesc_ (self, myname) |
Public Member Functions inherited from Modules.EDProducer | |
def | __init__ (self, type_, *arg, **kargs) |
Public Member Functions inherited from Modules._Module | |
def | setPrerequisites (self, *libs) |
Public Member Functions inherited from Mixins._TypedParameterizable | |
def | appendToProcessDescList_ (self, lst, myname) |
def | clone (self, *args, **params) |
def | copy (self) |
def | dumpConfig (self, options=PrintOptions()) |
def | dumpPythonAttributes (self, myname, options) |
def | type_ (self) |
Public Member Functions inherited from Mixins._Parameterizable | |
def | __delattr__ (self, name) |
def | __init__ (self, *arg, **kargs) |
def | __repr__ (self) |
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 | __invert__ (self) |
def | __mul__ (self, rhs) |
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) |
def | _clonesequence (self, lookuptable) |
def | _errorstr (self) |
def | _getProducer (self) |
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 |
Reimplemented from Mixins._Parameterizable.
Definition at line 280 of file Modules.py.
References Modules.SwitchProducer.__typeIsValid(), Modules.SwitchProducer._caseFunctionDict, Mixins._ParameterTypeBase._isModified, Mixins._SimpleParameterTypeBase._isModified, Mixins._Parameterizable._isModified, mps_setup.append, Mixins._ParameterTypeBase.dumpPython(), Mixins.UsingBlock.dumpPython(), Mixins._Parameterizable.dumpPython(), Config.Process.dumpPython(), Config.SubProcess.dumpPython(), join(), and relativeConstraints.keys.
def Modules.SwitchProducer.__setattr__ | ( | self, | |
name, | |||
value | |||
) |
Reimplemented from Mixins._Parameterizable.
Definition at line 298 of file Modules.py.
References Mixins._Parameterizable.__addParameter(), Modules.SwitchProducer.__typeIsValid(), Mixins._ParameterTypeBase._isModified, Mixins._SimpleParameterTypeBase._isModified, Mixins._Parameterizable._isModified, Mixins._ParameterTypeBase.dumpPython(), Mixins.UsingBlock.dumpPython(), Mixins._Parameterizable.dumpPython(), Config.Process.dumpPython(), Config.SubProcess.dumpPython(), Mixins._ParameterTypeBase.isFrozen(), and Mixins._Parameterizable.isFrozen().
Referenced by GenObject.GenObject.setValue().
|
private |
Reimplemented from Mixins._Parameterizable.
Definition at line 294 of file Modules.py.
References Mixins._Parameterizable.__addParameter().
|
staticprivate |
Definition at line 277 of file Modules.py.
Referenced by Modules.SwitchProducer.__addParameter(), and Modules.SwitchProducer.__setattr__().
|
private |
Returns the name of the chosen case.
Definition at line 260 of file Modules.py.
References Modules.SwitchProducer._caseFunctionDict, Mixins._Parameterizable.parameterNames_(), and str.
Referenced by Modules.SwitchProducer._getProducer(), and Modules.SwitchProducer.insertInto().
|
private |
Reimplemented from Modules._Module.
Definition at line 408 of file Modules.py.
References Modules._Module._errorstr(), and triggerObjects_cff.id.
|
private |
Reimplemented from Modules._Module.
Definition at line 413 of file Modules.py.
|
private |
Returns the EDroducer of the chosen case
Definition at line 272 of file Modules.py.
References Modules.SwitchProducer._chooseCase().
|
private |
Reimplemented from Modules.EDProducer.
Definition at line 393 of file Modules.py.
Referenced by SequenceTypes._ModuleSequenceType._place(), and Mixins._TypedParameterizable._place().
def Modules.SwitchProducer.appendToProcessDescLists_ | ( | self, | |
modules, | |||
aliases, | |||
myname | |||
) |
Definition at line 371 of file Modules.py.
References Modules.SwitchProducer.caseLabel_(), and Mixins._Parameterizable.parameterNames_().
def Modules.SwitchProducer.caseLabel_ | ( | self, | |
name, | |||
case | |||
) |
Definition at line 369 of file Modules.py.
Referenced by Modules.SwitchProducer.appendToProcessDescLists_(), and Modules.SwitchProducer.insertInto().
def Modules.SwitchProducer.clone | ( | self, | |
** | params | ||
) |
Definition at line 323 of file Modules.py.
References Mixins._Parameterizable.parameterNames_(), and Mixins.saveOrigin().
def Modules.SwitchProducer.directDependencies | ( | self | ) |
Reimplemented from Mixins._TypedParameterizable.
Definition at line 361 of file Modules.py.
def Modules.SwitchProducer.dumpPython | ( | self, | |
options = PrintOptions() |
|||
) |
Reimplemented from Mixins._TypedParameterizable.
Definition at line 346 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 256 of file Modules.py.
def Modules.SwitchProducer.insertInto | ( | self, | |
parameterSet, | |||
myname | |||
) |
Reimplemented from Modules._Module.
Definition at line 381 of file Modules.py.
References Modules.SwitchProducer._chooseCase(), Modules.SwitchProducer.caseLabel_(), edm::ModuleProcessName.moduleLabel_, FWJobMetadataManager::Data.moduleLabel_, PFMatchedCandidateRefExtractor.moduleLabel_, edm::ModuleLabelMatch.moduleLabel_, GBRForestWriter.moduleLabel_, HPSPFTauProducer.moduleLabel_, edm::BranchKey.moduleLabel_, MuonMETcorrInputProducer.moduleLabel_, SysShiftMETcorrInputProducer.moduleLabel_, ShiftedJetProducerByMatchedObjectT< T >.moduleLabel_, Type0PFMETcorrInputProducer.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_, BoostedTauSeedsProducer.moduleLabel_, edm::ESConsumesInfoEntry.moduleLabel_, TauDiscriminationAgainstElectronDeadECAL< TauType, TauDiscriminator >.moduleLabel_, SubjetFilterAlgorithm.moduleLabel_, pat::TauJetCorrFactorsProducer.moduleLabel_, TauDiscriminationAgainstElectronMVA6< TauType, TauDiscriminator, ElectronType >.moduleLabel_, JetIdSelector< T >.moduleLabel_, edm::ModuleDescription.moduleLabel_, PFRecoTauChargedHadronProducer.moduleLabel_, edm::ProductSelectorRules::Rule.moduleLabel_, ObjectViewMatcher< T1, T2 >.moduleLabel_, MinMETProducerT< T >.moduleLabel_, PFRecoTauDiscriminationAgainstMuon2.moduleLabel_, TauTagValidation.moduleLabel_, ObjectViewCleaner< T >.moduleLabel_, PFRecoTauDiscriminationAgainstMuon2Container.moduleLabel_, PFRecoTauDiscriminationAgainstMuonSimple.moduleLabel_, ShiftedParticleProducerT< T >.moduleLabel_, PFRecoTauDiscriminationAgainstMuonMVA.moduleLabel_, CorrectedMETProducerT< T >.moduleLabel_, TauDiscriminationProducerBase< TauType, TauDiscriminator, TauDiscriminatorDataType, ConsumeType >.moduleLabel_, HLTMuonMatchAndPlot.moduleLabel_, PFRecoTauDiscriminationByIsolationMVA2.moduleLabel_, edm::test::TestProcessorConfig::ProduceEntry.moduleLabel_, reco::tau::PFRecoTauDiscriminationByMVAIsolationRun2.moduleLabel_, VirtualJetProducer.moduleLabel_, reco::tau::PATTauDiscriminationByMVAIsolationRun2.moduleLabel_, ShiftedJetProducerT< T, Textractor >.moduleLabel_, CaloJetMETcorrInputProducerT< T, Textractor >.moduleLabel_, PFRecoTauDiscriminationByIsolation.moduleLabel_, JetCleanerForType1METT< T, Textractor >.moduleLabel_, edm::PoolOutputModule.moduleLabel_, edm::BranchDescription.moduleLabel_, PFRecoTauDiscriminationByIsolationContainer.moduleLabel_, PFJetMETcorrInputProducerT< T, Textractor >.moduleLabel_, edm::ProductResolverIndexHelper::Item.moduleLabel_, Mixins._TypedParameterizable.moduleLabel_(), Mixins._TypedParameterizable.nameInProcessDesc_(), Config.SubProcess.nameInProcessDesc_(), and Mixins._Parameterizable.parameterNames_().
def Modules.SwitchProducer.moduleLabel_ | ( | self, | |
myname | |||
) |
Reimplemented from Mixins._TypedParameterizable.
Definition at line 367 of file Modules.py.
Referenced by ExternalGeneratorFilter.ExternalGeneratorFilter.insertInto().
def Modules.SwitchProducer.nameInProcessDesc_ | ( | self, | |
myname | |||
) |
Reimplemented from Mixins._TypedParameterizable.
Definition at line 365 of file Modules.py.
Referenced by Types.EDAlias.appendToProcessDescList_(), ExternalGeneratorFilter.ExternalGeneratorFilter.insertInto(), and Types.EDAlias.insertInto().
|
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.