|
7 | 7 | //////////////////////////////////////////////////////////////////////////////// |
8 | 8 |
|
9 | 9 | #include "CondFormats/JetMETObjects/interface/JetResolution.h" |
| 10 | +#include "FWCore/ParameterSet/interface/FileInPath.h" |
10 | 11 |
|
11 | 12 | #include <TROOT.h> |
12 | 13 | #include <TApplication.h> |
@@ -61,20 +62,12 @@ int main(int argc, char** argv) { |
61 | 62 | cout << "nevts: " << nevts << endl; |
62 | 63 | cout << "gaussian: " << doGaussian << endl << endl; |
63 | 64 |
|
64 | | - string cmssw_base(std::getenv("CMSSW_BASE")); |
65 | | - string cmssw_release_base(std::getenv("CMSSW_RELEASE_BASE")); |
66 | | - string path = cmssw_base + "/src/CondFormats/JetMETObjects/data"; |
67 | | - struct stat st; |
68 | | - if (stat(path.c_str(), &st) != 0) |
69 | | - path = cmssw_release_base + "/src/CondFormats/JetMETObjects/data"; |
70 | | - if (stat(path.c_str(), &st) != 0) { |
71 | | - cerr << "ERROR: tried to set path but failed, abort." << endl; |
72 | | - return 0; |
73 | | - } |
74 | | - |
75 | | - string ptFileName = path + "/" + era + "_PtResolution_" + alg + ".txt"; |
76 | | - string etaFileName = path + "/" + era + "_EtaResolution_" + alg + ".txt"; |
77 | | - string phiFileName = path + "/" + era + "_PhiResolution_" + alg + ".txt"; |
| 65 | + string ptFileName = |
| 66 | + edm::FileInPath("CondFormats/JetMETObjects/data/" + era + "_PtResolution_" + alg + ".txt").fullPath(); |
| 67 | + string etaFileName = |
| 68 | + edm::FileInPath("CondFormats/JetMETObjects/data/" + era + "_EtaResolution_" + alg + ".txt").fullPath(); |
| 69 | + string phiFileName = |
| 70 | + edm::FileInPath("CondFormats/JetMETObjects/data/" + era + "_PhiResolution_" + alg + ".txt").fullPath(); |
78 | 71 |
|
79 | 72 | cout << ptFileName << endl; |
80 | 73 | cout << etaFileName << endl; |
|
0 commit comments