99TString
findFilePath(
const TString& fileName,
const TString& path,
const TString& calibArea)
101 TString pathToGet =
"";
104 if (path !=
"" &&
fileExists(path+(path.EndsWith(
"/")?
"":
"/")+fileName))
105 pathToGet = path+(path.EndsWith(
"/")?
"":
"/")+fileName;
107 pathToGet = fileName;
112 if (pathToGet ==
"" && calibArea !=
"")
115 if (pathToGet ==
"" && calibArea ==
"")
125 if (TString(gSystem->Getenv(
"ROOTCOREBIN")) !=
"" &&
fileExists(TString(gSystem->Getenv(
"ROOTCOREBIN"))+
"/data/JetUncertainties/"+fileName))
126 pathToGet = TString(gSystem->Getenv(
"ROOTCOREBIN"))+
"/data/JetUncertainties/"+fileName;
128 else if (TString(gSystem->Getenv(
"ROOTCOREDIR")) !=
"" &&
fileExists(TString(gSystem->Getenv(
"ROOTCOREDIR"))+
"/data/JetUncertainties/"+fileName))
129 pathToGet = TString(gSystem->Getenv(
"ROOTCOREDIR"))+
"/data/JetUncertainties/"+fileName;
131 else if (TString(gSystem->Getenv(
"TestArea")) !=
"" &&
fileExists(TString(gSystem->Getenv(
"TestArea"))+
"/Reconstruction/Jet/JetUncertainties/share/"+fileName))
132 pathToGet = TString(gSystem->Getenv(
"TestArea"))+
"/Reconstruction/Jet/JetUncertainties/share/"+fileName;
178void scaleHistoAxes(TH1* toScale,
const double factorX,
const double factorY,
const double factorZ)
180 const int dim = toScale->GetDimension();
183 bool returnDuplicate =
false;
184 if ( dim == 1 && (factorX < 0 || fabs(factorX-1) < 1.e-4) )
185 returnDuplicate =
true;
186 else if ( dim == 2 && (factorX < 0 || fabs(factorX-1) < 1.e-4)
187 && (factorY < 0 || fabs(factorY-1) < 1.e-4) )
188 returnDuplicate =
true;
189 else if ( dim == 3 && (factorX < 0 || fabs(factorX-1) < 1.e-4)
190 && (factorY < 0 || fabs(factorY-1) < 1.e-4)
191 && (factorZ < 0 || fabs(factorZ-1) < 1.e-4) )
192 returnDuplicate =
true;
195 printf(
"ScaleHistoAxes: Doing nothing, as all scale factors require no changes\n");
200 const double facX = factorX < 0 ? 1 : factorX;
201 const double facY = factorY < 0 ? 1 : factorY;
202 const double facZ = factorZ < 0 ? 1 : factorZ;
205 if (fabs(facX-1) > 1.e-4)
207 std::vector<double> binsX;
208 for (
int iBin = 1; iBin <= toScale->GetNbinsX()+1; ++iBin)
209 binsX.push_back(toScale->GetXaxis()->GetBinLowEdge(iBin)*facX);
210 toScale->GetXaxis()->Set(binsX.size()-1,&binsX[0]);
213 if (dim > 1 && fabs(facY-1) > 1.e-4)
215 std::vector<double> binsY;
216 for (
int iBin = 1; iBin <= toScale->GetNbinsY()+1; ++iBin)
217 binsY.push_back(toScale->GetYaxis()->GetBinLowEdge(iBin)*facY);
218 toScale->GetYaxis()->Set(binsY.size()-1,&binsY[0]);
221 if (dim > 2 && fabs(facZ-1) > 1.e-4)
223 std::vector<double> binsZ;
224 for (
int iBin = 1; iBin <= toScale->GetNbinsZ()+1; ++iBin)
225 binsZ.push_back(toScale->GetZaxis()->GetBinLowEdge(iBin)*facZ);
226 toScale->GetZaxis()->Set(binsZ.size()-1,&binsZ[0]);