Skip to content

Commit

Permalink
Merge pull request #87 from senkin/TriggerWorkflow
Browse files Browse the repository at this point in the history
Trigger workflow
  • Loading branch information
jjacob committed Jun 11, 2014
2 parents 3ace596 + b2eb4dc commit 7186eb1
Show file tree
Hide file tree
Showing 21 changed files with 503 additions and 189 deletions.
24 changes: 24 additions & 0 deletions interface/BristolNTuple_TriggerObjects.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#ifndef BristolNTupleTriggerObjects
#define BristolNTupleTriggerObjects
#include <string>

#include "FWCore/Framework/interface/EDProducer.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/Utilities/interface/InputTag.h"
#include "HLTrigger/HLTcore/interface/HLTConfigProvider.h"

class BristolNTuple_TriggerObjects : public edm::EDProducer {
public:
explicit BristolNTuple_TriggerObjects(const edm::ParameterSet&);

private:
void produce( edm::Event &, const edm::EventSetup & );
void beginRun( edm::Run &, const edm::EventSetup & );
//unsigned int findTrigger(const std::string& triggerWildCard);

const edm::InputTag hltObjectsInputTag, hltObjectOfInterest;
HLTConfigProvider hltConfig;
const std::string prefix, suffix;
};

#endif

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef BristolTopPairElectronPlusJets2012SelectionFilter
#define BristolTopPairElectronPlusJets2012SelectionFilter
#ifndef BristolTopPairElectronPlusJetsSelectionFilter
#define BristolTopPairElectronPlusJetsSelectionFilter

#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/EDFilter.h"
Expand Down Expand Up @@ -50,10 +50,10 @@ const std::string StringSteps[NUMBER_OF_SELECTION_STEPS] = { //
};
}

class TopPairElectronPlusJets2012SelectionFilter: public edm::EDFilter {
class TopPairElectronPlusJetsSelectionFilter: public edm::EDFilter {
public:
explicit TopPairElectronPlusJets2012SelectionFilter(const edm::ParameterSet&);
virtual ~TopPairElectronPlusJets2012SelectionFilter();
explicit TopPairElectronPlusJetsSelectionFilter(const edm::ParameterSet&);
virtual ~TopPairElectronPlusJetsSelectionFilter();

virtual void beginJob();
virtual bool filter(edm::Event&, const edm::EventSetup&);
Expand Down Expand Up @@ -103,7 +103,7 @@ class TopPairElectronPlusJets2012SelectionFilter: public edm::EDFilter {
double min1JetPt_, min2JetPt_, min3JetPt_, min4JetPt_;

double tightElectronIso_, looseElectronIso_, looseMuonIso_;
bool useDeltaBetaCorrectionsForMuons_, useDeltaBetaCorrectionsForElectrons_, useRhoActiveAreaCorrections_, useMETFilters_, useEEBadScFilter_;
bool useDeltaBetaCorrectionsForMuons_, useDeltaBetaCorrectionsForElectrons_, useRhoActiveAreaCorrections_, useMETFilters_, useEEBadScFilter_, tagAndProbeStudies_, dropTriggerSelection_;

std::string prefix_, MCSampleTag_;

Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef BristolTopPairMuonPlusJets2012SelectionFilter
#define BristolTopPairMuonPlusJets2012SelectionFilter
#ifndef BristolTopPairMuonPlusJetsSelectionFilter
#define BristolTopPairMuonPlusJetsSelectionFilter

#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/EDFilter.h"
Expand Down Expand Up @@ -48,10 +48,10 @@ const std::string StringSteps[NUMBER_OF_SELECTION_STEPS] = { //
};
}

class TopPairMuonPlusJets2012SelectionFilter: public edm::EDFilter {
class TopPairMuonPlusJetsSelectionFilter: public edm::EDFilter {
public:
explicit TopPairMuonPlusJets2012SelectionFilter(const edm::ParameterSet&);
virtual ~TopPairMuonPlusJets2012SelectionFilter();
explicit TopPairMuonPlusJetsSelectionFilter(const edm::ParameterSet&);
virtual ~TopPairMuonPlusJetsSelectionFilter();

virtual void beginJob();
virtual bool filter(edm::Event&, const edm::EventSetup&);
Expand Down Expand Up @@ -99,7 +99,7 @@ class TopPairMuonPlusJets2012SelectionFilter: public edm::EDFilter {
double min1JetPt_, min2JetPt_, min3JetPt_, min4JetPt_;

double tightMuonIso_, looseElectronIso_, looseMuonIso_;
bool useDeltaBetaCorrectionsForMuons_, useDeltaBetaCorrectionsForElectrons_, useRhoActiveAreaCorrections_, useMETFilters_, useEEBadScFilter_;
bool useDeltaBetaCorrectionsForMuons_, useDeltaBetaCorrectionsForElectrons_, useRhoActiveAreaCorrections_, useMETFilters_, useEEBadScFilter_, tagAndProbeStudies_, dropTriggerSelection_;

std::string prefix_, MCSampleTag_;

Expand Down
4 changes: 2 additions & 2 deletions python/BTagWeight_Producer_cfi.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import FWCore.ParameterSet.Config as cms

eventWeightBtag = cms.EDProducer("BTagWeight_Producer",
numberOfTagsInput = cms.InputTag( 'TopPairElectronPlusJets2012Selection.NumberOfBtags' ),
jetInput = cms.InputTag( 'TopPairElectronPlusJets2012Selection.cleanedJets' ),
numberOfTagsInput = cms.InputTag( 'TopPairElectronPlusJetsSelection.NumberOfBtags' ),
jetInput = cms.InputTag( 'TopPairElectronPlusJetsSelection.cleanedJets' ),
prefix = cms.string('Weights.'),
targetBtagMultiplicity = cms.uint32(0),
BJetSystematic = cms.int32(0),
Expand Down
6 changes: 3 additions & 3 deletions python/BristolNTuple_GlobalEventVars_cfi.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import FWCore.ParameterSet.Config as cms

rootTupleGlobalEventVars = cms.EDProducer('BristolNTuple_GlobalEventVars',
jetInputTag=cms.InputTag('topPairEPlusJetsSelection', 'TopPairElectronPlusJets2012Selection.cleanedJets'),
signalLeptonInputTag=cms.InputTag('topPairEPlusJetsSelection', 'TopPairElectronPlusJets2012Selection.signalElectron'),
signalLeptonIndexInputTag=cms.InputTag('topPairEPlusJetsSelection', 'TopPairElectronPlusJets2012Selection.signalElectronIndex'),
jetInputTag=cms.InputTag('topPairEPlusJetsSelection', 'TopPairElectronPlusJetsSelection.cleanedJets'),
signalLeptonInputTag=cms.InputTag('topPairEPlusJetsSelection', 'TopPairElectronPlusJetsSelection.signalElectron'),
signalLeptonIndexInputTag=cms.InputTag('topPairEPlusJetsSelection', 'TopPairElectronPlusJetsSelection.signalElectronIndex'),
metInputTag=cms.InputTag('patMETsPFlow'),
Prefix=cms.string('Event.'),
Suffix=cms.string(''),
Expand Down
67 changes: 67 additions & 0 deletions python/BristolNTuple_TriggerObjects_cfi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
import FWCore.ParameterSet.Config as cms

# electron+jets trigger objects
rootTupleTriggerObjectElectronLeg = cms.EDProducer("BristolNTuple_TriggerObjects",
HLTObjectsInputTag = cms.InputTag('hltTriggerSummaryAOD','','HLT'),
Prefix=cms.string('TriggerObjectElectronLeg.'),
Suffix=cms.string(''),
HLTObjectOfInterest = cms.InputTag('hltEle25CaloIdVTTrkIdTDphiFilter','','HLT'), # electron leg of Ele25+TriJet trigger, runs 16404-165633
)

rootTupleTriggerObjectElectronIsoLeg = cms.EDProducer("BristolNTuple_TriggerObjects",
HLTObjectsInputTag = cms.InputTag('hltTriggerSummaryAOD','','HLT'),
Prefix=cms.string('TriggerObjectElectronIsoLeg.'),
Suffix=cms.string(''),
HLTObjectOfInterest = cms.InputTag('hltEle25CaloIdVTTrkIdTCaloIsoTTrkIsoTTrackIsolFilter','','HLT'), # electron leg of Ele25+TriJet iso trigger, runs 165970-180252
)

rootTupleTriggerObjectHadronLeg = cms.EDProducer("BristolNTuple_TriggerObjects",
HLTObjectsInputTag = cms.InputTag('hltTriggerSummaryAOD','','HLT'),
Prefix=cms.string('TriggerObjectHadronLeg.'),
Suffix=cms.string(''),
HLTObjectOfInterest = cms.InputTag('hltEle25CaloIdVTTrkIdTCentralTriJet30Cleaned','','HLT'), # hadron leg of Ele25+TriJet trigger, runs 16404-165633
)

rootTupleTriggerObjectHadronIsoLeg = cms.EDProducer("BristolNTuple_TriggerObjects",
HLTObjectsInputTag = cms.InputTag('hltTriggerSummaryAOD','','HLT'),
Prefix=cms.string('TriggerObjectHadronIsoLeg.'),
Suffix=cms.string(''),
HLTObjectOfInterest = cms.InputTag('hltEle25CaloIdVTCaloIsoTTrkIdTTrkIsoTCentralTriJet30EleCleaned','','HLT'), # hadron leg of Ele25+TriJet iso trigger, runs 165970-178380
)

rootTupleTriggerObjectHadronPFIsoLeg = cms.EDProducer("BristolNTuple_TriggerObjects",
HLTObjectsInputTag = cms.InputTag('hltTriggerSummaryAOD','','HLT'),
Prefix=cms.string('TriggerObjectHadronPFIsoLeg.'),
Suffix=cms.string(''),
HLTObjectOfInterest = cms.InputTag('hltEle25CaloIdVTCaloIsoTTrkIdTTrkIsoTTriCentralPFJet30EleCleaned','','HLT'), # hadron leg of Ele25+TriPFJet iso trigger, runs 178420-180252
)

# single muon trigger objects
rootTupleTriggerObjectMuon1 = cms.EDProducer("BristolNTuple_TriggerObjects",
HLTObjectsInputTag = cms.InputTag('hltTriggerSummaryAOD','','HLT'),
Prefix=cms.string('TriggerObjectMuon1.'),
Suffix=cms.string(''),
HLTObjectOfInterest = cms.InputTag('hltSingleMuIsoL3IsoFiltered24','','HLT'), # muon object of SingleMu24 trigger, V1-V7, runs 160404-167913
)

rootTupleTriggerObjectMuon2 = cms.EDProducer("BristolNTuple_TriggerObjects",
HLTObjectsInputTag = cms.InputTag('hltTriggerSummaryAOD','','HLT'),
Prefix=cms.string('TriggerObjectMuon2.'),
Suffix=cms.string(''),
HLTObjectOfInterest = cms.InputTag('hltSingleMuL2QualIsoL3IsoFiltered24','','HLT'), # muon object of SingleMu24 trigger, V8, runs 170249-173198
)

rootTupleTriggerObjectMuon2p1 = cms.EDProducer("BristolNTuple_TriggerObjects",
HLTObjectsInputTag = cms.InputTag('hltTriggerSummaryAOD','','HLT'),
Prefix=cms.string('TriggerObjectMuon2p1.'),
Suffix=cms.string(''),
HLTObjectOfInterest = cms.InputTag('hltL3IsoL1sMu14Eta2p1L1f0L2f14QL2IsoL3f24L3IsoFiltered','','HLT'), # muon object of SingleMu24_eta2p1 trigger, runs 173236-190456
)

# quad jet trigger objects
rootTupleTriggerObjectQuadJets = cms.EDProducer("BristolNTuple_TriggerObjects",
HLTObjectsInputTag = cms.InputTag('hltTriggerSummaryAOD','','HLT'),
Prefix=cms.string('TriggerObjectQuadJets.'),
Suffix=cms.string(''),
HLTObjectOfInterest = cms.InputTag('hltQuadJet70','','HLT'), # from QuadJet70 trigger
)
20 changes: 19 additions & 1 deletion python/NTupleTools_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,24 @@
VarParsing.varType.string,
"HLT process name to use.")

options.register ('writeTriggerObjects',
False,
VarParsing.multiplicity.singleton,
VarParsing.varType.bool,
"Include trigger objects of interests")

options.register ('applyZselection',
False,
VarParsing.multiplicity.singleton,
VarParsing.varType.bool,
"Replace dilepton veto with Z mass window requirement for tag and probe studies")

options.register ('dropTriggerSelection',
False,
VarParsing.multiplicity.singleton,
VarParsing.varType.bool,
"Remove trigger selection for trigger studies")

options.register ('writeFat',
False,
VarParsing.multiplicity.singleton,
Expand Down Expand Up @@ -171,7 +189,7 @@
GLOBALTAG_MC = 'START53_V21::All' #TO BE UPDATED TO RELEVANT 5_3_X 2011 7TEV PRODUCTION GLOBAL TAGS WHEN AVAILABLE
FILETAG = '53X'
TEST_DATA_FILE = 'file:///storage/TopQuarkGroup/test/ElectronHad_Run2011A-12Oct2013-v1_AOD.root' #test file for 2011 7TEV RunA Oct2013 re-reco
TEST_MC_FILE = '' # NOT AVAILABLE YET
TEST_MC_FILE = 'file:///storage/TopQuarkGroup/test/TTJets_TuneZ2_7TeV-madgraph-tauola_Summer11LegDR_53X_AODSIM.root'
elif options.CMSSW == '44X':
GLOBALTAG_DATA = 'GR_R_44_V15::All'
GLOBALTAG_MC = 'START44_V13::All'
Expand Down
38 changes: 34 additions & 4 deletions python/NTupler_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,17 @@ def setup_ntupler(process, cms, options):
#PF photons
process.rootTuplePhotons.InputTag = cms.InputTag('patPhotons')
process.rootTuplePhotons.Prefix = cms.string('patPhotons.')
#trigger
#trigger and trigger objects
process.rootTupleTrigger.HLTInputTag = cms.InputTag('TriggerResults', '', options.hltProcess)
process.rootTupleTriggerObjectElectronLeg.HLTObjectsInputTag = cms.InputTag('hltTriggerSummaryAOD', '', options.hltProcess)
process.rootTupleTriggerObjectElectronIsoLeg.HLTObjectsInputTag = cms.InputTag('hltTriggerSummaryAOD', '', options.hltProcess)
process.rootTupleTriggerObjectHadronLeg.HLTObjectsInputTag = cms.InputTag('hltTriggerSummaryAOD', '', options.hltProcess)
process.rootTupleTriggerObjectHadronIsoLeg.HLTObjectsInputTag = cms.InputTag('hltTriggerSummaryAOD', '', options.hltProcess)
process.rootTupleTriggerObjectHadronPFIsoLeg.HLTObjectsInputTag = cms.InputTag('hltTriggerSummaryAOD', '', options.hltProcess)
process.rootTupleTriggerObjectMuon1.HLTObjectsInputTag = cms.InputTag('hltTriggerSummaryAOD', '', options.hltProcess)
process.rootTupleTriggerObjectMuon2.HLTObjectsInputTag = cms.InputTag('hltTriggerSummaryAOD', '', options.hltProcess)
process.rootTupleTriggerObjectMuon2p1.HLTObjectsInputTag = cms.InputTag('hltTriggerSummaryAOD', '', options.hltProcess)
process.rootTupleTriggerObjectQuadJets.HLTObjectsInputTag = cms.InputTag('hltTriggerSummaryAOD', '', options.hltProcess)
#GEN event
process.rootTupleGenEventInfo.StorePDFWeights = cms.bool(options.storePDFWeights)
process.rootTupleGenEventInfo.isTTbarMC = cms.bool(options.isTTbarMC)
Expand Down Expand Up @@ -86,8 +95,8 @@ def setup_ntupler(process, cms, options):
'keep *_rootTupleTaus_*_*',
#photons
'keep *_rootTuplePhotons_*_*',
#trigger
'keep *_rootTupleTrigger_*_*',
#trigger and trigger objects
'keep *_rootTupleTrigger*_*_*',
#vertices (DA)
'keep *_rootTupleVertex_*_*',
#tracks
Expand Down Expand Up @@ -174,8 +183,17 @@ def setup_ntupler(process, cms, options):
process.rootTupleType1p2CorrectedPFMetUnclusteredEnDown +
#Event
process.rootTupleEvent +
#trigger
#trigger and trigger objects
process.rootTupleTrigger +
process.rootTupleTriggerObjectElectronLeg +
process.rootTupleTriggerObjectElectronIsoLeg +
process.rootTupleTriggerObjectHadronLeg +
process.rootTupleTriggerObjectHadronIsoLeg +
process.rootTupleTriggerObjectHadronPFIsoLeg +
process.rootTupleTriggerObjectMuon1 +
process.rootTupleTriggerObjectMuon2 +
process.rootTupleTriggerObjectMuon2p1 +
process.rootTupleTriggerObjectQuadJets +
#genEventInfos
process.rootTupleGenEventInfo +
process.rootTupleGenParticles +
Expand Down Expand Up @@ -208,3 +226,15 @@ def setup_ntupler(process, cms, options):
#isolated leptons
process.rootNTuples.remove(process.rootTuplePFElectrons)
process.rootNTuples.remove(process.nTuplePFMuons)

if not options.writeTriggerObjects:
process.rootNTuples.remove(process.rootTupleTriggerObjectElectronLeg)
process.rootNTuples.remove(process.rootTupleTriggerObjectElectronIsoLeg)
process.rootNTuples.remove(process.rootTupleTriggerObjectHadronLeg)
process.rootNTuples.remove(process.rootTupleTriggerObjectHadronIsoLeg)
process.rootNTuples.remove(process.rootTupleTriggerObjectHadronPFIsoLeg)
process.rootNTuples.remove(process.rootTupleTriggerObjectMuon1)
process.rootNTuples.remove(process.rootTupleTriggerObjectMuon2)
process.rootNTuples.remove(process.rootTupleTriggerObjectMuon2p1)
process.rootNTuples.remove(process.rootTupleTriggerObjectQuadJets)

1 change: 1 addition & 0 deletions python/Ntuple_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from BristolAnalysis.NTupleTools.BristolNTuple_METcorrections_cfi import *
from BristolAnalysis.NTupleTools.BristolNTuple_Muons_cfi import *
from BristolAnalysis.NTupleTools.BristolNTuple_Trigger_cfi import *
from BristolAnalysis.NTupleTools.BristolNTuple_TriggerObjects_cfi import *
from BristolAnalysis.NTupleTools.BristolNTuple_Vertex_cfi import *
from BristolAnalysis.NTupleTools.BristolNTuple_GenEventInfo_cfi import *
from BristolAnalysis.NTupleTools.BristolNTuple_GenParticles_cfi import *
Expand Down
4 changes: 2 additions & 2 deletions python/SelectionAnalyser_cfi.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import FWCore.ParameterSet.Config as cms
selectionPrefix = 'TopPairElectronPlusJets2012Selection.'
selectionPrefix = 'TopPairElectronPlusJetsSelection.'
selectionName = 'topPairEPlusJetsSelection'
selectionCuts = [
"AllEvents",
Expand All @@ -23,7 +23,7 @@
selectionNames=cms.vstring(selectionCuts),
)

selectionPrefix = 'TopPairMuonPlusJets2012Selection.'
selectionPrefix = 'TopPairMuonPlusJetsSelection.'
selectionName = 'topPairMuPlusJetsSelection'
selectionCuts = [
"AllEvents",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import FWCore.ParameterSet.Config as cms

topPairEPlusJetsSelection = cms.EDFilter('TopPairElectronPlusJets2012SelectionFilter',
topPairEPlusJetsSelection = cms.EDFilter('TopPairElectronPlusJetsSelectionFilter',
# Specify input collections
jetInput=cms.InputTag("selectedPatJetsPFlow"),
electronInput=cms.InputTag("selectedPatElectronsLoosePFlow"),
Expand Down Expand Up @@ -34,8 +34,10 @@
useRhoActiveAreaCorrections = cms.bool(True),
useMETFilters = cms.bool(True),
useEEBadScFilter = cms.bool(False),
tagAndProbeStudies = cms.bool(False),
dropTriggerSelection = cms.bool(False),

prefix=cms.untracked.string('TopPairElectronPlusJets2012Selection.'),
prefix=cms.untracked.string('TopPairElectronPlusJetsSelection.'),
MCSampleTag = cms.string('Summer12'),#Fall11 or Summer12
#flags
debug=cms.untracked.bool(False),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import FWCore.ParameterSet.Config as cms

topPairMuPlusJetsSelection = cms.EDFilter('TopPairMuonPlusJets2012SelectionFilter',
topPairMuPlusJetsSelection = cms.EDFilter('TopPairMuonPlusJetsSelectionFilter',
# Specify input collections
jetInput=cms.InputTag("selectedPatJetsPFlow"),
electronInput=cms.InputTag("selectedPatElectronsLoosePFlow"),
Expand Down Expand Up @@ -34,8 +34,10 @@
useRhoActiveAreaCorrections = cms.bool(True),
useMETFilters = cms.bool(True),
useEEBadScFilter = cms.bool(False),
tagAndProbeStudies = cms.bool(False),
dropTriggerSelection = cms.bool(False),

prefix=cms.untracked.string('TopPairMuonPlusJets2012Selection.'),
prefix=cms.untracked.string('TopPairMuonPlusJetsSelection.'),
MCSampleTag = cms.string('Summer12'),#Fall11 or Summer12
#flags
debug=cms.untracked.bool(False),
Expand Down
6 changes: 3 additions & 3 deletions python/UnfoldingAnalyser_cfi.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@
reco_MET_Input=cms.InputTag('patMETsPFlow'),
gen_jet_input=cms.InputTag('ak5GenJetsNoNu'),
reco_jet_input=cms.InputTag('selectedPatJetsPFlow'),
electron_input=cms.InputTag("topPairEPlusJetsSelection", 'TopPairElectronPlusJets2012Selection.signalElectron', 'PAT'),
muon_input=cms.InputTag("topPairMuPlusJetsSelection", 'TopPairMuonPlusJets2012Selection.signalMuon', 'PAT'),
electron_input=cms.InputTag("topPairEPlusJetsSelection", 'TopPairElectronPlusJetsSelection.signalElectron', 'PAT'),
muon_input=cms.InputTag("topPairMuPlusJetsSelection", 'TopPairMuonPlusJetsSelection.signalMuon', 'PAT'),
vertex_input=cms.InputTag('goodOfflinePrimaryVertices'),
gen_event_input=cms.InputTag('genEvt'),
selection_flag_input=cms.InputTag("topPairEPlusJetsSelection", 'TopPairElectronPlusJets2012Selection.FullSelection', 'PAT'),
selection_flag_input=cms.InputTag("topPairEPlusJetsSelection", 'TopPairElectronPlusJetsSelection.FullSelection', 'PAT'),
is_fully_hadronic_flag=cms.InputTag('ttFullHadronicFilter'),
is_dileptonic_flag=cms.InputTag('ttFullLeptonicFilter'),
is_semileptonic_tau_flag=cms.InputTag('ttSemiLeptonicTauFilter'),
Expand Down
Loading

0 comments on commit 7186eb1

Please sign in to comment.