-
Notifications
You must be signed in to change notification settings - Fork 33
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
Izisopou patch miniaod #29
base: master
Are you sure you want to change the base?
Conversation
A slightly modified script of the xrootd/XrdCl/XrdClFileSystem.hh one, in order to avoid compilation errors.
This change includes the XrdClFileSystem_v2.hh script instead of the XrdClFileSystem.hh so as to avoid compilation errors.
Why did you copy an entire file from the XRootD code into this package, much less a header not in the interface folder? You're not going to want to maintain XrdClFileSystem_v2.hh. A better strategy is to put in static_asserts and header guards to make sure you pick up the correct files or exit right away upon a missing dependency. |
@@ -104,7 +105,8 @@ private: | |||
//edm::EDGetTokenT<vector<reco::PFCandidate> > srcPFCandidates_; | |||
edm::EDGetTokenT<PFCandidateView> srcPFCandidates_; | |||
edm::EDGetTokenT<std::vector<edm::FwdPtr<reco::PFCandidate> > > srcPFCandidatesAsFwdPtr_; | |||
edm::EDGetTokenT<vector<reco::GenParticle> > srcGenParticles_; | |||
// edm::EDGetTokenT<vector<reco::GenParticle> > srcGenParticles_; |
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.
You should remove code, specifically commented code, which is no longer needed. If you need to switch back an forth you should consider using an `edm::View``` and then casting to the correct base type.
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.
Okay, I removed the code that is no longer needed.
JetAnalyzers/python/Defaults_cff.py
Outdated
doRefPt = cms.bool(True), | ||
doJetPt = cms.bool(True), | ||
saveCandidates = cms.bool(False), | ||
# MATCHING MODE: deltaR(ref,jet) | ||
deltaRMax = cms.double(0.25), | ||
deltaRMax = cms.double(0.4), |
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.
I've been out of the loop for a while, so feel free to tell me I don't know the latest developments. That said, 0.4
seems awfully permissive for the deltaR matching. That's the entire cone radius for an R=0.4
jet. The default here should be the most often used value and should not change much. Is that why you changed this to 0.4
.
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.
Apologies for the confusion, this was actually a test version and we will fix it and upload the correct one with the values that were before. (However, this does not affect the results because we require dr max value of 0.2 in the MC Truth JECs derivation.)
JetAnalyzers/python/Defaults_cff.py
Outdated
@@ -76,7 +76,7 @@ | |||
dobalance = cms.bool(False), | |||
doflavor = cms.bool(False), | |||
noabsflavors = cms.bool(False), | |||
drmax = cms.double(0.3), | |||
drmax = cms.double(0.4), |
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.
I would imagine this should match the value in the JetResponseParameters
, so keep that in mind when answering my previous comment.
@@ -87,7 +87,9 @@ | |||
#! | |||
#! PF JETS CHS | |||
#! | |||
ak1PFCHSJets = ak1PFJets.clone( src = 'pfNoPileUpJME' ) | |||
|
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.
Please remove these newlines to keep the style the same among the various sections of the code. You should strive to keep the formatting consistent throughout the code.
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.
Okay!
JetAnalyzers/python/addAlgorithm.py
Outdated
@@ -20,6 +20,11 @@ | |||
from JetMETAnalysis.JetAnalyzers.JetCorrection_cff import * | |||
from RecoTauTag.TauTagTools.tauDecayModes_cfi import * | |||
from CommonTools.PileupAlgos.Puppi_cff import * | |||
from JetMETAnalysis.JetAnalyzers.customizePuppiTune_cff import * | |||
|
|||
|
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.
Please keep this to 1 newline to maintain the style.
@@ -115,6 +115,50 @@ void JetResponseAnalyzer::beginJob() | |||
} | |||
|
|||
|
|||
|
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.
Please try to match the style for this entire section (the getMult
function).
|
||
switch (std::abs(pfCand->pdgId())) { | ||
|
||
case 211: //PFCandidate::h: // charged hadron |
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.
Don't use unnamed constants. Instead, you should define enums as in
enum Flavor{all=0, h, e, mu, gamma, h0, h_HF, egamma_HF, chs, numFlavors, X}; //X=undefined |
You also only really have two cases:
- You add one to the
nMult
variable - You add one to the
chMult
variable
You should combine these cases using and OR of the conditions inside if, else if, else statements. This will reduce the number of comparisons. You can use thestd::any_of
function to reduce the verbosity of the conditional (https://www.cplusplus.com/reference/algorithm/any_of/).
@@ -439,12 +480,21 @@ void JetResponseAnalyzer::analyze(const edm::Event& iEvent, | |||
JRAEvt_->jtmuf ->push_back(pfJetRef->muonEnergyFraction() *JRAEvt_->jtjec->at(JRAEvt_->nref)); | |||
JRAEvt_->jthfhf->push_back(pfJetRef->HFHadronEnergyFraction() *JRAEvt_->jtjec->at(JRAEvt_->nref)); | |||
JRAEvt_->jthfef->push_back(pfJetRef->HFEMEnergyFraction() *JRAEvt_->jtjec->at(JRAEvt_->nref)); | |||
int chMult=0, nMult=0; |
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.
Spacing issue
JetUtilities/interface/JRAEvent.h
Outdated
@@ -80,6 +80,8 @@ public : | |||
vector<Int_t>* refpdgid_physicsDef; | |||
vector<Float_t>* refe; | |||
vector<Float_t>* refpt; | |||
vector<Int_t>* refnMult; |
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.
Match style
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.
Same comment for all of the nMult
and chMult
lines.
@@ -84,8 +84,8 @@ void JRAEvent::MakeTree(TTree* tree) | |||
fChain->Branch("evt", &evt, "evt/L"); | |||
fChain->Branch("nref", &nref, "nref/b"); | |||
fChain->Branch("refrank", "vector<UChar_t>", &refrank); | |||
fChain->Branch("refpdgid", "vector<Int_t>", &refpdgid); |
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.
This change means that the refpdgid
branch will always be loaded. Is that want you want?
You might also consider adding a GitHub action to run clang-tidy/clang-format on the code each time there is a PR or or push to the repo. This will help to keep the code in good shape and to help with formatting. |
1st recipe for Run-3 PF-Hadron Calibrations
Changes suggested by JERC conveners and implemented to run and produce ntuples from MINIAOD: