17 double mineta,
double maxeta,
19 double mine,
double maxe,
double value)
20 : TH2D(name, name, nbinseta, mineta, maxeta, nbinse, mine, maxe) {
24 GetXaxis()->SetTitle(
"#eta");
25 GetYaxis()->SetTitle(
"E");
28 for(
int ie=1; ie<=GetNbinsY(); ie++) {
29 for(
int ieta=1; ieta<=GetNbinsX(); ieta++) {
30 SetBinContent(ieta,ie, value);
74 GetXaxis()->SetTitle(
"#eta");
75 GetYaxis()->SetTitle(
"E");
77 string err =
"PFResolutionMap::PFResolutionMap : cannot read file ";
79 throw invalid_argument(err);
91 std::ofstream outf(mapfile);
93 cout<<
"PFResolutionMap::Write : cannot open file "<<mapfile<<endl;
99 cerr<<
"PFResolutionMap::Write : corrupted file "<<mapfile<<endl;
114 std::ifstream
inf(mapfile);
138 SetBins(nbinseta, mineta, maxeta, nbinse, mine, maxe);
154 if(
string(s).
empty()) {
158 istringstream lin(s);
164 SetBinContent(j, i, dataw);
166 }
while (lin.good() );
232 static double fMinEta = -2.95;
233 static double fMaxEta = 2.95;
234 static double fMinE=0;
235 static double fMaxE=100;
237 if( eta<fMinEta ) eta = fMinEta+0.001;
238 if( eta>fMaxEta ) eta = fMaxEta-0.001;
240 if( e<fMinE ) e = fMinE+0.001;
241 if( e>fMaxE ) e = fMaxE-0.001;
245 double res= GetBinContent(bin);
248 if(MapEta==1) res *= 1.88;
258 if(e >= GetYaxis()->GetXmax() )
259 e = GetYaxis()->GetXmax() - 0.001;
261 return TH2D::FindBin(eta,e);
268 if(!outf.good() )
return outf;
271 outf<<rm.GetNbinsX()<<endl;
272 outf<<rm.GetXaxis()->GetXmin()<<endl;
273 outf<<rm.GetXaxis()->GetXmax()<<endl;
275 outf<<rm.GetNbinsY()<<endl;
276 outf<<rm.GetYaxis()->GetXmin()<<endl;
277 outf<<rm.GetYaxis()->GetXmax()<<endl;
279 for(
int ie=1; ie<=rm.GetNbinsY(); ie++) {
280 for(
int ieta=1; ieta<=rm.GetNbinsX(); ieta++) {
281 outf<<rm.GetBinContent(ieta,ie)<<
"\t";
291 bool Is = (TMath::Abs(dminPhi)<0.005);
297 if(TMath::Abs(b)<TMath::Abs(a)) a=
b;
303 #define M_PI 3.14159265358979323846
312 static std::vector<double> cPhi;
315 for(
unsigned i=1;
i<=17;
i++) cPhi[
i]=cPhi[0]-2*
i*pi/18;
318 static double delta_cPhi=0.00638;
325 if(phi>pi) phi-=2*
pi;
327 if (phi>=-pi && phi<=pi){
330 if (phi<cPhi[17] || phi>=cPhi[0]){
331 if (phi<0) phi+= 2*
pi;
332 m =
minimum(phi -cPhi[0],phi-cPhi[17]-2*pi);
341 m=
minimum(phi-cPhi[i+1],phi-cPhi[i]);
350 std::cout<<
"Problem in dminphi"<<std::endl;
double minimum(double a, double b)
pair< int, edm::FunctionWithDict > OK
bool ReadMapFile(const char *mapfile)
read text file
double dCrackPhi(double phi, double eta)
static const unsigned lineSize_
bool WriteMapFile(const char *mapfile)
int FindBin(double eta, double e)
extrapolation requires overloading of this function
std::ostream & operator<<(std::ostream &out, const ALILine &li)
double getRes(double eta, double phi, double e, int MapEta=-1)
bool IsInAPhiCrack(double phi, double eta)
PFResolutionMap()
default constructor
Resolution Map (resolution as a function of eta and E)