CMS 3D CMS Logo

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

Public Member Functions

def __init__
 
def beginLoop
 
def declareHandles
 
def process
 

Public Attributes

 collMatchDRCut
 
 collMatchSelectors
 
 label
 
 match1To1
 
 processName
 
 trgObjSelectors
 

Static Public Attributes

float collMatchDRCut = 0.3
 
list collMatchSelectors = []
 
 collToMatch = None,
 
string label = 'DefaultTrigObjSelection'
 
string processName = 'PAT'
 
list trgObjSelectors = []
 
 univoqueMatching = True,
 
 unpackPathNames = True,
 
 verbose = False
 

Detailed Description

Definition at line 9 of file TriggerMatchAnalyzer.py.

Constructor & Destructor Documentation

def core.TriggerMatchAnalyzer.TriggerMatchAnalyzer.__init__ (   self,
  cfg_ana,
  cfg_comp,
  looperName 
)

Definition at line 10 of file TriggerMatchAnalyzer.py.

10 
11  def __init__(self, cfg_ana, cfg_comp, looperName ):
12  super(TriggerMatchAnalyzer,self).__init__(cfg_ana,cfg_comp,looperName)
13  self.processName = getattr(self.cfg_ana,"processName","PAT")
14  self.unpackPathNames = getattr(self.cfg_ana,"unpackPathNames",True)
15  self.label = self.cfg_ana.label
16  self.trgObjSelectors = []
17  self.trgObjSelectors.extend(getattr(self.cfg_ana,"trgObjSelectors",[]))
18  self.collToMatch = getattr(self.cfg_ana,"collToMatch",None)
19  self.collMatchSelectors = []
20  self.collMatchSelectors.extend(getattr(self.cfg_ana,"collMatchSelectors",[]))
21  self.collMatchDRCut = getattr(self.cfg_ana,"collMatchDRCut",0.3)
22  if self.collToMatch and not hasattr(self.cfg_ana,"univoqueMatching"): raise RuntimeError, "Please specify if the matching to trigger objects should be 1-to-1 or 1-to-many"
23  self.match1To1 = getattr(self.cfg_ana,"univoqueMatching",True)

Member Function Documentation

def core.TriggerMatchAnalyzer.TriggerMatchAnalyzer.beginLoop (   self,
  setup 
)

Definition at line 29 of file TriggerMatchAnalyzer.py.

29 
30  def beginLoop(self, setup):
31  super(TriggerMatchAnalyzer,self).beginLoop(setup)
def core.TriggerMatchAnalyzer.TriggerMatchAnalyzer.declareHandles (   self)

Definition at line 24 of file TriggerMatchAnalyzer.py.

References core.AutoHandle.AutoHandle.handles, core.Analyzer.Analyzer.handles, HTTP.RequestManager.handles, core.TriggerBitFilter.TriggerBitFilter.processName, core.TriggerMatchAnalyzer.TriggerMatchAnalyzer.processName, HcalIsoTrkAnalyzer.processName, IsoTrackCalibration.processName, core.TriggerBitAnalyzer.TriggerBitAnalyzer.processName, IsoTrig.processName, EgammaHLTValidationUtils.EgammaDQMModuleMaker.processName, and Types.InputTag.processName.

24 
25  def declareHandles(self):
26  super(TriggerMatchAnalyzer, self).declareHandles()
27  self.handles['TriggerBits'] = AutoHandle( ('TriggerResults','','HLT'), 'edm::TriggerResults' )
28  self.handles['TriggerObjects'] = AutoHandle( ('selectedPatTrigger','',self.processName), 'std::vector<pat::TriggerObjectStandAlone>' )
def core.TriggerMatchAnalyzer.TriggerMatchAnalyzer.process (   self,
  event 
)

Definition at line 32 of file TriggerMatchAnalyzer.py.

References core.TriggerMatchAnalyzer.TriggerMatchAnalyzer.collMatchDRCut, core.TriggerMatchAnalyzer.TriggerMatchAnalyzer.collMatchSelectors, core.TriggerMatchAnalyzer.TriggerMatchAnalyzer.collToMatch, core.AutoHandle.AutoHandle.handles, core.Analyzer.Analyzer.handles, HTTP.RequestManager.handles, join(), core.AutoHandle.AutoHandle.label, SubDetParams.label, ElectronLikelihoodCategoryData.label, entry< T >.label, SiPixelFedFillerWordEventNumber.label, TtEvent::HypoClassKeyStringToEnum.label, HcalLutSet.label, DTDQMHarvesting.DTDQMHarvesting.label, DTVDriftSegmentCalibration.DTVDriftSegmentCalibration.label, DTVDriftMeanTimerCalibration.DTVDriftMeanTimerCalibration.label, DTAnalysisResiduals.DTAnalysisResiduals.label, l1t::L1GtBoardTypeStringToEnum.label, L1GtBoardTypeStringToEnum.label, DTDQMValidation.DTDQMValidation.label, SiPixelDigiToRaw.label, DTResidualCalibration.DTResidualCalibration.label, DTTTrigValid.DTTTrigValid.label, L1GtObjectStringToEnum.label, muon::SelectionTypeStringToEnum.label, ConverterTester.label, DTTTrigResidualCorr.DTTTrigResidualCorr.label, SiPixelRawToDigi.label, HLTVertexPerformanceAnalyzer.label, TaggingVariablePlotter::VariableConfig.label, FWPSetTableManager::PSetData.label, core.TriggerMatchAnalyzer.TriggerMatchAnalyzer.label, MatrixInjector.MatrixInjector.label, l1t::L1GtPsbQuadStringToEnum.label, L1GtPsbQuadStringToEnum.label, HLTBTagPerformanceAnalyzer.label, ValidationMisalignedTracker.label, MatrixUtil.InputInfo.label, l1t::GtConditionTypeStringToEnum.label, L1GtConditionTypeStringToEnum.label, l1t::GtConditionCategoryStringToEnum.label, L1GtConditionCategoryStringToEnum.label, FastTimerService::LuminosityDescription.label, PhysicsTools::Calibration::Comparator.label, conddblib.GlobalTagMap.label, core.TriggerMatchAnalyzer.TriggerMatchAnalyzer.match1To1, deltar.matchObjectCollection(), deltar.matchObjectCollection3(), core.Analyzer.Analyzer.readCollections(), EgammaValidation_Wenu_cff.sel, core.TriggerMatchAnalyzer.TriggerMatchAnalyzer.trgObjSelectors, CSCTFanalyzer.verbose, heppy::Davismt2.verbose, CalibratedPatElectronProducer.verbose, DQMGenericTnPClient.verbose, dqmTnP::AbstractFitter.verbose, CalibratedElectronProducer.verbose, confdbOfflineConverter.OfflineConverter.verbose, ElectronStudy.verbose, MuonMillepedeAlgorithm.verbose, DeviationsFromFileSensor2D.verbose, core.TriggerMatchAnalyzer.TriggerMatchAnalyzer.verbose, HIPAlignmentAlgorithm.verbose, FFTJetLookupTableESProducer< CT >.verbose, FFTJetCorrectionESProducer< CT >.verbose, and OpticalObject.verbose.

Referenced by ConfigBuilder.ConfigBuilder.addExtraStream(), ConfigBuilder.ConfigBuilder.completeInputCommand(), ConfigBuilder.ConfigBuilder.doNotInlineEventContent(), ConfigBuilder.ConfigBuilder.PrintAllModules.leave(), ConfigBuilder.ConfigBuilder.prepare_HLT(), ConfigBuilder.ConfigBuilder.prepare_LHE(), ConfigBuilder.ConfigBuilder.prepare_PATFILTER(), ConfigBuilder.ConfigBuilder.prepare_VALIDATION(), ConfigBuilder.ConfigBuilder.renameHLTprocessInSequence(), ConfigBuilder.ConfigBuilder.renameInputTagsInSequence(), and ConfigBuilder.ConfigBuilder.scheduleSequence().

32 
33  def process(self, event):
34  self.readCollections( event.input )
35  triggerBits = self.handles['TriggerBits'].product()
36  allTriggerObjects = self.handles['TriggerObjects'].product()
37  names = event.input.object().triggerNames(triggerBits)
38  for ob in allTriggerObjects: ob.unpackPathNames(names)
39  triggerObjects = [ob for ob in allTriggerObjects if False not in [sel(ob) for sel in self.trgObjSelectors]]
40 
41  setattr(event,'trgObjects_'+self.label,triggerObjects)
42 
43  if self.collToMatch:
44  tcoll = getattr(event,self.collToMatch)
45  doubleandselector = lambda lep,ob: False if False in [sel(lep,ob) for sel in self.collMatchSelectors] else True
46  pairs = matchObjectCollection3(tcoll,triggerObjects,deltaRMax=self.collMatchDRCut,filter=doubleandselector) if self.match1To1 else matchObjectCollection(tcoll,triggerObjects,self.collMatchDRCut,filter=doubleandselector)
47  for lep in tcoll: setattr(lep,'matchedTrgObj'+self.label,pairs[lep])
48 
49  if self.verbose:
50  print 'Verbose debug for triggerMatchAnalyzer %s'%self.label
51  for ob in getattr(event,'trgObjects_'+self.label):
52  types = ", ".join([str(f) for f in ob.filterIds()])
53  filters = ", ".join([str(f) for f in ob.filterLabels()])
54  paths = ", ".join([("%s***" if f in set(ob.pathNames(True)) else "%s")%f for f in ob.pathNames()]) # asterisks indicate final paths fired by this object, see pat::TriggerObjectStandAlone class
55  print 'Trigger object: pt=%.2f, eta=%.2f, phi=%.2f, collection=%s, type_ids=%s, filters=%s, paths=%s'%(ob.pt(),ob.eta(),ob.phi(),ob.collection(),types,filters,paths)
56  if self.collToMatch:
57  for lep in tcoll:
58  mstring = 'None'
59  if getattr(lep,'matchedTrgObj'+self.label):
60  mstring = 'trigger obj with pt=%.2f, eta=%.2f, phi=%.2f, collection=%s'%(ob.pt(),ob.eta(),ob.phi(),ob.collection())
61  print 'Lepton pt=%.2f, eta=%.2f, phi=%.2f matched to %s'%(lep.pt(),lep.eta(),lep.phi(),mstring)
62 
63  return True
64 
65 
setattr(TriggerMatchAnalyzer,"defaultConfig",cfg.Analyzer(
def matchObjectCollection
Definition: deltar.py:152
static std::string join(char **cmd)
Definition: RemoteFile.cc:18
def matchObjectCollection3
Definition: deltar.py:41

Member Data Documentation

core.TriggerMatchAnalyzer.TriggerMatchAnalyzer.collMatchDRCut

Definition at line 20 of file TriggerMatchAnalyzer.py.

float core.TriggerMatchAnalyzer.TriggerMatchAnalyzer.collMatchDRCut = 0.3
static

Definition at line 73 of file TriggerMatchAnalyzer.py.

Referenced by core.TriggerMatchAnalyzer.TriggerMatchAnalyzer.process().

core.TriggerMatchAnalyzer.TriggerMatchAnalyzer.collMatchSelectors

Definition at line 18 of file TriggerMatchAnalyzer.py.

list core.TriggerMatchAnalyzer.TriggerMatchAnalyzer.collMatchSelectors = []
static

Definition at line 72 of file TriggerMatchAnalyzer.py.

Referenced by core.TriggerMatchAnalyzer.TriggerMatchAnalyzer.process().

core.TriggerMatchAnalyzer.TriggerMatchAnalyzer.collToMatch = None,
static

Definition at line 71 of file TriggerMatchAnalyzer.py.

Referenced by core.TriggerMatchAnalyzer.TriggerMatchAnalyzer.process().

core.TriggerMatchAnalyzer.TriggerMatchAnalyzer.label

Definition at line 14 of file TriggerMatchAnalyzer.py.

Referenced by Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor._sort_list(), python.rootplot.root2matplotlib.Hist.bar(), python.rootplot.root2matplotlib.Hist.barh(), python.rootplot.root2matplotlib.Hist.errorbar(), python.rootplot.root2matplotlib.Hist.errorbarh(), Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor.foundIn(), Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor.fullFilename(), Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor.inputEventContent(), Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor.outputEventContent(), Vispa.Plugins.ConfigEditor.ToolDataAccessor.ToolDataAccessor.properties(), Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.properties(), Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor.properties(), Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor.readConnections(), Vispa.Plugins.ConfigEditor.ToolDataAccessor.ToolDataAccessor.updateProcess(), and Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor.usedBy().

string core.TriggerMatchAnalyzer.TriggerMatchAnalyzer.label = 'DefaultTrigObjSelection'
static

Definition at line 67 of file TriggerMatchAnalyzer.py.

Referenced by Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor._sort_list(), python.rootplot.root2matplotlib.Hist.bar(), python.rootplot.root2matplotlib.Hist.barh(), python.rootplot.root2matplotlib.Hist.errorbar(), python.rootplot.root2matplotlib.Hist.errorbarh(), Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor.foundIn(), Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor.fullFilename(), Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor.inputEventContent(), Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor.outputEventContent(), core.TriggerMatchAnalyzer.TriggerMatchAnalyzer.process(), Vispa.Plugins.ConfigEditor.ToolDataAccessor.ToolDataAccessor.properties(), Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.properties(), Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor.properties(), Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor.readConnections(), Vispa.Plugins.ConfigEditor.ToolDataAccessor.ToolDataAccessor.updateProcess(), and Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor.usedBy().

core.TriggerMatchAnalyzer.TriggerMatchAnalyzer.match1To1

Definition at line 22 of file TriggerMatchAnalyzer.py.

Referenced by core.TriggerMatchAnalyzer.TriggerMatchAnalyzer.process().

core.TriggerMatchAnalyzer.TriggerMatchAnalyzer.processName

Definition at line 12 of file TriggerMatchAnalyzer.py.

string core.TriggerMatchAnalyzer.TriggerMatchAnalyzer.processName = 'PAT'
static

Definition at line 68 of file TriggerMatchAnalyzer.py.

Referenced by core.TriggerMatchAnalyzer.TriggerMatchAnalyzer.declareHandles().

core.TriggerMatchAnalyzer.TriggerMatchAnalyzer.trgObjSelectors

Definition at line 15 of file TriggerMatchAnalyzer.py.

list core.TriggerMatchAnalyzer.TriggerMatchAnalyzer.trgObjSelectors = []
static

Definition at line 70 of file TriggerMatchAnalyzer.py.

Referenced by core.TriggerMatchAnalyzer.TriggerMatchAnalyzer.process().

core.TriggerMatchAnalyzer.TriggerMatchAnalyzer.univoqueMatching = True,
static

Definition at line 74 of file TriggerMatchAnalyzer.py.

core.TriggerMatchAnalyzer.TriggerMatchAnalyzer.unpackPathNames = True,
static

Definition at line 69 of file TriggerMatchAnalyzer.py.

core.TriggerMatchAnalyzer.TriggerMatchAnalyzer.verbose = False
static

Definition at line 75 of file TriggerMatchAnalyzer.py.

Referenced by python.diff_provenance.difference.list_diff(), python.diffProv.difference.list_diff(), python.diff_provenance.difference.module_diff(), python.diffProv.difference.module_diff(), python.diff_provenance.difference.onefilemodules(), python.diffProv.difference.onefilemodules(), core.TriggerMatchAnalyzer.TriggerMatchAnalyzer.process(), and objects.VertexAnalyzer.VertexAnalyzer.process().