diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 0000000..60fd1be
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,3 @@
+[submodule "Analyzer/python/wsuciutils"]
+ path = Analyzer/python/wsuciutils
+ url = git@github.com:jsturdy/wsu-ci-analysis-tools.git
diff --git a/Analyzer/plugins/BuildFile.xml b/Analyzer/plugins/BuildFile.xml
index 570bc8e..12da09e 100755
--- a/Analyzer/plugins/BuildFile.xml
+++ b/Analyzer/plugins/BuildFile.xml
@@ -1,5 +1,9 @@
+
+
+
+
diff --git a/Analyzer/plugins/MakeZprimeMiniAodTree.cc b/Analyzer/plugins/MakeZprimeMiniAodTree.cc
index b28f98b..a9c0c2b 100644
--- a/Analyzer/plugins/MakeZprimeMiniAodTree.cc
+++ b/Analyzer/plugins/MakeZprimeMiniAodTree.cc
@@ -69,7 +69,7 @@
#include "DataFormats/HLTReco/interface/TriggerTypeDefs.h"
#include "HLTrigger/HLTcore/interface/HLTConfigProvider.h"
#include "FWCore/ServiceRegistry/interface/Service.h"
-#include "CommonTools/UtilAlgos/interface/TFileService.h"
+#include "CommonTools/UtilAlgos/interface/TFileService.h"
#include "DataFormats/MuonReco/interface/MuonSelectors.h"
#include "DataFormats/MuonReco/interface/MuonCocktails.h"
#include "DataFormats/Common/interface/RefCore.h"
@@ -154,7 +154,7 @@ class MakeZprimeMiniAodTree : public edm::EDAnalyzer {
// ----------member data --------------------------- //
edm::EDGetTokenT rhoToken;
edm::EDGetTokenT genInfoProductToken;
- edm::EDGetTokenT EDMGenJetsToken_;
+ edm::EDGetTokenT EDMGenJetsToken_;
edm::EDGetTokenT scProducer_;
edm::EDGetTokenT vtxToken_;
edm::EDGetTokenT muonToken_;
@@ -230,7 +230,7 @@ class MakeZprimeMiniAodTree : public edm::EDAnalyzer {
std::vector Ele_phiTrack;
std::vector Ele_hadronicOverEm;
std::vector Ele_deltaEtaInSeedCluster;
- std::vector Ele_deltaPhiInSeedCluster;
+ std::vector Ele_deltaPhiInSeedCluster;
std::vector Ele_deltaEtaInSC;
std::vector Ele_deltaPhiInSC;
std::vector Ele_sigmaIetaIeta;
@@ -275,7 +275,7 @@ class MakeZprimeMiniAodTree : public edm::EDAnalyzer {
std::vector Ele_hcalDepth2OverEcal;
std::vector Ele_dr03HcalDepth2TowerSumEt;
std::vector Ele_hcalDepth2TowerSumEtNoVeto;
- std::vector Ele_hcalDepth1TowerSumEtNoVeto;
+ std::vector Ele_hcalDepth1TowerSumEtNoVeto;
//------------- PF isolation from pat::ele -------------------------
std::vector Ele_pfSumPhotonEt;
std::vector Ele_pfSumChargedHadronPt;
@@ -290,9 +290,9 @@ class MakeZprimeMiniAodTree : public edm::EDAnalyzer {
std::vector Ele_phiWidth;
std::vector Ele_etaWidth;
//=============================================================
- //
+ //
// Create Branchs for ecal rec hits
- //
+ //
//=============================================================
std::vector ecaleb_rawId;
std::vector ecalee_rawId;
@@ -371,7 +371,7 @@ class MakeZprimeMiniAodTree : public edm::EDAnalyzer {
std::vector Tau_id;
std::vector Tau_LooseCombinedIsolationDeltaBetaCorr3Hits;
//=============================================================
- //
+ //
// Create Branchs for PileUp tree
//
//=============================================================
@@ -379,13 +379,13 @@ class MakeZprimeMiniAodTree : public edm::EDAnalyzer {
int PU_BunchCrossing;
int num_PU_gen_vertices;
//=============================================================
- //
+ //
// Create Branch for Rho
//
//=============================================================
float Rho;
//=============================================================
- //
+ //
// Create Branch for events reweighting
//
//=============================================================
@@ -410,7 +410,7 @@ class MakeZprimeMiniAodTree : public edm::EDAnalyzer {
//===================================================
std::vector iGen;
std::vector idGen;
- std::vector statusGen;
+ std::vector statusGen;
std::vector ptGen;
std::vector etaGen;
std::vector phiGen;
@@ -448,7 +448,7 @@ class MakeZprimeMiniAodTree : public edm::EDAnalyzer {
std::vector Mu_eta;
std::vector Mu_phi;
std::vector Mu_et;
- std::vector Mu_charge;
+ std::vector Mu_charge;
std::vector Mu_normalizedChi2;
std::vector Mu_trackiso;
std::vector Mu_numberOfMatchedStations;
@@ -496,7 +496,7 @@ class MakeZprimeMiniAodTree : public edm::EDAnalyzer {
std::vector Mu_absdz;
std::vector Mu_patDeltaBeta;
//=============================================================
- //
+ //
// Create Branches for PF MET
//
//=============================================================
@@ -514,7 +514,7 @@ class MakeZprimeMiniAodTree : public edm::EDAnalyzer {
double PFMet_pt_uncor;
double PFMet_phi_uncor;
double PFMet_sumEt_uncor;
- //The raw calo ETmiss
+ //The raw calo ETmiss
double CaloMet_pt;
double CaloMet_phi;
double CaloMet_sumEt;
@@ -578,7 +578,7 @@ MakeZprimeMiniAodTree::MakeZprimeMiniAodTree(const edm::ParameterSet& iConfig):
eleTrkPtIso_(consumes >(iConfig.getParameter("eleTrkPtIsoLabel"))),
outputFile_(iConfig.getParameter("outputFile"))
{
- rootFile_ = TFile::Open(outputFile_.c_str(),"RECREATE"); // open output file to store histograms
+ rootFile_ = TFile::Open(outputFile_.c_str(),"RECREATE"); // open output file to store histograms
BosonID_ = iConfig.getParameter("GenBosonID");
ParticleID1_ = iConfig.getParameter("ParticleID1");
ParticleID2_ = iConfig.getParameter("ParticleID2");
@@ -612,7 +612,7 @@ void MakeZprimeMiniAodTree::beginJob()
mytree->Branch("event_evtNo", &Event, "event_evtNo/I");
mytree->Branch("event_lumi", &lumi, "event_lumi/I");
mytree->Branch("event_bunch", &bunch, "event_bunch/I");
-
+
if(Analysis_== "ZprimeToMuMu"){
//===================================================
//
@@ -642,7 +642,7 @@ void MakeZprimeMiniAodTree::beginJob()
mytree->Branch("pxGen",&pxGen);
mytree->Branch("pyGen",&pyGen);
mytree->Branch("pzGen",&pzGen);
- //=============================================================
+ //=============================================================
//
// Create Branchs for Muons variables
//
@@ -703,11 +703,11 @@ void MakeZprimeMiniAodTree::beginJob()
mytree->Branch("Mu_nbofpv",&Mu_nbofpv);
mytree->Branch("Mu_patDeltaBeta",&Mu_patDeltaBeta);
//mytree->Branch("Mu_pfDeltaBeta",&Mu_pfDeltaBeta);
- //=============================================================
+ //=============================================================
//
// Create Branchs for Muons match HLT variables
//
- //=============================================================
+ //=============================================================
mytree->Branch("HLT_nb", &HLT_nb);
mytree->Branch("HLT_name", &HLT_name);
mytree->Branch("HLT_isaccept", &HLT_isaccept);
@@ -717,7 +717,7 @@ void MakeZprimeMiniAodTree::beginJob()
mytree->Branch("HLTObj_phi",&HLTObj_phi);
mytree->Branch("HLTObj_collection", &HLTObj_collection);
//=============================================================
- //
+ //
// Create Branches for PF MET
//
//=============================================================
@@ -731,7 +731,7 @@ void MakeZprimeMiniAodTree::beginJob()
mytree->Branch("PFMet_py_cor", &PFMet_py_cor, "PFMet_py_cor/D");
mytree->Branch("PFMet_pz_cor", &PFMet_pz_cor, "PFMet_pz_cor/D");
mytree->Branch("PFMet_sumEt_cor",&PFMet_sumEt_cor,"PFMet_sumEt_cor/D");
- //The raw calo ETmiss
+ //The raw calo ETmiss
mytree->Branch("CaloMet_pt", &CaloMet_pt, "CaloMet_pt/D");
mytree->Branch("CaloMet_phi", &CaloMet_phi, "CaloMet_phi/D");
mytree->Branch("CaloMet_sumEt",&CaloMet_sumEt,"CaloMet_sumEt/D");
@@ -744,9 +744,9 @@ void MakeZprimeMiniAodTree::beginJob()
//mytree->Branch("METSign",&METSign,"METSign/D");
//=============================================================
//
- // Create Branches for jets variables
+ // Create Branches for jets variables
//
- //=============================================================
+ //=============================================================
mytree->Branch("jet_nb",&jet_nb);
mytree->Branch("jet_charge",&jet_charge);
mytree->Branch("jet_et",&jet_et);
@@ -759,9 +759,9 @@ void MakeZprimeMiniAodTree::beginJob()
mytree->Branch("jet_pileup_mva_disc",&jet_pileup_mva_disc);
//=============================================================
//
- // Create Branches for Btagging variables
+ // Create Branches for Btagging variables
//
- //=============================================================
+ //=============================================================
mytree->Branch("Nb_bDiscriminators",&Nb_bDiscriminators);
mytree->Branch("jet_btag_pt",&jet_btag_pt);
mytree->Branch("jet_btag_eta",&jet_btag_eta);
@@ -795,21 +795,21 @@ void MakeZprimeMiniAodTree::beginJob()
//mytree->Branch("pfphoton_PFPUchAllPart",&pfphoton_PFPUchAllPart);
//mytree->Branch("pfphoton_pfphoton_PFX_rho",&pfphoton_pfphoton_PFX_rho);
//=============================================================
- //
- // Create Branchs for PileUp tree
+ //
+ // Create Branchs for PileUp tree
//
//=============================================================
mytree->Branch("num_PU_vertices",&num_PU_vertices,"num_PU_vertices/I");
mytree->Branch("PU_BunchCrossing",&PU_BunchCrossing,"PU_BunchCrossing/I");
mytree->Branch("num_PU_gen_vertices",&num_PU_gen_vertices,"num_PU_gen_vertices/I");
//=============================================================
- //
+ //
// Create Branch for Rho
//
//=============================================================
mytree->Branch("Rho",&Rho,"Rho/F");
//=============================================================
- //
+ //
// Create Branch for events reweighting
//
//=============================================================
@@ -897,12 +897,12 @@ void MakeZprimeMiniAodTree::beginJob()
mytree->Branch("Ele_dr03TkSumPt",&Ele_dr03TkSumPt);
mytree->Branch("Ele_dr03TkSumPt_corrected",&Ele_dr03TkSumPt_corrected);
}
-
+
if(Analysis_== "ZprimeToEE"){
- //=============================================================
- //
+ //=============================================================
+ //
// Create Branchs for ecal rec hits variables
- //
+ //
//=============================================================
mytree->Branch("ecaleb_rawId",&ecaleb_rawId);
mytree->Branch("ecaleb_iRechit",&ecaleb_iRechit);
@@ -942,21 +942,21 @@ void MakeZprimeMiniAodTree::beginJob()
mytree->Branch("PositionY",&PositionY);
mytree->Branch("PositionZ",&PositionZ);
//=============================================================
- //
- // Create Branchs for PileUp tree
+ //
+ // Create Branchs for PileUp tree
//
//=============================================================
mytree->Branch("num_PU_vertices",&num_PU_vertices,"num_PU_vertices/I");
mytree->Branch("PU_BunchCrossing",&PU_BunchCrossing,"PU_BunchCrossing/I");
mytree->Branch("num_PU_gen_vertices",&num_PU_gen_vertices,"num_PU_gen_vertices/I");
//=============================================================
- //
+ //
// Create Branch for Rho
//
//=============================================================
mytree->Branch("Rho",&Rho,"Rho/F");
//=============================================================
- //
+ //
// Create Branch for events reweighting
//
//=============================================================
@@ -968,7 +968,7 @@ void MakeZprimeMiniAodTree::analyze(const edm::Event& iEvent, const edm::EventSe
{
//==============================================
//= Begin of the main program =
- //==============================================
+ //==============================================
Run = iEvent.id().run();
Event = iEvent.id().event();
lumi = iEvent.luminosityBlock();
@@ -984,8 +984,8 @@ void MakeZprimeMiniAodTree::analyze(const edm::Event& iEvent, const edm::EventSe
PatMuonTree(iEvent,iSetup);
ComputeMuonMassVtx(iEvent,iSetup);
accessGenInfo(iEvent,iSetup);
- TriggerMatchingTree(iEvent,iSetup);
- fillMET(iEvent);
+ TriggerMatchingTree(iEvent,iSetup);
+ fillMET(iEvent);
JetsTree(iEvent,iSetup);
GenJetTree(iEvent);
ParticleFlowPhotonTree(iEvent,iSetup);
@@ -996,16 +996,16 @@ void MakeZprimeMiniAodTree::analyze(const edm::Event& iEvent, const edm::EventSe
TauTree(iEvent);
PatElectronTree(iEvent,iSetup);
}
-
-
+
+
//==============================================
//= End of the main program =
- //==============================================
+ //==============================================
mytree->Fill();
}
// ------------ method called once each job just after ending the event loop ------------
-void MakeZprimeMiniAodTree::endJob()
+void MakeZprimeMiniAodTree::endJob()
{
// go to *OUR* root file and store histograms
rootFile_->cd();
@@ -1044,7 +1044,7 @@ bool MakeZprimeMiniAodTree::PrimaryVertex(const reco::VertexCollection &vertices
//
//=============================================================
void MakeZprimeMiniAodTree::PatElectronTree(const edm::Event& iEvent,const edm::EventSetup& es)
-{
+{
int NbElectrons = 0;
Ele_rawId.clear();
Ele_nbElectrons.clear();
@@ -1066,7 +1066,7 @@ void MakeZprimeMiniAodTree::PatElectronTree(const edm::Event& iEvent,const edm::
Ele_phiTrack.clear();
Ele_hadronicOverEm.clear();
Ele_deltaEtaInSeedCluster.clear();
- Ele_deltaPhiInSeedCluster.clear();
+ Ele_deltaPhiInSeedCluster.clear();
Ele_deltaEtaInSC.clear();
Ele_deltaPhiInSC.clear();
Ele_sigmaIetaIeta.clear();
@@ -1110,7 +1110,7 @@ void MakeZprimeMiniAodTree::PatElectronTree(const edm::Event& iEvent,const edm::
Ele_hcalDepth2OverEcal.clear();
Ele_dr03HcalDepth2TowerSumEt.clear();
Ele_hcalDepth2TowerSumEtNoVeto.clear();
- Ele_hcalDepth1TowerSumEtNoVeto.clear();
+ Ele_hcalDepth1TowerSumEtNoVeto.clear();
Ele_pfSumPhotonEt.clear();
Ele_pfSumChargedHadronPt.clear();
Ele_pfSumNeutralHadronEt.clear();
@@ -1136,7 +1136,7 @@ void MakeZprimeMiniAodTree::PatElectronTree(const edm::Event& iEvent,const edm::
//------------ Rec Hits in EB ----------------
edm::Handle ecalEB;
iEvent.getByToken(tok_EB_,ecalEB);
- //------------ Rec Hits in EE ----------------
+ //------------ Rec Hits in EE ----------------
edm::Handle ecalEE;
iEvent.getByToken(tok_EE_,ecalEE);
//------------ Rec Hits in ES ----------------
@@ -1151,21 +1151,21 @@ void MakeZprimeMiniAodTree::PatElectronTree(const edm::Event& iEvent,const edm::
edm::Handle> eleTrkPtIsoHandle_;
iEvent.getByToken(eleTrkPtIso_,eleTrkPtIsoHandle_);
std::auto_ptr lazyTools_;
- lazyTools_ .reset(new EcalClusterLazyTools( iEvent, es, ecalRechitEBToken_, ecalRechitEEToken_ ));
+ lazyTools_ .reset(new EcalClusterLazyTools( iEvent, es, ecalRechitEBToken_, ecalRechitEEToken_ ));
for (const pat::Electron &el : *electrons) {
if(el.caloEnergy() * sin(el.p4().theta()) < 20) continue;
NbElectrons++;
- Ele_nbElectrons.push_back(NbElectrons);
+ Ele_nbElectrons.push_back(NbElectrons);
Ele_Et.push_back(el.superCluster()->energy() * sin(el.p4().theta()));
Ele_EtFromCaloEn.push_back(el.caloEnergy() * sin(el.p4().theta()));
- Ele_pt.push_back(el.pt());
+ Ele_pt.push_back(el.pt());
Ele_thetaSC.push_back(el.caloPosition().theta()); //theta SC
Ele_etaSC.push_back(el.superCluster()->eta()); //eta SC
Ele_phiSC.push_back(el.superCluster()->phi()); //phi SC
- Ele_phiWidth.push_back(el.superCluster()->phiWidth());
- Ele_etaWidth.push_back(el.superCluster()->etaWidth());
+ Ele_phiWidth.push_back(el.superCluster()->phiWidth());
+ Ele_etaWidth.push_back(el.superCluster()->etaWidth());
Ele_energySC.push_back(el.superCluster()->energy()); //energy SC
- Ele_preshowerEnergySC.push_back(el.superCluster()->preshowerEnergy());
+ Ele_preshowerEnergySC.push_back(el.superCluster()->preshowerEnergy());
Ele_thetaTrack.push_back(el.p4().theta()); //theta track
Ele_etaTrack.push_back(el.p4().eta()); //eta track
Ele_phiTrack.push_back(el.p4().phi()); //phi track
@@ -1186,7 +1186,7 @@ void MakeZprimeMiniAodTree::PatElectronTree(const edm::Event& iEvent,const edm::
Ele_e5x5.push_back(el.e5x5());
Ele_e2x5MaxOver5x5.push_back(el.e2x5Max()/el.e5x5());
Ele_e1x5Over5x5.push_back(el.e1x5()/el.e5x5());
- Ele_sigmaIetaIetaFull5x5.push_back(el.full5x5_sigmaIetaIeta());
+ Ele_sigmaIetaIetaFull5x5.push_back(el.full5x5_sigmaIetaIeta());
Ele_e2x5MaxFull5x5.push_back(el.full5x5_e2x5Max());
Ele_e1x5Full5x5.push_back(el.full5x5_e1x5());
Ele_e5x5Full5x5.push_back(el.full5x5_e5x5());
@@ -1212,29 +1212,29 @@ void MakeZprimeMiniAodTree::PatElectronTree(const edm::Event& iEvent,const edm::
Ele_frac15.push_back( lazyTools_->e1x5(*(el.superCluster()->seed()))/el.full5x5_e5x5() );
Ele_nbVtx.push_back(vertices->size());
if(vertices->size()>0){
- Ele_dxy.push_back(el.gsfTrack()->dxy(PV.position()));
- Ele_dz.push_back(el.gsfTrack()->dz(PV.position()));
+ Ele_dxy.push_back(el.gsfTrack()->dxy(PV.position()));
+ Ele_dz.push_back(el.gsfTrack()->dz(PV.position()));
}
else{
- Ele_dxy.push_back(el.gsfTrack()->dxy());
+ Ele_dxy.push_back(el.gsfTrack()->dxy());
Ele_dz.push_back(el.gsfTrack()->dz());
}
Ele_isEcalDrivenSeed.push_back(el.ecalDrivenSeed());
Ele_isPassConversionVeto.push_back(el.passConversionVeto());
Ele_charge.push_back(el.gsfTrack()->charge());
Ele_rhoIso.push_back(rhoIso);
- Ele_nbOfMissingHits.push_back(el.gsfTrack()->numberOfLostHits());
+ Ele_nbOfMissingHits.push_back(el.gsfTrack()->numberOfLostHits());
Ele_fbrem.push_back(el.fbrem());
Ele_EoverP.push_back(el.eSeedClusterOverP());
- Ele_Xposition.push_back(el.caloPosition().x());
- Ele_Yposition.push_back(el.caloPosition().y());
+ Ele_Xposition.push_back(el.caloPosition().x());
+ Ele_Yposition.push_back(el.caloPosition().y());
//------------- detector isolation -------------------------
Ele_hcalDepth1OverEcal.push_back(el.hcalDepth1OverEcal());
Ele_hcalDepth2OverEcal.push_back(el.hcalDepth2OverEcal());
Ele_dr03HcalDepth2TowerSumEt.push_back(el.dr03HcalDepth2TowerSumEt());
- Ele_hcalDepth2TowerSumEtNoVeto.push_back(el.isolationVariables03().hcalDepth2TowerSumEt);// hcaldepht2 iso deposit with
+ Ele_hcalDepth2TowerSumEtNoVeto.push_back(el.isolationVariables03().hcalDepth2TowerSumEt);// hcaldepht2 iso deposit with
// electron footprint removed
- Ele_hcalDepth1TowerSumEtNoVeto.push_back(el.isolationVariables03().hcalDepth1TowerSumEt);// hcaldepht1 iso deposit with
+ Ele_hcalDepth1TowerSumEtNoVeto.push_back(el.isolationVariables03().hcalDepth1TowerSumEt);// hcaldepht1 iso deposit with
// electron footprint removed
Ele_EcalPlusHcald1iso.push_back(el.dr03EcalRecHitSumEt() + el.dr03HcalDepth1TowerSumEt());
Ele_dr03EcalRecHitSumEt.push_back(el.dr03EcalRecHitSumEt());
@@ -1244,9 +1244,9 @@ void MakeZprimeMiniAodTree::PatElectronTree(const edm::Event& iEvent,const edm::
Ele_dr03TkSumPt_corrected.push_back((*eleTrkPtIsoHandle_).get(NbElectrons));
//------------- PF isolation from pat::ele -------------------------
Ele_pfSumPhotonEt.push_back(el.pfIsolationVariables().sumPhotonEt);
- Ele_pfSumChargedHadronPt.push_back(el.pfIsolationVariables().sumChargedHadronPt);
+ Ele_pfSumChargedHadronPt.push_back(el.pfIsolationVariables().sumChargedHadronPt);
Ele_pfSumNeutralHadronEt.push_back(el.pfIsolationVariables().sumNeutralHadronEt);
- Ele_pfSumPUPt.push_back(el.pfIsolationVariables().sumPUPt);
+ Ele_pfSumPUPt.push_back(el.pfIsolationVariables().sumPUPt);
// do deltaBeta
double charged = el.pfIsolationVariables().sumPhotonEt;
double neutral = el.pfIsolationVariables().sumNeutralHadronEt;
@@ -1276,7 +1276,7 @@ bool MakeZprimeMiniAodTree::isAncestor(const reco::Candidate* ancestor, const re
}
void MakeZprimeMiniAodTree::accessGenInfo(const edm::Event& iEvent,const edm::EventSetup& es)
-{
+{
int NbGenMuons = 0;
iGen.clear();
idGen.clear();
@@ -1292,12 +1292,12 @@ void MakeZprimeMiniAodTree::accessGenInfo(const edm::Event& iEvent,const edm::Ev
// Pruned particles are the one containing "important" stuff
Handle > pruned;
iEvent.getByToken(prunedGenToken_,pruned);
- if (!(pruned.isValid())) return;
+ if (!(pruned.isValid())) return;
// Packed particles are all the status 1, so usable to remake jets
// The navigation from status 1 to pruned is possible (the other direction should be made by hand)
Handle > packed;
iEvent.getByToken(packedGenToken_,packed);
- //let's try to find all status1 originating directly from a B meson decay
+ //let's try to find all status1 originating directly from a B meson decay
for(size_t i=0; isize();i++){
//if(abs((*pruned)[i].pdgId()) > 22 && abs((*pruned)[i].pdgId()) <24){
if(abs((*pruned)[i].pdgId()) < BosonID_){
@@ -1305,12 +1305,12 @@ void MakeZprimeMiniAodTree::accessGenInfo(const edm::Event& iEvent,const edm::Ev
//std::cout << "PdgID: " << Zprime->pdgId() << " pt " << Zprime->pt() << " eta: " << Zprime->eta() << " phi: " << Zprime->phi() << std::endl;
//std::cout << " found daugthers: " << std::endl;
for(size_t j=0; jsize();j++){
- //get the pointer to the first survied ancestor of a given packed GenParticle in the prunedCollection
+ //get the pointer to the first survied ancestor of a given packed GenParticle in the prunedCollection
const Candidate * motherInPrunedCollection = (*packed)[j].mother(0) ;
if(motherInPrunedCollection != nullptr && isAncestor( Zprime , motherInPrunedCollection)){
if( (*packed)[j].pt() < 20.0 ) continue;
- if( fabs((*packed)[j].pdgId()) != ParticleID1_ &&
- fabs((*packed)[j].pdgId()) != ParticleID2_ &&
+ if( fabs((*packed)[j].pdgId()) != ParticleID1_ &&
+ fabs((*packed)[j].pdgId()) != ParticleID2_ &&
fabs((*packed)[j].pdgId()) != ParticleID3_ ) continue;
if( (*packed)[j].status() > ParticleStatus_ ) continue;
NbGenMuons++;
@@ -1330,13 +1330,13 @@ void MakeZprimeMiniAodTree::accessGenInfo(const edm::Event& iEvent,const edm::Ev
}
}
}
-//=============================================================
+//=============================================================
////
//// Method for ECAL Rec Hits Tree
////
////=============================================================
void MakeZprimeMiniAodTree::EBecalRecHitsTree(const edm::Event& iEvent,const edm::EventSetup& es)
-{
+{
int nbRecHits = 0;
ecaleb_iRechit.clear();
ecaleb_EnRecHit.clear();
@@ -1369,7 +1369,7 @@ void MakeZprimeMiniAodTree::EBecalRecHitsTree(const edm::Event& iEvent,const edm
for(EcalRecHitCollection::const_iterator it = ebhits->begin(); it != ebhits->end(); ++it) {
if( (*it).energy() < 10.0 ) continue;
nbRecHits++;
- EBDetId elementId = it->id() ;
+ EBDetId elementId = it->id() ;
ecaleb_rawId.push_back(it->id().rawId());
ecaleb_iRechit.push_back(nbRecHits);
ecaleb_EnRecHit.push_back( (*it).energy() );
@@ -1392,7 +1392,7 @@ void MakeZprimeMiniAodTree::EBecalRecHitsTree(const edm::Event& iEvent,const edm
}
}
void MakeZprimeMiniAodTree::EEecalRecHitsTree(const edm::Event& iEvent,const edm::EventSetup& es)
-{
+{
int nbRecHits = 0;
ecalee_iRechit.clear();
ecalee_EnRecHit.clear();
@@ -1447,7 +1447,7 @@ void MakeZprimeMiniAodTree::EEecalRecHitsTree(const edm::Event& iEvent,const edm
//
//=============================================================
void MakeZprimeMiniAodTree::TriggerMatchingTree(const edm::Event& iEvent,const edm::EventSetup& es)
-{
+{
int NbTriggers = 0;
int NbTriggerObj = 0;
HLT_nb.clear();
@@ -1479,7 +1479,7 @@ void MakeZprimeMiniAodTree::TriggerMatchingTree(const edm::Event& iEvent,const e
names.triggerName(i) != "HLT_TkMu50_v3" && names.triggerName(i) != "HLT_TkMu50_v4" &&
names.triggerName(i) != "HLT_TkMu50_v5" && names.triggerName(i) != "HLT_TkMu50_v6" &&
names.triggerName(i) != "HLT_TkMu50_v7" && names.triggerName(i) != "HLT_TkMu50_v8" &&
- names.triggerName(i) != "HLT_TkMu50_v9" && names.triggerName(i) != "HLT_TkMu50_v10" &&
+ names.triggerName(i) != "HLT_TkMu50_v9" && names.triggerName(i) != "HLT_TkMu50_v10" &&
names.triggerName(i) != "HLT_DoubleEle33_CaloIdL_MW_v1" && names.triggerName(i) != "HLT_DoubleEle33_CaloIdL_MW_v2" &&
names.triggerName(i) != "HLT_DoubleEle33_CaloIdL_MW_v3" && names.triggerName(i) != "HLT_DoubleEle33_CaloIdL_MW_v4" &&
names.triggerName(i) != "HLT_DoubleEle33_CaloIdL_MW_v5" && names.triggerName(i) != "HLT_DoubleEle33_CaloIdL_MW_v6" &&
@@ -1500,11 +1500,11 @@ void MakeZprimeMiniAodTree::TriggerMatchingTree(const edm::Event& iEvent,const e
//full_name = name;
NbTriggers++;
HLT_nb.push_back(NbTriggers);
- HLT_name.push_back(names.triggerName(i));
+ HLT_name.push_back(names.triggerName(i));
HLT_isaccept.push_back(triggerBits->accept(i));
- /*std::cout << "Trigger " << names.triggerName(i) <<
+ /*std::cout << "Trigger " << names.triggerName(i) <<
", prescale " << triggerPrescales->getPrescaleForIndex(i) <<
- ": " << (triggerBits->accept(i) ? "PASS" : "fail (or not run)")
+ ": " << (triggerBits->accept(i) ? "PASS" : "fail (or not run)")
<< std::endl;*/
}
for (unsigned i = 0; i < trigobj_handle->size(); ++i) {
@@ -1525,7 +1525,7 @@ void MakeZprimeMiniAodTree::TriggerMatchingTree(const edm::Event& iEvent,const e
pathnames[j] != "HLT_TkMu50_v3" && pathnames[j] != "HLT_TkMu50_v4" &&
pathnames[j] != "HLT_TkMu50_v5" && pathnames[j] != "HLT_TkMu50_v6" &&
pathnames[j] != "HLT_TkMu50_v7" && pathnames[j] != "HLT_TkMu50_v8" &&
- pathnames[j] != "HLT_TkMu50_v9" && pathnames[j] != "HLT_TkMu50_v10" &&
+ pathnames[j] != "HLT_TkMu50_v9" && pathnames[j] != "HLT_TkMu50_v10" &&
pathnames[j] != "HLT_DoubleEle33_CaloIdL_MW_v1" && pathnames[j] != "HLT_DoubleEle33_CaloIdL_MW_v2" &&
pathnames[j] != "HLT_DoubleEle33_CaloIdL_MW_v3" && pathnames[j] != "HLT_DoubleEle33_CaloIdL_MW_v4" &&
pathnames[j] != "HLT_DoubleEle33_CaloIdL_MW_v5" && pathnames[j] != "HLT_DoubleEle33_CaloIdL_MW_v6" &&
@@ -1543,7 +1543,7 @@ void MakeZprimeMiniAodTree::TriggerMatchingTree(const edm::Event& iEvent,const e
pathnames[j] != "HLT_Mu33_Ele33_CaloIdL_GsfTrkIdVL_v9" && pathnames[j] != "HLT_Mu33_Ele33_CaloIdL_GsfTrkIdVL_v10"
) continue;
HLTObj_nbObj.push_back(NbTriggerObj);
- HLTObj_pt.push_back(src.pt());
+ HLTObj_pt.push_back(src.pt());
HLTObj_eta.push_back(src.eta());
HLTObj_phi.push_back(src.phi());
HLTObj_collection.push_back(pathnames[j]);
@@ -1557,7 +1557,7 @@ void MakeZprimeMiniAodTree::TriggerMatchingTree(const edm::Event& iEvent,const e
//
//=============================================================
void MakeZprimeMiniAodTree::PatMuonTree(const edm::Event& evt,const edm::EventSetup& es)
-{
+{
int NbMuons = 0;
Mu_nbMuon.clear();
Mu_isTightMuon.clear();
@@ -1597,7 +1597,7 @@ void MakeZprimeMiniAodTree::PatMuonTree(const edm::Event& evt,const edm::EventSe
Mu_thetaTunePMuonBestTrack.clear();
Mu_chargeTunePMuonBestTrack.clear();
Mu_absdxyTunePMuonBestTrack.clear();
- Mu_absdzTunePMuonBestTrack.clear();
+ Mu_absdzTunePMuonBestTrack.clear();
Mu_ptInnerTrack.clear();
Mu_dPToverPTInnerTrack.clear();
Mu_pxInnerTrack.clear();
@@ -1613,7 +1613,7 @@ void MakeZprimeMiniAodTree::PatMuonTree(const edm::Event& evt,const edm::EventSe
Mu_absdxy.clear();
Mu_absdz.clear();
Mu_patDeltaBeta.clear();
- // Get TransientTracks (for use in e.g. the vertex fit) for each of
+ // Get TransientTracks (for use in e.g. the vertex fit) for each of
// the muon tracks, using e.g. the cocktail momentum.
//edm::ESHandle ttkb;
//es.get().get("TransientTrackBuilder", ttkb);
@@ -1659,10 +1659,10 @@ void MakeZprimeMiniAodTree::PatMuonTree(const edm::Event& evt,const edm::EventSe
const reco::TrackRef& tunePTrack = mu.tunePMuonBestTrack();
Mu_ptTunePMuonBestTrack.push_back(tunePTrack->pt());
Mu_dPToverPTTunePMuonBestTrack.push_back(tunePTrack->ptError()/tunePTrack->pt());
- Mu_pxTunePMuonBestTrack.push_back(tunePTrack->px()); //px component of the track
- Mu_pyTunePMuonBestTrack.push_back(tunePTrack->py()); //py component of the track
- Mu_pzTunePMuonBestTrack.push_back(tunePTrack->pz()); //pz component of the track
- Mu_pTunePMuonBestTrack.push_back(tunePTrack->p()); //magnitude of momentum vector
+ Mu_pxTunePMuonBestTrack.push_back(tunePTrack->px()); //px component of the track
+ Mu_pyTunePMuonBestTrack.push_back(tunePTrack->py()); //py component of the track
+ Mu_pzTunePMuonBestTrack.push_back(tunePTrack->pz()); //pz component of the track
+ Mu_pTunePMuonBestTrack.push_back(tunePTrack->p()); //magnitude of momentum vector
Mu_etaTunePMuonBestTrack.push_back(tunePTrack->eta());
Mu_phiTunePMuonBestTrack.push_back(tunePTrack->phi());
Mu_thetaTunePMuonBestTrack.push_back(tunePTrack->theta());
@@ -1675,12 +1675,12 @@ void MakeZprimeMiniAodTree::PatMuonTree(const edm::Event& evt,const edm::EventSe
Mu_eta.push_back(mu.eta());
Mu_phi.push_back(mu.phi());
Mu_charge.push_back(mu.charge());
- Mu_ptInnerTrack.push_back(mu.innerTrack()->pt());
+ Mu_ptInnerTrack.push_back(mu.innerTrack()->pt());
Mu_dPToverPTInnerTrack.push_back(mu.innerTrack()->ptError()/mu.innerTrack()->pt());
- Mu_pxInnerTrack.push_back(mu.innerTrack()->px());
- Mu_pyInnerTrack.push_back(mu.innerTrack()->py());
- Mu_pzInnerTrack.push_back(mu.innerTrack()->pz());
- Mu_pInnerTrack.push_back(mu.innerTrack()->p());
+ Mu_pxInnerTrack.push_back(mu.innerTrack()->px());
+ Mu_pyInnerTrack.push_back(mu.innerTrack()->py());
+ Mu_pzInnerTrack.push_back(mu.innerTrack()->pz());
+ Mu_pInnerTrack.push_back(mu.innerTrack()->p());
Mu_etaInnerTrack.push_back(mu.innerTrack()->eta());
Mu_phiInnerTrack.push_back(mu.innerTrack()->phi());
Mu_thetaInnerTrack.push_back(mu.innerTrack()->theta());
@@ -1713,7 +1713,7 @@ void MakeZprimeMiniAodTree::PatMuonTree(const edm::Event& evt,const edm::EventSe
}
}
void MakeZprimeMiniAodTree::ComputeMuonMassVtx(const edm::Event& evt,const edm::EventSetup& es)
-{
+{
int NbMuons1 = 0;
int NbMuons2 = 0;
int NbMuons3 = 0;
@@ -1753,10 +1753,10 @@ void MakeZprimeMiniAodTree::ComputeMuonMassVtx(const edm::Event& evt,const edm::
MuonBestTrack1 = mu.tunePMuonBestTrack();
//if(fabs(mu.innerTrack()->eta())<=1.2) MuonBestTrack1 = mu.tunePMuonBestTrack();
//else if(fabs(mu.innerTrack()->eta())>1.2) MuonBestTrack1 = mu.innerTrack();
- if( MuonBestTrack1->pt()>53.0 && (mu.isolationR03().sumPt/mu.innerTrack()->pt()<0.10)
- && (MuonBestTrack1->ptError()/MuonBestTrack1->pt()<0.3) &&
+ if( MuonBestTrack1->pt()>53.0 && (mu.isolationR03().sumPt/mu.innerTrack()->pt()<0.10)
+ && (MuonBestTrack1->ptError()/MuonBestTrack1->pt()<0.3) &&
fabs(MuonBestTrack1->dxy(vertex.position()))<0.2 &&
- mu.globalTrack()->hitPattern().trackerLayersWithMeasurement()>5 &&
+ mu.globalTrack()->hitPattern().trackerLayersWithMeasurement()>5 &&
mu.globalTrack()->hitPattern().numberOfValidPixelHits()>0 &&
mu.globalTrack()->hitPattern().numberOfValidMuonHits()>0 &&
mu.numberOfMatchedStations()>1 ){
@@ -1777,10 +1777,10 @@ void MakeZprimeMiniAodTree::ComputeMuonMassVtx(const edm::Event& evt,const edm::
//else if(fabs(mu2.innerTrack()->eta())>1.2) MuonBestTrack2 = mu2.innerTrack();
//cout << "PT 2mu= " << MuonBestTrack2->pt() << " and charge =" << MuonBestTrack2->charge()<< endl;
if(MuonBestTrack2->pt() == MuonBestTrack1->pt()) continue;
- if( MuonBestTrack2->pt()>53.0 && (mu2.isolationR03().sumPt/mu2.innerTrack()->pt()<0.10)
- && (MuonBestTrack2->ptError()/MuonBestTrack2->pt()<0.3) &&
+ if( MuonBestTrack2->pt()>53.0 && (mu2.isolationR03().sumPt/mu2.innerTrack()->pt()<0.10)
+ && (MuonBestTrack2->ptError()/MuonBestTrack2->pt()<0.3) &&
fabs(MuonBestTrack2->dxy(vertex.position()))<0.2 &&
- mu2.globalTrack()->hitPattern().trackerLayersWithMeasurement()>5 &&
+ mu2.globalTrack()->hitPattern().trackerLayersWithMeasurement()>5 &&
mu2.globalTrack()->hitPattern().numberOfValidPixelHits()>0 &&
mu2.globalTrack()->hitPattern().numberOfValidMuonHits()>0 &&
mu2.numberOfMatchedStations()>1 ){
@@ -1815,12 +1815,12 @@ void MakeZprimeMiniAodTree::ComputeMuonMassVtx(const edm::Event& evt,const edm::
//if(fabs(mu3.innerTrack()->eta())<=1.2) MuonBestTrack3 = mu3.tunePMuonBestTrack();
//else if(fabs(mu3.innerTrack()->eta())>1.2) MuonBestTrack3 = mu3.innerTrack();
//cout << "PT 3mu= " << MuonBestTrack3->pt() << " and charge =" << MuonBestTrack3->charge() << endl;
- if(MuonBestTrack3->pt() == MuonBestTrack1->pt()) continue;
- if(MuonBestTrack3->pt() == MuonBestTrack2->pt()) continue;
- if( MuonBestTrack3->pt()>53.0 && (mu3.isolationR03().sumPt/mu3.innerTrack()->pt()<0.10)
- && (MuonBestTrack3->ptError()/MuonBestTrack3->pt()<0.3) &&
+ if(MuonBestTrack3->pt() == MuonBestTrack1->pt()) continue;
+ if(MuonBestTrack3->pt() == MuonBestTrack2->pt()) continue;
+ if( MuonBestTrack3->pt()>53.0 && (mu3.isolationR03().sumPt/mu3.innerTrack()->pt()<0.10)
+ && (MuonBestTrack3->ptError()/MuonBestTrack3->pt()<0.3) &&
fabs(MuonBestTrack3->dxy(vertex.position()))<0.2 &&
- mu3.globalTrack()->hitPattern().trackerLayersWithMeasurement()>5 &&
+ mu3.globalTrack()->hitPattern().trackerLayersWithMeasurement()>5 &&
mu3.globalTrack()->hitPattern().numberOfValidPixelHits()>0 &&
mu3.globalTrack()->hitPattern().numberOfValidMuonHits()>0 &&
mu3.numberOfMatchedStations()>1 ){
@@ -1873,16 +1873,16 @@ void MakeZprimeMiniAodTree::ComputeMuonMassVtx(const edm::Event& evt,const edm::
}
void MakeZprimeMiniAodTree::SuperClusterTree(const edm::Event& iEvent,const edm::EventSetup& es)
-{
+{
using namespace edm;
- // Get raw SuperClusters from the event
+ // Get raw SuperClusters from the event
Handle pRawSuperClusters;
- try {
+ try {
iEvent.getByToken(scProducer_, pRawSuperClusters);
} catch ( cms::Exception& ex ) {
- edm::LogError("EgammaSCCorrectionMakerError")
+ edm::LogError("EgammaSCCorrectionMakerError")
<< "Error! can't get the rawSuperClusters ";
- }
+ }
// Create a pointer to the RecHits and raw SuperClusters
const reco::SuperClusterCollection *rawClusters = pRawSuperClusters.product();
// Loop over raw clusters and make corrected ones
@@ -1911,7 +1911,7 @@ void MakeZprimeMiniAodTree::PrimaryVertexTree(const edm::Event& iEvent,const edm
PositionY.clear();
PositionZ.clear();
PositionRho.clear();
- edm::Handle pvHandle;
+ edm::Handle pvHandle;
iEvent.getByToken(vtxToken_,pvHandle);
const reco::VertexCollection &vertices = *pvHandle.product();
for(reco::VertexCollection::const_iterator it=vertices.begin() ; it!=vertices.end() ; ++it){
@@ -1936,41 +1936,41 @@ void MakeZprimeMiniAodTree::fillMET(const edm::Event& iEvent)
iEvent.getByToken(metToken_, mets);
const pat::MET &met = mets->front();
//[1] https://twiki.cern.ch/twiki/bin/viewauth/CMS/MissingETRun2Corrections
- //It is strongly recommended to use the Type-1 corrected MET, directly available from miniaod.
- //In case it is needed to recompute the Type-1 MET, please follow this twiki: here you find how
- //to get straight from miniAOD (slimmedMET and slimmedMETnoHF), how to recalculate correction
- //and uncertainties with the latest and greatest JEC.
- //You can find instructions for each analysis release.
+ //It is strongly recommended to use the Type-1 corrected MET, directly available from miniaod.
+ //In case it is needed to recompute the Type-1 MET, please follow this twiki: here you find how
+ //to get straight from miniAOD (slimmedMET and slimmedMETnoHF), how to recalculate correction
+ //and uncertainties with the latest and greatest JEC.
+ //You can find instructions for each analysis release.
//[2] https://twiki.cern.ch/twiki/bin/view/CMSPublic/WorkBookMiniAOD#Run2_Fall15_MiniAOD_v2_campaign
//the slimmedMETsNoHF was dropped (the recommendation from the MET group is to use standard slimmedMETs in 76X)
//The default type1 corrected MET
- PFMet_et_cor = met.et();
- PFMet_pt_cor = met.pt();
- PFMet_phi_cor = met.phi();
- PFMet_en_cor = met.energy();
- PFMet_px_cor = met.px();
- PFMet_py_cor = met.py();
- PFMet_pz_cor = met.pz();
+ PFMet_et_cor = met.et();
+ PFMet_pt_cor = met.pt();
+ PFMet_phi_cor = met.phi();
+ PFMet_en_cor = met.energy();
+ PFMet_px_cor = met.px();
+ PFMet_py_cor = met.py();
+ PFMet_pz_cor = met.pz();
PFMet_sumEt_cor = met.sumEt();
//The Raw PF Met (un-corrected MET in CMSSW_7_4_12 or later, on 74X version 2 miniAODs)
- /*PFMet_pt_uncor = met.uncorPt();
- PFMet_phi_uncor = met.uncorPhi();
- PFMet_en_uncor = met.uncorEnergy();
- PFMet_px_uncor = met.uncorPx();
- PFMet_py_uncor = met.uncorPy();
- PFMet_pz_uncor = met.uncorPz();
+ /*PFMet_pt_uncor = met.uncorPt();
+ PFMet_phi_uncor = met.uncorPhi();
+ PFMet_en_uncor = met.uncorEnergy();
+ PFMet_px_uncor = met.uncorPx();
+ PFMet_py_uncor = met.uncorPy();
+ PFMet_pz_uncor = met.uncorPz();
PFMet_sumEt_uncor = met.uncorSumEt();
//The Raw PF Met (un-corrected MET in CMSSW_7_4_11 or earlier, on 74X version 1 miniAODs)
- PFMet_pt_uncor = met.uncorrectedPt();
- PFMet_phi_uncor = met.uncorrectedPhi();
+ PFMet_pt_uncor = met.uncorrectedPt();
+ PFMet_phi_uncor = met.uncorrectedPhi();
PFMet_sumEt_uncor = met.uncorrectedSumEt();*/
- //The raw calo ETmiss
- CaloMet_pt = met.caloMETPt();
- CaloMet_phi = met.caloMETPhi();
+ //The raw calo ETmiss
+ CaloMet_pt = met.caloMETPt();
+ CaloMet_phi = met.caloMETPhi();
CaloMet_sumEt = met.caloMETSumEt();
PFMet_shiftedPt_JetEnUp = met.shiftedPt(pat::MET::JetEnUp);
PFMet_shiftedPt_JetEnDown = met.shiftedPt(pat::MET::JetEnDown);
- if (met.genMET() != NULL ) GenMet_pt = met.genMET()->pt();
+ if (met.genMET() != NULL ) GenMet_pt = met.genMET()->pt();
/*edm::Handle metsighandle;
iEvent.getByToken(theMETSignificance_, metsighandle);
METSign=*metsighandle;*/
@@ -1982,7 +1982,7 @@ void MakeZprimeMiniAodTree::fillMET(const edm::Event& iEvent)
//
//=============================================================
void MakeZprimeMiniAodTree::GenJetTree(const edm::Event& iEvent)
-{
+{
int NbGenJets = 0;
iGenJet.clear();
idGenJet.clear();
@@ -1994,7 +1994,7 @@ void MakeZprimeMiniAodTree::GenJetTree(const edm::Event& iEvent)
/**** GET GENJETS ****/
edm::Handle h_genjets;
iEvent.getByToken( EDMGenJetsToken_,h_genjets );
- if (!(h_genjets.isValid())) return;
+ if (!(h_genjets.isValid())) return;
std::vector const &genjets = *h_genjets;
for(size_t i=0; i(*j.daughter(id));
if (dau.charge() == 0) continue;
@@ -2062,7 +2062,7 @@ void MakeZprimeMiniAodTree::JetsTree(const edm::Event& iEvent,const edm::EventSe
jet_pileup_mva_disc.push_back(j.userFloat("pileupJetId:fullDiscriminant"));
}
else continue;
- }
+ }
}
//=============================================================
//
@@ -2084,7 +2084,7 @@ void MakeZprimeMiniAodTree::BtaggingTree(const edm::Event& iEvent)
iEvent.getByToken(jetToken_, jets);
// loop over jets
for( auto jet = jets->begin(); jet != jets->end(); ++jet )
- {
+ {
// fill discriminator variables
int flavor = std::abs( jet->partonFlavour() );
for( const std::string &bDiscr : bDiscriminators_ )
@@ -2114,7 +2114,7 @@ void MakeZprimeMiniAodTree::BtaggingTree(const edm::Event& iEvent)
//
//=============================================================
void MakeZprimeMiniAodTree::ParticleFlowPhotonTree(const edm::Event& iEvent,const edm::EventSetup& es)
-{
+{
pfphoton_size = 0;
pfphoton_pt.clear();
pfphoton_eta.clear();
@@ -2164,7 +2164,7 @@ void MakeZprimeMiniAodTree::ParticleFlowPhotonTree(const edm::Event& iEvent,cons
}
}
}
-//madgraph MC samples reweighing
+//madgraph MC samples reweighing
void MakeZprimeMiniAodTree::EventsReWeighting(const edm::Event& evt){
MC_weighting.clear();
float EventWeight = 1.0;
@@ -2242,8 +2242,8 @@ void MakeZprimeMiniAodTree::TauTree(const edm::Event& iEvent)
[11] kKilled, // MC only flag: the channel is killed in the real detector
[12] kTPSaturated, // the channel is in a region with saturated TP
[13] kL1SpikeFlag, // the channel is in a region with TP with sFGVB = 0
- [14] kWeird, // the signal is believed to originate from an anomalous deposit (spike)
- [15] kDiWeird, // the signal is anomalous, and neighbors another anomalous signal
+ [14] kWeird, // the signal is believed to originate from an anomalous deposit (spike)
+ [15] kDiWeird, // the signal is anomalous, and neighbors another anomalous signal
[16] kHasSwitchToGain6, // at least one data frame is in G6
[17] kHasSwitchToGain1, // at least one data frame is in G1
[18] kUnknown // to ease the interface with functions returning flags.
diff --git a/Analyzer/plugins/MakeZprimeMiniAodTreeHEEP.cc b/Analyzer/plugins/MakeZprimeMiniAodTreeHEEP.cc
index 3bb07b2..73d6ab2 100644
--- a/Analyzer/plugins/MakeZprimeMiniAodTreeHEEP.cc
+++ b/Analyzer/plugins/MakeZprimeMiniAodTreeHEEP.cc
@@ -10,7 +10,7 @@
//corresponds to which which cutnr
//this is fixed for a given ID (and can be different for each ID)
//hence its hard coded
-//also these headerfiles are intentionally completely standalone
+//also these headerfiles are intentionally completely standalone
//so you can easily include them in your analysis if you find them
//useful
#include "FWCore/Utilities/interface/InputTag.h"
@@ -77,7 +77,7 @@ using namespace pat;
#include "DataFormats/HLTReco/interface/TriggerTypeDefs.h"
#include "HLTrigger/HLTcore/interface/HLTConfigProvider.h"
#include "FWCore/ServiceRegistry/interface/Service.h"
-#include "CommonTools/UtilAlgos/interface/TFileService.h"
+#include "CommonTools/UtilAlgos/interface/TFileService.h"
#include "DataFormats/MuonReco/interface/MuonSelectors.h"
#include "DataFormats/MuonReco/interface/MuonCocktails.h"
#include "DataFormats/Common/interface/RefCore.h"
@@ -139,7 +139,7 @@ class MakeZprimeMiniAodTreeHEEP : public edm::EDAnalyzer {
static void globalEndJob(const NrPassFail* nrPassFail) {
std::cout <<"nr eles pass "<nrPass<<" / "<nrPass+nrPassFail->nrFail< > eleToken_;
// ----------member data --------------------------- //
edm::EDGetTokenT rhoToken;
edm::EDGetTokenT genInfoProductToken;
- edm::EDGetTokenT EDMGenJetsToken_;
+ edm::EDGetTokenT EDMGenJetsToken_;
edm::EDGetTokenT scProducer_;
edm::EDGetTokenT vtxToken_;
edm::EDGetTokenT muonToken_;
@@ -237,7 +237,7 @@ class MakeZprimeMiniAodTreeHEEP : public edm::EDAnalyzer {
std::vector Ele_phiTrack;
std::vector Ele_hadronicOverEm;
std::vector Ele_deltaEtaInSeedCluster;
- std::vector Ele_deltaPhiInSeedCluster;
+ std::vector Ele_deltaPhiInSeedCluster;
std::vector Ele_deltaEtaInSC;
std::vector Ele_deltaPhiInSC;
std::vector Ele_sigmaIetaIeta;
@@ -282,7 +282,7 @@ class MakeZprimeMiniAodTreeHEEP : public edm::EDAnalyzer {
std::vector Ele_hcalDepth2OverEcal;
std::vector Ele_dr03HcalDepth2TowerSumEt;
std::vector Ele_hcalDepth2TowerSumEtNoVeto;
- std::vector Ele_hcalDepth1TowerSumEtNoVeto;
+ std::vector Ele_hcalDepth1TowerSumEtNoVeto;
//------------- PF isolation from pat::ele -------------------------
std::vector Ele_pfSumPhotonEt;
std::vector Ele_pfSumChargedHadronPt;
@@ -360,7 +360,7 @@ class MakeZprimeMiniAodTreeHEEP : public edm::EDAnalyzer {
std::vector Tau_id;
std::vector Tau_LooseCombinedIsolationDeltaBetaCorr3Hits;
//=============================================================
- //
+ //
// Create Branchs for PileUp tree
//
//=============================================================
@@ -368,13 +368,13 @@ class MakeZprimeMiniAodTreeHEEP : public edm::EDAnalyzer {
int PU_BunchCrossing;
int num_PU_gen_vertices;
//=============================================================
- //
+ //
// Create Branch for Rho
//
//=============================================================
float Rho;
//=============================================================
- //
+ //
// Create Branch for events reweighting
//
//=============================================================
@@ -386,7 +386,7 @@ class MakeZprimeMiniAodTreeHEEP : public edm::EDAnalyzer {
//===================================================
std::vector iGen;
std::vector idGen;
- std::vector statusGen;
+ std::vector statusGen;
std::vector ptGen;
std::vector etaGen;
std::vector phiGen;
@@ -427,7 +427,7 @@ class MakeZprimeMiniAodTreeHEEP : public edm::EDAnalyzer {
std::vector Mu_eta;
std::vector Mu_phi;
std::vector Mu_et;
- std::vector Mu_charge;
+ std::vector Mu_charge;
std::vector Mu_normalizedChi2;
std::vector Mu_trackiso;
std::vector Mu_numberOfMatchedStations;
@@ -477,7 +477,7 @@ class MakeZprimeMiniAodTreeHEEP : public edm::EDAnalyzer {
std::vector Mu_stationMask;
std::vector Mu_numberOfMatchedRPCLayers;
//=============================================================
- //
+ //
// Create Branches for PF MET
//
//=============================================================
@@ -495,7 +495,7 @@ class MakeZprimeMiniAodTreeHEEP : public edm::EDAnalyzer {
double PFMet_pt_uncor;
double PFMet_phi_uncor;
double PFMet_sumEt_uncor;
- //The raw calo ETmiss
+ //The raw calo ETmiss
double CaloMet_pt;
double CaloMet_phi;
double CaloMet_sumEt;
@@ -559,7 +559,7 @@ MakeZprimeMiniAodTreeHEEP::MakeZprimeMiniAodTreeHEEP(const edm::ParameterSet& iC
bDiscriminators_(iConfig.getParameter >("bDiscriminators")),
outputFile_(iConfig.getParameter("outputFile"))
{
- rootFile_ = TFile::Open(outputFile_.c_str(),"RECREATE"); // open output file to store histograms
+ rootFile_ = TFile::Open(outputFile_.c_str(),"RECREATE"); // open output file to store histograms
BosonID_ = iConfig.getParameter("GenBosonID");
ParticleID1_ = iConfig.getParameter("ParticleID1");
ParticleID2_ = iConfig.getParameter("ParticleID2");
@@ -579,7 +579,7 @@ MakeZprimeMiniAodTreeHEEP::~MakeZprimeMiniAodTreeHEEP()
// ------------ method called once each job just before starting event loop ------------
void MakeZprimeMiniAodTreeHEEP::beginJob()
{
-
+
// go to *OUR* rootfile and book histograms
rootFile_->cd();
// Declare histograms
@@ -677,11 +677,11 @@ void MakeZprimeMiniAodTreeHEEP::beginJob()
mytree->Branch("Ele_dr03TkSumPt_corrected",&Ele_dr03TkSumPt_corrected);
mytree->Branch("Ele_nrSatCrys",&Ele_nrSatCrys);
mytree->Branch("Ele_isPassHeepID",&Ele_isPassHeepID);
- //=============================================================
+ //=============================================================
//
// Create Branchs for Muons match HLT variables
//
- //=============================================================
+ //=============================================================
mytree->Branch("HLT_nb", &HLT_nb);
mytree->Branch("HLT_name", &HLT_name);
mytree->Branch("HLT_isaccept", &HLT_isaccept);
@@ -718,7 +718,7 @@ void MakeZprimeMiniAodTreeHEEP::beginJob()
mytree->Branch("pxGen",&pxGen);
mytree->Branch("pyGen",&pyGen);
mytree->Branch("pzGen",&pzGen);
- //=============================================================
+ //=============================================================
//
// Create Branchs for Muons variables
//
@@ -784,7 +784,7 @@ void MakeZprimeMiniAodTreeHEEP::beginJob()
mytree->Branch("Mu_stationMask",&Mu_stationMask);
mytree->Branch("Mu_numberOfMatchedRPCLayers",&Mu_numberOfMatchedRPCLayers);
//=============================================================
- //
+ //
// Create Branches for PF MET
//
//=============================================================
@@ -798,7 +798,7 @@ void MakeZprimeMiniAodTreeHEEP::beginJob()
mytree->Branch("PFMet_py_cor", &PFMet_py_cor, "PFMet_py_cor/D");
mytree->Branch("PFMet_pz_cor", &PFMet_pz_cor, "PFMet_pz_cor/D");
mytree->Branch("PFMet_sumEt_cor",&PFMet_sumEt_cor,"PFMet_sumEt_cor/D");
- //The raw calo ETmiss
+ //The raw calo ETmiss
mytree->Branch("CaloMet_pt", &CaloMet_pt, "CaloMet_pt/D");
mytree->Branch("CaloMet_phi", &CaloMet_phi, "CaloMet_phi/D");
mytree->Branch("CaloMet_sumEt",&CaloMet_sumEt,"CaloMet_sumEt/D");
@@ -811,9 +811,9 @@ void MakeZprimeMiniAodTreeHEEP::beginJob()
//mytree->Branch("METSign",&METSign,"METSign/D");
//=============================================================
//
- // Create Branches for jets variables
+ // Create Branches for jets variables
//
- //=============================================================
+ //=============================================================
mytree->Branch("jet_nb",&jet_nb);
mytree->Branch("jet_charge",&jet_charge);
mytree->Branch("jet_et",&jet_et);
@@ -826,9 +826,9 @@ void MakeZprimeMiniAodTreeHEEP::beginJob()
mytree->Branch("jet_pileup_mva_disc",&jet_pileup_mva_disc);
//=============================================================
//
- // Create Branches for Btagging variables
+ // Create Branches for Btagging variables
//
- //=============================================================
+ //=============================================================
mytree->Branch("Nb_bDiscriminators",&Nb_bDiscriminators);
mytree->Branch("jet_btag_pt",&jet_btag_pt);
mytree->Branch("jet_btag_eta",&jet_btag_eta);
@@ -862,21 +862,21 @@ void MakeZprimeMiniAodTreeHEEP::beginJob()
//mytree->Branch("pfphoton_PFPUchAllPart",&pfphoton_PFPUchAllPart);
//mytree->Branch("pfphoton_pfphoton_PFX_rho",&pfphoton_pfphoton_PFX_rho);
//=============================================================
- //
- // Create Branchs for PileUp tree
+ //
+ // Create Branchs for PileUp tree
//
//=============================================================
mytree->Branch("num_PU_vertices",&num_PU_vertices,"num_PU_vertices/I");
mytree->Branch("PU_BunchCrossing",&PU_BunchCrossing,"PU_BunchCrossing/I");
mytree->Branch("num_PU_gen_vertices",&num_PU_gen_vertices,"num_PU_gen_vertices/I");
//=============================================================
- //
+ //
// Create Branch for Rho
//
//=============================================================
mytree->Branch("Rho",&Rho,"Rho/F");
//=============================================================
- //
+ //
// Create Branch for events reweighting
//
//=============================================================
@@ -899,7 +899,7 @@ void MakeZprimeMiniAodTreeHEEP::analyze(const edm::Event& iEvent, const edm::Eve
{
//==============================================
//= Begin of the main program =
- //==============================================
+ //==============================================
Run = (unsigned int) iEvent.id().run();
Event = (unsigned int) iEvent.id().event();
lumi = (unsigned int) iEvent.luminosityBlock();
@@ -913,10 +913,10 @@ void MakeZprimeMiniAodTreeHEEP::analyze(const edm::Event& iEvent, const edm::Eve
if( GoodPv == 0 ) return; //the aim of that command is to select only events
PatElectronTree(iEvent,iSetup);
PatMuonTree(iEvent,iSetup);
- TriggerMatchingTree(iEvent,iSetup);
+ TriggerMatchingTree(iEvent,iSetup);
ComputeMuonMassVtx(iEvent,iSetup);
accessGenInfo(iEvent,iSetup);
- fillMET(iEvent);
+ fillMET(iEvent);
JetsTree(iEvent,iSetup);
GenJetTree(iEvent);
ParticleFlowPhotonTree(iEvent,iSetup);
@@ -927,11 +927,11 @@ void MakeZprimeMiniAodTreeHEEP::analyze(const edm::Event& iEvent, const edm::Eve
TauTree(iEvent);
//==============================================
//= End of the main program =
- //==============================================
+ //==============================================
mytree->Fill();
}
// ------------ method called once each job just after ending the event loop ------------
-void MakeZprimeMiniAodTreeHEEP::endJob()
+void MakeZprimeMiniAodTreeHEEP::endJob()
{
// go to *OUR* root file and store histograms
rootFile_->cd();
@@ -969,7 +969,7 @@ bool MakeZprimeMiniAodTreeHEEP::PrimaryVertex(const reco::VertexCollection &vert
//
//=============================================================
void MakeZprimeMiniAodTreeHEEP::PatElectronTree(const edm::Event& iEvent,const edm::EventSetup& es)
-{
+{
unsigned int NbElectrons = -1 ;
Ele_nbElectrons.clear();
Ele_dr03TkSumPt.clear();
@@ -993,7 +993,7 @@ void MakeZprimeMiniAodTreeHEEP::PatElectronTree(const edm::Event& iEvent,const e
Ele_phiTrack.clear();
Ele_hadronicOverEm.clear();
Ele_deltaEtaInSeedCluster.clear();
- Ele_deltaPhiInSeedCluster.clear();
+ Ele_deltaPhiInSeedCluster.clear();
Ele_deltaEtaInSC.clear();
Ele_deltaPhiInSC.clear();
Ele_sigmaIetaIeta.clear();
@@ -1035,7 +1035,7 @@ void MakeZprimeMiniAodTreeHEEP::PatElectronTree(const edm::Event& iEvent,const e
Ele_hcalDepth2OverEcal.clear();
Ele_dr03HcalDepth2TowerSumEt.clear();
Ele_hcalDepth2TowerSumEtNoVeto.clear();
- Ele_hcalDepth1TowerSumEtNoVeto.clear();
+ Ele_hcalDepth1TowerSumEtNoVeto.clear();
Ele_pfSumPhotonEt.clear();
Ele_pfSumChargedHadronPt.clear();
Ele_pfSumNeutralHadronEt.clear();
@@ -1063,17 +1063,17 @@ void MakeZprimeMiniAodTreeHEEP::PatElectronTree(const edm::Event& iEvent,const e
//------------ Rec Hits in EB ----------------
edm::Handle ecalEB;
iEvent.getByToken(tok_EB_,ecalEB);
- //------------ Rec Hits in EE ----------------
+ //------------ Rec Hits in EE ----------------
edm::Handle ecalEE;
iEvent.getByToken(tok_EE_,ecalEE);
std::auto_ptr lazyTools_;
- lazyTools_ .reset(new EcalClusterLazyTools( iEvent, es, ecalRechitEBToken_, ecalRechitEEToken_ ));
+ lazyTools_ .reset(new EcalClusterLazyTools( iEvent, es, ecalRechitEBToken_, ecalRechitEEToken_ ));
edm::Handle > eleHandle;
iEvent.getByToken(eleToken_,eleHandle);
for(auto& el : *eleHandle){
if(el.caloEnergy() * sin(el.p4().theta()) < 20) continue;
NbElectrons++;
- Ele_nbElectrons.push_back(NbElectrons);
+ Ele_nbElectrons.push_back(NbElectrons);
Ele_Et.push_back(el.superCluster()->energy() * sin(el.p4().theta()));
Ele_EtFromCaloEn.push_back(el.caloEnergy() * sin(el.p4().theta()));
//================================================================
@@ -1098,14 +1098,14 @@ void MakeZprimeMiniAodTreeHEEP::PatElectronTree(const edm::Event& iEvent,const e
// End New piece of code by Sam
//
//================================================================
- Ele_pt.push_back(el.pt());
+ Ele_pt.push_back(el.pt());
Ele_thetaSC.push_back(el.caloPosition().theta()); //theta SC
Ele_etaSC.push_back(el.superCluster()->eta()); //eta SC
Ele_phiSC.push_back(el.superCluster()->phi()); //phi SC
- Ele_phiWidth.push_back(el.superCluster()->phiWidth());
- Ele_etaWidth.push_back(el.superCluster()->etaWidth());
+ Ele_phiWidth.push_back(el.superCluster()->phiWidth());
+ Ele_etaWidth.push_back(el.superCluster()->etaWidth());
Ele_energySC.push_back(el.superCluster()->energy()); //energy SC
- Ele_preshowerEnergySC.push_back(el.superCluster()->preshowerEnergy());
+ Ele_preshowerEnergySC.push_back(el.superCluster()->preshowerEnergy());
Ele_thetaTrack.push_back(el.p4().theta()); //theta track
Ele_etaTrack.push_back(el.p4().eta()); //eta track
Ele_phiTrack.push_back(el.p4().phi()); //phi track
@@ -1126,7 +1126,7 @@ void MakeZprimeMiniAodTreeHEEP::PatElectronTree(const edm::Event& iEvent,const e
Ele_e5x5.push_back(el.e5x5());
Ele_e2x5MaxOver5x5.push_back(el.e2x5Max()/el.e5x5());
Ele_e1x5Over5x5.push_back(el.e1x5()/el.e5x5());
- Ele_sigmaIetaIetaFull5x5.push_back(el.full5x5_sigmaIetaIeta());
+ Ele_sigmaIetaIetaFull5x5.push_back(el.full5x5_sigmaIetaIeta());
Ele_e2x5MaxFull5x5.push_back(el.full5x5_e2x5Max());
Ele_e1x5Full5x5.push_back(el.full5x5_e1x5());
Ele_e5x5Full5x5.push_back(el.full5x5_e5x5());
@@ -1152,29 +1152,29 @@ void MakeZprimeMiniAodTreeHEEP::PatElectronTree(const edm::Event& iEvent,const e
Ele_frac15.push_back( lazyTools_->e1x5(*(el.superCluster()->seed()))/el.full5x5_e5x5() );
Ele_nbVtx.push_back(vertices->size());
if(vertices->size()>0){
- Ele_dxy.push_back(el.gsfTrack()->dxy(PV.position()));
- Ele_dz.push_back(el.gsfTrack()->dz(PV.position()));
+ Ele_dxy.push_back(el.gsfTrack()->dxy(PV.position()));
+ Ele_dz.push_back(el.gsfTrack()->dz(PV.position()));
}
else{
- Ele_dxy.push_back(el.gsfTrack()->dxy());
+ Ele_dxy.push_back(el.gsfTrack()->dxy());
Ele_dz.push_back(el.gsfTrack()->dz());
}
Ele_isEcalDrivenSeed.push_back(el.ecalDrivenSeed());
Ele_isPassConversionVeto.push_back(el.passConversionVeto());
Ele_charge.push_back(el.gsfTrack()->charge());
Ele_rhoIso.push_back(rhoIso);
- Ele_nbOfMissingHits.push_back(el.gsfTrack()->numberOfLostHits());
+ Ele_nbOfMissingHits.push_back(el.gsfTrack()->numberOfLostHits());
Ele_fbrem.push_back(el.fbrem());
Ele_EoverP.push_back(el.eSeedClusterOverP());
- Ele_Xposition.push_back(el.caloPosition().x());
- Ele_Yposition.push_back(el.caloPosition().y());
+ Ele_Xposition.push_back(el.caloPosition().x());
+ Ele_Yposition.push_back(el.caloPosition().y());
//------------- detector isolation -------------------------
Ele_hcalDepth1OverEcal.push_back(el.hcalDepth1OverEcal());
Ele_hcalDepth2OverEcal.push_back(el.hcalDepth2OverEcal());
Ele_dr03HcalDepth2TowerSumEt.push_back(el.dr03HcalDepth2TowerSumEt());
- Ele_hcalDepth2TowerSumEtNoVeto.push_back(el.isolationVariables03().hcalDepth2TowerSumEt);// hcaldepht2 iso deposit with
+ Ele_hcalDepth2TowerSumEtNoVeto.push_back(el.isolationVariables03().hcalDepth2TowerSumEt);// hcaldepht2 iso deposit with
// electron footprint removed
- Ele_hcalDepth1TowerSumEtNoVeto.push_back(el.isolationVariables03().hcalDepth1TowerSumEt);// hcaldepht1 iso deposit with
+ Ele_hcalDepth1TowerSumEtNoVeto.push_back(el.isolationVariables03().hcalDepth1TowerSumEt);// hcaldepht1 iso deposit with
// electron footprint removed
Ele_EcalPlusHcald1iso.push_back(el.dr03EcalRecHitSumEt() + el.dr03HcalDepth1TowerSumEt());
Ele_dr03EcalRecHitSumEt.push_back(el.dr03EcalRecHitSumEt());
@@ -1182,16 +1182,16 @@ void MakeZprimeMiniAodTreeHEEP::PatElectronTree(const edm::Event& iEvent,const e
Ele_dr03HcalDepth1TowerSumEtBc.push_back(el.dr03HcalDepth1TowerSumEtBc());
//------------- PF isolation from pat::ele -------------------------
Ele_pfSumPhotonEt.push_back(el.pfIsolationVariables().sumPhotonEt);
- Ele_pfSumChargedHadronPt.push_back(el.pfIsolationVariables().sumChargedHadronPt);
+ Ele_pfSumChargedHadronPt.push_back(el.pfIsolationVariables().sumChargedHadronPt);
Ele_pfSumNeutralHadronEt.push_back(el.pfIsolationVariables().sumNeutralHadronEt);
- Ele_pfSumPUPt.push_back(el.pfIsolationVariables().sumPUPt);
+ Ele_pfSumPUPt.push_back(el.pfIsolationVariables().sumPUPt);
// do deltaBeta
double charged = el.pfIsolationVariables().sumPhotonEt;
double neutral = el.pfIsolationVariables().sumNeutralHadronEt;
double pileup = el.pfIsolationVariables().sumPUPt;
double deltaBeta = charged + std::max(0.0, neutral-0.5*pileup);
Ele_pfDeltaBeta.push_back(deltaBeta);
- }
+ }
}
//=============================================================
//
@@ -1199,7 +1199,7 @@ void MakeZprimeMiniAodTreeHEEP::PatElectronTree(const edm::Event& iEvent,const e
//
//=============================================================
void MakeZprimeMiniAodTreeHEEP::TriggerMatchingTree(const edm::Event& iEvent,const edm::EventSetup& es)
-{
+{
int NbTriggers = 0;
int NbTriggerObj = 0;
HLT_nb.clear();
@@ -1231,7 +1231,7 @@ void MakeZprimeMiniAodTreeHEEP::TriggerMatchingTree(const edm::Event& iEvent,con
names.triggerName(i) != "HLT_TkMu50_v3" && names.triggerName(i) != "HLT_TkMu50_v4" &&
names.triggerName(i) != "HLT_TkMu50_v5" && names.triggerName(i) != "HLT_TkMu50_v6" &&
names.triggerName(i) != "HLT_TkMu50_v7" && names.triggerName(i) != "HLT_TkMu50_v8" &&
- names.triggerName(i) != "HLT_TkMu50_v9" && names.triggerName(i) != "HLT_TkMu50_v10" &&
+ names.triggerName(i) != "HLT_TkMu50_v9" && names.triggerName(i) != "HLT_TkMu50_v10" &&
names.triggerName(i) != "HLT_DoubleEle33_CaloIdL_MW_v1" && names.triggerName(i) != "HLT_DoubleEle33_CaloIdL_MW_v2" &&
names.triggerName(i) != "HLT_DoubleEle33_CaloIdL_MW_v3" && names.triggerName(i) != "HLT_DoubleEle33_CaloIdL_MW_v4" &&
names.triggerName(i) != "HLT_DoubleEle33_CaloIdL_MW_v5" && names.triggerName(i) != "HLT_DoubleEle33_CaloIdL_MW_v6" &&
@@ -1251,17 +1251,17 @@ void MakeZprimeMiniAodTreeHEEP::TriggerMatchingTree(const edm::Event& iEvent,con
names.triggerName(i) != "HLT_Mu33_Ele33_CaloIdL_GsfTrkIdVL_v3" && names.triggerName(i) != "HLT_Mu33_Ele33_CaloIdL_GsfTrkIdVL_v4" &&
names.triggerName(i) != "HLT_Mu33_Ele33_CaloIdL_GsfTrkIdVL_v5" && names.triggerName(i) != "HLT_Mu33_Ele33_CaloIdL_GsfTrkIdVL_v6" &&
names.triggerName(i) != "HLT_Mu33_Ele33_CaloIdL_GsfTrkIdVL_v7" && names.triggerName(i) != "HLT_Mu33_Ele33_CaloIdL_GsfTrkIdVL_v8" &&
- names.triggerName(i) != "HLT_Mu33_Ele33_CaloIdL_GsfTrkIdVL_v9" && names.triggerName(i) != "HLT_Mu33_Ele33_CaloIdL_GsfTrkIdVL_v10"
+ names.triggerName(i) != "HLT_Mu33_Ele33_CaloIdL_GsfTrkIdVL_v9" && names.triggerName(i) != "HLT_Mu33_Ele33_CaloIdL_GsfTrkIdVL_v10"
) continue;
//std::string const& name = names.triggerName(i);
//full_name = name;
NbTriggers++;
HLT_nb.push_back(NbTriggers);
- HLT_name.push_back(names.triggerName(i));
+ HLT_name.push_back(names.triggerName(i));
HLT_isaccept.push_back(triggerBits->accept(i));
- /*std::cout << "Trigger " << names.triggerName(i) <<
+ /*std::cout << "Trigger " << names.triggerName(i) <<
", prescale " << triggerPrescales->getPrescaleForIndex(i) <<
- ": " << (triggerBits->accept(i) ? "PASS" : "fail (or not run)")
+ ": " << (triggerBits->accept(i) ? "PASS" : "fail (or not run)")
<< std::endl;*/
}
for (unsigned i = 0; i < trigobj_handle->size(); ++i) {
@@ -1282,7 +1282,7 @@ void MakeZprimeMiniAodTreeHEEP::TriggerMatchingTree(const edm::Event& iEvent,con
pathnames[j] != "HLT_TkMu50_v3" && pathnames[j] != "HLT_TkMu50_v4" &&
pathnames[j] != "HLT_TkMu50_v5" && pathnames[j] != "HLT_TkMu50_v6" &&
pathnames[j] != "HLT_TkMu50_v7" && pathnames[j] != "HLT_TkMu50_v8" &&
- pathnames[j] != "HLT_TkMu50_v9" && pathnames[j] != "HLT_TkMu50_v10" &&
+ pathnames[j] != "HLT_TkMu50_v9" && pathnames[j] != "HLT_TkMu50_v10" &&
pathnames[j] != "HLT_DoubleEle33_CaloIdL_MW_v1" && pathnames[j] != "HLT_DoubleEle33_CaloIdL_MW_v2" &&
pathnames[j] != "HLT_DoubleEle33_CaloIdL_MW_v3" && pathnames[j] != "HLT_DoubleEle33_CaloIdL_MW_v4" &&
pathnames[j] != "HLT_DoubleEle33_CaloIdL_MW_v5" && pathnames[j] != "HLT_DoubleEle33_CaloIdL_MW_v6" &&
@@ -1305,7 +1305,7 @@ void MakeZprimeMiniAodTreeHEEP::TriggerMatchingTree(const edm::Event& iEvent,con
pathnames[j] != "HLT_Mu33_Ele33_CaloIdL_GsfTrkIdVL_v9" && pathnames[j] != "HLT_Mu33_Ele33_CaloIdL_GsfTrkIdVL_v10"
) continue;
HLTObj_nbObj.push_back(NbTriggerObj);
- HLTObj_pt.push_back(src.pt());
+ HLTObj_pt.push_back(src.pt());
HLTObj_eta.push_back(src.eta());
HLTObj_phi.push_back(src.phi());
HLTObj_collection.push_back(pathnames[j]);
@@ -1333,7 +1333,7 @@ bool MakeZprimeMiniAodTreeHEEP::isAncestor(const reco::Candidate* ancestor, cons
}
void MakeZprimeMiniAodTreeHEEP::accessGenInfo(const edm::Event& iEvent,const edm::EventSetup& es)
-{
+{
int NbGenMuons = 0;
iGen.clear();
idGen.clear();
@@ -1349,12 +1349,12 @@ void MakeZprimeMiniAodTreeHEEP::accessGenInfo(const edm::Event& iEvent,const edm
// Pruned particles are the one containing "important" stuff
Handle > pruned;
iEvent.getByToken(prunedGenToken_,pruned);
- if (!(pruned.isValid())) return;
+ if (!(pruned.isValid())) return;
// Packed particles are all the status 1, so usable to remake jets
// The navigation from status 1 to pruned is possible (the other direction should be made by hand)
Handle > packed;
iEvent.getByToken(packedGenToken_,packed);
- //let's try to find all status1 originating directly from a B meson decay
+ //let's try to find all status1 originating directly from a B meson decay
for(size_t i=0; isize();i++){
//if(abs((*pruned)[i].pdgId()) > 22 && abs((*pruned)[i].pdgId()) <24){
if(abs((*pruned)[i].pdgId()) < BosonID_){
@@ -1362,12 +1362,12 @@ void MakeZprimeMiniAodTreeHEEP::accessGenInfo(const edm::Event& iEvent,const edm
//std::cout << "PdgID: " << Zprime->pdgId() << " pt " << Zprime->pt() << " eta: " << Zprime->eta() << " phi: " << Zprime->phi() << std::endl;
//std::cout << " found daugthers: " << std::endl;
for(size_t j=0; jsize();j++){
- //get the pointer to the first survied ancestor of a given packed GenParticle in the prunedCollection
+ //get the pointer to the first survied ancestor of a given packed GenParticle in the prunedCollection
const Candidate * motherInPrunedCollection = (*packed)[j].mother(0) ;
if(motherInPrunedCollection != nullptr && isAncestor( Zprime , motherInPrunedCollection)){
if( (*packed)[j].pt() < 20.0 ) continue;
- if( fabs((*packed)[j].pdgId()) != ParticleID1_ &&
- fabs((*packed)[j].pdgId()) != ParticleID2_ &&
+ if( fabs((*packed)[j].pdgId()) != ParticleID1_ &&
+ fabs((*packed)[j].pdgId()) != ParticleID2_ &&
fabs((*packed)[j].pdgId()) != ParticleID3_ ) continue;
if( (*packed)[j].status() > ParticleStatus_ ) continue;
NbGenMuons++;
@@ -1393,7 +1393,7 @@ void MakeZprimeMiniAodTreeHEEP::accessGenInfo(const edm::Event& iEvent,const edm
//
//=============================================================
void MakeZprimeMiniAodTreeHEEP::PatMuonTree(const edm::Event& evt,const edm::EventSetup& es)
-{
+{
int NbMuons = 0;
Mu_nbMuon.clear();
Mu_isTightMuon.clear();
@@ -1434,7 +1434,7 @@ void MakeZprimeMiniAodTreeHEEP::PatMuonTree(const edm::Event& evt,const edm::Eve
Mu_thetaTunePMuonBestTrack.clear();
Mu_chargeTunePMuonBestTrack.clear();
Mu_absdxyTunePMuonBestTrack.clear();
- Mu_absdzTunePMuonBestTrack.clear();
+ Mu_absdzTunePMuonBestTrack.clear();
Mu_ptInnerTrack.clear();
Mu_dPToverPTInnerTrack.clear();
Mu_pxInnerTrack.clear();
@@ -1454,7 +1454,7 @@ void MakeZprimeMiniAodTreeHEEP::PatMuonTree(const edm::Event& evt,const edm::Eve
Mu_passOldMatchedStationsCut.clear();
Mu_stationMask.clear();
Mu_numberOfMatchedRPCLayers.clear();
- // Get TransientTracks (for use in e.g. the vertex fit) for each of
+ // Get TransientTracks (for use in e.g. the vertex fit) for each of
// the muon tracks, using e.g. the cocktail momentum.
//edm::ESHandle ttkb;
//es.get().get("TransientTrackBuilder", ttkb);
@@ -1503,10 +1503,10 @@ void MakeZprimeMiniAodTreeHEEP::PatMuonTree(const edm::Event& evt,const edm::Eve
const reco::TrackRef& tunePTrack = mu.tunePMuonBestTrack();
Mu_ptTunePMuonBestTrack.push_back(tunePTrack->pt());
Mu_dPToverPTTunePMuonBestTrack.push_back(tunePTrack->ptError()/tunePTrack->pt());
- Mu_pxTunePMuonBestTrack.push_back(tunePTrack->px()); //px component of the track
- Mu_pyTunePMuonBestTrack.push_back(tunePTrack->py()); //py component of the track
- Mu_pzTunePMuonBestTrack.push_back(tunePTrack->pz()); //pz component of the track
- Mu_pTunePMuonBestTrack.push_back(tunePTrack->p()); //magnitude of momentum vector
+ Mu_pxTunePMuonBestTrack.push_back(tunePTrack->px()); //px component of the track
+ Mu_pyTunePMuonBestTrack.push_back(tunePTrack->py()); //py component of the track
+ Mu_pzTunePMuonBestTrack.push_back(tunePTrack->pz()); //pz component of the track
+ Mu_pTunePMuonBestTrack.push_back(tunePTrack->p()); //magnitude of momentum vector
Mu_etaTunePMuonBestTrack.push_back(tunePTrack->eta());
Mu_phiTunePMuonBestTrack.push_back(tunePTrack->phi());
Mu_thetaTunePMuonBestTrack.push_back(tunePTrack->theta());
@@ -1519,12 +1519,12 @@ void MakeZprimeMiniAodTreeHEEP::PatMuonTree(const edm::Event& evt,const edm::Eve
Mu_eta.push_back(mu.eta());
Mu_phi.push_back(mu.phi());
Mu_charge.push_back(mu.charge());
- Mu_ptInnerTrack.push_back(mu.innerTrack()->pt());
+ Mu_ptInnerTrack.push_back(mu.innerTrack()->pt());
Mu_dPToverPTInnerTrack.push_back(mu.innerTrack()->ptError()/mu.innerTrack()->pt());
- Mu_pxInnerTrack.push_back(mu.innerTrack()->px());
- Mu_pyInnerTrack.push_back(mu.innerTrack()->py());
- Mu_pzInnerTrack.push_back(mu.innerTrack()->pz());
- Mu_pInnerTrack.push_back(mu.innerTrack()->p());
+ Mu_pxInnerTrack.push_back(mu.innerTrack()->px());
+ Mu_pyInnerTrack.push_back(mu.innerTrack()->py());
+ Mu_pzInnerTrack.push_back(mu.innerTrack()->pz());
+ Mu_pInnerTrack.push_back(mu.innerTrack()->p());
Mu_etaInnerTrack.push_back(mu.innerTrack()->eta());
Mu_phiInnerTrack.push_back(mu.innerTrack()->phi());
Mu_thetaInnerTrack.push_back(mu.innerTrack()->theta());
@@ -1567,7 +1567,7 @@ void MakeZprimeMiniAodTreeHEEP::PatMuonTree(const edm::Event& evt,const edm::Eve
}
void MakeZprimeMiniAodTreeHEEP::ComputeMuonMassVtx(const edm::Event& evt,const edm::EventSetup& es)
-{
+{
int NbMuons1 = 0;
int NbMuons2 = 0;
int NbMuons3 = 0;
@@ -1604,10 +1604,10 @@ void MakeZprimeMiniAodTreeHEEP::ComputeMuonMassVtx(const edm::Event& evt,const e
if( !mu.globalTrack().isNonnull() ) continue;
if( mu.isTrackerMuon()==false ) continue;
MuonBestTrack1 = mu.tunePMuonBestTrack();
- if( MuonBestTrack1->pt()>53.0 && (mu.isolationR03().sumPt/mu.innerTrack()->pt()<0.10)
- && (MuonBestTrack1->ptError()/MuonBestTrack1->pt()<0.3) &&
+ if( MuonBestTrack1->pt()>53.0 && (mu.isolationR03().sumPt/mu.innerTrack()->pt()<0.10)
+ && (MuonBestTrack1->ptError()/MuonBestTrack1->pt()<0.3) &&
fabs(MuonBestTrack1->dxy(vertex.position()))<0.2 &&
- mu.globalTrack()->hitPattern().trackerLayersWithMeasurement()>5 &&
+ mu.globalTrack()->hitPattern().trackerLayersWithMeasurement()>5 &&
mu.globalTrack()->hitPattern().numberOfValidPixelHits()>0 &&
mu.globalTrack()->hitPattern().numberOfValidMuonHits()>0 &&
(mu.numberOfMatchedStations()>1
@@ -1627,10 +1627,10 @@ void MakeZprimeMiniAodTreeHEEP::ComputeMuonMassVtx(const edm::Event& evt,const e
MuonBestTrack2 = mu2.tunePMuonBestTrack();
//cout << "PT 2mu= " << MuonBestTrack2->pt() << " and charge =" << MuonBestTrack2->charge()<< endl;
if(MuonBestTrack2->pt() == MuonBestTrack1->pt()) continue;
- if( MuonBestTrack2->pt()>53.0 && (mu2.isolationR03().sumPt/mu2.innerTrack()->pt()<0.10)
- && (MuonBestTrack2->ptError()/MuonBestTrack2->pt()<0.3) &&
+ if( MuonBestTrack2->pt()>53.0 && (mu2.isolationR03().sumPt/mu2.innerTrack()->pt()<0.10)
+ && (MuonBestTrack2->ptError()/MuonBestTrack2->pt()<0.3) &&
fabs(MuonBestTrack2->dxy(vertex.position()))<0.2 &&
- mu2.globalTrack()->hitPattern().trackerLayersWithMeasurement()>5 &&
+ mu2.globalTrack()->hitPattern().trackerLayersWithMeasurement()>5 &&
mu2.globalTrack()->hitPattern().numberOfValidPixelHits()>0 &&
mu2.globalTrack()->hitPattern().numberOfValidMuonHits()>0 &&
(mu2.numberOfMatchedStations()>1
@@ -1664,12 +1664,12 @@ void MakeZprimeMiniAodTreeHEEP::ComputeMuonMassVtx(const edm::Event& evt,const e
if( mu3.isTrackerMuon()==false ) continue;
MuonBestTrack3 = mu3.tunePMuonBestTrack();
//cout << "PT 3mu= " << MuonBestTrack3->pt() << " and charge =" << MuonBestTrack3->charge() << endl;
- if(MuonBestTrack3->pt() == MuonBestTrack1->pt()) continue;
- if(MuonBestTrack3->pt() == MuonBestTrack2->pt()) continue;
- if( MuonBestTrack3->pt()>53.0 && (mu3.isolationR03().sumPt/mu3.innerTrack()->pt()<0.10)
- && (MuonBestTrack3->ptError()/MuonBestTrack3->pt()<0.3) &&
+ if(MuonBestTrack3->pt() == MuonBestTrack1->pt()) continue;
+ if(MuonBestTrack3->pt() == MuonBestTrack2->pt()) continue;
+ if( MuonBestTrack3->pt()>53.0 && (mu3.isolationR03().sumPt/mu3.innerTrack()->pt()<0.10)
+ && (MuonBestTrack3->ptError()/MuonBestTrack3->pt()<0.3) &&
fabs(MuonBestTrack3->dxy(vertex.position()))<0.2 &&
- mu3.globalTrack()->hitPattern().trackerLayersWithMeasurement()>5 &&
+ mu3.globalTrack()->hitPattern().trackerLayersWithMeasurement()>5 &&
mu3.globalTrack()->hitPattern().numberOfValidPixelHits()>0 &&
mu3.globalTrack()->hitPattern().numberOfValidMuonHits()>0 &&
(mu3.numberOfMatchedStations()>1
@@ -1736,7 +1736,7 @@ void MakeZprimeMiniAodTreeHEEP::PrimaryVertexTree(const edm::Event& iEvent,const
PositionY.clear();
PositionZ.clear();
PositionRho.clear();
- edm::Handle pvHandle;
+ edm::Handle pvHandle;
iEvent.getByToken(vtxToken_,pvHandle);
const reco::VertexCollection &vertices = *pvHandle.product();
for(reco::VertexCollection::const_iterator it=vertices.begin() ; it!=vertices.end() ; ++it){
@@ -1761,41 +1761,41 @@ void MakeZprimeMiniAodTreeHEEP::fillMET(const edm::Event& iEvent)
iEvent.getByToken(metToken_, mets);
const pat::MET &met = mets->front();
//[1] https://twiki.cern.ch/twiki/bin/viewauth/CMS/MissingETRun2Corrections
- //It is strongly recommended to use the Type-1 corrected MET, directly available from miniaod.
- //In case it is needed to recompute the Type-1 MET, please follow this twiki: here you find how
- //to get straight from miniAOD (slimmedMET and slimmedMETnoHF), how to recalculate correction
- //and uncertainties with the latest and greatest JEC.
- //You can find instructions for each analysis release.
+ //It is strongly recommended to use the Type-1 corrected MET, directly available from miniaod.
+ //In case it is needed to recompute the Type-1 MET, please follow this twiki: here you find how
+ //to get straight from miniAOD (slimmedMET and slimmedMETnoHF), how to recalculate correction
+ //and uncertainties with the latest and greatest JEC.
+ //You can find instructions for each analysis release.
//[2] https://twiki.cern.ch/twiki/bin/view/CMSPublic/WorkBookMiniAOD#Run2_Fall15_MiniAOD_v2_campaign
//the slimmedMETsNoHF was dropped (the recommendation from the MET group is to use standard slimmedMETs in 76X)
//The default type1 corrected MET
- PFMet_et_cor = met.et();
- PFMet_pt_cor = met.pt();
- PFMet_phi_cor = met.phi();
- PFMet_en_cor = met.energy();
- PFMet_px_cor = met.px();
- PFMet_py_cor = met.py();
- PFMet_pz_cor = met.pz();
+ PFMet_et_cor = met.et();
+ PFMet_pt_cor = met.pt();
+ PFMet_phi_cor = met.phi();
+ PFMet_en_cor = met.energy();
+ PFMet_px_cor = met.px();
+ PFMet_py_cor = met.py();
+ PFMet_pz_cor = met.pz();
PFMet_sumEt_cor = met.sumEt();
//The Raw PF Met (un-corrected MET in CMSSW_7_4_12 or later, on 74X version 2 miniAODs)
- /*PFMet_pt_uncor = met.uncorPt();
- PFMet_phi_uncor = met.uncorPhi();
- PFMet_en_uncor = met.uncorEnergy();
- PFMet_px_uncor = met.uncorPx();
- PFMet_py_uncor = met.uncorPy();
- PFMet_pz_uncor = met.uncorPz();
+ /*PFMet_pt_uncor = met.uncorPt();
+ PFMet_phi_uncor = met.uncorPhi();
+ PFMet_en_uncor = met.uncorEnergy();
+ PFMet_px_uncor = met.uncorPx();
+ PFMet_py_uncor = met.uncorPy();
+ PFMet_pz_uncor = met.uncorPz();
PFMet_sumEt_uncor = met.uncorSumEt();
//The Raw PF Met (un-corrected MET in CMSSW_7_4_11 or earlier, on 74X version 1 miniAODs)
- PFMet_pt_uncor = met.uncorrectedPt();
- PFMet_phi_uncor = met.uncorrectedPhi();
+ PFMet_pt_uncor = met.uncorrectedPt();
+ PFMet_phi_uncor = met.uncorrectedPhi();
PFMet_sumEt_uncor = met.uncorrectedSumEt();*/
- //The raw calo ETmiss
- CaloMet_pt = met.caloMETPt();
- CaloMet_phi = met.caloMETPhi();
+ //The raw calo ETmiss
+ CaloMet_pt = met.caloMETPt();
+ CaloMet_phi = met.caloMETPhi();
CaloMet_sumEt = met.caloMETSumEt();
PFMet_shiftedPt_JetEnUp = met.shiftedPt(pat::MET::JetEnUp);
PFMet_shiftedPt_JetEnDown = met.shiftedPt(pat::MET::JetEnDown);
- if (met.genMET() != NULL ) GenMet_pt = met.genMET()->pt();
+ if (met.genMET() != NULL ) GenMet_pt = met.genMET()->pt();
/*edm::Handle metsighandle;
iEvent.getByToken(theMETSignificance_, metsighandle);
METSign=*metsighandle;*/
@@ -1807,7 +1807,7 @@ void MakeZprimeMiniAodTreeHEEP::fillMET(const edm::Event& iEvent)
//
//=============================================================
void MakeZprimeMiniAodTreeHEEP::GenJetTree(const edm::Event& iEvent)
-{
+{
int NbGenJets = 0;
iGenJet.clear();
idGenJet.clear();
@@ -1819,7 +1819,7 @@ void MakeZprimeMiniAodTreeHEEP::GenJetTree(const edm::Event& iEvent)
/**** GET GENJETS ****/
edm::Handle h_genjets;
iEvent.getByToken( EDMGenJetsToken_,h_genjets );
- if (!(h_genjets.isValid())) return;
+ if (!(h_genjets.isValid())) return;
std::vector const &genjets = *h_genjets;
for(size_t i=0; i(*j.daughter(id));
if (dau.charge() == 0) continue;
@@ -1887,7 +1887,7 @@ void MakeZprimeMiniAodTreeHEEP::JetsTree(const edm::Event& iEvent,const edm::Eve
jet_pileup_mva_disc.push_back(j.userFloat("pileupJetId:fullDiscriminant"));
}
else continue;
- }
+ }
}
//=============================================================
//
@@ -1909,7 +1909,7 @@ void MakeZprimeMiniAodTreeHEEP::BtaggingTree(const edm::Event& iEvent)
iEvent.getByToken(jetToken_, jets);
// loop over jets
for( auto jet = jets->begin(); jet != jets->end(); ++jet )
- {
+ {
// fill discriminator variables
int flavor = std::abs( jet->partonFlavour() );
for( const std::string &bDiscr : bDiscriminators_ )
@@ -1939,7 +1939,7 @@ void MakeZprimeMiniAodTreeHEEP::BtaggingTree(const edm::Event& iEvent)
//
//=============================================================
void MakeZprimeMiniAodTreeHEEP::ParticleFlowPhotonTree(const edm::Event& iEvent,const edm::EventSetup& es)
-{
+{
pfphoton_size = 0;
pfphoton_pt.clear();
pfphoton_eta.clear();
@@ -1989,7 +1989,7 @@ void MakeZprimeMiniAodTreeHEEP::ParticleFlowPhotonTree(const edm::Event& iEvent,
}
}
}
-//madgraph MC samples reweighing
+//madgraph MC samples reweighing
void MakeZprimeMiniAodTreeHEEP::EventsReWeighting(const edm::Event& evt){
MC_weighting.clear();
float EventWeight = 1.0;
@@ -2067,8 +2067,8 @@ void MakeZprimeMiniAodTreeHEEP::TauTree(const edm::Event& iEvent)
[11] kKilled, // MC only flag: the channel is killed in the real detector
[12] kTPSaturated, // the channel is in a region with saturated TP
[13] kL1SpikeFlag, // the channel is in a region with TP with sFGVB = 0
- [14] kWeird, // the signal is believed to originate from an anomalous deposit (spike)
- [15] kDiWeird, // the signal is anomalous, and neighbors another anomalous signal
+ [14] kWeird, // the signal is believed to originate from an anomalous deposit (spike)
+ [15] kDiWeird, // the signal is anomalous, and neighbors another anomalous signal
[16] kHasSwitchToGain6, // at least one data frame is in G6
[17] kHasSwitchToGain1, // at least one data frame is in G1
[18] kUnknown // to ease the interface with functions returning flags.
diff --git a/Analyzer/plugins/MakeZprimeMiniAodTreeMC.cc b/Analyzer/plugins/MakeZprimeMiniAodTreeMC.cc
index fad62fe..4445c81 100644
--- a/Analyzer/plugins/MakeZprimeMiniAodTreeMC.cc
+++ b/Analyzer/plugins/MakeZprimeMiniAodTreeMC.cc
@@ -10,7 +10,7 @@
//corresponds to which which cutnr
//this is fixed for a given ID (and can be different for each ID)
//hence its hard coded
-//also these headerfiles are intentionally completely standalone
+//also these headerfiles are intentionally completely standalone
//so you can easily include them in your analysis if you find them
//useful
#include "FWCore/Utilities/interface/InputTag.h"
@@ -26,8 +26,12 @@
#include "HEEP/VID/interface/CutNrs.h"
#include "HEEP/VID/interface/VIDCutCodes.h"
//new by Sherif
+// TFile Service
+#include "FWCore/ServiceRegistry/interface/Service.h"
+#include "CommonTools/UtilAlgos/interface/TFileService.h"
#include "TTree.h"
-#include "TFile.h"
+// #include "TTree.h"
+// #include "TFile.h"
using namespace std;
using namespace edm;
using namespace reco;
@@ -77,7 +81,7 @@ using namespace pat;
#include "DataFormats/HLTReco/interface/TriggerTypeDefs.h"
#include "HLTrigger/HLTcore/interface/HLTConfigProvider.h"
#include "FWCore/ServiceRegistry/interface/Service.h"
-#include "CommonTools/UtilAlgos/interface/TFileService.h"
+#include "CommonTools/UtilAlgos/interface/TFileService.h"
#include "DataFormats/MuonReco/interface/MuonSelectors.h"
#include "DataFormats/MuonReco/interface/MuonCocktails.h"
#include "DataFormats/Common/interface/RefCore.h"
@@ -139,7 +143,7 @@ class MakeZprimeMiniAodTreeMC : public edm::EDAnalyzer {
static void globalEndJob(const NrPassFail* nrPassFail) {
std::cout <<"nr eles pass "<nrPass<<" / "<nrPass+nrPassFail->nrFail< > eleToken_;
// ----------member data --------------------------- //
edm::EDGetTokenT rhoToken;
edm::EDGetTokenT genInfoProductToken;
- edm::EDGetTokenT EDMGenJetsToken_;
+ edm::EDGetTokenT m_passMInvCutToken, m_passPreFSRMInvCutToken, m_passST1MInvCutToken, m_passST23MInvCutToken, m_passHSMInvCutToken;
+ edm::EDGetTokenT m_xsWeightToken;
+ edm::EDGetTokenT EDMGenJetsToken_;
edm::EDGetTokenT scProducer_;
edm::EDGetTokenT vtxToken_;
edm::EDGetTokenT muonToken_;
@@ -238,7 +244,7 @@ class MakeZprimeMiniAodTreeMC : public edm::EDAnalyzer {
std::vector Ele_phiTrack;
std::vector Ele_hadronicOverEm;
std::vector Ele_deltaEtaInSeedCluster;
- std::vector Ele_deltaPhiInSeedCluster;
+ std::vector Ele_deltaPhiInSeedCluster;
std::vector Ele_deltaEtaInSC;
std::vector Ele_deltaPhiInSC;
std::vector Ele_sigmaIetaIeta;
@@ -283,7 +289,7 @@ class MakeZprimeMiniAodTreeMC : public edm::EDAnalyzer {
std::vector Ele_hcalDepth2OverEcal;
std::vector Ele_dr03HcalDepth2TowerSumEt;
std::vector Ele_hcalDepth2TowerSumEtNoVeto;
- std::vector Ele_hcalDepth1TowerSumEtNoVeto;
+ std::vector Ele_hcalDepth1TowerSumEtNoVeto;
//------------- PF isolation from pat::ele -------------------------
std::vector Ele_pfSumPhotonEt;
std::vector Ele_pfSumChargedHadronPt;
@@ -361,7 +367,7 @@ class MakeZprimeMiniAodTreeMC : public edm::EDAnalyzer {
std::vector Tau_id;
std::vector Tau_LooseCombinedIsolationDeltaBetaCorr3Hits;
//=============================================================
- //
+ //
// Create Branchs for PileUp tree
//
//=============================================================
@@ -369,13 +375,13 @@ class MakeZprimeMiniAodTreeMC : public edm::EDAnalyzer {
int PU_BunchCrossing;
int num_PU_gen_vertices;
//=============================================================
- //
+ //
// Create Branch for Rho
//
//=============================================================
float Rho;
//=============================================================
- //
+ //
// Create Branch for events reweighting
//
//=============================================================
@@ -387,7 +393,7 @@ class MakeZprimeMiniAodTreeMC : public edm::EDAnalyzer {
//===================================================
std::vector iGen;
std::vector idGen;
- std::vector statusGen;
+ std::vector statusGen;
std::vector ptGen;
std::vector etaGen;
std::vector phiGen;
@@ -407,6 +413,17 @@ class MakeZprimeMiniAodTreeMC : public edm::EDAnalyzer {
std::vector McZpy;
std::vector McZpz;
std::vector McZen;
+ //=============================================================
+ //
+ // Create tree variables for extra GEN level info
+ //
+ //=============================================================
+ double xsWeight;
+ bool passPreFSRMInvCut;
+ bool passMInvCut;
+ bool passST1MInvCut;
+ bool passST23MInvCut;
+ bool passHSMInvCut;
//==================================================
//
// Create vectors for Muons variables
@@ -427,7 +444,7 @@ class MakeZprimeMiniAodTreeMC : public edm::EDAnalyzer {
std::vector Mu_eta;
std::vector Mu_phi;
std::vector Mu_et;
- std::vector Mu_charge;
+ std::vector Mu_charge;
std::vector Mu_normalizedChi2;
std::vector Mu_trackiso;
std::vector Mu_numberOfMatchedStations;
@@ -480,7 +497,7 @@ class MakeZprimeMiniAodTreeMC : public edm::EDAnalyzer {
std::vector Mu_stationMask;
std::vector Mu_numberOfMatchedRPCLayers;
//=============================================================
- //
+ //
// Create Branches for PF MET
//
//=============================================================
@@ -498,7 +515,7 @@ class MakeZprimeMiniAodTreeMC : public edm::EDAnalyzer {
double PFMet_pt_uncor;
double PFMet_phi_uncor;
double PFMet_sumEt_uncor;
- //The raw calo ETmiss
+ //The raw calo ETmiss
double CaloMet_pt;
double CaloMet_phi;
double CaloMet_sumEt;
@@ -510,8 +527,8 @@ class MakeZprimeMiniAodTreeMC : public edm::EDAnalyzer {
double pfMETshiftedPtJetEnDn;
double pfMETshiftedPtEleEnUp;
double pfMETshiftedPtEleEnDn;
- double pfMETshiftedPtMuEnUp;
- double pfMETshiftedPtMuEnDn;
+ double pfMETshiftedPtMuEnUp;
+ double pfMETshiftedPtMuEnDn;
double pfMETshiftedPtJetResUp;
double pfMETshiftedPtJetResDn;
double pfMETshiftedPtUnclEnUp;
@@ -520,7 +537,7 @@ class MakeZprimeMiniAodTreeMC : public edm::EDAnalyzer {
double pfMETshiftedPtPhoEnDn;
//double pfMETshiftedPtJetEnUpSmear;
//double pfMETshiftedPtJetEnDnSmear;
- //double pfMETUncertaintySize;
+ //double pfMETUncertaintySize;
//double pfMETFullUncertaintySize;
//===================================================
//
@@ -555,6 +572,12 @@ MakeZprimeMiniAodTreeMC::MakeZprimeMiniAodTreeMC(const edm::ParameterSet& iConfi
eleToken_(consumes >(iConfig.getParameter("eles"))),
rhoToken(consumes (edm::InputTag(std::string("fixedGridRhoFastjetAll")))),
genInfoProductToken(consumes (edm::InputTag(std::string("generator")))),
+ m_passMInvCutToken(consumes(iConfig.getParameter("passMInvCutTag"))),
+ m_passPreFSRMInvCutToken(consumes(iConfig.getParameter("passPreFSRMInvCutTag"))),
+ m_passST1MInvCutToken(consumes(iConfig.getParameter("passST1MInvCutTag"))),
+ m_passST23MInvCutToken(consumes(iConfig.getParameter("passST23MInvCutTag"))),
+ m_passHSMInvCutToken(consumes(iConfig.getParameter("passHSMInvCutTag"))),
+ m_xsWeightToken(consumes(iConfig.getParameter("xsWeightTag"))),
EDMGenJetsToken_(consumes(iConfig.getParameter("JetSource"))),
scProducer_(consumes(iConfig.getParameter("scProducer"))),
vtxToken_(consumes(iConfig.getParameter("vertices"))),
@@ -579,7 +602,10 @@ MakeZprimeMiniAodTreeMC::MakeZprimeMiniAodTreeMC(const edm::ParameterSet& iConfi
bDiscriminators_(iConfig.getParameter >("bDiscriminators")),
outputFile_(iConfig.getParameter("outputFile"))
{
- rootFile_ = TFile::Open(outputFile_.c_str(),"RECREATE"); // open output file to store histograms
+ edm::LogWarning("MakeZprimeMiniAodTreeMC::MakeZprimeMiniAodTreeMC")
+ << "Using outputFile named" << outputFile_;
+
+ rootFile_ = TFile::Open(outputFile_.c_str(),"RECREATE"); // open output file to store histograms
BosonID_ = iConfig.getParameter("GenBosonID");
ParticleID1_ = iConfig.getParameter("ParticleID1");
ParticleID2_ = iConfig.getParameter("ParticleID2");
@@ -599,11 +625,13 @@ MakeZprimeMiniAodTreeMC::~MakeZprimeMiniAodTreeMC()
// ------------ method called once each job just before starting event loop ------------
void MakeZprimeMiniAodTreeMC::beginJob()
{
-
+
// go to *OUR* rootfile and book histograms
rootFile_->cd();
- // Declare histograms
mytree = new TTree("tree","tr");
+ // Better, use the TFileService for improved compatibility
+ // edm::Service< TFileService > fs;
+ // mytree = fs->make("tree","tr");
//=============================================================
//
// Create Branchs for Nb of event,run,lumi
@@ -697,11 +725,11 @@ void MakeZprimeMiniAodTreeMC::beginJob()
mytree->Branch("Ele_dr03TkSumPt_corrected",&Ele_dr03TkSumPt_corrected);
mytree->Branch("Ele_nrSatCrys",&Ele_nrSatCrys);
mytree->Branch("Ele_isPassHeepID",&Ele_isPassHeepID);
- //=============================================================
+ //=============================================================
//
// Create Branchs for Muons match HLT variables
//
- //=============================================================
+ //=============================================================
mytree->Branch("HLT_nb", &HLT_nb);
mytree->Branch("HLT_name", &HLT_name);
mytree->Branch("HLT_isaccept", &HLT_isaccept);
@@ -738,9 +766,20 @@ void MakeZprimeMiniAodTreeMC::beginJob()
mytree->Branch("pxGen",&pxGen);
mytree->Branch("pyGen",&pyGen);
mytree->Branch("pzGen",&pzGen);
- //=============================================================
+ //=============================================================
//
- // Create Branchs for Muons variables
+ // Create Branches GEN level info
+ //
+ //=============================================================
+ mytree->Branch("xsWeight", &xsWeight);
+ mytree->Branch("passPreFSRMInvCut",&passPreFSRMInvCut);
+ mytree->Branch("passMInvCut", &passMInvCut);
+ mytree->Branch("passST1MInvCut",&passST1MInvCut);
+ mytree->Branch("passST23MInvCut",&passST23MInvCut);
+ mytree->Branch("passHSMInvCut",&passHSMInvCut);
+ //=============================================================
+ //
+ // Create Branchs for Muons variables
//
//=============================================================
mytree->Branch("Mu_nbMuon",&Mu_nbMuon);
@@ -807,7 +846,7 @@ void MakeZprimeMiniAodTreeMC::beginJob()
mytree->Branch("Mu_vtxNormChi30GeV",&Mu_vtxNormChi30GeV);
mytree->Branch("Mu_vtxMass30GeVLept",&Mu_vtxMass30GeVLept);
//=============================================================
- //
+ //
// Create Branches for PF MET
//
//=============================================================
@@ -821,7 +860,7 @@ void MakeZprimeMiniAodTreeMC::beginJob()
mytree->Branch("PFMet_py_cor", &PFMet_py_cor, "PFMet_py_cor/D");
mytree->Branch("PFMet_pz_cor", &PFMet_pz_cor, "PFMet_pz_cor/D");
mytree->Branch("PFMet_sumEt_cor",&PFMet_sumEt_cor,"PFMet_sumEt_cor/D");
- //The raw calo ETmiss
+ //The raw calo ETmiss
mytree->Branch("CaloMet_pt", &CaloMet_pt, "CaloMet_pt/D");
mytree->Branch("CaloMet_phi", &CaloMet_phi, "CaloMet_phi/D");
mytree->Branch("CaloMet_sumEt",&CaloMet_sumEt,"CaloMet_sumEt/D");
@@ -832,7 +871,7 @@ void MakeZprimeMiniAodTreeMC::beginJob()
mytree->Branch("PFMet_phi_uncor", &PFMet_phi_uncor, "PFMet_phi_uncor/D");
mytree->Branch("PFMet_sumEt_uncor",&PFMet_sumEt_uncor,"PFMet_sumEt_uncor/D");*/
//mytree->Branch("METSign",&METSign,"METSign/D");
-
+
//Type I MET Uncertainties
mytree->Branch("PFMet_METshiftedPtJetEnUp", &pfMETshiftedPtJetEnUp, "PFMet_METshiftedPtJetEnUp/D");
mytree->Branch("PFMet_METshiftedPtJetEnDn", &pfMETshiftedPtJetEnDn, "PFMet_METshiftedPtJetEnDn/D");
@@ -852,9 +891,9 @@ void MakeZprimeMiniAodTreeMC::beginJob()
//mytree->Branch("PFMet_METFullUncertaintySize", &pfMETFullUncertaintySize, "PFMet_METFullUncertaintySize/D");
//=============================================================
//
- // Create Branches for jets variables
+ // Create Branches for jets variables
//
- //=============================================================
+ //=============================================================
mytree->Branch("jet_nb",&jet_nb);
mytree->Branch("jet_charge",&jet_charge);
mytree->Branch("jet_et",&jet_et);
@@ -867,9 +906,9 @@ void MakeZprimeMiniAodTreeMC::beginJob()
mytree->Branch("jet_pileup_mva_disc",&jet_pileup_mva_disc);
//=============================================================
//
- // Create Branches for Btagging variables
+ // Create Branches for Btagging variables
//
- //=============================================================
+ //=============================================================
mytree->Branch("Nb_bDiscriminators",&Nb_bDiscriminators);
mytree->Branch("jet_btag_pt",&jet_btag_pt);
mytree->Branch("jet_btag_eta",&jet_btag_eta);
@@ -903,21 +942,21 @@ void MakeZprimeMiniAodTreeMC::beginJob()
//mytree->Branch("pfphoton_PFPUchAllPart",&pfphoton_PFPUchAllPart);
//mytree->Branch("pfphoton_pfphoton_PFX_rho",&pfphoton_pfphoton_PFX_rho);
//=============================================================
- //
- // Create Branchs for PileUp tree
+ //
+ // Create Branchs for PileUp tree
//
//=============================================================
mytree->Branch("num_PU_vertices",&num_PU_vertices,"num_PU_vertices/I");
mytree->Branch("PU_BunchCrossing",&PU_BunchCrossing,"PU_BunchCrossing/I");
mytree->Branch("num_PU_gen_vertices",&num_PU_gen_vertices,"num_PU_gen_vertices/I");
//=============================================================
- //
+ //
// Create Branch for Rho
//
//=============================================================
mytree->Branch("Rho",&Rho,"Rho/F");
//=============================================================
- //
+ //
// Create Branch for events reweighting
//
//=============================================================
@@ -940,7 +979,7 @@ void MakeZprimeMiniAodTreeMC::analyze(const edm::Event& iEvent, const edm::Event
{
//==============================================
//= Begin of the main program =
- //==============================================
+ //==============================================
Run = (unsigned int) iEvent.id().run();
Event = (unsigned int) iEvent.id().event();
lumi = (unsigned int) iEvent.luminosityBlock();
@@ -954,11 +993,11 @@ void MakeZprimeMiniAodTreeMC::analyze(const edm::Event& iEvent, const edm::Event
if( GoodPv == 0 ) return; //the aim of that command is to select only events*/
PatElectronTree(iEvent,iSetup);
PatMuonTree(iEvent,iSetup);
- TriggerMatchingTree(iEvent,iSetup);
+ TriggerMatchingTree(iEvent,iSetup);
ComputeMuonMassVtx(iEvent,iSetup);
ComputeMuonMassVtx30GeV(iEvent,iSetup);
accessGenInfo(iEvent,iSetup);
- fillMET(iEvent);
+ fillMET(iEvent);
JetsTree(iEvent,iSetup);
GenJetTree(iEvent);
ParticleFlowPhotonTree(iEvent,iSetup);
@@ -969,11 +1008,11 @@ void MakeZprimeMiniAodTreeMC::analyze(const edm::Event& iEvent, const edm::Event
TauTree(iEvent);
//==============================================
//= End of the main program =
- //==============================================
+ //==============================================
mytree->Fill();
}
// ------------ method called once each job just after ending the event loop ------------
-void MakeZprimeMiniAodTreeMC::endJob()
+void MakeZprimeMiniAodTreeMC::endJob()
{
// go to *OUR* root file and store histograms
rootFile_->cd();
@@ -1011,7 +1050,7 @@ bool MakeZprimeMiniAodTreeMC::PrimaryVertex(const reco::VertexCollection &vertic
//
//=============================================================
void MakeZprimeMiniAodTreeMC::PatElectronTree(const edm::Event& iEvent,const edm::EventSetup& es)
-{
+{
unsigned int NbElectrons = -1 ;
Ele_nbElectrons.clear();
Ele_dr03TkSumPt.clear();
@@ -1035,7 +1074,7 @@ void MakeZprimeMiniAodTreeMC::PatElectronTree(const edm::Event& iEvent,const edm
Ele_phiTrack.clear();
Ele_hadronicOverEm.clear();
Ele_deltaEtaInSeedCluster.clear();
- Ele_deltaPhiInSeedCluster.clear();
+ Ele_deltaPhiInSeedCluster.clear();
Ele_deltaEtaInSC.clear();
Ele_deltaPhiInSC.clear();
Ele_sigmaIetaIeta.clear();
@@ -1077,7 +1116,7 @@ void MakeZprimeMiniAodTreeMC::PatElectronTree(const edm::Event& iEvent,const edm
Ele_hcalDepth2OverEcal.clear();
Ele_dr03HcalDepth2TowerSumEt.clear();
Ele_hcalDepth2TowerSumEtNoVeto.clear();
- Ele_hcalDepth1TowerSumEtNoVeto.clear();
+ Ele_hcalDepth1TowerSumEtNoVeto.clear();
Ele_pfSumPhotonEt.clear();
Ele_pfSumChargedHadronPt.clear();
Ele_pfSumNeutralHadronEt.clear();
@@ -1105,17 +1144,17 @@ void MakeZprimeMiniAodTreeMC::PatElectronTree(const edm::Event& iEvent,const edm
//------------ Rec Hits in EB ----------------
edm::Handle ecalEB;
iEvent.getByToken(tok_EB_,ecalEB);
- //------------ Rec Hits in EE ----------------
+ //------------ Rec Hits in EE ----------------
edm::Handle ecalEE;
iEvent.getByToken(tok_EE_,ecalEE);
std::auto_ptr lazyTools_;
- lazyTools_ .reset(new EcalClusterLazyTools( iEvent, es, ecalRechitEBToken_, ecalRechitEEToken_ ));
+ lazyTools_ .reset(new EcalClusterLazyTools( iEvent, es, ecalRechitEBToken_, ecalRechitEEToken_ ));
edm::Handle > eleHandle;
iEvent.getByToken(eleToken_,eleHandle);
for(auto& el : *eleHandle){
if(el.caloEnergy() * sin(el.p4().theta()) < 20) continue;
NbElectrons++;
- Ele_nbElectrons.push_back(NbElectrons);
+ Ele_nbElectrons.push_back(NbElectrons);
Ele_Et.push_back(el.superCluster()->energy() * sin(el.p4().theta()));
Ele_EtFromCaloEn.push_back(el.caloEnergy() * sin(el.p4().theta()));
//================================================================
@@ -1140,14 +1179,14 @@ void MakeZprimeMiniAodTreeMC::PatElectronTree(const edm::Event& iEvent,const edm
// End New piece of code by Sam
//
//================================================================
- Ele_pt.push_back(el.pt());
+ Ele_pt.push_back(el.pt());
Ele_thetaSC.push_back(el.caloPosition().theta()); //theta SC
Ele_etaSC.push_back(el.superCluster()->eta()); //eta SC
Ele_phiSC.push_back(el.superCluster()->phi()); //phi SC
- Ele_phiWidth.push_back(el.superCluster()->phiWidth());
- Ele_etaWidth.push_back(el.superCluster()->etaWidth());
+ Ele_phiWidth.push_back(el.superCluster()->phiWidth());
+ Ele_etaWidth.push_back(el.superCluster()->etaWidth());
Ele_energySC.push_back(el.superCluster()->energy()); //energy SC
- Ele_preshowerEnergySC.push_back(el.superCluster()->preshowerEnergy());
+ Ele_preshowerEnergySC.push_back(el.superCluster()->preshowerEnergy());
Ele_thetaTrack.push_back(el.p4().theta()); //theta track
Ele_etaTrack.push_back(el.p4().eta()); //eta track
Ele_phiTrack.push_back(el.p4().phi()); //phi track
@@ -1168,7 +1207,7 @@ void MakeZprimeMiniAodTreeMC::PatElectronTree(const edm::Event& iEvent,const edm
Ele_e5x5.push_back(el.e5x5());
Ele_e2x5MaxOver5x5.push_back(el.e2x5Max()/el.e5x5());
Ele_e1x5Over5x5.push_back(el.e1x5()/el.e5x5());
- Ele_sigmaIetaIetaFull5x5.push_back(el.full5x5_sigmaIetaIeta());
+ Ele_sigmaIetaIetaFull5x5.push_back(el.full5x5_sigmaIetaIeta());
Ele_e2x5MaxFull5x5.push_back(el.full5x5_e2x5Max());
Ele_e1x5Full5x5.push_back(el.full5x5_e1x5());
Ele_e5x5Full5x5.push_back(el.full5x5_e5x5());
@@ -1194,29 +1233,29 @@ void MakeZprimeMiniAodTreeMC::PatElectronTree(const edm::Event& iEvent,const edm
Ele_frac15.push_back( lazyTools_->e1x5(*(el.superCluster()->seed()))/el.full5x5_e5x5() );
Ele_nbVtx.push_back(vertices->size());
if(vertices->size()>0){
- Ele_dxy.push_back(el.gsfTrack()->dxy(PV.position()));
- Ele_dz.push_back(el.gsfTrack()->dz(PV.position()));
+ Ele_dxy.push_back(el.gsfTrack()->dxy(PV.position()));
+ Ele_dz.push_back(el.gsfTrack()->dz(PV.position()));
}
else{
- Ele_dxy.push_back(el.gsfTrack()->dxy());
+ Ele_dxy.push_back(el.gsfTrack()->dxy());
Ele_dz.push_back(el.gsfTrack()->dz());
}
Ele_isEcalDrivenSeed.push_back(el.ecalDrivenSeed());
Ele_isPassConversionVeto.push_back(el.passConversionVeto());
Ele_charge.push_back(el.gsfTrack()->charge());
Ele_rhoIso.push_back(rhoIso);
- Ele_nbOfMissingHits.push_back(el.gsfTrack()->numberOfLostHits());
+ Ele_nbOfMissingHits.push_back(el.gsfTrack()->numberOfLostHits());
Ele_fbrem.push_back(el.fbrem());
Ele_EoverP.push_back(el.eSeedClusterOverP());
- Ele_Xposition.push_back(el.caloPosition().x());
- Ele_Yposition.push_back(el.caloPosition().y());
+ Ele_Xposition.push_back(el.caloPosition().x());
+ Ele_Yposition.push_back(el.caloPosition().y());
//------------- detector isolation -------------------------
Ele_hcalDepth1OverEcal.push_back(el.hcalDepth1OverEcal());
Ele_hcalDepth2OverEcal.push_back(el.hcalDepth2OverEcal());
Ele_dr03HcalDepth2TowerSumEt.push_back(el.dr03HcalDepth2TowerSumEt());
- Ele_hcalDepth2TowerSumEtNoVeto.push_back(el.isolationVariables03().hcalDepth2TowerSumEt);// hcaldepht2 iso deposit with
+ Ele_hcalDepth2TowerSumEtNoVeto.push_back(el.isolationVariables03().hcalDepth2TowerSumEt);// hcaldepht2 iso deposit with
// electron footprint removed
- Ele_hcalDepth1TowerSumEtNoVeto.push_back(el.isolationVariables03().hcalDepth1TowerSumEt);// hcaldepht1 iso deposit with
+ Ele_hcalDepth1TowerSumEtNoVeto.push_back(el.isolationVariables03().hcalDepth1TowerSumEt);// hcaldepht1 iso deposit with
// electron footprint removed
Ele_EcalPlusHcald1iso.push_back(el.dr03EcalRecHitSumEt() + el.dr03HcalDepth1TowerSumEt());
Ele_dr03EcalRecHitSumEt.push_back(el.dr03EcalRecHitSumEt());
@@ -1224,16 +1263,16 @@ void MakeZprimeMiniAodTreeMC::PatElectronTree(const edm::Event& iEvent,const edm
Ele_dr03HcalDepth1TowerSumEtBc.push_back(el.dr03HcalDepth1TowerSumEtBc());
//------------- PF isolation from pat::ele -------------------------
Ele_pfSumPhotonEt.push_back(el.pfIsolationVariables().sumPhotonEt);
- Ele_pfSumChargedHadronPt.push_back(el.pfIsolationVariables().sumChargedHadronPt);
+ Ele_pfSumChargedHadronPt.push_back(el.pfIsolationVariables().sumChargedHadronPt);
Ele_pfSumNeutralHadronEt.push_back(el.pfIsolationVariables().sumNeutralHadronEt);
- Ele_pfSumPUPt.push_back(el.pfIsolationVariables().sumPUPt);
+ Ele_pfSumPUPt.push_back(el.pfIsolationVariables().sumPUPt);
// do deltaBeta
double charged = el.pfIsolationVariables().sumPhotonEt;
double neutral = el.pfIsolationVariables().sumNeutralHadronEt;
double pileup = el.pfIsolationVariables().sumPUPt;
double deltaBeta = charged + std::max(0.0, neutral-0.5*pileup);
Ele_pfDeltaBeta.push_back(deltaBeta);
- }
+ }
}
//=============================================================
//
@@ -1241,7 +1280,7 @@ void MakeZprimeMiniAodTreeMC::PatElectronTree(const edm::Event& iEvent,const edm
//
//=============================================================
void MakeZprimeMiniAodTreeMC::TriggerMatchingTree(const edm::Event& iEvent,const edm::EventSetup& es)
-{
+{
int NbTriggers = 0;
int NbTriggerObj = 0;
HLT_nb.clear();
@@ -1283,7 +1322,7 @@ void MakeZprimeMiniAodTreeMC::TriggerMatchingTree(const edm::Event& iEvent,const
names.triggerName(i) != "HLT_TkMu50_v3" && names.triggerName(i) != "HLT_TkMu50_v4" &&
names.triggerName(i) != "HLT_TkMu50_v5" && names.triggerName(i) != "HLT_TkMu50_v6" &&
names.triggerName(i) != "HLT_TkMu50_v7" && names.triggerName(i) != "HLT_TkMu50_v8" &&
- names.triggerName(i) != "HLT_TkMu50_v9" && names.triggerName(i) != "HLT_TkMu50_v10" &&
+ names.triggerName(i) != "HLT_TkMu50_v9" && names.triggerName(i) != "HLT_TkMu50_v10" &&
names.triggerName(i) != "HLT_DoubleEle33_CaloIdL_MW_v1" && names.triggerName(i) != "HLT_DoubleEle33_CaloIdL_MW_v2" &&
names.triggerName(i) != "HLT_DoubleEle33_CaloIdL_MW_v3" && names.triggerName(i) != "HLT_DoubleEle33_CaloIdL_MW_v4" &&
names.triggerName(i) != "HLT_DoubleEle33_CaloIdL_MW_v5" && names.triggerName(i) != "HLT_DoubleEle33_CaloIdL_MW_v6" &&
@@ -1303,17 +1342,17 @@ void MakeZprimeMiniAodTreeMC::TriggerMatchingTree(const edm::Event& iEvent,const
names.triggerName(i) != "HLT_Mu33_Ele33_CaloIdL_GsfTrkIdVL_v3" && names.triggerName(i) != "HLT_Mu33_Ele33_CaloIdL_GsfTrkIdVL_v4" &&
names.triggerName(i) != "HLT_Mu33_Ele33_CaloIdL_GsfTrkIdVL_v5" && names.triggerName(i) != "HLT_Mu33_Ele33_CaloIdL_GsfTrkIdVL_v6" &&
names.triggerName(i) != "HLT_Mu33_Ele33_CaloIdL_GsfTrkIdVL_v7" && names.triggerName(i) != "HLT_Mu33_Ele33_CaloIdL_GsfTrkIdVL_v8" &&
- names.triggerName(i) != "HLT_Mu33_Ele33_CaloIdL_GsfTrkIdVL_v9" && names.triggerName(i) != "HLT_Mu33_Ele33_CaloIdL_GsfTrkIdVL_v10"
+ names.triggerName(i) != "HLT_Mu33_Ele33_CaloIdL_GsfTrkIdVL_v9" && names.triggerName(i) != "HLT_Mu33_Ele33_CaloIdL_GsfTrkIdVL_v10"
) continue;
//std::string const& name = names.triggerName(i);
//full_name = name;
NbTriggers++;
HLT_nb.push_back(NbTriggers);
- HLT_name.push_back(names.triggerName(i));
+ HLT_name.push_back(names.triggerName(i));
HLT_isaccept.push_back(triggerBits->accept(i));
- /*std::cout << "Trigger " << names.triggerName(i) <<
+ /*std::cout << "Trigger " << names.triggerName(i) <<
", prescale " << triggerPrescales->getPrescaleForIndex(i) <<
- ": " << (triggerBits->accept(i) ? "PASS" : "fail (or not run)")
+ ": " << (triggerBits->accept(i) ? "PASS" : "fail (or not run)")
<< std::endl;*/
}
for (unsigned i = 0; i < trigobj_handle->size(); ++i) {
@@ -1344,7 +1383,7 @@ void MakeZprimeMiniAodTreeMC::TriggerMatchingTree(const edm::Event& iEvent,const
pathnames[j] != "HLT_TkMu50_v3" && pathnames[j] != "HLT_TkMu50_v4" &&
pathnames[j] != "HLT_TkMu50_v5" && pathnames[j] != "HLT_TkMu50_v6" &&
pathnames[j] != "HLT_TkMu50_v7" && pathnames[j] != "HLT_TkMu50_v8" &&
- pathnames[j] != "HLT_TkMu50_v9" && pathnames[j] != "HLT_TkMu50_v10" &&
+ pathnames[j] != "HLT_TkMu50_v9" && pathnames[j] != "HLT_TkMu50_v10" &&
pathnames[j] != "HLT_DoubleEle33_CaloIdL_MW_v1" && pathnames[j] != "HLT_DoubleEle33_CaloIdL_MW_v2" &&
pathnames[j] != "HLT_DoubleEle33_CaloIdL_MW_v3" && pathnames[j] != "HLT_DoubleEle33_CaloIdL_MW_v4" &&
pathnames[j] != "HLT_DoubleEle33_CaloIdL_MW_v5" && pathnames[j] != "HLT_DoubleEle33_CaloIdL_MW_v6" &&
@@ -1367,7 +1406,7 @@ void MakeZprimeMiniAodTreeMC::TriggerMatchingTree(const edm::Event& iEvent,const
pathnames[j] != "HLT_Mu33_Ele33_CaloIdL_GsfTrkIdVL_v9" && pathnames[j] != "HLT_Mu33_Ele33_CaloIdL_GsfTrkIdVL_v10"
) continue;
HLTObj_nbObj.push_back(NbTriggerObj);
- HLTObj_pt.push_back(src.pt());
+ HLTObj_pt.push_back(src.pt());
HLTObj_eta.push_back(src.eta());
HLTObj_phi.push_back(src.phi());
HLTObj_collection.push_back(pathnames[j]);
@@ -1395,7 +1434,7 @@ bool MakeZprimeMiniAodTreeMC::isAncestor(const reco::Candidate* ancestor, const
}
void MakeZprimeMiniAodTreeMC::accessGenInfo(const edm::Event& iEvent,const edm::EventSetup& es)
-{
+{
int NbGenMuons = 0;
iGen.clear();
idGen.clear();
@@ -1408,15 +1447,91 @@ void MakeZprimeMiniAodTreeMC::accessGenInfo(const edm::Event& iEvent,const edm::
pxGen.clear();
pyGen.clear();
pzGen.clear();
+
+ xsWeight = -1.;
+ passPreFSRMInvCut = false;
+ passMInvCut = false;
+ passST1MInvCut = false;
+ passST23MInvCut = false;
+ passHSMInvCut = false;
+
+ edm::Handle h_passMInvCut;
+ edm::Handle h_passPreFSRMInvCut;
+ edm::Handle h_passST1MInvCut;
+ edm::Handle h_passST23MInvCut;
+ edm::Handle h_passHSMInvCut;
+ edm::Handle h_xsWeight;
+
+ iEvent.getByToken(m_passMInvCutToken, h_passMInvCut);
+ iEvent.getByToken(m_passPreFSRMInvCutToken, h_passPreFSRMInvCut);
+ iEvent.getByToken(m_passST1MInvCutToken, h_passST1MInvCut);
+ iEvent.getByToken(m_passST23MInvCutToken, h_passST23MInvCut);
+ iEvent.getByToken(m_passHSMInvCutToken, h_passHSMInvCut);
+ iEvent.getByToken(m_xsWeightToken, h_xsWeight);
+
+ if (h_xsWeight.isValid()) {
+ xsWeight = *h_xsWeight;
+ edm::LogInfo("MakeZprimeMiniAodTreeMC::accessGenInfo")
+ << "xsWeight::" << *h_xsWeight;
+ } else {
+ edm::LogWarning("MakeZprimeMiniAodTreeMC::accessGenInfo")
+ << "invalid handle to xsWeight";
+ }
+
+ if (h_passPreFSRMInvCut.isValid()) {
+ passPreFSRMInvCut = *h_passPreFSRMInvCut;
+ edm::LogInfo("MakeZprimeMiniAodTreeMC::accessGenInfo")
+ << "passPreFSRMInvCut::" << *h_passPreFSRMInvCut;
+ } else {
+ edm::LogWarning("MakeZprimeMiniAodTreeMC::accessGenInfo")
+ << "invalid handle to passPreFSRMInvCut";
+ }
+
+ if (h_passST1MInvCut.isValid()) {
+ passST1MInvCut = *h_passST1MInvCut;
+ edm::LogInfo("MakeZprimeMiniAodTreeMC::accessGenInfo")
+ << "passST1MInvCut::" << *h_passST1MInvCut;
+ } else {
+ edm::LogWarning("MakeZprimeMiniAodTreeMC::accessGenInfo")
+ << "invalid handle to passST1MInvCut";
+ }
+
+ if (h_passST23MInvCut.isValid()) {
+ passST23MInvCut = *h_passST23MInvCut;
+ edm::LogInfo("MakeZprimeMiniAodTreeMC::accessGenInfo")
+ << "passST23MInvCut::" << *h_passST23MInvCut;
+ } else {
+ edm::LogWarning("MakeZprimeMiniAodTreeMC::accessGenInfo")
+ << "invalid handle to passST23MInvCut";
+ }
+
+ if (h_passHSMInvCut.isValid()) {
+ passHSMInvCut = *h_passHSMInvCut;
+ edm::LogInfo("MakeZprimeMiniAodTreeMC::accessGenInfo")
+ << "passHSMInvCut::" << *h_passHSMInvCut;
+ } else {
+ edm::LogWarning("MakeZprimeMiniAodTreeMC::accessGenInfo")
+ << "invalid handle to passHSMInvCut";
+ }
+
+ if (h_passMInvCut.isValid()) {
+ passMInvCut = *h_passMInvCut;
+ edm::LogInfo("MakeZprimeMiniAodTreeMC::accessGenInfo")
+ << "passMInvCut::" << *h_passMInvCut;
+ } else {
+ edm::LogWarning("MakeZprimeMiniAodTreeMC::accessGenInfo")
+ << "invalid handle to passMInvCut";
+ }
+
// Pruned particles are the one containing "important" stuff
Handle > pruned;
iEvent.getByToken(prunedGenToken_,pruned);
- if (!(pruned.isValid())) return;
+ if (!(pruned.isValid())) return;
// Packed particles are all the status 1, so usable to remake jets
// The navigation from status 1 to pruned is possible (the other direction should be made by hand)
Handle > packed;
iEvent.getByToken(packedGenToken_,packed);
- //let's try to find all status1 originating directly from a B meson decay
+ //let's try to find all status1 originating directly from a B meson decay
for(size_t i=0; isize();i++){
//if(abs((*pruned)[i].pdgId()) > 22 && abs((*pruned)[i].pdgId()) <24){
if(abs((*pruned)[i].pdgId()) < BosonID_){
@@ -1424,12 +1539,12 @@ void MakeZprimeMiniAodTreeMC::accessGenInfo(const edm::Event& iEvent,const edm::
//std::cout << "PdgID: " << Zprime->pdgId() << " pt " << Zprime->pt() << " eta: " << Zprime->eta() << " phi: " << Zprime->phi() << std::endl;
//std::cout << " found daugthers: " << std::endl;
for(size_t j=0; jsize();j++){
- //get the pointer to the first survied ancestor of a given packed GenParticle in the prunedCollection
+ //get the pointer to the first survied ancestor of a given packed GenParticle in the prunedCollection
const Candidate * motherInPrunedCollection = (*packed)[j].mother(0) ;
if(motherInPrunedCollection != nullptr && isAncestor( Zprime , motherInPrunedCollection)){
if( (*packed)[j].pt() < 20.0 ) continue;
- if( fabs((*packed)[j].pdgId()) != ParticleID1_ &&
- fabs((*packed)[j].pdgId()) != ParticleID2_ &&
+ if( fabs((*packed)[j].pdgId()) != ParticleID1_ &&
+ fabs((*packed)[j].pdgId()) != ParticleID2_ &&
fabs((*packed)[j].pdgId()) != ParticleID3_ ) continue;
if( (*packed)[j].status() > ParticleStatus_ ) continue;
NbGenMuons++;
@@ -1455,7 +1570,7 @@ void MakeZprimeMiniAodTreeMC::accessGenInfo(const edm::Event& iEvent,const edm::
//
//=============================================================
void MakeZprimeMiniAodTreeMC::PatMuonTree(const edm::Event& evt,const edm::EventSetup& es)
-{
+{
int NbMuons = 0;
Mu_nbMuon.clear();
Mu_isTightMuon.clear();
@@ -1495,7 +1610,7 @@ void MakeZprimeMiniAodTreeMC::PatMuonTree(const edm::Event& evt,const edm::Event
Mu_thetaTunePMuonBestTrack.clear();
Mu_chargeTunePMuonBestTrack.clear();
Mu_absdxyTunePMuonBestTrack.clear();
- Mu_absdzTunePMuonBestTrack.clear();
+ Mu_absdzTunePMuonBestTrack.clear();
Mu_ptInnerTrack.clear();
Mu_dPToverPTInnerTrack.clear();
Mu_pxInnerTrack.clear();
@@ -1516,7 +1631,7 @@ void MakeZprimeMiniAodTreeMC::PatMuonTree(const edm::Event& evt,const edm::Event
Mu_stationMask.clear();
Mu_numberOfMatchedRPCLayers.clear();
//Mu_isMuonsCleaned.clear();
- // Get TransientTracks (for use in e.g. the vertex fit) for each of
+ // Get TransientTracks (for use in e.g. the vertex fit) for each of
// the muon tracks, using e.g. the cocktail momentum.
//edm::ESHandle ttkb;
//es.get().get("TransientTrackBuilder", ttkb);
@@ -1563,10 +1678,10 @@ void MakeZprimeMiniAodTreeMC::PatMuonTree(const edm::Event& evt,const edm::Event
const reco::TrackRef& tunePTrack = mu.tunePMuonBestTrack();
Mu_ptTunePMuonBestTrack.push_back(tunePTrack->pt());
Mu_dPToverPTTunePMuonBestTrack.push_back(tunePTrack->ptError()/tunePTrack->pt());
- Mu_pxTunePMuonBestTrack.push_back(tunePTrack->px()); //px component of the track
- Mu_pyTunePMuonBestTrack.push_back(tunePTrack->py()); //py component of the track
- Mu_pzTunePMuonBestTrack.push_back(tunePTrack->pz()); //pz component of the track
- Mu_pTunePMuonBestTrack.push_back(tunePTrack->p()); //magnitude of momentum vector
+ Mu_pxTunePMuonBestTrack.push_back(tunePTrack->px()); //px component of the track
+ Mu_pyTunePMuonBestTrack.push_back(tunePTrack->py()); //py component of the track
+ Mu_pzTunePMuonBestTrack.push_back(tunePTrack->pz()); //pz component of the track
+ Mu_pTunePMuonBestTrack.push_back(tunePTrack->p()); //magnitude of momentum vector
Mu_etaTunePMuonBestTrack.push_back(tunePTrack->eta());
Mu_phiTunePMuonBestTrack.push_back(tunePTrack->phi());
Mu_thetaTunePMuonBestTrack.push_back(tunePTrack->theta());
@@ -1579,12 +1694,12 @@ void MakeZprimeMiniAodTreeMC::PatMuonTree(const edm::Event& evt,const edm::Event
Mu_eta.push_back(mu.eta());
Mu_phi.push_back(mu.phi());
Mu_charge.push_back(mu.charge());
- Mu_ptInnerTrack.push_back(mu.innerTrack()->pt());
+ Mu_ptInnerTrack.push_back(mu.innerTrack()->pt());
Mu_dPToverPTInnerTrack.push_back(mu.innerTrack()->ptError()/mu.innerTrack()->pt());
- Mu_pxInnerTrack.push_back(mu.innerTrack()->px());
- Mu_pyInnerTrack.push_back(mu.innerTrack()->py());
- Mu_pzInnerTrack.push_back(mu.innerTrack()->pz());
- Mu_pInnerTrack.push_back(mu.innerTrack()->p());
+ Mu_pxInnerTrack.push_back(mu.innerTrack()->px());
+ Mu_pyInnerTrack.push_back(mu.innerTrack()->py());
+ Mu_pzInnerTrack.push_back(mu.innerTrack()->pz());
+ Mu_pInnerTrack.push_back(mu.innerTrack()->p());
Mu_etaInnerTrack.push_back(mu.innerTrack()->eta());
Mu_phiInnerTrack.push_back(mu.innerTrack()->phi());
Mu_thetaInnerTrack.push_back(mu.innerTrack()->theta());
@@ -1627,7 +1742,7 @@ void MakeZprimeMiniAodTreeMC::PatMuonTree(const edm::Event& evt,const edm::Event
}
void MakeZprimeMiniAodTreeMC::ComputeMuonMassVtx(const edm::Event& evt,const edm::EventSetup& es)
-{
+{
int NbMuons1 = 0;
int NbMuons2 = 0;
int NbMuons3 = 0;
@@ -1664,10 +1779,10 @@ void MakeZprimeMiniAodTreeMC::ComputeMuonMassVtx(const edm::Event& evt,const edm
if( !mu.globalTrack().isNonnull() ) continue;
if( mu.isTrackerMuon()==false ) continue;
MuonBestTrack1 = mu.tunePMuonBestTrack();
- if( MuonBestTrack1->pt()>53.0 && (mu.isolationR03().sumPt/mu.innerTrack()->pt()<0.10)
- && (MuonBestTrack1->ptError()/MuonBestTrack1->pt()<0.3) &&
+ if( MuonBestTrack1->pt()>53.0 && (mu.isolationR03().sumPt/mu.innerTrack()->pt()<0.10)
+ && (MuonBestTrack1->ptError()/MuonBestTrack1->pt()<0.3) &&
fabs(MuonBestTrack1->dxy(vertex.position()))<0.2 &&
- mu.globalTrack()->hitPattern().trackerLayersWithMeasurement()>5 &&
+ mu.globalTrack()->hitPattern().trackerLayersWithMeasurement()>5 &&
mu.globalTrack()->hitPattern().numberOfValidPixelHits()>0 &&
mu.globalTrack()->hitPattern().numberOfValidMuonHits()>0 &&
(mu.numberOfMatchedStations()>1
@@ -1687,10 +1802,10 @@ void MakeZprimeMiniAodTreeMC::ComputeMuonMassVtx(const edm::Event& evt,const edm
MuonBestTrack2 = mu2.tunePMuonBestTrack();
//cout << "PT 2mu= " << MuonBestTrack2->pt() << " and charge =" << MuonBestTrack2->charge()<< endl;
if(MuonBestTrack2->pt() == MuonBestTrack1->pt()) continue;
- if( MuonBestTrack2->pt()>53.0 && (mu2.isolationR03().sumPt/mu2.innerTrack()->pt()<0.10)
- && (MuonBestTrack2->ptError()/MuonBestTrack2->pt()<0.3) &&
+ if( MuonBestTrack2->pt()>53.0 && (mu2.isolationR03().sumPt/mu2.innerTrack()->pt()<0.10)
+ && (MuonBestTrack2->ptError()/MuonBestTrack2->pt()<0.3) &&
fabs(MuonBestTrack2->dxy(vertex.position()))<0.2 &&
- mu2.globalTrack()->hitPattern().trackerLayersWithMeasurement()>5 &&
+ mu2.globalTrack()->hitPattern().trackerLayersWithMeasurement()>5 &&
mu2.globalTrack()->hitPattern().numberOfValidPixelHits()>0 &&
mu2.globalTrack()->hitPattern().numberOfValidMuonHits()>0 &&
(mu2.numberOfMatchedStations()>1
@@ -1724,12 +1839,12 @@ void MakeZprimeMiniAodTreeMC::ComputeMuonMassVtx(const edm::Event& evt,const edm
if( mu3.isTrackerMuon()==false ) continue;
MuonBestTrack3 = mu3.tunePMuonBestTrack();
//cout << "PT 3mu= " << MuonBestTrack3->pt() << " and charge =" << MuonBestTrack3->charge() << endl;
- if(MuonBestTrack3->pt() == MuonBestTrack1->pt()) continue;
- if(MuonBestTrack3->pt() == MuonBestTrack2->pt()) continue;
- if( MuonBestTrack3->pt()>53.0 && (mu3.isolationR03().sumPt/mu3.innerTrack()->pt()<0.10)
- && (MuonBestTrack3->ptError()/MuonBestTrack3->pt()<0.3) &&
+ if(MuonBestTrack3->pt() == MuonBestTrack1->pt()) continue;
+ if(MuonBestTrack3->pt() == MuonBestTrack2->pt()) continue;
+ if( MuonBestTrack3->pt()>53.0 && (mu3.isolationR03().sumPt/mu3.innerTrack()->pt()<0.10)
+ && (MuonBestTrack3->ptError()/MuonBestTrack3->pt()<0.3) &&
fabs(MuonBestTrack3->dxy(vertex.position()))<0.2 &&
- mu3.globalTrack()->hitPattern().trackerLayersWithMeasurement()>5 &&
+ mu3.globalTrack()->hitPattern().trackerLayersWithMeasurement()>5 &&
mu3.globalTrack()->hitPattern().numberOfValidPixelHits()>0 &&
mu3.globalTrack()->hitPattern().numberOfValidMuonHits()>0 &&
(mu3.numberOfMatchedStations()>1
@@ -1783,7 +1898,7 @@ void MakeZprimeMiniAodTreeMC::ComputeMuonMassVtx(const edm::Event& evt,const edm
}
}
void MakeZprimeMiniAodTreeMC::ComputeMuonMassVtx30GeV(const edm::Event& evt,const edm::EventSetup& es)
-{
+{
int NbMuons1 = 0;
int NbMuons2 = 0;
int NbMuons3 = 0;
@@ -1820,10 +1935,10 @@ void MakeZprimeMiniAodTreeMC::ComputeMuonMassVtx30GeV(const edm::Event& evt,cons
if( !mu.globalTrack().isNonnull() ) continue;
if( mu.isTrackerMuon()==false ) continue;
MuonBestTrack1 = mu.tunePMuonBestTrack();
- if( MuonBestTrack1->pt()>30.0 && (mu.isolationR03().sumPt/mu.innerTrack()->pt()<0.10)
- && (MuonBestTrack1->ptError()/MuonBestTrack1->pt()<0.3) &&
+ if( MuonBestTrack1->pt()>30.0 && (mu.isolationR03().sumPt/mu.innerTrack()->pt()<0.10)
+ && (MuonBestTrack1->ptError()/MuonBestTrack1->pt()<0.3) &&
fabs(MuonBestTrack1->dxy(vertex.position()))<0.2 &&
- mu.globalTrack()->hitPattern().trackerLayersWithMeasurement()>5 &&
+ mu.globalTrack()->hitPattern().trackerLayersWithMeasurement()>5 &&
mu.globalTrack()->hitPattern().numberOfValidPixelHits()>0 &&
mu.globalTrack()->hitPattern().numberOfValidMuonHits()>0 &&
(mu.numberOfMatchedStations()>1
@@ -1839,10 +1954,10 @@ void MakeZprimeMiniAodTreeMC::ComputeMuonMassVtx30GeV(const edm::Event& evt,cons
if( mu2.isTrackerMuon()==false ) continue;
MuonBestTrack2 = mu2.tunePMuonBestTrack();
if(MuonBestTrack2->pt() == MuonBestTrack1->pt()) continue;
- if( MuonBestTrack2->pt()>30.0 && (mu2.isolationR03().sumPt/mu2.innerTrack()->pt()<0.10)
- && (MuonBestTrack2->ptError()/MuonBestTrack2->pt()<0.3) &&
+ if( MuonBestTrack2->pt()>30.0 && (mu2.isolationR03().sumPt/mu2.innerTrack()->pt()<0.10)
+ && (MuonBestTrack2->ptError()/MuonBestTrack2->pt()<0.3) &&
fabs(MuonBestTrack2->dxy(vertex.position()))<0.2 &&
- mu2.globalTrack()->hitPattern().trackerLayersWithMeasurement()>5 &&
+ mu2.globalTrack()->hitPattern().trackerLayersWithMeasurement()>5 &&
mu2.globalTrack()->hitPattern().numberOfValidPixelHits()>0 &&
mu2.globalTrack()->hitPattern().numberOfValidMuonHits()>0 &&
(mu2.numberOfMatchedStations()>1
@@ -1868,12 +1983,12 @@ void MakeZprimeMiniAodTreeMC::ComputeMuonMassVtx30GeV(const edm::Event& evt,cons
if( !mu3.globalTrack().isNonnull() ) continue;
if( mu3.isTrackerMuon()==false ) continue;
MuonBestTrack3 = mu3.tunePMuonBestTrack();
- if(MuonBestTrack3->pt() == MuonBestTrack1->pt()) continue;
- if(MuonBestTrack3->pt() == MuonBestTrack2->pt()) continue;
- if( MuonBestTrack3->pt()>30.0 && (mu3.isolationR03().sumPt/mu3.innerTrack()->pt()<0.10)
- && (MuonBestTrack3->ptError()/MuonBestTrack3->pt()<0.3) &&
+ if(MuonBestTrack3->pt() == MuonBestTrack1->pt()) continue;
+ if(MuonBestTrack3->pt() == MuonBestTrack2->pt()) continue;
+ if( MuonBestTrack3->pt()>30.0 && (mu3.isolationR03().sumPt/mu3.innerTrack()->pt()<0.10)
+ && (MuonBestTrack3->ptError()/MuonBestTrack3->pt()<0.3) &&
fabs(MuonBestTrack3->dxy(vertex.position()))<0.2 &&
- mu3.globalTrack()->hitPattern().trackerLayersWithMeasurement()>5 &&
+ mu3.globalTrack()->hitPattern().trackerLayersWithMeasurement()>5 &&
mu3.globalTrack()->hitPattern().numberOfValidPixelHits()>0 &&
mu3.globalTrack()->hitPattern().numberOfValidMuonHits()>0 &&
(mu3.numberOfMatchedStations()>1
@@ -1927,7 +2042,7 @@ void MakeZprimeMiniAodTreeMC::PrimaryVertexTree(const edm::Event& iEvent,const e
PositionY.clear();
PositionZ.clear();
PositionRho.clear();
- edm::Handle pvHandle;
+ edm::Handle pvHandle;
iEvent.getByToken(vtxToken_,pvHandle);
const reco::VertexCollection &vertices = *pvHandle.product();
for(reco::VertexCollection::const_iterator it=vertices.begin() ; it!=vertices.end() ; ++it){
@@ -1952,21 +2067,21 @@ void MakeZprimeMiniAodTreeMC::fillMET(const edm::Event& iEvent)
iEvent.getByToken(metToken_, mets);
const pat::MET &met = mets->front();
//[1] https://twiki.cern.ch/twiki/bin/viewauth/CMS/MissingETRun2Corrections
- //It is strongly recommended to use the Type-1 corrected MET, directly available from miniaod.
- //In case it is needed to recompute the Type-1 MET, please follow this twiki: here you find how
- //to get straight from miniAOD (slimmedMET and slimmedMETnoHF), how to recalculate correction
- //and uncertainties with the latest and greatest JEC.
- //You can find instructions for each analysis release.
+ //It is strongly recommended to use the Type-1 corrected MET, directly available from miniaod.
+ //In case it is needed to recompute the Type-1 MET, please follow this twiki: here you find how
+ //to get straight from miniAOD (slimmedMET and slimmedMETnoHF), how to recalculate correction
+ //and uncertainties with the latest and greatest JEC.
+ //You can find instructions for each analysis release.
//[2] https://twiki.cern.ch/twiki/bin/view/CMSPublic/WorkBookMiniAOD#Run2_Fall15_MiniAOD_v2_campaign
//the slimmedMETsNoHF was dropped (the recommendation from the MET group is to use standard slimmedMETs in 76X)
//The default type1 corrected MET
- PFMet_et_cor = met.et();
- PFMet_pt_cor = met.pt();
- PFMet_phi_cor = met.phi();
- PFMet_en_cor = met.energy();
- PFMet_px_cor = met.px();
- PFMet_py_cor = met.py();
- PFMet_pz_cor = met.pz();
+ PFMet_et_cor = met.et();
+ PFMet_pt_cor = met.pt();
+ PFMet_phi_cor = met.phi();
+ PFMet_en_cor = met.energy();
+ PFMet_px_cor = met.px();
+ PFMet_py_cor = met.py();
+ PFMet_pz_cor = met.pz();
PFMet_sumEt_cor = met.sumEt();
//Type I MET Uncertainties
pfMETshiftedPtJetEnUp = met.shiftedPt(pat::MET::JetEnUp, pat::MET::Type1 ) ;
@@ -1978,16 +2093,16 @@ void MakeZprimeMiniAodTreeMC::fillMET(const edm::Event& iEvent)
pfMETshiftedPtJetResUp = met.shiftedPt(pat::MET::JetResUp, pat::MET::Type1 ) ;
pfMETshiftedPtJetResDn = met.shiftedPt(pat::MET::JetResDown, pat::MET::Type1 ) ;
pfMETshiftedPtUnclEnUp = met.shiftedPt(pat::MET::UnclusteredEnUp, pat::MET::Type1 ) ;
- pfMETshiftedPtUnclEnDn = met.shiftedPt(pat::MET::UnclusteredEnDown, pat::MET::Type1 ) ;
+ pfMETshiftedPtUnclEnDn = met.shiftedPt(pat::MET::UnclusteredEnDown, pat::MET::Type1 ) ;
pfMETshiftedPtPhoEnUp = met.shiftedPt(pat::MET::PhotonEnUp, pat::MET::Type1 ) ;
- pfMETshiftedPtPhoEnDn = met.shiftedPt(pat::MET::PhotonEnDown, pat::MET::Type1 ) ;
+ pfMETshiftedPtPhoEnDn = met.shiftedPt(pat::MET::PhotonEnDown, pat::MET::Type1 ) ;
//pfMETshiftedPtJetEnUpSmear = met.shiftedPhi(pat::MET::METUncertainty::JetResUpSmear);
//pfMETshiftedPtJetEnDnSmear = met.shiftedPt(pat::MET::JetResDownSmear, pat::MET::Type1Smear ) ;
//pfMETUncertaintySize = met.shiftedPt(pat::MET::METUncertaintySize, pat::MET::Type1 ) ;
//pfMETFullUncertaintySize = met.shiftedPt(pat::MET::METFullUncertaintySize, pat::MET::Type1 ) ;
//cout<<"jet smeared = "<pt();
+ if (met.genMET() != NULL ) GenMet_pt = met.genMET()->pt();
/*edm::Handle metsighandle;
iEvent.getByToken(theMETSignificance_, metsighandle);
METSign=*metsighandle;*/
@@ -2025,7 +2140,7 @@ void MakeZprimeMiniAodTreeMC::fillMET(const edm::Event& iEvent)
//
//=============================================================
void MakeZprimeMiniAodTreeMC::GenJetTree(const edm::Event& iEvent)
-{
+{
int NbGenJets = 0;
iGenJet.clear();
idGenJet.clear();
@@ -2037,7 +2152,7 @@ void MakeZprimeMiniAodTreeMC::GenJetTree(const edm::Event& iEvent)
/**** GET GENJETS ****/
edm::Handle h_genjets;
iEvent.getByToken( EDMGenJetsToken_,h_genjets );
- if (!(h_genjets.isValid())) return;
+ if (!(h_genjets.isValid())) return;
std::vector const &genjets = *h_genjets;
for(size_t i=0; i(*j.daughter(id));
if (dau.charge() == 0) continue;
@@ -2105,7 +2220,7 @@ void MakeZprimeMiniAodTreeMC::JetsTree(const edm::Event& iEvent,const edm::Event
jet_pileup_mva_disc.push_back(j.userFloat("pileupJetId:fullDiscriminant"));
}
else continue;
- }
+ }
}
//=============================================================
//
@@ -2127,7 +2242,7 @@ void MakeZprimeMiniAodTreeMC::BtaggingTree(const edm::Event& iEvent)
iEvent.getByToken(jetToken_, jets);
// loop over jets
for( auto jet = jets->begin(); jet != jets->end(); ++jet )
- {
+ {
// fill discriminator variables
int flavor = std::abs( jet->partonFlavour() );
for( const std::string &bDiscr : bDiscriminators_ )
@@ -2157,7 +2272,7 @@ void MakeZprimeMiniAodTreeMC::BtaggingTree(const edm::Event& iEvent)
//
//=============================================================
void MakeZprimeMiniAodTreeMC::ParticleFlowPhotonTree(const edm::Event& iEvent,const edm::EventSetup& es)
-{
+{
pfphoton_size = 0;
pfphoton_pt.clear();
pfphoton_eta.clear();
@@ -2207,7 +2322,7 @@ void MakeZprimeMiniAodTreeMC::ParticleFlowPhotonTree(const edm::Event& iEvent,co
}
}
}
-//madgraph MC samples reweighing
+//madgraph MC samples reweighing
void MakeZprimeMiniAodTreeMC::EventsReWeighting(const edm::Event& evt){
MC_weighting.clear();
float EventWeight = 1.0;
@@ -2285,8 +2400,8 @@ void MakeZprimeMiniAodTreeMC::TauTree(const edm::Event& iEvent)
[11] kKilled, // MC only flag: the channel is killed in the real detector
[12] kTPSaturated, // the channel is in a region with saturated TP
[13] kL1SpikeFlag, // the channel is in a region with TP with sFGVB = 0
- [14] kWeird, // the signal is believed to originate from an anomalous deposit (spike)
- [15] kDiWeird, // the signal is anomalous, and neighbors another anomalous signal
+ [14] kWeird, // the signal is believed to originate from an anomalous deposit (spike)
+ [15] kDiWeird, // the signal is anomalous, and neighbors another anomalous signal
[16] kHasSwitchToGain6, // at least one data frame is in G6
[17] kHasSwitchToGain1, // at least one data frame is in G1
[18] kUnknown // to ease the interface with functions returning flags.
diff --git a/Analyzer/plugins/MakeZprimeMiniAodTreeMuon.cc b/Analyzer/plugins/MakeZprimeMiniAodTreeMuon.cc
index e7b8efb..ff14bbf 100644
--- a/Analyzer/plugins/MakeZprimeMiniAodTreeMuon.cc
+++ b/Analyzer/plugins/MakeZprimeMiniAodTreeMuon.cc
@@ -10,7 +10,7 @@
//corresponds to which which cutnr
//this is fixed for a given ID (and can be different for each ID)
//hence its hard coded
-//also these headerfiles are intentionally completely standalone
+//also these headerfiles are intentionally completely standalone
//so you can easily include them in your analysis if you find them
//useful
#include "FWCore/Utilities/interface/InputTag.h"
@@ -77,7 +77,7 @@ using namespace pat;
#include "DataFormats/HLTReco/interface/TriggerTypeDefs.h"
#include "HLTrigger/HLTcore/interface/HLTConfigProvider.h"
#include "FWCore/ServiceRegistry/interface/Service.h"
-#include "CommonTools/UtilAlgos/interface/TFileService.h"
+#include "CommonTools/UtilAlgos/interface/TFileService.h"
#include "DataFormats/MuonReco/interface/MuonSelectors.h"
#include "DataFormats/MuonReco/interface/MuonCocktails.h"
#include "DataFormats/Common/interface/RefCore.h"
@@ -139,7 +139,7 @@ class MakeZprimeMiniAodTreeMuon : public edm::EDAnalyzer {
static void globalEndJob(const NrPassFail* nrPassFail) {
std::cout <<"nr eles pass "<nrPass<<" / "<nrPass+nrPassFail->nrFail< > eleToken_;
// ----------member data --------------------------- //
edm::EDGetTokenT rhoToken;
edm::EDGetTokenT genInfoProductToken;
- edm::EDGetTokenT EDMGenJetsToken_;
+ edm::EDGetTokenT EDMGenJetsToken_;
edm::EDGetTokenT scProducer_;
edm::EDGetTokenT vtxToken_;
edm::EDGetTokenT muonToken_;
@@ -218,7 +218,7 @@ class MakeZprimeMiniAodTreeMuon : public edm::EDAnalyzer {
// Create vectors for Electrons variables
//
//==================================================
-
+
std::vector Ele_rawId;
std::vector Ele_nbElectrons;
std::vector Ele_isEcalDrivenSeed;
@@ -239,7 +239,7 @@ class MakeZprimeMiniAodTreeMuon : public edm::EDAnalyzer {
std::vector Ele_phiTrack;
std::vector Ele_hadronicOverEm;
std::vector Ele_deltaEtaInSeedCluster;
- std::vector Ele_deltaPhiInSeedCluster;
+ std::vector Ele_deltaPhiInSeedCluster;
std::vector Ele_deltaEtaInSC;
std::vector Ele_deltaPhiInSC;
std::vector Ele_sigmaIetaIeta;
@@ -284,7 +284,7 @@ class MakeZprimeMiniAodTreeMuon : public edm::EDAnalyzer {
std::vector