CMS 3D CMS Logo

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__ (self, process, triggerProducer=None, path=None, hltProcess=None, outputModule=None)
 
def __init__ (self)
 
def getDefaultParameters (self)
 
def toolCode (self, process)
 

Private Attributes

 _comment
 
 _parameters
 

Static Private Attributes

 _defaultParameters
 
 _label
 

Detailed Description

Enables trigger information in PAT, limited to stand-alone trigger objects
SwitchOnTriggerStandAlone( [cms.Process], triggerProducer = 'patTrigger', path = '', hltProcess = 'HLT', outputModule = 'out' )
- [cms.Process]       : the 'cms.Process'
- 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'
Using None as any argument restores its default value.

Definition at line 191 of file trigTools.py.

Constructor & Destructor Documentation

◆ __init__()

def trigTools.SwitchOnTriggerStandAlone.__init__ (   self)

Definition at line 209 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, tauTools.AddTauCollection._defaultParameters, trackTools.MakeTrackCandidates._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(), Python11ParameterSet.addParameter(), l1t::TriggerSystem.addParameter(), LutXml.addParameter(), ConfigToolBase.ConfigToolBase.addParameter(), and edm::ParameterSet.addParameter().

209  def __init__( self ):
210  ConfigToolBase.__init__( self )
211  self.addParameter( self._defaultParameters, 'triggerProducer', _defaultTriggerProducer, _defaultTriggerProducerComment )
212  self.addParameter( self._defaultParameters, 'path' , _defaultPath , _defaultPathComment )
213  self.addParameter( self._defaultParameters, 'hltProcess' , _defaultHltProcess , _defaultHltProcessComment )
214  self.addParameter( self._defaultParameters, 'outputModule' , _defaultOutputModule , _defaultOutputModuleComment )
215  self._parameters = copy.deepcopy( self._defaultParameters )
216  self._comment = ""
217 
def __init__(self, dataset, job_number, job_id, job_name, isDA, isMC, applyBOWS, applyEXTRACOND, extraconditions, runboundary, lumilist, intlumi, maxevents, gt, allFromGT, alignmentDB, alignmentTAG, apeDB, apeTAG, bowDB, bowTAG, vertextype, tracktype, refittertype, ttrhtype, applyruncontrol, ptcut, CMSSW_dir, the_dir)

Member Function Documentation

◆ __call__()

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

Definition at line 226 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, tauTools.AddTauCollection._defaultParameters, trackTools.MakeTrackCandidates._defaultParameters, jetTools.AddJetCollection._defaultParameters, jetTools.SwitchJetCollection._defaultParameters, jetTools.UpdateJetCollection._defaultParameters, jetTools.AddJetID._defaultParameters, jetTools.SetTagInfos._defaultParameters, SignedImpactParameter3D.apply(), SignedDecayLength3D.apply(), SignedTransverseImpactParameter.apply(), ProcessAcceleratorCUDA.ProcessAcceleratorCUDA.apply(), ProcessAcceleratorROCm.ProcessAcceleratorROCm.apply(), gen::PhotosInterfaceBase.apply(), SurveyParameters.apply(), DummyOOTPileupCorrection.apply(), MatrixReader.MatrixReader.apply, gen::PhotosppInterface.apply(), FWPSetCellEditor.apply(), BeamSpotAlignmentParameters.apply(), RigidBodyAlignmentParameters.apply(), FWGUIEventFilter.apply(), DeviationsFromFileSensor2D.apply(), AlignmentParameters.apply(), ConfigToolBase.ConfigToolBase.apply(), BowedSurfaceAlignmentParameters.apply(), OOTPileupCorrData.apply(), ProcessAcceleratorAlpaka.ProcessAcceleratorAlpaka.apply(), AbsOOTPileupCorrection.apply(), TwoBowedSurfacesAlignmentParameters.apply(), reco::modules::TrackerTrackHitFilter::Rule.apply(), cmsswVersionTools.PickRelValInputFiles.apply(), models.RegExp.apply(), npstat::ArrayND< Numeric, StackLen, StackDim >.apply(), ArrayND< Num1, Len1, Dim1 >.apply(), ArrayND< Numeric, Len2, Dim2 >.apply(), npstat::ArrayND< Numeric >.apply(), ArrayND< Num2, Len2, Dim2 >.apply(), ArrayND< Numeric, Len, Dim >.apply(), ArrayND< Accumulator >.apply(), Config.ProcessModifier.apply(), Config.ProcessAccelerator.apply(), Config.ProcessAcceleratorTest.apply(), Config.ProcessAcceleratorTest2.apply(), HGCalCassette.setParameter(), PedeReader.setParameter(), QIE8Simulator.setParameter(), AbsElectronicODERHS.setParameter(), SiStripLorentzAngleCalibration.setParameter(), IntegratedCalibrationBase.setParameter(), SiPixelLorentzAngleCalibration.setParameter(), SiStripBackplaneCalibration.setParameter(), fit::RootMinuit< Function >.setParameter(), and ConfigToolBase.ConfigToolBase.setParameter().

Referenced by trigTools.SwitchOnTriggerStandAlone.getDefaultParameters().

226  ):
227  if triggerProducer is None:
228  triggerProducer = self._defaultParameters[ 'triggerProducer' ].value
229  if path is None:
230  path = self._defaultParameters[ 'path' ].value
231  if hltProcess is None:
232  hltProcess = self._defaultParameters[ 'hltProcess' ].value
233  if outputModule is None:
234  outputModule = self._defaultParameters[ 'outputModule' ].value
235  self.setParameter( 'triggerProducer', triggerProducer )
236  self.setParameter( 'path' , path )
237  self.setParameter( 'hltProcess' , hltProcess )
238  self.setParameter( 'outputModule' , outputModule )
239  self.apply( process )
240 

◆ getDefaultParameters()

def trigTools.SwitchOnTriggerStandAlone.getDefaultParameters (   self)

◆ toolCode()

def trigTools.SwitchOnTriggerStandAlone.toolCode (   self,
  process 
)

Definition at line 241 of file trigTools.py.

References trigTools._addEventContent(), metTools.AddMETCollection._label, trackTools.MakeAODTrackCandidates._label, heavyIonTools.ConfigureHeavyIons._label, ProcessAcceleratorCUDA.ProcessAcceleratorCUDA._label, ProcessAcceleratorROCm.ProcessAcceleratorROCm._label, coreTools.RunOnData._label, heavyIonTools.ProductionDefaults._label, ConfigToolBase.ConfigToolBase._label, LHECOMWeightProducer._label, cmsswVersionTools.PickRelValInputFiles._label, coreTools.RemoveMCMatching._label, trackTools.MakePATTrackCandidates._label, trigTools.SwitchOnTrigger._label, heavyIonTools.SelectionDefaults._label, heavyIonTools.DisbaleMonteCarloDeps._label, trigTools.SwitchOnTriggerStandAlone._label, tauTools.AddTauCollection._label, trackTools.MakeTrackCandidates._label, jetTools.AddJetCollection._label, jetTools.SwitchJetCollection._label, jetTools.UpdateJetCollection._label, jetTools.AddJetID._label, jetTools.SetTagInfos._label, trigTools._modulesInPath(), heavyIonTools.ConfigureHeavyIons._parameters, trackTools.MakeAODTrackCandidates._parameters, coreTools.RunOnData._parameters, metTools.AddMETCollection._parameters, heavyIonTools.ProductionDefaults._parameters, ConfigToolBase.ConfigToolBase._parameters, TAbsFitConstraint._parameters, TAbsFitParticle._parameters, cmsswVersionTools.PickRelValInputFiles._parameters, coreTools.RemoveMCMatching._parameters, trackTools.MakePATTrackCandidates._parameters, trigTools.SwitchOnTrigger._parameters, heavyIonTools.SelectionDefaults._parameters, heavyIonTools.DisbaleMonteCarloDeps._parameters, trigTools.SwitchOnTriggerStandAlone._parameters, tauTools.AddTauCollection._parameters, trackTools.MakeTrackCandidates._parameters, jetTools.AddJetCollection._parameters, jetTools.SwitchJetCollection._parameters, jetTools.UpdateJetCollection._parameters, jetTools.AddJetID._parameters, jetTools.SetTagInfos._parameters, helpers.addToProcessAndTask(), helpers.getPatAlgosToolsTask(), and print().

241  def toolCode( self, process ):
242 
243  task = getPatAlgosToolsTask(process)
244 
245  triggerProducer = self._parameters[ 'triggerProducer' ].value
246  path = self._parameters[ 'path' ].value
247  hltProcess = self._parameters[ 'hltProcess' ].value
248  outputModule = self._parameters[ 'outputModule' ].value
249 
250  # Load default producer from existing config file, if needed
251  if not hasattr( process, triggerProducer ):
253  addToProcessAndTask(triggerProducer, patTrigger.clone( onlyStandAlone = True ), process, task)
254  else:
255  print('%s():'%( self._label ))
256  print(' PATTriggerProducer module \'%s\' exists already in process'%( triggerProducer ))
257  print(' ==> entry re-used')
258  print(_longLine)
259 
260  # Maintain configuration
261  trigProdMod = getattr( process, triggerProducer )
262  trigProdMod.processName = hltProcess
263  if path != '':
264  if not hasattr( process, path ):
265  prodPath = cms.Path( trigProdMod )
266  setattr( process, path, prodPath )
267  print('%s():'%( self._label ))
268  print(' Path \'%s\' does not exist in process'%( path ))
269  print(' ==> created')
270  print(_longLine)
271  elif not triggerProducer in _modulesInPath( process, path ):
272  prodPath = getattr( process, path )
273  prodPath += trigProdMod
274 
275  # Add event content
276  if outputModule != '':
277  patTriggerEventContent = [ 'keep patTriggerObjectStandAlones_%s_*_%s'%( triggerProducer, process.name_() )
278  ]
279  if ( hasattr( trigProdMod, 'saveL1Refs' ) and trigProdMod.saveL1Refs.value() is True ):
280  patTriggerEventContent += patTriggerL1RefsEventContent
281  getattr( process, outputModule ).outputCommands = _addEventContent( getattr( process, outputModule ).outputCommands, patTriggerEventContent )
282 
def addToProcessAndTask(label, module, process, task)
Definition: helpers.py:28
def _addEventContent(outputCommands, eventContent)
Definition: trigTools.py:31
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
def getPatAlgosToolsTask(process)
Definition: helpers.py:13
def _modulesInPath(process, pathLabel)
Definition: trigTools.py:27

Member Data Documentation

◆ _comment

trigTools.SwitchOnTriggerStandAlone._comment
private

Definition at line 216 of file trigTools.py.

◆ _defaultParameters

trigTools.SwitchOnTriggerStandAlone._defaultParameters
staticprivate

◆ _label

trigTools.SwitchOnTriggerStandAlone._label
staticprivate

◆ _parameters

trigTools.SwitchOnTriggerStandAlone._parameters
private

Definition at line 215 of file trigTools.py.

Referenced by runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.ak4JetReclustering(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.createSmearedJetModule(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.extractMET(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.getCorrectedMET(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.getMETUncertainties(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.getVariations(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.jetCleaning(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.jetConfiguration(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.miniAODConfiguration(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.miniAODConfigurationPost(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.miniAODConfigurationPre(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.recomputeRawMetFromPfcs(), runJetUncertainties.RunJetUncertainties.toolCode(), trigTools.SwitchOnTriggerStandAlone.toolCode(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.toolCode(), trigTools.SwitchOnTriggerMatching.toolCode(), trigTools.SwitchOnTriggerMatchingStandAlone.toolCode(), trigTools.SwitchOnTriggerMatchEmbedding.toolCode(), and runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.updateJECs().