Inherits FWCore::GuiBrowsers::ConfigToolBase::ConfigToolBase.
Public Member Functions | |
def | __call__ |
def | __init__ |
def | getDefaultParameters |
def | toolCode |
Private Member Functions | |
def | _renameMatchers |
Private Attributes | |
_comment | |
_parameters | |
Static Private Attributes | |
tuple | _defaultParameters = dicttypes.SortedKeysDict() |
string | _label = 'removeCleaningFromTriggerMatching' |
Removes cleaning from already existing PAT trigger matching/embedding configuration RemoveCleaningFromTriggerMatching( [cms.Process], outputModule = 'out' ) - [cms.Process] : the 'cms.Process' - sequence : name of sequence to use; optional, default: 'patDefaultSequence' - outputModule : output module label; empty label indicates no output; optional, default: 'out' Using None as any argument restores its default value.
Definition at line 723 of file trigTools.py.
def trigTools::RemoveCleaningFromTriggerMatching::__init__ | ( | self | ) |
Definition at line 737 of file trigTools.py.
00738 : 00739 ConfigToolBase.__init__( self ) 00740 self.addParameter( self._defaultParameters, 'sequence' , _defaultSequence , _defaultSequenceComment ) 00741 self.addParameter( self._defaultParameters, 'outputModule', _defaultOutputModule, _defaultOutputModuleComment ) 00742 self._parameters = copy.deepcopy( self._defaultParameters ) 00743 self._comment = ""
def trigTools::RemoveCleaningFromTriggerMatching::__call__ | ( | self, | |
process, | |||
sequence = None , |
|||
outputModule = None |
|||
) |
Definition at line 747 of file trigTools.py.
00751 : 00752 if sequence is None: 00753 sequence = self._defaultParameters[ 'sequence' ].value 00754 if outputModule is None: 00755 outputModule = self._defaultParameters[ 'outputModule' ].value 00756 self.setParameter( 'sequence' , sequence ) 00757 self.setParameter( 'outputModule', outputModule ) 00758 self.apply( process )
def trigTools::RemoveCleaningFromTriggerMatching::_renameMatchers | ( | self, | |
matchers, | |||
oldModules | |||
) | [private] |
Definition at line 824 of file trigTools.py.
def trigTools::RemoveCleaningFromTriggerMatching::getDefaultParameters | ( | self | ) |
Definition at line 744 of file trigTools.py.
def trigTools::RemoveCleaningFromTriggerMatching::toolCode | ( | self, | |
process | |||
) |
Definition at line 759 of file trigTools.py.
00760 : 00761 sequence = self._parameters[ 'sequence' ].value 00762 outputModule = self._parameters[ 'outputModule' ].value 00763 00764 # Maintain configurations 00765 listMatchers = [ 'PATTriggerMatcherDRLessByR' 00766 , 'PATTriggerMatcherDRDPtLessByR' 00767 , 'PATTriggerMatcherDRLessByPt' 00768 , 'PATTriggerMatcherDRDPtLessByPt' 00769 , 'PATTriggerMatcherDEtaLessByDR' 00770 , 'PATTriggerMatcherDEtaLessByDEta' 00771 ] 00772 listEmbedders = [ 'PATTriggerMatchPhotonEmbedder' 00773 , 'PATTriggerMatchElectronEmbedder' 00774 , 'PATTriggerMatchMuonEmbedder' 00775 , 'PATTriggerMatchTauEmbedder' 00776 , 'PATTriggerMatchJetEmbedder' 00777 , 'PATTriggerMatchMETEmbedder' 00778 ] 00779 modules = _modulesInSequence( process, sequence ) 00780 oldModules = [] 00781 oldSources = [] 00782 # input source labels 00783 for module in modules: 00784 if hasattr( process, module ): 00785 trigMod = getattr( process, module ) 00786 if trigMod.type_() in listMatchers: 00787 if trigMod.src.value()[ : 8 ] == 'cleanPat': 00788 trigMod.src = trigMod.src.value().replace( 'cleanPat', 'selectedPat' ) 00789 if trigMod.label()[ : 5 ] == 'clean': 00790 oldModules += [ trigMod.label() ] 00791 setattr( process, trigMod.label().replace( 'clean', 'selected' ), trigMod ) 00792 if trigMod.type_() in listEmbedders: 00793 if trigMod.src.value()[ : 8 ] == 'cleanPat': 00794 oldSources += [ trigMod.src.getModuleLabel() ] 00795 trigMod.src = trigMod.src.value().replace( 'cleanPat', 'selectedPat' ) 00796 if trigMod.label()[ : 5 ] == 'clean': 00797 oldModules += [ trigMod.label() ] 00798 setattr( process, trigMod.label().replace( 'clean', 'selected' ), trigMod ) 00799 # matcher labels 00800 for module in modules: 00801 if hasattr( process, module ): 00802 trigMod = getattr( process, module ) 00803 if trigMod.type_() == 'PATTriggerEventProducer': 00804 matchers = getattr( trigMod, 'patTriggerMatches' ) 00805 matchers = self._renameMatchers( matchers, oldModules ) 00806 elif trigMod.type_() in listEmbedders: 00807 matchers = getattr( trigMod, 'matches' ) 00808 matchers = self._renameMatchers( matchers, oldModules ) 00809 00810 # Maintain event content 00811 if outputModule is not '': 00812 patTriggerEventContent = getattr( process, outputModule ).outputCommands 00813 for statement in range( len( patTriggerEventContent ) ): 00814 for module in oldModules: 00815 if module in patTriggerEventContent[ statement ]: 00816 patTriggerEventContent[ statement ] = patTriggerEventContent[ statement ].replace( 'clean', 'selected' ) 00817 for source in oldSources: 00818 if source in patTriggerEventContent[ statement ] and 'drop' in patTriggerEventContent[ statement ]: 00819 patTriggerEventContent[ statement ] = patTriggerEventContent[ statement ].replace( 'clean', 'selected' ) 00820 print '%s():'%( self._label ) 00821 print ' Input from cleaning has been switched to input from selection;' 00822 print ' matcher and embedder modules have been renamed accordingly.' 00823 print _longLine
Definition at line 737 of file trigTools.py.
tuple trigTools::RemoveCleaningFromTriggerMatching::_defaultParameters = dicttypes.SortedKeysDict() [static, private] |
Definition at line 735 of file trigTools.py.
string trigTools::RemoveCleaningFromTriggerMatching::_label = 'removeCleaningFromTriggerMatching' [static, private] |
Definition at line 734 of file trigTools.py.
Definition at line 737 of file trigTools.py.