-
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 new fitting approaches #30
base: master
Are you sure you want to change the base?
Izisopou patch new fitting approaches #30
Conversation
Veto regions for UL 2017 and UL 2018 added and commented out.
Veto regions for UL2017 and UL2018 added and commented out.
This script is necessary for matching jets between the NoPU (or EpsilonPU) and PU files.
Implemented fitting approach with standard+gaussian function, along with a pt-clipping technique and sanity checks for the fits in all eta bins.
Implemented 2D fitting approach with semi-simple parametrization (also complex and simple parametrizations, which were previously used are commented out), along with sanity checks for the fits in all eta bins.
Added pt-clip for the fitting approach ---> ptclipfit (and for splines --->ptclip).
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.
@@ -603,6 +604,13 @@ int main(int argc,char**argv) | |||
|
|||
if(nrefmax>0 && JRAEvt->nref>nrefmax) JRAEvt->nref = nrefmax; | |||
for (unsigned char iref=0;iref<JRAEvt->nref;iref++) { | |||
/* |
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.
Do not leave unused, commented code. If it's commented because it's only sometimes used, then there should be a switch. If it's commented because you want to reference the old code occasionally you should look at the git history.
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'll remove the commented out code in this case.
@@ -18,7 +18,8 @@ | |||
#include "CondFormats/JetMETObjects/interface/FactorizedJetCorrector.h" | |||
#include "PhysicsTools/Utilities/interface/LumiReWeighting.h" | |||
#if __has_include("xrootd/XrdCl/XrdClFileSystem.hh") | |||
#include "xrootd/XrdCl/XrdClFileSystem.hh" | |||
//#include "xrootd/XrdCl/XrdClFileSystem.hh" |
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 left a comment in #29 about using a copy of an XRootD header. A short version is you shouldn't copy headers from external dependencies. Instead you should use static_asserts and header guards to make sure the dependencies you need exist during compilation.
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.
We were getting compilation errors when using the xrootd/XrdCl/XrdClFileSystem.hh file and since it’s read-only we created a slightly modified XrdClFileSystem_v2.hh script in oder to avoid the error. This was a quick and easy way to keep the workflow running without getting errors. I’m not sure I understood what you are suggesting. Could you explain more in detail?
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.
Without knowing what the compilation errors were I can't comment on an alternative for fixing them. I was assuming the original xrootd/XrdCl/XrdClFileSystem.hh
file would work and that you were worried about dependencies. Perhaps you can post the compilation error you were seeing (as an attachment).
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.
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 can't be certain, but it look like adding #include "xrootd/XProtocol/XProtocol.hh"
above the other XRootD header will fix the problem. Give it a try and let us know.
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.
Thank you! I tested it and it works, I don't get the compilation error anymore. I'll add this line and remove the XrdClFileSystem_v2.hh code, if that's okay with you.
@@ -1478,6 +1478,12 @@ int main(int argc,char**argv) | |||
|
|||
if (nrefmax>0) JRAEvt->nref = std::min((int)JRAEvt->nref,nrefmax); | |||
for (unsigned char iref=0;iref<JRAEvt->nref;iref++) { | |||
/* |
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 about commented 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, I'll remove the commented out code.
JetAnalyzers/bin/jet_synchfit_x.cc
Outdated
|
||
}//if | ||
|
||
TGraph2DErrors * getGraph2D(int iEta, TProfile3D * prof, |
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 don't make white space changes unless absolutely necessary.
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'll fix that.
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 double-check. The diff of jet_synchfit_x.cc is still very long and e.g. the getGraph2D still looks ~identical except for white space changes. Please make the formating such that one can better see the changes in the logic (if there are any). Thanks!
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 will double-check and try to see if I can make the format better!
JetAnalyzers/bin/jet_match_x.cc
Outdated
@@ -0,0 +1,1695 @@ | |||
// ROOT Libraries |
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 add a section to https://github.com/cms-jet/JetMETAnalysis/blob/master/JetAnalyzers/bin/README.md. I'm not sure what this code is suppose to do and how it's different from jet_synchtest_x.cc. If you're renaming the file that is not reflected in this PR.
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.
The jet_match_x.cc code is actually a modification of the jet_synchtest_x.cc one, which we do not use anymore. It implements an option to remove a phi slice (for the HEM issue studies). So it's basically a rename, as you said, and I will add that in the description of the code to avoid confusion.
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.
But does it really provide fundamentally different functionality? I think it would be better to add a "remove phi-slice" option to jet_synchtest_x.cc, if it's essentially the same thing
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 agree with you, I will remove the jet_match_x.cc code and re-upload the jet_synchtest_x.cc with the latest updates.
JetAnalyzers/bin/jet_synchfit_x.cc
Outdated
if(!fin->IsOpen()) { | ||
cout << "ERROR jet_synchfit_xx::getInputProfiles() could not open file " | ||
<<inputFilename<< endl; | ||
bool getInputProfiles(TString inputFilename, TProfile3D *& prof, |
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 white space changes unless necessary and globally matched.
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'll fix that here as well, thank you.
JetUtilities/src/L2Creator.cc
Outdated
@@ -46,6 +47,10 @@ L2Creator::L2Creator(CommandLine& cl) { | |||
histMet = cl.getValue<string> ("histMet", "mu_h"); | |||
histogramMetric = HistUtil::getHistogramMetricType(histMet); | |||
|
|||
ptclip = cl.getValue<float> ("ptclip", 0.); | |||
statTh = cl.getValue<int> ("statTh", 4); | |||
ptclipfit = cl.getValue<bool> ("ptclipfit", false); |
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.
Okay, done.
JetUtilities/src/L2Creator.cc
Outdated
@@ -537,6 +573,54 @@ void L2Creator::loopOverEtaBins() { | |||
} | |||
} | |||
|
|||
|
|||
//edw ptclipfit |
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 "ewd"? Is it needed here?
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.
It is not needed and I will remove it.
JetUtilities/src/L2Creator.cc
Outdated
@@ -804,7 +918,7 @@ void L2Creator::makeCanvas(string makeCanvasVariable) { | |||
spline_func->SetRange(bounds.first,bounds.second); | |||
spline_func->SetLineColor(igraph%nperpad+1); | |||
spline_func->SetLineStyle(kDotted); | |||
spline_func->Draw("same"); | |||
// spline_func->Draw("same"); |
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.
Why comment out the Draw
statement? If you don't want to draw a spline this should be controlled by logic, not by commenting out 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.
It was actually done by accident, thank you for pointing it out! I fixed it.
The jet_match_x.cc code is actually a modification of the jet_synchtest_x.cc one, which we do not use anymore. It implements an option to remove a phi slice (for the HEM issue studies).
General comment @izisopou : It would be great to give a bit more context in your commit messages (not the name of a changed file name, but what the commit is supposed to do), cf. e.g. a random Google find https://chris.beams.io/posts/git-commit/ and the "CMSSW on github" pages at http://cms-sw.github.io/index.html for some good practices :-) |
The main focus of the changes are: 1) an option to remove a phi slice (for the HEM issue studies) 2) the implementation of energy fractions
Changes that mainly focus on the implementation of: