Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion plugins/RateTree.cc
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ class RateTree : public edm::EDAnalyzer {
std::vector<Float_t>* puEM_;
std::vector<Float_t>* puUICEM_;
std::vector<Float_t>* effArea_;
std::vector<Float_t>* eneighbor_;
std::vector<bool>* taus_;
std::vector<bool>* tausneighbor_;
std::vector<bool>* mips_;

};
Expand All @@ -89,7 +91,9 @@ RateTree::RateTree(const edm::ParameterSet& pset) {
pts_ = new std::vector<Float_t>();
etas_ = new std::vector<Float_t>();
phis_ = new std::vector<Float_t>();
eneighbor_ = new std::vector<Float_t>();
taus_ = new std::vector<bool>();
tausneighbor_ = new std::vector<bool>();
mips_ = new std::vector<bool>();


Expand Down Expand Up @@ -162,7 +166,9 @@ RateTree::RateTree(const edm::ParameterSet& pset) {
tree->Branch("puEM", "std::vector<float>", &puEM_);
tree->Branch("puUICEM", "std::vector<float>", &puUICEM_);
tree->Branch("effArea", "std::vector<float>", &effArea_);
tree->Branch("associated4x4Et", "std::vector<float>",&eneighbor_);
tree->Branch("tauVeto", "std::vector<bool>", &taus_);
tree->Branch("associated4x4Tau","std::vector<bool>",&tausneighbor_);
tree->Branch("mipBit", "std::vector<bool>", &mips_);

// Now add nice aliases so the same draw commands work for rate/eff
Expand All @@ -183,6 +189,7 @@ RateTree::RateTree(const edm::ParameterSet& pset) {

tree->SetAlias("l1gEllIso", "ellIso");
tree->SetAlias("l1gTauVeto", "tauVeto");
tree->SetAlias("l1gTauVetoNeighbor","associated4x4Tau");
tree->SetAlias("l1gMIP", "mipBit");

tree->SetAlias("l1gPU", "pu");
Expand Down Expand Up @@ -228,7 +235,9 @@ RateTree::~RateTree() {
delete puUICEM_;
delete effArea_;
delete mips_;
delete eneighbor_;
delete taus_;
delete tausneighbor_;
}


Expand Down Expand Up @@ -303,7 +312,9 @@ void RateTree::analyze(const edm::Event& evt, const edm::EventSetup& es) {
puEM_->clear();
puUICEM_->clear();
effArea_->clear();
eneighbor_->clear();
taus_->clear();
tausneighbor_->clear();
mips_->clear();

// Setup meta info
Expand Down Expand Up @@ -359,7 +370,10 @@ void RateTree::analyze(const edm::Event& evt, const edm::EventSetup& es) {
puUICEM_->push_back(uct->getFloat("puLevelUICEM", -4));
effArea_->push_back(uct->getFloat("effArea", -4));
mips_->push_back(uct->getInt("mipBit", -4));
eneighbor_->push_back(uct->getFloat("associated4x4Et",-4));
taus_->push_back(uct->getInt("tauVeto", -4));
//std::cout << "tauVeto Rate Tree:" << uct->getFloat("tauVeto",-4) << std::endl;
tausneighbor_->push_back(uct->getInt("associated4x4Tau",-4));
// UCT doesn't have a type
type_->push_back(-1);
} else {
Expand Down Expand Up @@ -409,7 +423,8 @@ void RateTree::analyze(const edm::Event& evt, const edm::EventSetup& es) {
puUICEM_->push_back(-5);
effArea_->push_back(-5);
mips_->push_back(-5);
taus_->push_back(-5);
//taus_->push_back(-5);
//tausneighbor_->push_back(-5);
type_->push_back(-5);

tree->Fill();
Expand Down
25 changes: 23 additions & 2 deletions test/makeEfficiencyTree_cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
'If 1, turn off the ECAL for the stage1 EGTau path.')
options.register(
'isMC',
0,
1,
VarParsing.multiplicity.singleton,
VarParsing.varType.int,
'Set to 1 for simulated samples - updates GT, emulates HCAL TPGs.')
Expand Down Expand Up @@ -177,6 +177,7 @@
l1gJetPt = cms.string("? l1gMatch ? l1g.getFloat('associatedJetPt', -4) : -2"),
l1gEllIso = cms.string("? l1gMatch ? l1g.getInt('ellIsolation', -4) : -2"),
l1gTauVeto = cms.string("? l1gMatch ? l1g.getInt('tauVeto', -4) : -2"),
l1gTauVetoNeighbor = cms.string("? l1gMatch ? l1g.getInt('associated4x4Tau', -4) : -2"),
l1gMIP = cms.string("? l1gMatch ? l1g.getInt('mipBit', -4) : -2"),
l1gIsEle = cms.string("? l1gMatch ? l1g.getInt('isEle', -4) : -2"),
)
Expand All @@ -202,6 +203,24 @@

process.isoTauEfficiency = cms.EDAnalyzer(
"EfficiencyTree",
#recoSrc = cms.VInputTag("isoTaus"),
recoSrc = cms.VInputTag("recoTaus"),
l1Src = cms.VInputTag(cms.InputTag("l1extraParticles", "Tau")),
l1GSrc = cms.VInputTag(cms.InputTag("UCT2015Producer", "IsolatedTauUnpacked")),
l1GPUSrc = cms.InputTag("UCT2015Producer", "PULevelPUM0Unpacked"),
# Max DR for RECO-trigger matching
maxDR = cms.double(0.5),
# Ntuple configuration
ntuple = cms.PSet(
common_ntuple_branches,
egtau_branches,
tau_branches,
)
)

process.isoTauCheckEfficiency = cms.EDAnalyzer(
"EfficiencyTree",
#recoSrc = cms.VInputTag("isoTaus"),
recoSrc = cms.VInputTag("isoTaus"),
l1Src = cms.VInputTag(cms.InputTag("l1extraParticles", "Tau")),
l1GSrc = cms.VInputTag(cms.InputTag("UCT2015Producer", "IsolatedTauUnpacked")),
Expand Down Expand Up @@ -315,6 +334,7 @@
process.leptonEfficiencies = cms.Sequence(

process.isoTauEfficiency *
process.isoTauCheckEfficiency *
process.rlxTauEfficiency
*process.rlxTauPlusJetEfficiency *

Expand Down Expand Up @@ -427,6 +447,7 @@
process.isoTauEfficiency.recoSrc = cms.VInputTag("trueTaus")
process.rlxTauEfficiency.recoSrc = cms.VInputTag("trueTaus")
process.isoTauEfficiency.recoSrc = cms.VInputTag("trueTaus")
process.isoTauCheckEfficiency.recoSrc = cms.VInputTag("trueTaus")
process.rlxTauEfficiency.recoSrc = cms.VInputTag("trueTaus")
process.printTaus.src=cms.InputTag("trueTaus")

Expand Down Expand Up @@ -561,7 +582,7 @@

# Make the framework shut up.
process.load("FWCore.MessageLogger.MessageLogger_cfi")
process.MessageLogger.cerr.FwkReport.reportEvery = 1000
process.MessageLogger.cerr.FwkReport.reportEvery = 100

# Spit out filter efficiency at the end.
process.options = cms.untracked.PSet(wantSummary = cms.untracked.bool(False))
Expand Down