CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes | Static Private Attributes
trigTools.SwitchOnTriggerMatchingStandAlone Class Reference
Inheritance diagram for trigTools.SwitchOnTriggerMatchingStandAlone:

Public Member Functions

def __call__ (self, process, triggerMatchers=None, triggerProducer=None, path=None, hltProcess=None, outputModule=None, postfix=None)
 
def __init__ (self)
 
def getDefaultParameters (self)
 
def toolCode (self, process)
 

Private Attributes

 _comment
 
 _parameters
 

Static Private Attributes

 _defaultParameters
 
 _label
 

Detailed Description

Enables trigger matching in PAT
SwitchOnTriggerMatchingStandAlone( [cms.Process], triggerMatchers = [default list], triggerProducer = 'patTrigger', path = '', hltProcess = 'HLT', outputModule = 'out', postfix = '' )
- [cms.Process]  : the 'cms.Process'
- triggerMatchers: PAT trigger matcher module labels (list)
                   optional; default: defined in 'triggerMatchingDefaultSequence'
                   (s. PhysicsTools/PatAlgos/python/triggerLayer1/triggerMatcherExamples_cfi.py)
- triggerProducer: PATTriggerProducer module label;
                   optional, default: 'patTrigger'
- path           : name of path to use;
                   optional, default: ''
- hltProcess     : HLT process name;
                   optional, default: 'HLT'
- outputModule   : output module label;
                   empty label indicates no output;
                   optional, default: 'out'
- postfix        : postfix to apply to PAT module labels;
                   optional, default: ''
Using None as any argument restores its default value.

Definition at line 423 of file trigTools.py.

Constructor & Destructor Documentation

def trigTools.SwitchOnTriggerMatchingStandAlone.__init__ (   self)

Definition at line 446 of file trigTools.py.

References heavyIonTools.ConfigureHeavyIons._defaultParameters, metTools.AddMETCollection._defaultParameters, trackTools.MakeAODTrackCandidates._defaultParameters, coreTools.RunOnData._defaultParameters, heavyIonTools.ProductionDefaults._defaultParameters, cmsswVersionTools.PickRelValInputFiles._defaultParameters, coreTools.RemoveMCMatching._defaultParameters, trackTools.MakePATTrackCandidates._defaultParameters, trigTools.SwitchOnTrigger._defaultParameters, heavyIonTools.SelectionDefaults._defaultParameters, heavyIonTools.DisbaleMonteCarloDeps._defaultParameters, trigTools.SwitchOnTriggerStandAlone._defaultParameters, trackTools.MakeTrackCandidates._defaultParameters, tauTools.AddTauCollection._defaultParameters, trigTools.SwitchOnTriggerMatching._defaultParameters, trigTools.SwitchOnTriggerMatchingStandAlone._defaultParameters, jetTools.AddJetCollection._defaultParameters, jetTools.SwitchJetCollection._defaultParameters, jetTools.UpdateJetCollection._defaultParameters, jetTools.AddJetID._defaultParameters, jetTools.SetTagInfos._defaultParameters, root::helper::RootFunctionAdapter< F, args >.addParameter(), root::helper::RootFunctionHelper< F, args, Tag >.addParameter(), ParameterMgr.addParameter(), fit::RootMinuit< Function >.addParameter(), DropBoxMetadata::Parameters.addParameter(), PythonParameterSet.addParameter(), l1t::TriggerSystem.addParameter(), LutXml.addParameter(), ConfigToolBase.ConfigToolBase.addParameter(), and edm::ParameterSet.addParameter().

446  def __init__( self ):
447  ConfigToolBase.__init__( self )
448  self.addParameter( self._defaultParameters, 'triggerMatchers', _exampleTriggerMatchers, _defaultTriggerMatchersComment )
449  self.addParameter( self._defaultParameters, 'exampleMatchers', False , '' )
450  self.addParameter( self._defaultParameters, 'triggerProducer', _defaultTriggerProducer, _defaultTriggerProducerComment )
451  self.addParameter( self._defaultParameters, 'path' , _defaultPath , _defaultPathComment )
452  self.addParameter( self._defaultParameters, 'hltProcess' , _defaultHltProcess , _defaultHltProcessComment )
453  self.addParameter( self._defaultParameters, 'outputModule' , _defaultOutputModule , _defaultOutputModuleComment )
454  self.addParameter( self._defaultParameters, 'postfix' , _defaultPostfix , _defaultPostfixComment )
455  self._parameters = copy.deepcopy( self._defaultParameters )
456  self._comment = ""
457 

Member Function Documentation

def trigTools.SwitchOnTriggerMatchingStandAlone.__call__ (   self,
  process,
  triggerMatchers = None,
  triggerProducer = None,
  path = None,
  hltProcess = None,
  outputModule = None,
  postfix = None 
)

Definition at line 468 of file trigTools.py.

References heavyIonTools.ConfigureHeavyIons._defaultParameters, metTools.AddMETCollection._defaultParameters, trackTools.MakeAODTrackCandidates._defaultParameters, coreTools.RunOnData._defaultParameters, heavyIonTools.ProductionDefaults._defaultParameters, cmsswVersionTools.PickRelValInputFiles._defaultParameters, coreTools.RemoveMCMatching._defaultParameters, trackTools.MakePATTrackCandidates._defaultParameters, trigTools.SwitchOnTrigger._defaultParameters, heavyIonTools.SelectionDefaults._defaultParameters, heavyIonTools.DisbaleMonteCarloDeps._defaultParameters, trigTools.SwitchOnTriggerStandAlone._defaultParameters, trackTools.MakeTrackCandidates._defaultParameters, tauTools.AddTauCollection._defaultParameters, trigTools.SwitchOnTriggerMatching._defaultParameters, trigTools.SwitchOnTriggerMatchingStandAlone._defaultParameters, jetTools.AddJetCollection._defaultParameters, jetTools.SwitchJetCollection._defaultParameters, jetTools.UpdateJetCollection._defaultParameters, jetTools.AddJetID._defaultParameters, jetTools.SetTagInfos._defaultParameters, SignedImpactParameter3D.apply(), gen::PhotosInterfaceBase.apply(), SignedTransverseImpactParameter.apply(), SignedDecayLength3D.apply(), MatrixReader.MatrixReader.apply, DummyOOTPileupCorrection.apply(), HcalDeterministicFit.apply(), gen::PhotosppInterface.apply(), SurveyParameters.apply(), FWPSetCellEditor.apply(), gen::PhotosInterface.apply(), FWGUIEventFilter.apply(), DeviationsFromFileSensor2D.apply(), BeamSpotAlignmentParameters.apply(), RigidBodyAlignmentParameters.apply(), ConfigToolBase.ConfigToolBase.apply(), AlignmentParameters.apply(), OOTPileupCorrData.apply(), BowedSurfaceAlignmentParameters.apply(), Vispa.Plugins.ConfigEditor.ToolDataAccessor.ImportTool.apply(), Vispa.Plugins.ConfigEditor.ToolDataAccessor.ApplyTool.apply(), AbsOOTPileupCorrection.apply(), TwoBowedSurfacesAlignmentParameters.apply(), Vispa.Gui.BoxContentDialog.BoxContentDialog.apply(), reco::modules::TrackerTrackHitFilter::Rule.apply(), Vispa.Plugins.ConfigEditor.ToolDialog.ToolDialog.apply(), PulseShapeFitOOTPileupCorrection.apply(), reco::Add< T >.apply(), reco::Sub< T >.apply(), reco::Mul< T >.apply(), reco::Div< T >.apply(), cmsswVersionTools.PickRelValInputFiles.apply(), models.RegExp.apply(), reco::And< bool >.apply(), reco::Or< bool >.apply(), reco::Less< T >.apply(), reco::LessEqual< T >.apply(), reco::More< T >.apply(), reco::MoreEqual< T >.apply(), reco::Equal< T >.apply(), ArrayND< Accumulator >.apply(), ArrayND< Numeric, Len2, Dim2 >.apply(), ArrayND< Numeric, Len, Dim >.apply(), ArrayND< Num2, Len2, Dim2 >.apply(), npstat::ArrayND< Numeric, StackLen, StackDim >.apply(), npstat::ArrayND< Numeric >.apply(), npstat::ArrayND< Num1, Len1, Dim1 >.apply(), Config.ProcessModifier.apply(), PedeReader.setParameter(), QIE8Simulator.setParameter(), AbsElectronicODERHS.setParameter(), IntegratedCalibrationBase.setParameter(), SiStripLorentzAngleCalibration.setParameter(), SiPixelLorentzAngleCalibration.setParameter(), SiStripBackplaneCalibration.setParameter(), fit::RootMinuit< Function >.setParameter(), and ConfigToolBase.ConfigToolBase.setParameter().

Referenced by trigTools.SwitchOnTriggerMatchingStandAlone.getDefaultParameters().

468  ):
469  if triggerMatchers is None:
470  triggerMatchers = self._defaultParameters[ 'triggerMatchers' ].value
471  self.setParameter( 'exampleMatchers', True )
472  if triggerProducer is None:
473  triggerProducer = self._defaultParameters[ 'triggerProducer' ].value
474  if path is None:
475  path = self._defaultParameters[ 'path' ].value
476  if hltProcess is None:
477  hltProcess = self._defaultParameters[ 'hltProcess' ].value
478  if outputModule is None:
479  outputModule = self._defaultParameters[ 'outputModule' ].value
480  if postfix is None:
481  postfix = self._defaultParameters[ 'postfix' ].value
482  self.setParameter( 'triggerMatchers', triggerMatchers )
483  self.setParameter( 'triggerProducer', triggerProducer )
484  self.setParameter( 'path' , path )
485  self.setParameter( 'hltProcess' , hltProcess )
486  self.setParameter( 'outputModule' , outputModule )
487  self.setParameter( 'postfix' , postfix )
488  self.apply( process )
489 
def trigTools.SwitchOnTriggerMatchingStandAlone.getDefaultParameters (   self)
def trigTools.SwitchOnTriggerMatchingStandAlone.toolCode (   self,
  process 
)

Definition at line 490 of file trigTools.py.

References trigTools._addEventContent(), metTools.AddMETCollection._label, heavyIonTools.ConfigureHeavyIons._label, trackTools.MakeAODTrackCandidates._label, coreTools.RunOnData._label, MagneticFieldMapESProducer._label, TrackerInteractionGeometryESProducer._label, Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigFolder._label, heavyIonTools.ProductionDefaults._label, LHECOMWeightProducer._label, cmsswVersionTools.PickRelValInputFiles._label, coreTools.RemoveMCMatching._label, trackTools.MakePATTrackCandidates._label, trigTools.SwitchOnTrigger._label, heavyIonTools.SelectionDefaults._label, heavyIonTools.DisbaleMonteCarloDeps._label, trigTools.SwitchOnTriggerStandAlone._label, trackTools.MakeTrackCandidates._label, tauTools.AddTauCollection._label, trigTools.SwitchOnTriggerMatching._label, trigTools.SwitchOnTriggerMatchingStandAlone._label, jetTools.AddJetCollection._label, jetTools.SwitchJetCollection._label, Vispa.Views.LineDecayView.DecayLine._label, jetTools.UpdateJetCollection._label, jetTools.AddJetID._label, jetTools.SetTagInfos._label, editorTools.UserCodeTool._parameters, heavyIonTools.ConfigureHeavyIons._parameters, coreTools.RunOnData._parameters, trackTools.MakeAODTrackCandidates._parameters, Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigFolder._parameters, metTools.AddMETCollection._parameters, Vispa.Plugins.ConfigEditor.ToolDataAccessor.ImportTool._parameters, heavyIonTools.ProductionDefaults._parameters, ConfigToolBase.ConfigToolBase._parameters, editorTools.ChangeSource._parameters, TAbsFitConstraint._parameters, TAbsFitParticle._parameters, cmsswVersionTools.PickRelValInputFiles._parameters, coreTools.RemoveMCMatching._parameters, trigTools.SwitchOnTrigger._parameters, trackTools.MakePATTrackCandidates._parameters, heavyIonTools.SelectionDefaults._parameters, heavyIonTools.DisbaleMonteCarloDeps._parameters, trigTools.SwitchOnTriggerStandAlone._parameters, trackTools.MakeTrackCandidates._parameters, tauTools.AddTauCollection._parameters, trigTools.SwitchOnTriggerMatching._parameters, trigTools.SwitchOnTriggerMatchingStandAlone._parameters, jetTools.AddJetCollection._parameters, jetTools.SwitchJetCollection._parameters, jetTools.UpdateJetCollection._parameters, jetTools.AddJetID._parameters, jetTools.SetTagInfos._parameters, helpers.getPatAlgosToolsTask(), and trigTools.switchOnTriggerStandAlone.

490  def toolCode( self, process ):
491  triggerMatchers = self._parameters[ 'triggerMatchers' ].value
492  exampleMatchers = self._parameters[ 'exampleMatchers' ].value
493  triggerProducer = self._parameters[ 'triggerProducer' ].value
494  path = self._parameters[ 'path' ].value
495  hltProcess = self._parameters[ 'hltProcess' ].value
496  outputModule = self._parameters[ 'outputModule' ].value
497  postfix = self._parameters[ 'postfix' ].value
498 
499  # Load default producers from existing config file, if needed
500  task = getPatAlgosToolsTask(process)
501  if exampleMatchers:
502  process.load( "PhysicsTools.PatAlgos.triggerLayer1.triggerMatcherExamples_cfi" )
503  task.add(process.triggerMatcherExamplesTask)
504 
505  # Switch on PAT trigger information if needed
506  if not hasattr( process, triggerProducer ):
507  print '%s():'%( self._label )
508  print ' PAT trigger production switched on automatically using'
509  print ' switchOnTriggerStandAlone( process, \'%s\', \'%s\', \'%s\', \'%s\' )'%( hltProcess, triggerProducer, path, outputModule )
510  print _longLine
511  switchOnTriggerStandAlone( process, triggerProducer, path, hltProcess, outputModule )
512 
513  # Maintain configurations
514  triggerMatchersKnown = []
515  for matcher in triggerMatchers:
516  if not hasattr( process, matcher ):
517  print '%s():'%( self._label )
518  print ' Matcher \'%s\' not known to process'%( matcher )
519  print ' ==> skipped'
520  print _longLine
521  continue
522  triggerMatchersKnown.append( matcher )
523  trigMchMod = getattr( process, matcher )
524  trigMchMod.src = cms.InputTag( trigMchMod.src.getModuleLabel() + postfix )
525  trigMchMod.matched = triggerProducer
526 
527  # Add event content
528  if outputModule is not '':
529  patTriggerEventContent = []
530  for matcher in triggerMatchersKnown:
531  patTriggerEventContent += [ 'keep patTriggerObjectStandAlonesedmAssociation_%s_*_%s'%( matcher, process.name_() )
532  , 'keep *_%s_*_*'%( getattr( process, matcher ).src.value() )
533  ]
534  getattr( process, outputModule ).outputCommands = _addEventContent( getattr( process, outputModule ).outputCommands, patTriggerEventContent )
535 
def _addEventContent(outputCommands, eventContent)
Definition: trigTools.py:29
switchOnTriggerStandAlone
Definition: trigTools.py:281
def getPatAlgosToolsTask(process)
Definition: helpers.py:12

Member Data Documentation

trigTools.SwitchOnTriggerMatchingStandAlone._comment
private

Definition at line 456 of file trigTools.py.

trigTools.SwitchOnTriggerMatchingStandAlone._defaultParameters
staticprivate

Definition at line 444 of file trigTools.py.

Referenced by HiCoreTools.RestrictInputToAOD.__call__(), runJetUncertainties.RunJetUncertainties.__call__(), editorTools.ChangeSource.__call__(), HiCoreTools.RemoveMCMatching.__call__(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.__call__(), HiCoreTools.RemoveAllPATObjectsBut.__call__(), HiCoreTools.RemoveSpecificPATObjects.__call__(), HiCoreTools.RemoveCleaning.__call__(), HiCoreTools.AddCleaning.__call__(), trigTools.SwitchOnTriggerMatchingStandAlone.__call__(), trigTools.SwitchOnTriggerMatchEmbedding.__call__(), editorTools.UserCodeTool.__init__(), HiCoreTools.RestrictInputToAOD.__init__(), runJetUncertainties.RunJetUncertainties.__init__(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.__init__(), Vispa.Plugins.ConfigEditor.ToolDataAccessor.ImportTool.__init__(), editorTools.ChangeSource.__init__(), HiCoreTools.RemoveMCMatching.__init__(), HiCoreTools.RemoveAllPATObjectsBut.__init__(), HiCoreTools.RemoveSpecificPATObjects.__init__(), HiCoreTools.RemoveCleaning.__init__(), HiCoreTools.AddCleaning.__init__(), trigTools.SwitchOnTriggerMatchingStandAlone.__init__(), trigTools.SwitchOnTriggerMatchEmbedding.__init__(), ConfigToolBase.ConfigToolBase.dumpPython(), ConfigToolBase.ConfigToolBase.getAllowedValues(), HiCoreTools.RestrictInputToAOD.getDefaultParameters(), editorTools.ChangeSource.getDefaultParameters(), HiCoreTools.RemoveMCMatching.getDefaultParameters(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.getDefaultParameters(), HiCoreTools.RemoveAllPATObjectsBut.getDefaultParameters(), HiCoreTools.RemoveSpecificPATObjects.getDefaultParameters(), HiCoreTools.RemoveCleaning.getDefaultParameters(), HiCoreTools.AddCleaning.getDefaultParameters(), trigTools.SwitchOnTriggerMatchingStandAlone.getDefaultParameters(), trigTools.SwitchOnTriggerMatchEmbedding.getDefaultParameters(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.initializeInputTag(), ConfigToolBase.ConfigToolBase.reset(), and ConfigToolBase.ConfigToolBase.setParameter().

trigTools.SwitchOnTriggerMatchingStandAlone._label
staticprivate
trigTools.SwitchOnTriggerMatchingStandAlone._parameters
private

Definition at line 455 of file trigTools.py.

Referenced by runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.__call__(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.ak4JetReclustering(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.createMVAMETModule(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.createSmearedJetModule(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.extractMET(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.getCorrectedMET(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.getUnclusteredVariationsForMVAMET(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.getVariations(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.jetCleaning(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.jetConfiguration(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.miniAODConfiguration(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.miniAODConfigurationPost(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.produceMET(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.recomputeRawMetFromPfcs(), HiCoreTools.RestrictInputToAOD.toolCode(), runJetUncertainties.RunJetUncertainties.toolCode(), HiCoreTools.RemoveMCMatching.toolCode(), HiCoreTools.RemoveAllPATObjectsBut.toolCode(), HiCoreTools.RemoveSpecificPATObjects.toolCode(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.toolCode(), HiCoreTools.RemoveCleaning.toolCode(), HiCoreTools.AddCleaning.toolCode(), trigTools.SwitchOnTriggerMatchingStandAlone.toolCode(), trigTools.SwitchOnTriggerMatchEmbedding.toolCode(), and runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.updateJECs().