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
L1 prefiring weight producer #25380
L1 prefiring weight producer #25380
Conversation
The code-checks are being triggered in jenkins. |
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-25380/7414 |
A new Pull Request was created by @lathomas for master. It involves the following packages: L1Prefiring/EventWeightProducer The following packages do not have a category, yet: L1Prefiring/EventWeightProducer @cmsbuild can you please review it and eventually sign? Thanks. cms-bot commands are listed here |
If the review and backport to 10_2_X proceed in an expedite way, this could get into the next NanoAOD production, which would be very valuable. |
for(int fluct = 0; fluct<3;fluct++) { | ||
//Start by applying the prefiring maps to photons in the affected regions. | ||
std::vector < pat::Photon > affectedphotons; | ||
for( std::vector<pat::Photon>::const_iterator photon = (*thePhotons).begin(); photon != (*thePhotons).end(); photon++ ) { |
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 can be more cleanly/efficiently written as
for ( const auto & photon : *thePhotons ) {
double pt_gam = photon.pt();
etc
if( pt_gam < 20.) continue; | ||
if( fabs(eta_gam) <2.) continue; | ||
if( fabs(eta_gam) >3.) continue; | ||
affectedphotons.push_back((*photon)); |
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.
consider storing a const & or just a vector of bools instead of copying the photon object here
how big is the TH2F? |
probably PhysicsTools/PatUtils is a good home for this 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.
In order to speed up the review I give a few comments from a quick look at the code
if( pt_gam < 20.) continue; | ||
if( fabs(eta_gam) <2.) continue; | ||
if( fabs(eta_gam) >3.) continue; | ||
affectedphotons.push_back((*photon)); |
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 think we want to avoid copies by value here
edm::EDGetTokenT<std::vector< pat::Jet> > jets_token_; | ||
|
||
|
||
TH2F * h_prefmap_photon; |
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.
where does this get deleted? should we use smart pointers?
|
||
TFile * file_prefiringmaps_; | ||
std::string fname = iConfig.getParameter<std::string>( "L1Maps" ); | ||
file_prefiringmaps_ = new TFile( fname.c_str(),"read" ); |
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 think we want to use FileInPath to eventually read from different locations here
std::string fname = iConfig.getParameter<std::string>( "L1Maps" ); | ||
file_prefiringmaps_ = new TFile( fname.c_str(),"read" ); | ||
TString mapphotonfullname= "L1prefiring_photonptvseta_"+ dataera_; | ||
h_prefmap_photon =(TH2F*) file_prefiringmaps_->Get(mapphotonfullname); |
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.
needs protection/check if the file does not contain the histogram with that name
// virtual void beginJob(); | ||
//virtual void endJob(void); | ||
void endStream() override; | ||
virtual double GetPrefiringRate( double eta, double pt, TH2F * h_prefmap,/*std::string object, std::string dataera, */ int fluctuation); |
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.
here it's probably cleaner to pass the enum type and not the int
|
||
} | ||
//If overlapping photons have a non prefiring rate smaller than the jet, don't consider the jet in the event weight | ||
else if(nonprefiringprobfromoverlappingphotons < nonprefiringprobfromoverlappingjet ) NonPrefiringProba[fluct]*=1.; |
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.
what is this line actually doing? (multiply by 1)
|
||
double L1ECALPrefiringWeightProducer::GetPrefiringRate( double eta, double pt, TH2F * h_prefmap /*std::string object, std::string dataera*/ , int fluctuation){ | ||
|
||
if(h_prefmap==nullptr) return 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.
this is dangerous as it fails silently in case of a configuration mistake
The code-checks are being triggered in jenkins. |
@peruzzim @davidlange6 Thanks ! |
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-25380/7420 |
please test |
The tests are being triggered in jenkins. |
Comparison job queued. |
Comparison is ready Comparison Summary:
|
@lathomas : do you have an analyzer (which runs on nanoAOD, possibly) that consumes these weights? I.e. something obtained with https://twiki.cern.ch/twiki/bin/viewauth/CMS/L1ECALPrefiringWeightRecipe but avoiding me the need to recreate everything from scratch following that recipe. |
+1
|
@perrotta : thanks ! |
+1 the configuration of the module has been properly adjusted, thanks |
merge |
Analyses will be performed in 10_2_X (preferably), and also in 94X:
please consider backporting in both cycles.
lathomas <notifications@github.com> ha scritto:
… @fabiocos @perrotta @peruzzim
Thanks for the merging and for your help.
Can I proceed with the backport? What branches should I consider? I
guess at least 94X is needed but are there others?
--
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub:
#25380 (comment)
|
@perrotta @lathomas |
Thank you Mircho!
Mircho Rodozov <notifications@github.com> ha scritto:
… @perrotta @lathomas
cms-sw/cmsdist#4635
cms-sw/cmsdist#4636
are for 10_2 and 9_4
--
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub:
#25380 (comment)
|
Dear CMSSW managers/PR reviewers,
This PR contains an EDProducer computing weights associated to the L1 ECAL prefiring issue that affected 2016 and 2017 data.
Since the effect is not present in MC, the proposed solution is to reweight simulations by those weights.
I add some links to documentation at the end of this post for more information.
The code is a producer returning three double (central, up/down weights). The code loops over all photons and jets found in the event and multiplies their prefiring probabilities.
I expect the PR to need a bit of iteration before being approved.
In particular, I would greatly appreciate your suggestions regarding the following points:
Please let me know if anything else is unclear,
Thanks a lot,
Laurent
Documentation
-Talk at CMS week about prefiring:
https://indico.cern.ch/event/704625/contributions/3164334/attachments/1726987/2790093/prefiringupdateCMSweek.pdf
-Prefiring discussion at the XPOG forum:
https://indico.cern.ch/event/764279/
-Twiki describing how to run the producer:
https://twiki.cern.ch/twiki/bin/viewauth/CMS/L1ECALPrefiringWeightRecipe
-L1 prefiring maps per object:
https://lathomas.web.cern.ch/lathomas/TSGStuff/L1Prefiring/PrefiringMaps_2016and2017/
-Validation plots:
https://twiki.cern.ch/twiki/pub/CMS/L1ECALPrefiringWeightRecipe/prefiring_producervalidation.pdf