Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
67b8a31
update
cmkuo Sep 9, 2017
8c77bee
update to 92X
cmkuo Sep 9, 2017
2427ae4
update to 92x
cmkuo Sep 9, 2017
df064b7
update to 92X
cmkuo Sep 9, 2017
189bfd0
new py cfg files for 92X
cmkuo Sep 9, 2017
66a6254
update
cmkuo Sep 9, 2017
f5cc5a2
bugfix for triggermatching
bartokm Sep 8, 2017
67b5ba3
fix the bug of HEEP ID
cmkuo Sep 14, 2017
435b40e
update
cmkuo Sep 14, 2017
fb12da7
add trigger
Sep 20, 2017
752467b
Merge pull request #11 from doanhien/addtriggers
cmkuo Sep 20, 2017
4965750
add isLastCopy to mcStatusFlag
bartokm Oct 26, 2017
f47a7b1
PreScaleProvider and rejectedbyPS for 92X
bartokm Oct 25, 2017
e32fdba
new triggers for 92X
bartokm Oct 25, 2017
160119e
correction for phoPrescale
bartokm Oct 26, 2017
0814176
new files
cmkuo Feb 21, 2018
e8c3a53
update
cmkuo Feb 21, 2018
38a3349
update to 94X
cmkuo Feb 21, 2018
509af0c
upgrade to 94X
cmkuo Feb 21, 2018
4dcdde7
add new JEC files for Fall17 MC
cmkuo Feb 21, 2018
0a15749
remove JEC and turn off AK8 jets for the time being
cmkuo Feb 21, 2018
86f9cd4
updates
cmkuo Feb 21, 2018
488dd77
update
cmkuo Feb 21, 2018
2d85f05
update to 949
cmkuo Aug 7, 2018
1ed8492
update to 94X
cmkuo Aug 7, 2018
daced37
for 2017 data
cmkuo Aug 7, 2018
929575d
update to 949
cmkuo Aug 8, 2018
20f5490
align muon variables
cmkuo Aug 8, 2018
1e2de65
separate ak8jets from ak4jets
cmkuo Aug 8, 2018
ce3bc7e
separate ak8jets from ak4jets
cmkuo Aug 8, 2018
e3af415
remove old JEC files
cmkuo Aug 8, 2018
f2efd92
remove old py cfg files
cmkuo Aug 8, 2018
ec4ac92
add DeepCSV tagger
cmkuo Aug 8, 2018
7281d92
add both of 2016 and 2017 triggers. year_ should be used to control w…
cmkuo Aug 13, 2018
c68c0f7
add the correct InputTag for GSF electrons
cmkuo Aug 13, 2018
fd12e64
update py cfg for 2017 MC
cmkuo Aug 13, 2018
291ca2f
remove useless variable
cmkuo Aug 13, 2018
18b92cf
add new py cfg files and remove the old ones
cmkuo Aug 13, 2018
3b87355
remove useless py cfg file
cmkuo Aug 13, 2018
5e950e2
comment out photon prescale rate for the time being since it does
cmkuo Aug 13, 2018
b58f724
complete the first version for PF photons
cmkuo Aug 14, 2018
66b834e
add two variables for e/g SC veto
cmkuo Aug 15, 2018
01f6fd5
add Et resolution for PF photons
cmkuo Aug 17, 2018
751db98
Added genJetInfo and AK8JetInfo
jainshilpi Sep 24, 2018
1e16db0
ak8 pt cut to 170
jainshilpi Sep 24, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 11 additions & 52 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,61 +1,20 @@
#### Current production tag : V08_00_26_03
#### Current production tag :
#### Newest tag for testing :
#### Note that the current head version can be run with CMSSW_8_0_26_patch1
#### Note that the current head version can be run with CMSSW_9_4_9

##### To work with CMSSW_8_0_26_patch1 and head version, you do :
cd CMSSW_8_0_26_patch1/src <br>
##### To work with CMSSW_9_4_9 and head version, you do :
cmsrel CMSSW_9_4_9_cand2 <br>
cd CMSSW_9_4_9_cand2/src <br>
cmsenv <br>
setenv CMSSW_GIT_REFERENCE /cvmfs/cms.cern.ch/cmssw.git.daily <br>
git cms-init <br>
git remote add btv-cmssw https://github.com/cms-btv-pog/cmssw.git <br>
git fetch --tags btv-cmssw <br>
git cms-merge-topic -u cms-btv-pog:BoostedDoubleSVTaggerV4-WithWeightFiles-v1_from-CMSSW_8_0_21 <br>
git cms-merge-topic rafaellopesdesa:RegressionCheckNegEnergy <br>
git cms-merge-topic cms-egamma:EGM_gain_v1 <br>
cd EgammaAnalysis/ElectronTools/data <br>
git clone -b Moriond17_gainSwitch_unc https://github.com/ECALELFS/ScalesSmearings.git <br>
git cms-merge-topic cms-egamma:EgammaPostRecoTools_940 <br>
scram b -j 8 <br>
git cms-merge-topic cms-met:METFixEE2017_949 <br>
scram b -j 8 <br>
cd $CMSSW_BASE/src <br>
git cms-merge-topic cms-met:METRecipe_8020 -u <br>
git cms-merge-topic cms-met:METRecipe_80X_part2 -u <br>
git cms-merge-topic Sam-Harper:HEEPV70VID_8010_ReducedCheckout <br>
git cms-merge-topic Sam-Harper:PackedCandNoPuppi <br>
git cms-merge-topic ikrav:egm_id_80X_v2 <br>
git cms-merge-topic ikrav:egm_id_80X_v3_photons <br>
git clone https://github.com/cmkuo/HiggsAnalysis.git <br>
git clone -b V08_00_26_03 https://github.com/cmkuo/ggAnalysis.git <br>

scram b -j 10 <br>

##### To work with CMSSW_8_0_26_patch1 and V08_00_26_01, you do :
cd CMSSW_8_0_26_patch1/src <br>
cmsenv <br>
setenv CMSSW_GIT_REFERENCE /cvmfs/cms.cern.ch/cmssw.git.daily <br>
git cms-init <br>
git remote add btv-cmssw https://github.com/cms-btv-pog/cmssw.git <br>
git fetch --tags btv-cmssw <br>
git cms-merge-topic -u cms-btv-pog:BoostedDoubleSVTaggerV4-WithWeightFiles-v1_from-CMSSW_8_0_21 <br>
git cms-merge-topic rafaellopesdesa:EgammaAnalysis80_EGMSmearer_Moriond17_23Jan <br>
cd EgammaAnalysis/ElectronTools/data <br>
git clone git@github.com:ECALELFS/ScalesSmearings.git <br>
cd ../../../ <br>
git cms-merge-topic cms-met:METRecipe_8020 -u <br>
git cms-merge-topic cms-met:METRecipe_80X_part2 -u <br>
git cms-merge-topic Sam-Harper:HEEPV70VID_8010_ReducedCheckout <br>
git cms-merge-topic Sam-Harper:PackedCandNoPuppi <br>
git cms-merge-topic ikrav:egm_id_80X_v2 <br>
git cms-merge-topic ikrav:egm_id_80X_v3_photons <br>
git clone https://github.com/cmkuo/HiggsAnalysis.git <br>
git clone -b V08_00_26_01 https://github.com/cmkuo/ggAnalysis.git <br>

scram b -j 10 <br>

##### To work with CMSSW_7_6_3_patch2, you do:
cd CMSSW_7_6_3_patch2/src <br>
cmsenv <br>
git cms-merge-topic -u matteosan1:smearer_76X <br>
git clone https://github.com/cmkuo/HiggsAnalysis.git <br>
git clone -b V07_06_03_01 https://github.com/cmkuo/ggAnalysis.git <br>
scram b -j 10 <br>
git clone -b 94X https://github.com/cmkuo/ggAnalysis.git <br>
scram b -j8 <br>

The above code stores the decision in 64 integer. Each bit represents a decision<br>
for ELECRON ID: 5 IDs (Veto, Loose, Medium, Tight and HEEP) so only 5 bits are imp for us (59 bits of this integer we are not using so may be we can change that to 16 bit integer later)<br>
Expand Down
82 changes: 33 additions & 49 deletions ggNtuplizer/interface/ggNtuplizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
#define ggNtuplizer_h

#include "TTree.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/EventSetup.h"
#include "DataFormats/Common/interface/Handle.h"
#include "FWCore/Framework/interface/ESHandle.h"
#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/EDAnalyzer.h"
#include "FWCore/Framework/interface/MakerMacros.h"
Expand All @@ -24,10 +28,11 @@
#include "DataFormats/PatCandidates/interface/Jet.h"
#include "DataFormats/PatCandidates/interface/Tau.h"
#include "CondFormats/JetMETObjects/interface/FactorizedJetCorrector.h"
#include "EgammaAnalysis/ElectronTools/interface/EnergyScaleCorrection_class.h"
//#include "EgammaAnalysis/ElectronTools/interface/EnergyScaleCorrection_class.h"
#include "HiggsAnalysis/HiggsTo2photons/interface/CiCPhotonID.h"
#include "JetMETCorrections/Modules/interface/JetResolution.h"
//#include "PhysicsTools/SelectorUtils/interface/PFJetIDSelectionFunctor.h"
#include "HLTrigger/HLTcore/interface/HLTPrescaleProvider.h"

using namespace std;

Expand All @@ -48,13 +53,14 @@ class ggNtuplizer : public edm::EDAnalyzer {
// virtual void endJob() {};

void initTriggerFilters(const edm::Event&);
UInt_t matchSingleElectronTriggerFilters(double pt, double eta, double phi);
UInt_t matchDoubleElectronTriggerFilters(double pt, double eta, double phi);
UInt_t matchSinglePhotonTriggerFilters(double pt, double eta, double phi);
UInt_t matchDoublePhotonTriggerFilters(double pt, double eta, double phi);
UInt_t matchMuonTriggerFilters(double pt, double eta, double phi);
UInt_t matchJetTriggerFilters(double pt, double eta, double phi);
UInt_t matchL1TriggerFilters(double pt, double eta, double phi);
ULong64_t matchSingleElectronTriggerFilters(double pt, double eta, double phi);
ULong64_t matchDoubleElectronTriggerFilters(double pt, double eta, double phi);
ULong64_t matchSinglePhotonTriggerFilters(double pt, double eta, double phi);
ULong64_t matchDoublePhotonTriggerFilters(double pt, double eta, double phi);
ULong64_t matchTriplePhotonTriggerFilters(double pt, double eta, double phi);
ULong64_t matchMuonTriggerFilters(double pt, double eta, double phi);
ULong64_t matchJetTriggerFilters(double pt, double eta, double phi);
ULong64_t matchL1TriggerFilters(double pt, double eta, double phi);
Double_t deltaPhi(Double_t phi1, Double_t phi2);
Double_t deltaR(Double_t eta1, Double_t phi1, Double_t eta2, Double_t phi2);
Double_t getMiniIsolation(edm::Handle<pat::PackedCandidateCollection> pfcands, const reco::Candidate* ptcl,
Expand All @@ -71,6 +77,8 @@ class ggNtuplizer : public edm::EDAnalyzer {
void branchesMuons (TTree*);
void branchesTaus (TTree*);
void branchesJets (TTree*);
void branchesAK8Jets (TTree*);
void branchesGenJetPart (TTree*);

void fillGlobalEvent(const edm::Event&, const edm::EventSetup&);
void fillGenInfo (const edm::Event&);
Expand All @@ -83,25 +91,30 @@ class ggNtuplizer : public edm::EDAnalyzer {
void fillMuons (const edm::Event&, math::XYZPoint&, const reco::Vertex);
void fillTaus (const edm::Event&);
void fillJets (const edm::Event&, const edm::EventSetup&);
void fillAK8Jets (const edm::Event&, const edm::EventSetup&);

void fillGenJetInfo (const edm::Event&);

void cleanupPhotons();

bool development_;
bool addFilterInfoAOD_;
bool addFilterInfoMINIAOD_;
bool doNoHFMET_;
bool doGenParticles_;

bool doGenJets_;

bool runOnParticleGun_;
bool runOnSherpa_;
bool dumpPhotons_;
bool dumpPFPhotons_;
bool dumpTaus_;
bool dumpJets_;
bool dumpSubJets_;
bool dumpAK8Jets_;
bool dumpSoftDrop_;
bool dumpPDFSystWeight_;

bool isAOD_;
bool runHFElectrons_;
bool dumpHFElectrons_;
int year_;

vector<int> newparticles_;

Expand All @@ -123,9 +136,7 @@ class ggNtuplizer : public edm::EDAnalyzer {
edm::EDGetTokenT<vector<reco::GenParticle> > genParticlesCollection_;
edm::EDGetTokenT<edm::View<pat::MET> > pfMETlabel_;
edm::EDGetTokenT<edm::View<pat::Electron> > electronCollection_;
edm::EDGetTokenT<edm::View<pat::Electron> > calibelectronCollection_;
edm::EDGetTokenT<edm::View<pat::Photon> > photonCollection_;
edm::EDGetTokenT<edm::View<pat::Photon> > calibphotonCollection_;
edm::EDGetTokenT<edm::View<pat::Muon> > muonCollection_;
edm::EDGetTokenT<vector<pat::Tau> > tauCollection_;
edm::EDGetTokenT<EcalRecHitCollection> ebReducedRecHitCollection_;
Expand All @@ -143,40 +154,12 @@ class ggNtuplizer : public edm::EDAnalyzer {
edm::EDGetTokenT<reco::JetTagCollection> boostedDoubleSVLabel_;
edm::EDGetTokenT<pat::PackedCandidateCollection> pckPFCandidateCollection_;

edm::EDGetTokenT<std::vector<reco::GenJet> > GenJetLabel_;

// for MET filters
edm::EDGetTokenT<bool> BadChCandFilterToken_;
edm::EDGetTokenT<bool> BadPFMuonFilterToken_;

///Photon ID in VID framework - 11th May, 2015
// photon ID decision objects and isolations
edm::EDGetTokenT<edm::ValueMap<bool> > phoLooseIdMapToken_;
edm::EDGetTokenT<edm::ValueMap<bool> > phoMediumIdMapToken_;
edm::EDGetTokenT<edm::ValueMap<bool> > phoTightIdMapToken_;
edm::EDGetTokenT<edm::ValueMap<float> > phoMVAValuesMapToken_;
edm::EDGetTokenT<edm::ValueMap<float> > phoChargedIsolationToken_;
edm::EDGetTokenT<edm::ValueMap<float> > phoNeutralHadronIsolationToken_;
edm::EDGetTokenT<edm::ValueMap<float> > phoPhotonIsolationToken_;
edm::EDGetTokenT<edm::ValueMap<float> > phoWorstChargedIsolationToken_;
edm::EDGetTokenT<edm::ValueMap<float> > phoChargedIsolationToken_CITK_;
edm::EDGetTokenT<edm::ValueMap<float> > phoNeutralHadronIsolationToken_CITK_;
edm::EDGetTokenT<edm::ValueMap<float> > phoPhotonIsolationToken_CITK_;
edm::EDGetTokenT<edm::ValueMap<float> > phoChargedIsolationToken_PUPPI_;
edm::EDGetTokenT<edm::ValueMap<float> > phoNeutralHadronIsolationToken_PUPPI_;
edm::EDGetTokenT<edm::ValueMap<float> > phoPhotonIsolationToken_PUPPI_;

// elecontr ID decisions objects
edm::EDGetTokenT<edm::ValueMap<bool> > eleVetoIdMapToken_;
edm::EDGetTokenT<edm::ValueMap<bool> > eleLooseIdMapToken_;
edm::EDGetTokenT<edm::ValueMap<bool> > eleMediumIdMapToken_;
edm::EDGetTokenT<edm::ValueMap<bool> > eleTightIdMapToken_;
edm::EDGetTokenT<edm::ValueMap<bool> > eleHLTIdMapToken_;
edm::EDGetTokenT<edm::ValueMap<bool> > eleHEEPIdMapToken_;
edm::EDGetTokenT<edm::ValueMap<float> > eleMVAValuesMapToken_;
edm::EDGetTokenT<edm::ValueMap<float> > eleMVAHZZValuesMapToken_;
edm::EDGetTokenT<edm::ValueMap<float> > elePFClusEcalIsoToken_;
edm::EDGetTokenT<edm::ValueMap<float> > elePFClusHcalIsoToken_;
edm::EDGetTokenT<reco::PFCandidateCollection> pfCandidateCollection_;

//check
edm::EDGetToken gsfEle_;

Expand All @@ -188,17 +171,18 @@ class ggNtuplizer : public edm::EDAnalyzer {
TH1F *hSumGenWeight_;

CiCPhotonID *cicPhotonId_;
EnergyScaleCorrection_class *egmScaler_;
//EnergyScaleCorrection_class *egmScaler_;

JME::JetResolution jetResolution_;
JME::JetResolutionScaleFactor jetResolutionSF_;
JME::JetResolution AK8jetResolution_;
JME::JetResolutionScaleFactor AK8jetResolutionSF_;

//PFJetIDSelectionFunctor pfLooseId_;
boost::shared_ptr<FactorizedJetCorrector> jecAK8_;
boost::shared_ptr<FactorizedJetCorrector> jecAK8pSD_;
std::vector<std::string> jecAK8PayloadNames_;
//boost::shared_ptr<FactorizedJetCorrector> jecAK8_;
//boost::shared_ptr<FactorizedJetCorrector> jecAK8pSD_;
//std::vector<std::string> jecAK8PayloadNames_;
HLTPrescaleProvider hltPrescaleProvider_;
};

#endif
1 change: 1 addition & 0 deletions ggNtuplizer/plugins/BuildFile.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<use name="HiggsAnalysis/HiggsTo2photons"/>
<use name="RecoEcal/EgammaCoreTools"/>
<use name="RecoEgamma/PhotonIdentification"/>
<use name="RecoParticleFlow/PFClusterTools"/>
<use name="CondFormats/JetMETObjects"/>
<use name="JetMETCorrections/Objects"/>
<use name="JetMETCorrections/Modules"/>
Expand Down
Loading