Skip to content

Commit

Permalink
Merge pull request #408 from amarini/submission_v3.5
Browse files Browse the repository at this point in the history
Submission v3.5
  • Loading branch information
amarini authored Sep 9, 2019
2 parents 27fd932 + c4f4db7 commit e51c86c
Show file tree
Hide file tree
Showing 8 changed files with 587 additions and 23 deletions.
5 changes: 5 additions & 0 deletions Core/interface/BareLeptons.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ class BareLeptons : virtual public BareP4
vector<float> *kinfitPtErr{0};

TClonesArray *fsrP4{0}; // at most 1.
vector<float> *dxy{0};
vector<float> *dz{0};

vector<float> *dxybs{0};
vector<float> *dzbs{0};

};

Expand Down
24 changes: 24 additions & 0 deletions Core/src/BareLeptons.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ BareLeptons::~BareLeptons(){
BareFunctions::Delete(kinfitP4);
BareFunctions::Delete(kinfitPtErr);
BareFunctions::Delete(fsrP4);
BareFunctions::Delete(dxy);
BareFunctions::Delete(dz);
BareFunctions::Delete(dxybs);
BareFunctions::Delete(dzbs);
}

void BareLeptons::init(){
Expand Down Expand Up @@ -53,6 +57,11 @@ void BareLeptons::init(){
BareFunctions::New(kinfitP4);
BareFunctions::New(kinfitPtErr);
BareFunctions::New(fsrP4);
BareFunctions::New(dxy);
BareFunctions::New(dz);

BareFunctions::New(dxybs);
BareFunctions::New(dzbs);
}

void BareLeptons::clear(){
Expand Down Expand Up @@ -84,6 +93,11 @@ void BareLeptons::clear(){
kinfitPtErr->clear();
fsrP4->Clear();

dxy->clear();
dz->clear();
dxybs->clear();
dzbs->clear();

}

void BareLeptons::defineBranches(TTree*t){
Expand Down Expand Up @@ -123,6 +137,10 @@ void BareLeptons::defineBranches(TTree*t){
t->Branch( "lepKinfitP4","TClonesArray", &kinfitP4, 128000, 0);
t->Branch( "lepFsrP4","TClonesArray", &fsrP4, 128000, 0);

t->Branch("lepDxy","vector<float>",&dxy);
t->Branch("lepDz","vector<float>",&dz);
t->Branch("lepDxyBS","vector<float>",&dxybs);
t->Branch("lepDzBS","vector<float>",&dzbs);

}

Expand Down Expand Up @@ -155,6 +173,12 @@ void BareLeptons::setBranchAddresses(TTree*t){
BareFunctions::SetBranchAddress(t,"lepKinfitPtErr",&kinfitPtErr);
BareFunctions::SetBranchAddress(t,"lepKinfitP4",&kinfitP4);
BareFunctions::SetBranchAddress(t,"lepFsrP4",&fsrP4);

BareFunctions::SetBranchAddress(t,"lepDxy",&dxy);
BareFunctions::SetBranchAddress(t,"lepDz",&dz);

BareFunctions::SetBranchAddress(t,"lepDxyBS",&dxybs);
BareFunctions::SetBranchAddress(t,"lepDzBS",&dzbs);
}

BAREREGISTER(BareLeptons);
Expand Down
10 changes: 9 additions & 1 deletion Nero/interface/NeroLeptons.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

// Electron corrector
#include "EgammaAnalysis/ElectronTools/interface/EnergyScaleCorrection_class.h"
#include "DataFormats/BeamSpot/interface/BeamSpot.h"

class NeroLeptons : virtual public NeroCollection,
virtual public BareLeptons
Expand All @@ -26,7 +27,7 @@ class NeroLeptons : virtual public NeroCollection,
public:
myLepton(){ chiso=-999; nhiso=-999; phoiso=-999; puiso=-999;mva = -999; miniiso=-999;
etasc=0; sieie=0; sipip=0; sieip=0; r9=0; ecorr=1;
resolution =-999; nlayers=-999;
resolution =-999; nlayers=-999;
kinfitP4.SetPxPyPzE(0,0,0,0);
kinfitPtErr=-999;
fsrP4.SetPxPyPzE(0,0,0,0);
Expand Down Expand Up @@ -57,6 +58,11 @@ class NeroLeptons : virtual public NeroCollection,

float resolution;
int nlayers;

float dxy{-999};
float dz{-999};
float dxy2{-999};
float dz2{-999};

};

Expand All @@ -68,6 +74,7 @@ class NeroLeptons : virtual public NeroCollection,
// --- Token
edm::EDGetTokenT<reco::VertexCollection> vtx_token;
edm::EDGetTokenT<pat::PackedCandidateCollection> token_pf;
edm::EDGetTokenT<reco::BeamSpot> beamspot_token;

// Token
edm::EDGetTokenT<pat::MuonCollection> mu_token;
Expand Down Expand Up @@ -106,6 +113,7 @@ class NeroLeptons : virtual public NeroCollection,

edm::Handle<reco::VertexCollection> vtx_handle;
edm::Handle<pat::PackedCandidateCollection> handle_pf;
edm::Handle<reco::BeamSpot> beamspot_handle;

// for miniiso
edm::Handle<double> rho_handle;
Expand Down
2 changes: 1 addition & 1 deletion Nero/script/duplicate_removal.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from subprocess import call, check_output
import re
import math
EOS = "/afs/cern.ch/project/eos/installation/0.3.84-aquamarine/bin/eos.select"
EOS = "/usr/bin/eos"

usage = '''
script to remove duplicates when running on data. The script is meant for multiple submission,
Expand Down
30 changes: 29 additions & 1 deletion Nero/src/NeroLeptons.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ NeroLeptons::NeroLeptons(edm::ConsumesCollector & cc,edm::ParameterSet iConfig):
#endif

vtx_token = cc.consumes<reco::VertexCollection>(iConfig.getParameter<edm::InputTag>("vertices"));
beamspot_token = cc.consumes<reco::BeamSpot>(edm::InputTag("offlineBeamSpot"));
token_pf = cc.consumes<pat::PackedCandidateCollection>(iConfig.getParameter<edm::InputTag>("pfCands"));
ea_ . reset (new EffectiveAreas( edm::FileInPath(iConfig.getParameter<std::string>("eleEA")).fullPath () ) );
mu_token = cc.consumes<pat::MuonCollection>(iConfig.getParameter<edm::InputTag>("muons"));
Expand Down Expand Up @@ -121,6 +122,9 @@ int NeroLeptons::analyze(const edm::Event & iEvent)
const reco::Vertex *pv = &vtx_handle->front();
iEvent.getByToken(token_pf, handle_pf);

iEvent.getByToken(beamspot_token, beamspot_handle);
const reco::BeamSpot *bs = &(*beamspot_handle); // recast

iEvent.getByToken(mu_token,mu_handle);
iEvent.getByToken(el_token,el_handle);

Expand Down Expand Up @@ -234,11 +238,22 @@ int NeroLeptons::analyze(const edm::Event & iEvent)
l.selBits |= unsigned(LepHighPt * myid::isHighPtMuon(mu,*pv)) ;

l.pfPt = mu.pfP4().pt();

//
if (not mu.innerTrack().isNull())
{
l.dz = mu.innerTrack()->dz(pv->position());
l.dxy = mu.innerTrack()->dxy(pv->position());
//offlineBeamSpot
l.dz2 = mu.innerTrack()->dz(bs->position());
l.dxy2 = mu.innerTrack()->dxy(bs->position());
}

if (mu.hasUserCand("cutBasedFsrPhoton"))
{
pat::PFParticle *pho = (pat::PFParticle *)(mu.userCand("cutBasedFsrPhoton").get());
l.fsrP4.SetPtEtaPhiM(pho->pt(),pho->eta(),pho->phi(),0.);
//l.fsrP4.SetPtEtaPhiM(pho->pt(),pho->eta(),pho->phi(),0.);
l.fsrP4.SetPtEtaPhiM(pho->userFloat("correctedPt"),pho->eta(),pho->phi(),0.);
}

l.chiso = chiso;
Expand Down Expand Up @@ -378,6 +393,14 @@ int NeroLeptons::analyze(const edm::Event & iEvent)
l.sieip = el.full5x5_sigmaIetaIphi();
l.r9 = el.r9();

if ( not el.gsfTrack().isNull()){
l.dz = el.gsfTrack()->dz(pv->position());
l.dxy = el.gsfTrack()->dxy(pv->position());
//offlineBeamSpot
l.dz2 = el.gsfTrack()->dz(bs->position());
l.dxy2 = el.gsfTrack()->dxy(bs->position());
}

// float chIso = el.chargedHadronIso();
// float nhIso = el.neutralHadronIso();
// float phoIso = el.photonIso();
Expand Down Expand Up @@ -530,6 +553,11 @@ int NeroLeptons::analyze(const edm::Event & iEvent)
resolution -> push_back(l.resolution);
nLayers -> push_back(l.nlayers);

dxy -> push_back(l.dxy);
dz -> push_back(l.dz);
dxybs -> push_back(l.dxy2);
dzbs -> push_back(l.dz2);

//kinfit
new ( (*kinfitP4)[kinfitP4->GetEntriesFast()]) TLorentzVector(l.kinfitP4);
kinfitPtErr -> push_back(l.kinfitPtErr);
Expand Down
25 changes: 25 additions & 0 deletions Nero/test/crabNero.py
Original file line number Diff line number Diff line change
Expand Up @@ -483,8 +483,13 @@ def submitDatasets(datasetNames):

config.General.requestName = 'DYJetsToLL2'
config.Data.inputDataset = '/DYJetsToLL_M-50_TuneCP5_13TeV-amcatnloFXFX-pythia8/RunIIFall17MiniAODv2-PU2017_12Apr2018_94X_mc2017_realistic_v14-v1/MINIAODSIM'
submit(config)\

config.General.requestName = 'DYJetsToMuMu_105_160'
config.Data.inputDataset='/DYJetsToLL_M-105To160_TuneCP5_PSweights_13TeV-amcatnloFXFX-pythia8/RunIIFall17MiniAODv2-PU2017_12Apr2018_94X_mc2017_realistic_v14-v1/MINIAODSIM'
submit(config)


#config.General.requestName = 'QCD-15-700-hpp'
#config.Data.inputDataset = '/QCD_Pt-15to7000_TuneCUETHS1_Flat_13TeV_herwigpp/RunIIFall17MiniAOD-94X_mc2017_realistic_v10-v1/MINIAODSIM'
#submit(config)
Expand Down Expand Up @@ -519,9 +524,29 @@ def submitDatasets(datasetNames):
#config.Data.inputDataset = '/GluGluToHHTo2B2G_node_4_13TeV-madgraph/amarini-Fall17_94X_Apr2018_MINIAOD-18783c0a07109245951450a1a4f55409/USER'
#submit(config)

config.General.requestName = 'GGZZ2e2mu'
config.Data.inputDataset = '/GluGluToContinToZZTo2e2mu_13TeV_MCFM701_pythia8/RunIIFall17MiniAODv2-PU2017_12Apr2018_94X_mc2017_realistic_v14-v1/MINIAODSIM'
submit(config)

config.General.requestName = 'GGZZ2mu2tau'
config.Data.inputDataset = '/GluGluToContinToZZTo2mu2tau_13TeV_MCFM701_pythia8/RunIIFall17MiniAODv2-PU2017_12Apr2018_94X_mc2017_realistic_v14-v2/MINIAODSIM'
submit(config)

config.General.requestName = 'GGZZ2e2tau'
config.Data.inputDataset = '/GluGluToContinToZZTo2e2tau_13TeV_MCFM701_pythia8/RunIIFall17MiniAODv2-PU2017_12Apr2018_94X_mc2017_realistic_v14-v2/MINIAODSIM'
submit(config)

config.General.requestName = 'GGZZ4mu'
config.Data.inputDataset = '/GluGluToContinToZZTo4mu_13TeV_MCFM701_pythia8/RunIIFall17MiniAODv2-PU2017_12Apr2018_94X_mc2017_realistic_v14-v1/MINIAODSIM'
submit(config)

config.General.requestName = 'GGZZ4tau'
config.Data.inputDataset = '/GluGluToContinToZZTo4tau_13TeV_MCFM701_pythia8/RunIIFall17MiniAODv2-PU2017_12Apr2018_94X_mc2017_realistic_v14_ext1-v2/MINIAODSIM'
submit(config)

config.General.requestName = 'GGZZ2mu2nu'
config.Data.inputDataset = '/GluGluToContinToZZTo2mu2nu_13TeV_MCFM701_pythia8/RunIIFall17MiniAODv2-PU2017_12Apr2018_94X_mc2017_realistic_v14-v2/MINIAODSIM'
submit(config)

# Local Variables:
# mode:python
Expand Down
Loading

0 comments on commit e51c86c

Please sign in to comment.