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

Izisopou patch new fitting approaches #30

Open
wants to merge 19 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
759 changes: 759 additions & 0 deletions JetAnalyzers/XrdClFileSystem_v2.hh

Large diffs are not rendered by default.

13 changes: 11 additions & 2 deletions JetAnalyzers/bin/jet_correction_analyzer_x.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Copy link
Member

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.

Copy link
Author

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?

Copy link
Member

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).

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! I am attaching an image of the error we were having. Basically we changed the kXR_evict to kXR_wait , as the error suggested, and the compilation of XrdClFileSystem_v2.hh works fine without issues.
compilation_error

Copy link
Member

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.

Copy link
Author

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.

#include "JetMETAnalysis/JetAnalyzers/XrdClFileSystem_v2.hh"
#define has_xrdcl 1
#else
#define has_xrdcl 0
Expand Down Expand Up @@ -215,7 +216,7 @@ int main(int argc,char**argv)

edm::LumiReWeighting LumiWeights_;
if(!MCPUReWeighting.IsNull() && !DataPUReWeighting.IsNull()) {
LumiWeights_ = edm::LumiReWeighting(string(MCPUReWeighting),string(DataPUReWeighting),"pileup","pileup");
LumiWeights_ = edm::LumiReWeighting(string(MCPUReWeighting),string(DataPUReWeighting),"h_pileup","pileup");
}

if(!outputDir.IsNull() && !outputDir.EndsWith("/")) outputDir += "/";
Expand Down Expand Up @@ -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++) {
/*
Copy link
Member

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.

Copy link
Author

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.

//=== veto region for UL2017 =======
//if((JRAEvt->jtphi->at(iref)<-0.5236 && JRAEvt->jtphi->at(iref)>-0.8727 && JRAEvt->jteta->at(iref) >1.31 && JRAEvt->jteta->at(iref)<2.96) || (JRAEvt->jtphi->at(iref)>2.705 && JRAEvt->jtphi->at(iref)<3.1416 && JRAEvt->jteta->at(iref) >0 && JRAEvt->jteta->at(iref)<1.4835) )continue;
//=== veto region for UL2018 =======
//if((JRAEvt->jtphi->at(iref)<-0.8727 && JRAEvt->jtphi->at(iref)>-1.5708 && JRAEvt->jteta->at(iref) < -1.31 && JRAEvt->jteta->at(iref)> -2.96) || (JRAEvt->jtphi->at(iref)>0.4363 && JRAEvt->jtphi->at(iref)<0.7854 && JRAEvt->jteta->at(iref) >0 && JRAEvt->jteta->at(iref)<1.31) )continue;
*/
// if(JRAEvt->npv>0 && JRAEvt->npv<10){ //nVtx cut starts here
float rho = JRAEvt->rho;
float rho_hlt = (0!=chain->GetBranch("rho_hlt")) ? JRAEvt->rho_hlt : 0;
float ptgen = JRAEvt->refpt->at(iref);
Expand Down Expand Up @@ -858,6 +866,7 @@ int main(int argc,char**argv)
ThetaDistribution ->Fill(theta);
SolidAngleDist ->Fill(2*TMath::Pi()*cos(theta));
}
// }//nVtx ends here
}//for (unsigned char iref=0;iref<nrefmax;iref++)
}//for (unsigned int ievt=0;ievt<nevt;ievt++)

Expand Down
Loading