-
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
Shower shape variables for HF jets #31271
Conversation
The code-checks are being triggered in jenkins. |
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-31271/17952
|
A new Pull Request was created by @lathomas for master. It involves the following packages: PhysicsTools/NanoAOD @perrotta, @gouskos, @cmsbuild, @fgolf, @slava77, @jpata, @mariadalfonso, @santocch, @peruzzim can you please review it and eventually sign? Thanks. cms-bot commands are listed here |
please test |
The tests are being triggered in jenkins.
|
+1 |
Comparison job queued. |
Comparison is ready Comparison Summary:
|
process.patJets.userData.userFloats.src += [ cms.InputTag('HFJetShowerShape:sigmaEtaEta'),cms.InputTag('HFJetShowerShape:sigmaPhiPhi'), ] | ||
process.patJets.userData.userInts.src += [ cms.InputTag('HFJetShowerShape:centralEtaStripSize'),cms.InputTag('HFJetShowerShape:adjacentEtaStripsSize'), ] |
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 drop type specifications for all parameters which already exist.
This is a safer way to protect from parameter name mistakes and will also help in possible parameter migrations.
process.patJets.userData.userFloats.src += [ cms.InputTag('HFJetShowerShape:sigmaEtaEta'),cms.InputTag('HFJetShowerShape:sigmaPhiPhi'), ] | |
process.patJets.userData.userInts.src += [ cms.InputTag('HFJetShowerShape:centralEtaStripSize'),cms.InputTag('HFJetShowerShape:adjacentEtaStripsSize'), ] | |
process.patJets.userData.userFloats.src += [ 'HFJetShowerShape:sigmaEtaEta', 'HFJetShowerShape:sigmaPhiPhi', ] | |
process.patJets.userData.userInts.src += [ 'HFJetShowerShape:centralEtaStripSize', 'HFJetShowerShape:adjacentEtaStripsSize', ] |
edm::EDGetTokenT<edm::View<reco::Jet>> jets_token_; | ||
edm::EDGetTokenT<std::vector<reco::Vertex>> vertices_token_; | ||
|
||
//Jet pt/eta thresholds | ||
double jetPtThreshold_, jetEtaThreshold_; | ||
//HF geometry | ||
double hfTowerEtaWidth_, hfTowerPhiWidth_; | ||
//Variables for PU subtraction | ||
double vertexRecoEffcy_, offsetPerPU_, jetReferenceRadius_; | ||
//Pt thresholds for showershape variable calculation | ||
double stripPtThreshold_, widthPtThreshold_; |
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.
edm::EDGetTokenT<edm::View<reco::Jet>> jets_token_; | |
edm::EDGetTokenT<std::vector<reco::Vertex>> vertices_token_; | |
//Jet pt/eta thresholds | |
double jetPtThreshold_, jetEtaThreshold_; | |
//HF geometry | |
double hfTowerEtaWidth_, hfTowerPhiWidth_; | |
//Variables for PU subtraction | |
double vertexRecoEffcy_, offsetPerPU_, jetReferenceRadius_; | |
//Pt thresholds for showershape variable calculation | |
double stripPtThreshold_, widthPtThreshold_; | |
const edm::EDGetTokenT<edm::View<reco::Jet>> jets_token_; | |
const edm::EDGetTokenT<std::vector<reco::Vertex>> vertices_token_; | |
//Jet pt/eta thresholds | |
const double jetPtThreshold_, jetEtaThreshold_; | |
//HF geometry | |
const double hfTowerEtaWidth_, hfTowerPhiWidth_; | |
//Variables for PU subtraction | |
const double vertexRecoEffcy_, offsetPerPU_, jetReferenceRadius_; | |
//Pt thresholds for showershape variable calculation | |
const double stripPtThreshold_, widthPtThreshold_; |
all of this is known at configuration time and does not need to change
jets_token_ = consumes<edm::View<reco::Jet>>(iConfig.getParameter<edm::InputTag>("theJets")); | ||
vertices_token_ = consumes<std::vector<reco::Vertex>>(iConfig.getParameter<edm::InputTag>("theVertices")); | ||
jetPtThreshold_ = iConfig.getParameter<double>("jetPtThreshold"); | ||
jetEtaThreshold_ = iConfig.getParameter<double>("jetEtaThreshold"); | ||
hfTowerEtaWidth_ = iConfig.getParameter<double>("hfTowerEtaWidth"); | ||
hfTowerPhiWidth_ = iConfig.getParameter<double>("hfTowerPhiWidth"); | ||
vertexRecoEffcy_ = iConfig.getParameter<double>("vertexRecoEffcy"); | ||
offsetPerPU_ = iConfig.getParameter<double>("offsetPerPU"); | ||
jetReferenceRadius_ = iConfig.getParameter<double>("jetReferenceRadius"); | ||
stripPtThreshold_ = iConfig.getParameter<double>("stripPtThreshold"); | ||
widthPtThreshold_ = iConfig.getParameter<double>("widthPtThreshold"); |
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.
move this part to the initializer list (a comma-separated list after iConfig) :
)
HFJetShowerShape::~HFJetShowerShape() { | ||
// do anything here that needs to be done at destruction time | ||
// (e.g. close files, deallocate resources etc.) | ||
} |
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.
remove this and its declaration; overload only when needed
edm::Handle<edm::View<reco::Jet>> theJets; | ||
iEvent.getByToken(jets_token_, theJets); |
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.
edm::Handle<edm::View<reco::Jet>> theJets; | |
iEvent.getByToken(jets_token_, theJets); | |
auto theJets = iEvent.getHandle(jets_token_); |
is a more compact syntax
std::vector<int>* v_size_AdjacentEtaStrips = new std::vector<int>; | ||
|
||
//Et offset for HF PF candidates | ||
double PUoffset = offsetPerPU_ / (TMath::Pi() * jetReferenceRadius_ * jetReferenceRadius_) * nPV / vertexRecoEffcy_ * |
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.
double PUoffset = offsetPerPU_ / (TMath::Pi() * jetReferenceRadius_ * jetReferenceRadius_) * nPV / vertexRecoEffcy_ * | |
double puOffset = offsetPerPU_ / (M_PI * jetReferenceRadius_ * jetReferenceRadius_) * nPV / vertexRecoEffcy_ * |
- pi is known from elsewhere (and remove TMath include)
- variable names should not be capitalized
double PUoffset = offsetPerPU_ / (TMath::Pi() * jetReferenceRadius_ * jetReferenceRadius_) * nPV / vertexRecoEffcy_ * | ||
(hfTowerEtaWidth_ * hfTowerPhiWidth_); | ||
|
||
for (auto jet = theJets->begin(); jet != theJets->end(); ++jet) { |
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.
for (auto jet = theJets->begin(); jet != theJets->end(); ++jet) { | |
for (auto const& jet : *theJets ) { |
double eta_jet = jet->eta(); | ||
|
||
//If central or low pt jets, fill with dummy variables | ||
if (pt_jet <= jetPtThreshold_ || fabs(eta_jet) <= jetEtaThreshold_) { |
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.
if (pt_jet <= jetPtThreshold_ || fabs(eta_jet) <= jetEtaThreshold_) { | |
if (pt_jet <= jetPtThreshold_ || std::abs(eta_jet) <= jetEtaThreshold_) { |
std::abs is preferred
reco::CandidatePtr pfJetConstituent = jet->sourceCandidatePtr(i); | ||
const reco::Candidate* icand = pfJetConstituent.get(); |
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.
reco::CandidatePtr pfJetConstituent = jet->sourceCandidatePtr(i); | |
const reco::Candidate* icand = pfJetConstituent.get(); | |
const reco::Candidate* icand = jet->sourceCandidatePtr(i).get(); |
just a bit less verbose
widthPtThreshold = cms.double(3) | ||
) | ||
|
||
HFJetShowerShapeTask = cms.Task(HFJetShowerShape) |
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.
no need for a task for a single module
this file can be removed, simply use RecoJets.JetProducers.hfJetShowerShape_cfi already created by the fillDescriptions.
producer names should also start from lower case (more common style for products in CMSSW reco)
Comparison is ready Comparison Summary:
|
+1
|
+1 |
+xpog |
This pull request is fully signed and it will be integrated in one of the next master IBs (tests are also fine). This pull request will now be reviewed by the release team before it's merged. @silviodonato, @dpiparo, @qliphy (and backports should be raised in the release meeting by the corresponding L2) |
+1 |
This pull request is causing failures in the following workflows: 10224.15, 11024.15, and 25202.15. |
the issues are apparently related to
This will delay the 106X backport |
@lathomas |
uhm, apparently it doesn't have to, at least for the IB integrity; I did not find the JME nano setup in 10_6_X in the matrix. |
Yes I'm looking into it... It looks like it comes from the fact that the producer is only rerun for specific era modifiers... |
PR description:
This PR computes a few shower shape related variables for HF jets that are then added as userFloats/userInts to AK4 CHS jets. The variables are also added to NANOAOD.
Such variables turn out to be useful to discriminate physics jets from noise.
The description of the variables and their motivation can be found in this talk:
https://indico.cern.ch/event/944298/#sc-10-4-hf-noise-study-on-aod
PR validation:
runTheMatrix.py -l limited -i all --ibeos gave no error
It was explicitly checked that the variables added to MINIAOD (computed from AOD) and to NANOAOD (computed from MINIAOD) are consistent.
The code quality checks were performed.
if this PR is a backport please specify the original PR and why you need to backport that PR:
Not a backport. A backport to 10_6_X is however expected soon as the goal would ideally be to have this PR integrated for Run 2 UL reMINIAOD.