CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes | Static Private Attributes
trigTools.SwitchOnTriggerStandAlone Class Reference
Inheritance diagram for trigTools.SwitchOnTriggerStandAlone:

Public Member Functions

def __call__
 
def __init__
 
def getDefaultParameters
 
def toolCode
 

Private Attributes

 _comment
 
 _parameters
 

Static Private Attributes

tuple _defaultParameters = dicttypes.SortedKeysDict()
 
string _label = 'switchOnTriggerStandAlone'
 

Detailed Description

Enables trigger information in PAT, limited to stand-alone trigger objects
SwitchOnTriggerStandAlone( [cms.Process], triggerProducer = 'patTrigger', sequence = 'patDefaultSequence', hltProcess = 'HLT', outputModule = 'out' )
- [cms.Process]       : the 'cms.Process'
- triggerProducer     : PATTriggerProducer module label;
                        optional, default: 'patTrigger'
- sequence            : name of sequence to use;
                        optional, default: 'patDefaultSequence'
- hltProcess          : HLT process name;
                        optional, default: 'HLT'
- outputModule        : output module label;
                        empty label indicates no output;
                        optional, default: 'out'
Using None as any argument restores its default value.

Definition at line 200 of file trigTools.py.

Constructor & Destructor Documentation

def trigTools.SwitchOnTriggerStandAlone.__init__ (   self)

Definition at line 218 of file trigTools.py.

References electronTools.AddElectronUserIsolation._defaultParameters, photonTools.AddPhotonUserIsolation._defaultParameters, editorTools.UserCodeTool._defaultParameters, muonTools.AddMuonUserIsolation._defaultParameters, metTools.AddTcMET._defaultParameters, trackTools.MakeAODTrackCandidates._defaultParameters, heavyIonTools.ConfigureHeavyIons._defaultParameters, coreTools.RestrictInputToAOD._defaultParameters, cmsswVersionTools.Run52xOn51xTrigger._defaultParameters, Vispa.Plugins.ConfigEditor.ToolDataAccessor.ImportTool._defaultParameters, heavyIonTools.ProductionDefaults._defaultParameters, editorTools.ChangeSource._defaultParameters, metTools.AddPfMET._defaultParameters, coreTools.RunOnData._defaultParameters, trackTools.MakePATTrackCandidates._defaultParameters, trigTools.SwitchOnTrigger._defaultParameters, cmsswVersionTools.PickRelValInputFiles._defaultParameters, coreTools.RemoveMCMatching._defaultParameters, heavyIonTools.SelectionDefaults._defaultParameters, heavyIonTools.DisbaleMonteCarloDeps._defaultParameters, jetTools.RunBTagging._defaultParameters, trigTools.SwitchOnTriggerStandAlone._defaultParameters, trackTools.MakeTrackCandidates._defaultParameters, coreTools.RemoveAllPATObjectsBut._defaultParameters, coreTools.RemoveSpecificPATObjects._defaultParameters, tauTools.AddTauCollection._defaultParameters, coreTools.RemoveCleaning._defaultParameters, coreTools.AddCleaning._defaultParameters, jetTools.AddJetCollection._defaultParameters, jetTools.SwitchJetCollection._defaultParameters, jetTools.AddJetID._defaultParameters, jetTools.SetTagInfos._defaultParameters, jetTools.SwitchJetCorrLevels._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(), LutXml.addParameter(), ConfigToolBase.ConfigToolBase.addParameter(), and edm::ParameterSet.addParameter().

219  def __init__( self ):
220  ConfigToolBase.__init__( self )
221  self.addParameter( self._defaultParameters, 'triggerProducer', _defaultTriggerProducer, _defaultTriggerProducerComment )
222  self.addParameter( self._defaultParameters, 'sequence' , _defaultSequence , _defaultSequenceComment )
223  self.addParameter( self._defaultParameters, 'hltProcess' , _defaultHltProcess , _defaultHltProcessComment )
224  self.addParameter( self._defaultParameters, 'outputModule' , _defaultOutputModule , _defaultOutputModuleComment )
225  self._parameters = copy.deepcopy( self._defaultParameters )
226  self._comment = ""

Member Function Documentation

def trigTools.SwitchOnTriggerStandAlone.__call__ (   self,
  process,
  triggerProducer = None,
  sequence = None,
  hltProcess = None,
  outputModule = None 
)

Definition at line 235 of file trigTools.py.

References electronTools.AddElectronUserIsolation._defaultParameters, photonTools.AddPhotonUserIsolation._defaultParameters, editorTools.UserCodeTool._defaultParameters, metTools.AddTcMET._defaultParameters, muonTools.AddMuonUserIsolation._defaultParameters, trackTools.MakeAODTrackCandidates._defaultParameters, heavyIonTools.ConfigureHeavyIons._defaultParameters, coreTools.RestrictInputToAOD._defaultParameters, cmsswVersionTools.Run52xOn51xTrigger._defaultParameters, Vispa.Plugins.ConfigEditor.ToolDataAccessor.ImportTool._defaultParameters, heavyIonTools.ProductionDefaults._defaultParameters, editorTools.ChangeSource._defaultParameters, metTools.AddPfMET._defaultParameters, coreTools.RunOnData._defaultParameters, trackTools.MakePATTrackCandidates._defaultParameters, trigTools.SwitchOnTrigger._defaultParameters, cmsswVersionTools.PickRelValInputFiles._defaultParameters, coreTools.RemoveMCMatching._defaultParameters, heavyIonTools.SelectionDefaults._defaultParameters, heavyIonTools.DisbaleMonteCarloDeps._defaultParameters, jetTools.RunBTagging._defaultParameters, trigTools.SwitchOnTriggerStandAlone._defaultParameters, trackTools.MakeTrackCandidates._defaultParameters, coreTools.RemoveAllPATObjectsBut._defaultParameters, coreTools.RemoveSpecificPATObjects._defaultParameters, tauTools.AddTauCollection._defaultParameters, coreTools.RemoveCleaning._defaultParameters, coreTools.AddCleaning._defaultParameters, jetTools.AddJetCollection._defaultParameters, jetTools.SwitchJetCollection._defaultParameters, jetTools.AddJetID._defaultParameters, jetTools.SetTagInfos._defaultParameters, jetTools.SwitchJetCorrLevels._defaultParameters, SignedImpactParameter3D.apply(), gen::PhotosInterfaceBase.apply(), SignedTransverseImpactParameter.apply(), SignedDecayLength3D.apply(), SurveyParameters.apply(), FWPSetCellEditor.apply(), gen::PhotosInterface.apply(), gen::PhotosInterface53XLegacy.apply(), cmsswVersionTools.Run52xOn51xTrigger.apply(), FWGUIEventFilter.apply(), DeviationsFromFileSensor2D.apply(), BeamSpotAlignmentParameters.apply(), RigidBodyAlignmentParameters.apply(), ConfigToolBase.ConfigToolBase.apply(), BowedSurfaceAlignmentParameters.apply(), AlignmentParameters.apply(), Vispa.Plugins.ConfigEditor.ToolDataAccessor.ImportTool.apply(), Vispa.Plugins.ConfigEditor.ToolDataAccessor.ApplyTool.apply(), TwoBowedSurfacesAlignmentParameters.apply(), Vispa.Gui.BoxContentDialog.BoxContentDialog.apply(), reco::modules::TrackerTrackHitFilter::Rule.apply(), Vispa.Plugins.ConfigEditor.ToolDialog.ToolDialog.apply(), reco::Add< T >.apply(), reco::Sub< T >.apply(), reco::Mul< T >.apply(), reco::Div< T >.apply(), reco::And< bool >.apply(), reco::Or< bool >.apply(), reco::Less< T >.apply(), cmsswVersionTools.PickRelValInputFiles.apply(), reco::LessEqual< T >.apply(), reco::More< T >.apply(), reco::MoreEqual< T >.apply(), reco::Equal< T >.apply(), jetTools.RunBTagging.apply(), ora::OraMainTable.setParameter(), ora::IMainTable.setParameter(), PedeReader.setParameter(), ora::PoolMainTable.setParameter(), fit::RootMinuit< Function >.setParameter(), and ConfigToolBase.ConfigToolBase.setParameter().

Referenced by trigTools.SwitchOnTriggerStandAlone.getDefaultParameters().

236  ):
237  if triggerProducer is None:
238  triggerProducer = self._defaultParameters[ 'triggerProducer' ].value
239  if sequence is None:
240  sequence = self._defaultParameters[ 'sequence' ].value
241  if hltProcess is None:
242  hltProcess = self._defaultParameters[ 'hltProcess' ].value
243  if outputModule is None:
244  outputModule = self._defaultParameters[ 'outputModule' ].value
245  self.setParameter( 'triggerProducer', triggerProducer )
246  self.setParameter( 'sequence' , sequence )
247  self.setParameter( 'hltProcess' , hltProcess )
248  self.setParameter( 'outputModule' , outputModule )
249  self.apply( process )
def trigTools.SwitchOnTriggerStandAlone.getDefaultParameters (   self)

Definition at line 227 of file trigTools.py.

References trigTools.SwitchOnTriggerStandAlone.__call__(), electronTools.AddElectronUserIsolation._defaultParameters, photonTools.AddPhotonUserIsolation._defaultParameters, editorTools.UserCodeTool._defaultParameters, metTools.AddTcMET._defaultParameters, muonTools.AddMuonUserIsolation._defaultParameters, trackTools.MakeAODTrackCandidates._defaultParameters, heavyIonTools.ConfigureHeavyIons._defaultParameters, coreTools.RestrictInputToAOD._defaultParameters, cmsswVersionTools.Run52xOn51xTrigger._defaultParameters, Vispa.Plugins.ConfigEditor.ToolDataAccessor.ImportTool._defaultParameters, heavyIonTools.ProductionDefaults._defaultParameters, editorTools.ChangeSource._defaultParameters, metTools.AddPfMET._defaultParameters, coreTools.RunOnData._defaultParameters, trackTools.MakePATTrackCandidates._defaultParameters, trigTools.SwitchOnTrigger._defaultParameters, cmsswVersionTools.PickRelValInputFiles._defaultParameters, coreTools.RemoveMCMatching._defaultParameters, heavyIonTools.SelectionDefaults._defaultParameters, heavyIonTools.DisbaleMonteCarloDeps._defaultParameters, jetTools.RunBTagging._defaultParameters, trigTools.SwitchOnTriggerStandAlone._defaultParameters, trackTools.MakeTrackCandidates._defaultParameters, coreTools.RemoveAllPATObjectsBut._defaultParameters, coreTools.RemoveSpecificPATObjects._defaultParameters, tauTools.AddTauCollection._defaultParameters, coreTools.RemoveCleaning._defaultParameters, coreTools.AddCleaning._defaultParameters, jetTools.AddJetCollection._defaultParameters, jetTools.SwitchJetCollection._defaultParameters, jetTools.AddJetID._defaultParameters, jetTools.SetTagInfos._defaultParameters, and jetTools.SwitchJetCorrLevels._defaultParameters.

Referenced by trigTools.SwitchOnTriggerStandAlone.toolCode(), trigTools.SwitchOnTriggerMatching.toolCode(), and trigTools.SwitchOnTriggerMatchingStandAlone.toolCode().

228  def getDefaultParameters( self ):
229  return self._defaultParameters
def trigTools.SwitchOnTriggerStandAlone.toolCode (   self,
  process 
)

Definition at line 250 of file trigTools.py.

References trigTools._addEventContent(), electronTools.AddElectronUserIsolation._label, photonTools.AddPhotonUserIsolation._label, editorTools.UserCodeTool._label, muonTools.AddMuonUserIsolation._label, metTools.AddTcMET._label, trackTools.MakeAODTrackCandidates._label, heavyIonTools.ConfigureHeavyIons._label, coreTools.RestrictInputToAOD._label, MagneticFieldMapESProducer._label, TrackerInteractionGeometryESProducer._label, Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigFolder._label, cmsswVersionTools.Run52xOn51xTrigger._label, Vispa.Plugins.ConfigEditor.ToolDataAccessor.ImportTool._label, heavyIonTools.ProductionDefaults._label, ConfigToolBase.ConfigToolBase._label, editorTools.ChangeSource._label, LHECOMWeightProducer._label, metTools.AddPfMET._label, coreTools.RunOnData._label, Vispa.Plugins.ConfigEditor.ToolDataAccessor.ApplyTool._label, trackTools.MakePATTrackCandidates._label, trigTools.SwitchOnTrigger._label, cmsswVersionTools.PickRelValInputFiles._label, coreTools.RemoveMCMatching._label, heavyIonTools.SelectionDefaults._label, heavyIonTools.DisbaleMonteCarloDeps._label, jetTools.RunBTagging._label, trigTools.SwitchOnTriggerStandAlone._label, trackTools.MakeTrackCandidates._label, coreTools.RemoveAllPATObjectsBut._label, coreTools.RemoveSpecificPATObjects._label, tauTools.AddTauCollection._label, coreTools.RemoveCleaning._label, coreTools.AddCleaning._label, jetTools.AddJetCollection._label, jetTools.SwitchJetCollection._label, Vispa.Views.LineDecayView.DecayLine._label, jetTools.AddJetID._label, jetTools.SetTagInfos._label, jetTools.SwitchJetCorrLevels._label, trigTools._modulesInSequence(), editorTools.UserCodeTool._parameters, electronTools.AddElectronUserIsolation._parameters, photonTools.AddPhotonUserIsolation._parameters, heavyIonTools.ConfigureHeavyIons._parameters, metTools.AddTcMET._parameters, muonTools.AddMuonUserIsolation._parameters, coreTools.RestrictInputToAOD._parameters, trackTools.MakeAODTrackCandidates._parameters, Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigFolder._parameters, cmsswVersionTools.Run52xOn51xTrigger._parameters, Vispa.Plugins.ConfigEditor.ToolDataAccessor.ImportTool._parameters, heavyIonTools.ProductionDefaults._parameters, ConfigToolBase.ConfigToolBase._parameters, editorTools.ChangeSource._parameters, TAbsFitConstraint._parameters, metTools.AddPfMET._parameters, TAbsFitParticle._parameters, coreTools.RunOnData._parameters, trackTools.MakePATTrackCandidates._parameters, trigTools.SwitchOnTrigger._parameters, cmsswVersionTools.PickRelValInputFiles._parameters, coreTools.RemoveMCMatching._parameters, heavyIonTools.SelectionDefaults._parameters, heavyIonTools.DisbaleMonteCarloDeps._parameters, jetTools.RunBTagging._parameters, trigTools.SwitchOnTriggerStandAlone._parameters, coreTools.RemoveAllPATObjectsBut._parameters, trackTools.MakeTrackCandidates._parameters, coreTools.RemoveSpecificPATObjects._parameters, coreTools.RemoveCleaning._parameters, tauTools.AddTauCollection._parameters, coreTools.AddCleaning._parameters, jetTools.AddJetCollection._parameters, jetTools.SwitchJetCollection._parameters, jetTools.AddJetID._parameters, jetTools.SetTagInfos._parameters, jetTools.SwitchJetCorrLevels._parameters, electronTools.AddElectronUserIsolation.getDefaultParameters(), photonTools.AddPhotonUserIsolation.getDefaultParameters(), heavyIonTools.ConfigureHeavyIons.getDefaultParameters(), metTools.AddTcMET.getDefaultParameters(), muonTools.AddMuonUserIsolation.getDefaultParameters(), coreTools.RestrictInputToAOD.getDefaultParameters(), trackTools.MakeAODTrackCandidates.getDefaultParameters(), cmsswVersionTools.Run52xOn51xTrigger.getDefaultParameters(), heavyIonTools.ProductionDefaults.getDefaultParameters(), editorTools.ChangeSource.getDefaultParameters(), metTools.AddPfMET.getDefaultParameters(), coreTools.RunOnData.getDefaultParameters(), trackTools.MakePATTrackCandidates.getDefaultParameters(), cmsswVersionTools.PickRelValInputFiles.getDefaultParameters(), trigTools.SwitchOnTrigger.getDefaultParameters(), coreTools.RemoveMCMatching.getDefaultParameters(), heavyIonTools.SelectionDefaults.getDefaultParameters(), heavyIonTools.DisbaleMonteCarloDeps.getDefaultParameters(), jetTools.RunBTagging.getDefaultParameters(), trigTools.SwitchOnTriggerStandAlone.getDefaultParameters(), coreTools.RemoveAllPATObjectsBut.getDefaultParameters(), trackTools.MakeTrackCandidates.getDefaultParameters(), coreTools.RemoveSpecificPATObjects.getDefaultParameters(), coreTools.RemoveCleaning.getDefaultParameters(), tauTools.AddTauCollection.getDefaultParameters(), coreTools.AddCleaning.getDefaultParameters(), jetTools.AddJetCollection.getDefaultParameters(), jetTools.SwitchJetCollection.getDefaultParameters(), jetTools.AddJetID.getDefaultParameters(), jetTools.SetTagInfos.getDefaultParameters(), jetTools.SwitchJetCorrLevels.getDefaultParameters(), and edm::eventsetup::heterocontainer.insert().

251  def toolCode( self, process ):
252  triggerProducer = self._parameters[ 'triggerProducer' ].value
253  sequence = self._parameters[ 'sequence' ].value
254  hltProcess = self._parameters[ 'hltProcess' ].value
255  outputModule = self._parameters[ 'outputModule' ].value
256 
257  # Load default producer from existing config file, if needed
258  if not hasattr( process, triggerProducer ):
259  if triggerProducer is self.getDefaultParameters()[ 'triggerProducer' ].value:
260  process.load( "PhysicsTools.PatAlgos.triggerLayer1.triggerProducer_cfi" )
261 
262  # Maintain configuration
263  prodSequence = getattr( process, sequence )
264  trigProdMod = getattr( process, triggerProducer )
265  trigProdMod.processName = hltProcess
266  if triggerProducer in _modulesInSequence( process, sequence ):
267  print '%s():'%( self._label )
268  print ' PATTriggerProducer module %s exists already in sequence %s'%( triggerProducer, sequence )
269  print ' ==> entry re-used'
270  print _longLine
271  else:
272  # Sequence arithmetics for PATTriggerProducer module
273  if trigProdMod.onlyStandAlone.value() is False:
274  trigProdMod.onlyStandAlone = True
275  print '%s():'%( self._label )
276  print ' configuration parameter automatically changed'
277  print ' PATTriggerProducer %s.onlyStandAlone --> %s'%( triggerProducer, trigProdMod.onlyStandAlone )
278  print _longLine
279  if hasattr( process, sequence + 'Trigger' ):
280  index = len( getattr( process, sequence + 'Trigger' ).moduleNames() )
281  getattr( process, sequence + 'Trigger' ).insert( index, trigProdMod )
282  else:
283  patTriggerSequence = cms.Sequence( trigProdMod )
284  setattr( process, sequence + 'Trigger', patTriggerSequence )
285  prodSequence *= getattr( process, sequence + 'Trigger' )
286 
287  # Add event content
288  if outputModule is not '':
289  patTriggerEventContent = [ 'keep patTriggerObjectStandAlones_%s_*_%s'%( triggerProducer, process.name_() )
290  ]
291  if hasattr( trigProdMod, 'saveL1Refs' ) and trigProdMod.saveL1Refs.value() is True:
292  patTriggerEventContent += patTriggerL1RefsEventContent
293  getattr( process, outputModule ).outputCommands = _addEventContent( getattr( process, outputModule ).outputCommands, patTriggerEventContent )
def _modulesInSequence
Definition: trigTools.py:34
def _addEventContent
Definition: trigTools.py:38
bool insert(Storage &, ItemType *, const IdTag &)

Member Data Documentation

trigTools.SwitchOnTriggerStandAlone._comment
private

Definition at line 225 of file trigTools.py.

Referenced by metUncertaintyTools.RunMEtUncertainties.__init__().

tuple trigTools.SwitchOnTriggerStandAlone._defaultParameters = dicttypes.SortedKeysDict()
staticprivate

Definition at line 216 of file trigTools.py.

Referenced by HiCoreTools.RestrictInputToAOD.__call__(), HiCoreTools.RemoveMCMatching.__call__(), HiCoreTools.RemoveAllPATObjectsBut.__call__(), HiCoreTools.RemoveSpecificPATObjects.__call__(), trigTools.SwitchOnTriggerStandAlone.__call__(), HiCoreTools.RemoveCleaning.__call__(), trigTools.SwitchOnTriggerMatching.__call__(), HiCoreTools.AddCleaning.__call__(), trigTools.SwitchOnTriggerMatchingStandAlone.__call__(), trigTools.SwitchOnTriggerMatchEmbedding.__call__(), trigTools.RemoveCleaningFromTriggerMatching.__call__(), metUncertaintyTools.RunMEtUncertainties.__call__(), HiCoreTools.RestrictInputToAOD.__init__(), metUncertaintyTools.RunMEtUncertainties.__init__(), HiCoreTools.RemoveMCMatching.__init__(), HiCoreTools.RemoveAllPATObjectsBut.__init__(), HiCoreTools.RemoveSpecificPATObjects.__init__(), trigTools.SwitchOnTriggerStandAlone.__init__(), HiCoreTools.RemoveCleaning.__init__(), trigTools.SwitchOnTriggerMatching.__init__(), HiCoreTools.AddCleaning.__init__(), trigTools.SwitchOnTriggerMatchingStandAlone.__init__(), trigTools.SwitchOnTriggerMatchEmbedding.__init__(), trigTools.RemoveCleaningFromTriggerMatching.__init__(), metUncertaintyTools.RunMEtUncertainties._initializeInputTag(), ConfigToolBase.ConfigToolBase.dumpPython(), ConfigToolBase.ConfigToolBase.getAllowedValues(), HiCoreTools.RestrictInputToAOD.getDefaultParameters(), HiCoreTools.RemoveMCMatching.getDefaultParameters(), metUncertaintyTools.RunMEtUncertainties.getDefaultParameters(), HiCoreTools.RemoveAllPATObjectsBut.getDefaultParameters(), HiCoreTools.RemoveSpecificPATObjects.getDefaultParameters(), trigTools.SwitchOnTriggerStandAlone.getDefaultParameters(), HiCoreTools.RemoveCleaning.getDefaultParameters(), trigTools.SwitchOnTriggerMatching.getDefaultParameters(), HiCoreTools.AddCleaning.getDefaultParameters(), trigTools.SwitchOnTriggerMatchingStandAlone.getDefaultParameters(), trigTools.SwitchOnTriggerMatchEmbedding.getDefaultParameters(), trigTools.RemoveCleaningFromTriggerMatching.getDefaultParameters(), ConfigToolBase.ConfigToolBase.reset(), and ConfigToolBase.ConfigToolBase.setParameter().

string trigTools.SwitchOnTriggerStandAlone._label = 'switchOnTriggerStandAlone'
staticprivate

Definition at line 215 of file trigTools.py.

Referenced by trigTools.SwitchOnTriggerStandAlone.toolCode(), trigTools.SwitchOnTriggerMatching.toolCode(), trigTools.SwitchOnTriggerMatchingStandAlone.toolCode(), trigTools.SwitchOnTriggerMatchEmbedding.toolCode(), and trigTools.RemoveCleaningFromTriggerMatching.toolCode().

trigTools.SwitchOnTriggerStandAlone._parameters
private

Definition at line 224 of file trigTools.py.

Referenced by metUncertaintyTools.RunMEtUncertainties.__init__(), HiCoreTools.RestrictInputToAOD.toolCode(), HiCoreTools.RemoveMCMatching.toolCode(), HiCoreTools.RemoveAllPATObjectsBut.toolCode(), HiCoreTools.RemoveSpecificPATObjects.toolCode(), trigTools.SwitchOnTriggerStandAlone.toolCode(), HiCoreTools.RemoveCleaning.toolCode(), trigTools.SwitchOnTriggerMatching.toolCode(), HiCoreTools.AddCleaning.toolCode(), trigTools.SwitchOnTriggerMatchingStandAlone.toolCode(), trigTools.SwitchOnTriggerMatchEmbedding.toolCode(), trigTools.RemoveCleaningFromTriggerMatching.toolCode(), and metUncertaintyTools.RunMEtUncertainties.toolCode().