-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NanoAOD update 10XY version (master version of #23445) #23446
Merged
cmsbuild
merged 59 commits into
cms-sw:master
from
arizzi:nanoAODrebasedMasterWithoutData10XY
Jul 9, 2018
Merged
Changes from 57 commits
Commits
Show all changes
59 commits
Select commit
Hold shift + click to select a range
a9ba3f6
fix dqm
arizzi 465c4fa
BadGlobalMuonTagger -> add a boolean flagging the event as good or bad
a8c054a
NanoAOD file to run the bad muon / bad charged hadron modules + a tab…
4c8e9db
Add the extra flags producers and table to 80X for nanoaod (flags pre…
9f7accb
Use the correct bad charged hadron module for the full 2016 dataset
073088d
Rename bad charged hadron flag for consistency with 94X flags
078366b
Add a flag for the BadPFMuonFilter module in 80X nanoAOD
bc6eca0
Added my own version of triggerObjects_cff.py witn modified e and mu …
rdewanje b9c697c
Updated e, mu and tau sections triggerObjects_cff.py for better reada…
rdewanje 672287c
Fix syntax errors in HLT filter expressions
ktht 1eafd4e
Added the new HLT filter logic for e/mu/tau
rdewanje 6c0029c
Added the latest changes to the HLT bit masks for e, mu and tau objects
rdewanje 7906f35
Corrected the qualityBitsDoc line FOR Electron setting bits: 2 = 1e (…
rdewanje a65ae20
Minor modifications in qualityBits for Electron to make them have the…
rdewanje 84ba040
Added b-tag SF EDProducer to get event weights, configs in nano_cff, …
b36518f
Modified BTagSFProducer and config to produce one weight table for mu…
dcccc9e
Added era switches, added default output of 1.0 for the eras where SF…
be182a2
Minor change
e04ce58
Edited BTagSFProducer to not produce any branch for b-taggers marked …
22027f8
Saving Discriminator Reshaping weights; added latest SF .csv files
arizzi 443d6f5
Using jet.hadronFlavour() instead of jet.partonFlavour()
53666c5
Adapting GenWeightsTableProducer to work with new header file format …
adewit 3f695e4
Assigning bools with explicit true/false instead of 0/1
adewit e84506a
Reducing code duplication in GenWeightsTableProducer
adewit 89736f7
Perform all bracket replacements in initial loop
adewit 591920b
Removing redundant if statement
adewit db498d8
bug fix, wrong input tag used
arizzi ee6fdf6
Add PS weights to GenWeightsTableProducer
adewit 7697afa
first version of tensorflow support for MVA value map producer
arizzi f7779bc
adding regression variables
leonardogiannini af349bd
adding jet energy rings needed for b-jet regression
nadya-chernyavskaya a755df8
£target
leonardogiannini 2df1fb8
target
leonardogiannini 98fabdb
ptRel simple def
leonardogiannini 39b0ead
first version of bjet NN tensorflow regression
arizzi 52019f4
nadya's regression
arizzi bf213de
do not add unexpected vars, silence printout
arizzi 98622f9
NN regression for b-jets, modified inputs
nadya-chernyavskaya f0bfbb0
Update jets_cff.py
4a39178
enable only working version
arizzi 46dc6f1
remove variables needed for training from nano
arizzi 2115d6d
better naming and remove second version
arizzi 748df7c
readd deep flav
arizzi 692914b
code checks and 80Xlegacy fix
arizzi 1dfd71f
reduce precision of resolution, remove old reg, add dqm
arizzi 6cb7642
add DeepCSV to 80X samples
arizzi f5ee560
add qgtagger for 80X
arizzi 0150b51
updated rms and mean for new training
arizzi 8e7db2a
restore cut at 15 GeV
arizzi 4fbd56a
enable re-btag only for 80X
arizzi 1a9886e
remove nPV normalization
arizzi 82d3ed1
fix b-regression target
arizzi 6adba45
remove legacy regression, fix dqm
arizzi 7a4a65f
fix code-checks
arizzi 7cc8509
use FileInPath
arizzi a26d44a
fix conflict
arizzi 41e6b51
style cleanup
arizzi dd1e24d
Remove include
gpetruc 355f35c
Merge pull request #37 from gpetruc/nanoAODrebasedMasterWithoutData10XY
arizzi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,7 +33,8 @@ class BJetEnergyRegressionMVA : public BaseMVAValueMapProducer<pat::Jet> { | |
explicit BJetEnergyRegressionMVA(const edm::ParameterSet &iConfig): | ||
BaseMVAValueMapProducer<pat::Jet>(iConfig), | ||
pvsrc_(edm::stream::EDProducer<>::consumes<std::vector<reco::Vertex>>(iConfig.getParameter<edm::InputTag>("pvsrc"))), | ||
svsrc_(edm::stream::EDProducer<>::consumes<edm::View<reco::VertexCompositePtrCandidate>> (iConfig.getParameter<edm::InputTag>("svsrc"))) | ||
svsrc_(edm::stream::EDProducer<>::consumes<edm::View<reco::VertexCompositePtrCandidate>> (iConfig.getParameter<edm::InputTag>("svsrc"))), | ||
rhosrc_(edm::stream::EDProducer<>::consumes<double> (iConfig.getParameter<edm::InputTag>("rhosrc"))) | ||
|
||
{ | ||
|
||
|
@@ -42,65 +43,95 @@ class BJetEnergyRegressionMVA : public BaseMVAValueMapProducer<pat::Jet> { | |
void readAdditionalCollections(edm::Event&iEvent, const edm::EventSetup&) override { | ||
iEvent.getByToken(pvsrc_, pvs_); | ||
iEvent.getByToken(svsrc_, svs_); | ||
} | ||
|
||
void fillAdditionalVariables(const pat::Jet&j) override { | ||
this->setValue("nPVs",pvs_->size()); | ||
BaseMVAValueMapProducer<pat::Jet>::setValue("Jet_leptonPtRel",0); | ||
|
||
if(!j.overlaps("muons").empty()) { | ||
const auto *lep=dynamic_cast<const pat::Muon *>(&*j.overlaps("muons")[0]); | ||
if(lep!=nullptr) {BaseMVAValueMapProducer<pat::Jet>::setValue("Jet_leptonPtRel",lep->userFloat("ptRel"));} | ||
} | ||
else if(!j.overlaps("electrons").empty()) { | ||
const auto *lep=dynamic_cast<const pat::Electron *>(&*j.overlaps("electrons")[0]); | ||
if(lep!=nullptr) {BaseMVAValueMapProducer<pat::Jet>::setValue("Jet_leptonPtRel",lep->userFloat("ptRel"));} | ||
} | ||
|
||
float ptMax=0; | ||
for(const auto & d : j.daughterPtrVector()){if(d->pt()>ptMax) ptMax=d->pt();} | ||
BaseMVAValueMapProducer<pat::Jet>::setValue("Jet_leadTrackPt",ptMax); | ||
|
||
//Fill vertex properties | ||
VertexDistance3D vdist; | ||
float maxFoundSignificance=0; | ||
const auto & pv = (*pvs_)[0]; | ||
this->setValue("Jet_vtxPt",0); | ||
this->setValue("Jet_vtxMass",0); | ||
this->setValue("Jet_vtx3dL",0); | ||
this->setValue("Jet_vtx3deL",0); | ||
this->setValue("Jet_vtxNtrk",0); | ||
|
||
for(const auto &sv: *svs_){ | ||
GlobalVector flightDir(sv.vertex().x() - pv.x(), sv.vertex().y() - pv.y(),sv.vertex().z() - pv.z()); | ||
GlobalVector jetDir(j.px(),j.py(),j.pz()); | ||
if( Geom::deltaR2( flightDir, jetDir ) < 0.09 ){ | ||
Measurement1D dl= vdist.distance(pv,VertexState(RecoVertex::convertPos(sv.position()),RecoVertex::convertError(sv.error()))); | ||
if(dl.significance() > maxFoundSignificance){ | ||
maxFoundSignificance=dl.significance(); | ||
this->setValue("Jet_vtxPt",sv.pt()); | ||
this->setValue("Jet_vtxMass",sv.p4().M()); | ||
this->setValue("Jet_vtx3dL",dl.value()); | ||
this->setValue("Jet_vtx3deL",dl.error()); | ||
this->setValue("Jet_vtxNtrk",sv.numberOfSourceCandidatePtrs()); | ||
} | ||
} | ||
} | ||
iEvent.getByToken(rhosrc_,rho_); | ||
|
||
} | ||
|
||
void fillAdditionalVariables(const pat::Jet&j) override { | ||
|
||
this->setValue("nPVs",pvs_->size()); | ||
this->setValue("rho",*(rho_.product())); | ||
|
||
|
||
float cone_boundaries[] = { 0.05, 0.1, 0.2, 0.3,0.4 }; | ||
size_t ncone_boundaries = sizeof(cone_boundaries)/sizeof(float); | ||
std::vector<float> emFractionEnergyRings(ncone_boundaries+1); | ||
std::vector<float> chFractionEnergyRings(ncone_boundaries+1); | ||
std::vector<float> neFractionEnergyRings(ncone_boundaries+1); | ||
std::vector<float> muFractionEnergyRings(ncone_boundaries+1); | ||
float jetRawEnergy=j.p4().E()*j.jecFactor("Uncorrected"); | ||
int numDaughtersPt03=0; | ||
for (unsigned int ijcone = 0; ijcone<ncone_boundaries; ijcone++){ | ||
emFractionEnergyRings[ijcone] = 0; | ||
muFractionEnergyRings[ijcone] = 0; | ||
chFractionEnergyRings[ijcone] = 0; | ||
neFractionEnergyRings[ijcone] = 0; | ||
} | ||
for(const auto & d : j.daughterPtrVector()){ | ||
float candDr = Geom::deltaR(d->p4(),j.p4()); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
size_t icone = std::lower_bound(&cone_boundaries[0],&cone_boundaries[ncone_boundaries],candDr) - &cone_boundaries[0]; | ||
float candEnergy = d->energy()/jetRawEnergy; | ||
int pdgid = abs(d->pdgId()) ; | ||
if( pdgid == 22 || pdgid == 11 ) { | ||
emFractionEnergyRings[icone] += candEnergy; | ||
} else if ( pdgid == 13 ) { | ||
muFractionEnergyRings[icone] += candEnergy; | ||
} else if ( d->charge() != 0 ) { | ||
chFractionEnergyRings[icone] += candEnergy; | ||
} else { | ||
neFractionEnergyRings[icone] += candEnergy; | ||
} | ||
if(d->pt()>0.3) numDaughtersPt03+=1; | ||
} // end of jet daughters loop | ||
|
||
this->setValue("Jet_energyRing_dR0_em_Jet_rawEnergy", emFractionEnergyRings[0]); | ||
this->setValue("Jet_energyRing_dR1_em_Jet_rawEnergy", emFractionEnergyRings[1]); | ||
this->setValue("Jet_energyRing_dR2_em_Jet_rawEnergy", emFractionEnergyRings[2]); | ||
this->setValue("Jet_energyRing_dR3_em_Jet_rawEnergy", emFractionEnergyRings[3]); | ||
this->setValue("Jet_energyRing_dR4_em_Jet_rawEnergy", emFractionEnergyRings[4]); | ||
// this->setValue("Jet_energyRing_dR5_em_Jet_rawEnergy", emFractionEnergyRings[5]); | ||
|
||
this->setValue("Jet_energyRing_dR0_ch_Jet_rawEnergy", chFractionEnergyRings[0]); | ||
this->setValue("Jet_energyRing_dR1_ch_Jet_rawEnergy", chFractionEnergyRings[1]); | ||
this->setValue("Jet_energyRing_dR2_ch_Jet_rawEnergy", chFractionEnergyRings[2]); | ||
this->setValue("Jet_energyRing_dR3_ch_Jet_rawEnergy", chFractionEnergyRings[3]); | ||
this->setValue("Jet_energyRing_dR4_ch_Jet_rawEnergy", chFractionEnergyRings[4]); | ||
// this->setValue("Jet_energyRing_dR5_ch_Jet_rawEnergy", chFractionEnergyRings[5]); | ||
|
||
this->setValue("Jet_energyRing_dR0_mu_Jet_rawEnergy", muFractionEnergyRings[0]); | ||
this->setValue("Jet_energyRing_dR1_mu_Jet_rawEnergy", muFractionEnergyRings[1]); | ||
this->setValue("Jet_energyRing_dR2_mu_Jet_rawEnergy", muFractionEnergyRings[2]); | ||
this->setValue("Jet_energyRing_dR3_mu_Jet_rawEnergy", muFractionEnergyRings[3]); | ||
this->setValue("Jet_energyRing_dR4_mu_Jet_rawEnergy", muFractionEnergyRings[4]); | ||
// this->setValue("Jet_energyRing_dR5_mu_Jet_rawEnergy", muFractionEnergyRings[5]); | ||
|
||
this->setValue("Jet_energyRing_dR0_neut_Jet_rawEnergy", neFractionEnergyRings[0]); | ||
this->setValue("Jet_energyRing_dR1_neut_Jet_rawEnergy", neFractionEnergyRings[1]); | ||
this->setValue("Jet_energyRing_dR2_neut_Jet_rawEnergy", neFractionEnergyRings[2]); | ||
this->setValue("Jet_energyRing_dR3_neut_Jet_rawEnergy", neFractionEnergyRings[3]); | ||
this->setValue("Jet_energyRing_dR4_neut_Jet_rawEnergy", neFractionEnergyRings[4]); | ||
// this->setValue("Jet_energyRing_dR5_neut_Jet_rawEnergy", neFractionEnergyRings[5]); | ||
|
||
this->setValue("Jet_numDaughters_pt03",numDaughtersPt03); | ||
|
||
} | ||
|
||
static void fillDescriptions(edm::ConfigurationDescriptions& descriptions) { | ||
edm::ParameterSetDescription desc = BaseMVAValueMapProducer<pat::Jet>::getDescription(); | ||
desc.add<edm::InputTag>("pvsrc")->setComment("primary vertices input collection"); | ||
desc.add<edm::InputTag>("svsrc")->setComment("secondary vertices input collection"); | ||
desc.add<edm::InputTag>("rhosrc")->setComment("rho input collection"); | ||
descriptions.add("BJetEnergyRegressionMVA",desc); | ||
} | ||
|
||
private: | ||
const edm::EDGetTokenT<std::vector<reco::Vertex>> pvsrc_; | ||
edm::Handle<std::vector<reco::Vertex>> pvs_; | ||
const edm::EDGetTokenT<edm::View<reco::VertexCompositePtrCandidate> > svsrc_; | ||
const edm::EDGetTokenT<edm::View<reco::VertexCompositePtrCandidate> > svsrc_; | ||
edm::Handle<edm::View<reco::VertexCompositePtrCandidate>> svs_; | ||
edm::EDGetTokenT<double> rhosrc_; | ||
edm::Handle<double> rho_; | ||
|
||
|
||
}; | ||
|
||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use
std::array<float>