Skip to content
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

Jet corrections always from the txt files? (2012 branch) #41

Open
katilp opened this issue Jul 4, 2021 · 1 comment
Open

Jet corrections always from the txt files? (2012 branch) #41

katilp opened this issue Jul 4, 2021 · 1 comment
Labels
2012 Branch 2012

Comments

@katilp
Copy link
Member

katilp commented Jul 4, 2021

@jmhogan Do I understand correctly that the jet correction parameters are read from the txt files in both cases, for the doPat or else?

That's what I read from the comments in the poet_cfg.py config file (they are very clear, thanks!), and it is also in agreement with what I observe when running on 2011 without creating the txt files first.

That's all OK for now. In the longer term, I'm just wondering that as we now have the possibility of having the jet correction db files locally in the container with fast access, could we possibly read them from there without this additional step of first producing the txt files.
Producing the txt files is very well justified if reading them from the db takes ages for every job, but it is an additional step.

I believe it originates from the working mode in the JETMET group as they work within their own framework rather than with CMSSW and AOD.

From what I can read from the Run1 NanoAOD code in development, the corrections parameters are read from the db with this:

https://gitlab.cern.ch/cms-opendata/cms-opendata-nanoaodplus/nanoaodplus_v1/-/blob/master/src/NanoAnalyzer.cc#L4334
and if I follow the code correctly (not easy because of ifndefs/ifdefs), it results to

#include "JetMETCorrections/Objects/interface/JetCorrector.h"
 
[...]

const JetCorrector* corrector = JetCorrector::getJetCorrector(mJetCorr, iSetup);

const float jet_min_pt = 15;
  value_jet_n = 0;
  // for (auto it = jets->begin(); it != jets->end(); ++it) {
  for (reco::PFJetCollection::const_iterator it = jets->begin(); it != jets->end(); ++it) {
    if (it->pt() > jet_min_pt) {
      // note that pt cut is applied to uncorrected jets
      value_jet_ptuncor[value_jet_n] = it->pt();
      value_jet_eta[value_jet_n] = it->eta();
      value_jet_phi[value_jet_n] = it->phi();
      value_jet_mass[value_jet_n] = it->mass();
      double jec = corrector->correction(*it, iEvent, iSetup);
      // copy original (uncorrected) jet;
      reco::PFJet corjet = *it;
      // apply JEC
      corjet.scaleEnergy(jec);
      value_jet_pt[value_jet_n] = corjet.pt();

     [...]

However, it is also easy to provide the correction txt file as they are now in the JEC subdirectory, and it is to be discussed if reading them from the db actually makes the use of code easier or more complicated. Your thoughts?
It certainly also depends on how deeply the way of accessing the correction parameters is rooted in the jet analyzers. I had a look but it is difficult for me to tell.

@jmhogan
Copy link
Collaborator

jmhogan commented Jul 4, 2021 via email

@caredg caredg changed the title Jet corrections always from the txt files? Jet corrections always from the txt files? (2012 branch) May 5, 2022
@caredg caredg added the 2012 Branch 2012 label May 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2012 Branch 2012
Projects
None yet
Development

No branches or pull requests

3 participants