FairRoot/PandaRoot
PndEmcClusterCalibrator.cxx
Go to the documentation of this file.
1 //--------------------------------------------------------------------------
2 // Description:
3 // Class PndEmcClusterCalibrator
4 // Do an energy and position corrections for EMC cluster
5 // PndEmcClusterCalibrator is a factory which call specific method depending on the input parameter "method"
6 // method=1 - PndEmcClusterHistCalibrator is called, which perform correction from the interpolation on 2-dimensional histogram on (Energy, theta)
7 // method=2 - PndEmcClusterSimpleCalibrator is called, where energy correction is parametrised as a function of (Energy, theta)
8 // PndEmcAbsClusterCalibrator - abstract interface class
9 //
10 // Versions of the correction:
11 // 1 - "emc_module12.dat","emc_module3_2011_new.root","emc_module4_StraightGeo24.4.root","emc_module5_fsc.root" (+ full PANDA geometry) TGeant3
12 //
13 // Author List:
14 // D.Melnychuk
15 // PndEmcClusterHistCalibrator class is based on code PndEmcMakeCorr.cxx
16 // (A. Biegun, M. Babai)
17 // PndEmcClusterSimpleCalibrator class is based on EmcPhotonSimpleCalib class in Babar framework (Jan Zhong)
18 //------------------------------------------------------------------------
19 
20 
21 //-----------------------
22 // This Class's Header --
23 //-----------------------
25 
26 //-------------------------------
27 // Collaborating Class Headers --
28 //-------------------------------
29 #include "PndEmcStructure.h"
30 #include "PndEmcDataTypes.h"
31 
32 #include "PndEmcMapper.h"
33 #include "PndEmcDigi.h"
34 #include "PndEmcCluster.h"
35 #include "PndEmcBump.h"
37 
38 #include <algorithm>
39 #include <iostream>
40 
41 using std::cout;
42 using std::endl;
43 
44 //----------------
45 // Constructors --
46 //----------------
48 {
49 }
50 
51 //--------------
52 // Destructor --
53 //--------------
55 {
56 }
57 
59 {
60  switch (method) {
61  case 1:
62  return new PndEmcClusterHistCalibrator(version);
63  break;
64  case 2:
65  return new PndEmcClusterSimpleCalibrator(version);
66  break;
67  default :
68  cout<<"PndEmcClusterCalibrator:: Method "<<method<<" is not defined. Default PndEmcClusterHistCalibrator is used"<<endl;
69  return new PndEmcClusterHistCalibrator(version);
70  }
71 
72 }
73 
74 
79 fVersion(version), fPath("")
80 {
81 }
82 
84 {
85 }
86 
87 
91 
93 fPhoton(new TFile()), fElectron(new TFile()), fPion(new TFile()),
94 fHEnergyRatioBarrelPhoton(0), fHEnergyRatioFwdPhoton(0), fHEnergyRatioBwdPhoton(0), fHEnergyRatioShashlykPhoton(0), fHThetaDiffBarrelPhoton(0), fHThetaDiffFwdPhoton(0), fHThetaDiffBwdPhoton(0), fHThetaDiffShashlykPhoton(0)
95 {
96 
97  fPath = getenv("VMCWORKDIR");
98  fPath += "/macro/params/";
99 
100  TString fileNamePhoton;
101  fileNamePhoton.Form("emc_correction_hist_gamma_%i.root",version);
102  fileNamePhoton=fPath+fileNamePhoton;
103 
104  fPhoton = new TFile(fileNamePhoton,"READ");
105  if (fPhoton->IsZombie())
106  {
107  std::cout<<"EMC cluster correction file "<<fileNamePhoton<<" for photons does not exist for given version"<<std::endl;
108  } else
109  {
110  // Photon
111  fHEnergyRatioBarrelPhoton = (TH2F*) fPhoton->Get("hisEnergyRatioBarrel");
112  fHThetaDiffBarrelPhoton = (TH2F*) fPhoton->Get("hisThetaDiffBarrel");
113  fHEnergyRatioFwdPhoton = (TH2F*) fPhoton->Get("hisEnergyRatioFwd");
114  fHThetaDiffFwdPhoton = (TH2F*) fPhoton->Get("hisThetaDiffFwd");
115  fHEnergyRatioBwdPhoton = (TH2F*) fPhoton->Get("hisEnergyRatioBwd");
116  fHThetaDiffBwdPhoton = (TH2F*) fPhoton->Get("hisThetaDiffBwd");
117  fHEnergyRatioShashlykPhoton = (TH2F*) fPhoton->Get("hisEnergyRatioShashlyk");
118  fHThetaDiffShashlykPhoton = (TH2F*) fPhoton->Get("hisThetaDiffShashlyk");
119  }
120 
121 // TString fileNameElectron;
122 // TString fileNamePion;
123 // fileNameElectron.Form("emc_correction_hist_electron_%i.root",version);
124 // fileNamePion.Form("emc_correction_hist_pion_%i.root",version);
125 // fileNameElectron=fPath+fileNameElectron;
126 // fileNamePion=fPath+fileNamePion;
127 // fHEnergyRatioBarrelElectron=0; fHEnergyRatioFwdElectron=0; fHEnergyRatioBwdElectron=0; fHEnergyRatioShashlykElectron=0;
128 // fHThetaDiffBarrelElectron=0; fHThetaDiffFwdElectron=0; fHThetaDiffBwdElectron=0; fHThetaDiffShashlykElectron=0;
129 // fHEnergyRatioBarrelPion=0; fHEnergyRatioFwdPion=0; fHEnergyRatioBwdPion=0; fHEnergyRatioShashlykPion=0;
130 // fHThetaDiffBarrelPion=0; fHThetaDiffFwdPion=0; fHThetaDiffBwdPion=0; fHThetaDiffShashlykPion=0;
131 //
132 //
133 // fElectron = new TFile(fileNameElectron,"READ");
134 // if (fElectron->IsZombie())
135 // {
136 // std::cout<<"EMC cluster correction file "<<fileNameElectron<<" for electrons does not exist for given version"<<std::endl;
137 // } else
138 // {
139 // // Electron
140 // fHEnergyRatioBarrelElectron = (TH2F*) fElectron->Get("hisEnergyRatioBarrel");
141 // fHThetaDiffBarrelElectron = (TH2F*) fElectron->Get("hisThetaDiffBarrel");
142 // fHEnergyRatioFwdElectron = (TH2F*) fElectron->Get("hisEnergyRatioFwd");
143 // fHThetaDiffFwdElectron = (TH2F*) fElectron->Get("hisThetaDiffFwd");
144 // fHEnergyRatioBwdElectron = (TH2F*) fElectron->Get("hisEnergyRatioBwd");
145 // fHThetaDiffBwdElectron = (TH2F*) fElectron->Get("hisThetaDiffBwd");
146 // fHEnergyRatioShashlykElectron = (TH2F*) fElectron->Get("hisEnergyRatioShashlyk");
147 // fHThetaDiffShashlykElectron = (TH2F*) fElectron->Get("hisThetaDiffShashlyk");
148 // }
149 //
150 // fPion = new TFile(fileNamePion,"READ");
151 // if (fPion->IsZombie())
152 // {
153 // std::cout<<"EMC cluster correction file "<<fileNamePion<<" for pions does not exist for given version"<<std::endl;
154 // } else
155 // {
156 // // Pion
157 // fHEnergyRatioBarrelPion = (TH2F*) fPion->Get("hisEnergyRatioBarrel");
158 // fHThetaDiffBarrelPion = (TH2F*) fPion->Get("hisThetaDiffBarrel");
159 // fHEnergyRatioFwdPion = (TH2F*) fPion->Get("hisEnergyRatioFwd");
160 // fHThetaDiffFwdPion = (TH2F*) fPion->Get("hisThetaDiffFwd");
161 // fHEnergyRatioBwdPion = (TH2F*) fPion->Get("hisEnergyRatioBwd");
162 // fHThetaDiffBwdPion = (TH2F*) fPion->Get("hisThetaDiffBwd");
163 // fHEnergyRatioShashlykPion = (TH2F*) fPion->Get("hisEnergyRatioShashlyk");
164 // fHThetaDiffShashlykPion = (TH2F*) fPion->Get("hisThetaDiffShashlyk");
165 // }
166 
167 }
168 
170 {
171  fPhoton->Close();
172  delete fPhoton;
173 // fElectron->Close();
174 // fPion->Close();
175 // delete fElectron;
176 // delete fPion;
177 }
178 
180 {
181  Double_t valzEn;
182  Bool_t use_interpolation=kTRUE;
183 
184  Double_t energy=theCluster->energy();
185  TVector3 position=theCluster->where();
186  Double_t theta=position.Theta();
187  Double_t thetaRad=theta*(180./TMath::Pi());
188 
189  Int_t module=theCluster->GetModule();
190 
191  //TH2F *fHEnergyRatioBarrel, *fHThetaDiffBarrel, *fHEnergyRatioFwd, *fHThetaDiffFwd,
192  //*fHEnergyRatioBwd, *fHThetaDiffBwd, *fHEnergyRatioShashlyk, *fHThetaDiffShashlyk; //[R.K. 01/2017] unused variable?
193 
194  switch (pid)
195  {
196  case 22: // photon
197  switch (module)
198  {
199  case 1:
200  case 2:
201  valzEn = GetValueInZ( fHEnergyRatioBarrelPhoton, energy, thetaRad, use_interpolation);
202  break;
203  case 3:
204  valzEn = GetValueInZ( fHEnergyRatioFwdPhoton, energy, thetaRad, use_interpolation);
205  break;
206  case 4:
207  valzEn = GetValueInZ( fHEnergyRatioBwdPhoton, energy, thetaRad, use_interpolation);
208  break;
209  case 5:
210  valzEn = GetValueInZ( fHEnergyRatioShashlykPhoton, energy, thetaRad, use_interpolation);
211  break;
212  default:
213  std::cout<<"Wrong EMC module in PndEmcClusterHistCalibrator"<<std::endl;
214  }
215  break;
216 // case 11: // electron
217 // case -11: // positron
218 // switch (module)
219 // {
220 // case 1:
221 // case 2:
222 // valzEn = GetValueInZ( fHEnergyRatioBarrelElectron, energy, thetaRad, use_interpolation);
223 // break;
224 // case 3:
225 // valzEn = GetValueInZ( fHEnergyRatioFwdElectron, energy, thetaRad, use_interpolation);
226 // break;
227 // case 4:
228 // valzEn = GetValueInZ( fHEnergyRatioBwdElectron, energy, thetaRad, use_interpolation);
229 // break;
230 // case 5:
231 // valzEn = GetValueInZ( fHEnergyRatioShashlykElectron, energy, thetaRad, use_interpolation);
232 // break;
233 // default:
234 // std::cout<<"Wrong EMC module in PndEmcClusterHistCalibrator"<<std::endl;
235 // }
236 // break;
237 // case 211:
238 // case -211:
239 // switch (module)
240 // {
241 // case 1:
242 // case 2:
243 // valzEn = GetValueInZ( fHEnergyRatioBarrelPion, energy, thetaRad, use_interpolation);
244 // break;
245 // case 3:
246 // valzEn = GetValueInZ( fHEnergyRatioFwdPion, energy, thetaRad, use_interpolation);
247 // break;
248 // case 4:
249 // valzEn = GetValueInZ( fHEnergyRatioBwdPion, energy, thetaRad, use_interpolation);
250 // break;
251 // case 5:
252 // valzEn = GetValueInZ( fHEnergyRatioShashlykPion, energy, thetaRad, use_interpolation);
253 // break;
254 // default:
255 // std::cout<<"Wrong EMC module in PndEmcClusterHistCalibrator"<<std::endl;
256 // }
257 // break;
258  default:
259  std::cout<<"Emc cluster correction for pid= "<<pid<<" is not defined. Photon values is used."<<std::endl;
260  switch (module)
261  {
262  case 1:
263  case 2:
264  valzEn = GetValueInZ( fHEnergyRatioBarrelPhoton, energy, thetaRad, use_interpolation);
265  break;
266  case 3:
267  valzEn = GetValueInZ( fHEnergyRatioFwdPhoton, energy, thetaRad, use_interpolation);
268  break;
269  case 4:
270  valzEn = GetValueInZ( fHEnergyRatioBwdPhoton, energy, thetaRad, use_interpolation);
271  break;
272  case 5:
273  valzEn = GetValueInZ( fHEnergyRatioShashlykPhoton, energy, thetaRad, use_interpolation);
274  break;
275  default:
276  std::cout<<"Wrong EMC module in PndEmcClusterHistCalibrator"<<std::endl;
277  }
278  }
279 
280  Double_t energyCorrected = energy/valzEn;
281 
282  return energyCorrected;
283 }
284 
286 {
287  Double_t valzTh;
288  Bool_t use_interpolation=kTRUE;
289 
290  Double_t energy=theCluster->energy();
291  TVector3 position=theCluster->where();
292  Double_t thetaRad=position.Theta()*(180./TMath::Pi());
293  Double_t phiRad=position.Phi();
294  Double_t mag=position.Mag();
295 
296  Int_t module=theCluster->GetModule();
297 
298  switch (pid)
299  {
300  case 22: // photon
301  switch (module)
302  {
303  case 1:
304  case 2:
305  valzTh = GetValueInZ( fHThetaDiffBarrelPhoton, energy, thetaRad, use_interpolation);
306  break;
307  case 3:
308  valzTh = GetValueInZ( fHThetaDiffFwdPhoton, energy, thetaRad, use_interpolation);
309  break;
310  case 4:
311  valzTh = GetValueInZ( fHThetaDiffBwdPhoton, energy, thetaRad, use_interpolation);
312  break;
313  case 5:
314  valzTh = GetValueInZ( fHThetaDiffShashlykPhoton, energy, thetaRad, use_interpolation);
315  break;
316  default:
317  std::cout<<"Wrong EMC module in PndEmcClusterHistCalibrator"<<std::endl;
318  }
319  break;
320 // case 11: // electron
321 // case -11: // positron
322 // switch (module)
323 // {
324 // case 1:
325 // case 2:
326 // valzTh = GetValueInZ( fHThetaDiffBarrelElectron, energy, thetaRad, use_interpolation);
327 // break;
328 // case 3:
329 // valzTh = GetValueInZ( fHThetaDiffFwdElectron, energy, thetaRad, use_interpolation);
330 // break;
331 // case 4:
332 // valzTh = GetValueInZ( fHThetaDiffBwdElectron, energy, thetaRad, use_interpolation);
333 // break;
334 // case 5:
335 // valzTh = GetValueInZ( fHThetaDiffShashlykElectron, energy, thetaRad, use_interpolation);
336 // break;
337 // default:
338 // std::cout<<"Wrong EMC module in PndEmcClusterHistCalibrator"<<std::endl;
339 // }
340 // break;
341 // case 211:
342 // case -211:
343 // switch (module)
344 // {
345 // case 1:
346 // case 2:
347 // valzTh = GetValueInZ( fHThetaDiffBarrelPion, energy, thetaRad, use_interpolation);
348 // break;
349 // case 3:
350 // valzTh = GetValueInZ( fHThetaDiffFwdPion, energy, thetaRad, use_interpolation);
351 // break;
352 // case 4:
353 // valzTh = GetValueInZ( fHThetaDiffBwdPion, energy, thetaRad, use_interpolation);
354 // break;
355 // case 5:
356 // valzTh = GetValueInZ( fHThetaDiffShashlykPion, energy, thetaRad, use_interpolation);
357 // break;
358 // default:
359 // std::cout<<"Wrong EMC module in PndEmcClusterHistCalibrator"<<std::endl;
360 // }
361 // break;
362  default:
363  std::cout<<"Emc cluster correction for pid= "<<pid<<" is not defined. Photon values is used."<<std::endl;
364  switch (module)
365  {
366  case 1:
367  case 2:
368  valzTh = GetValueInZ( fHThetaDiffBarrelPhoton, energy, thetaRad, use_interpolation);
369  break;
370  case 3:
371  valzTh = GetValueInZ( fHThetaDiffFwdPhoton, energy, thetaRad, use_interpolation);
372  break;
373  case 4:
374  valzTh = GetValueInZ( fHThetaDiffBwdPhoton, energy, thetaRad, use_interpolation);
375  break;
376  case 5:
377  valzTh = GetValueInZ( fHThetaDiffShashlykPhoton, energy, thetaRad, use_interpolation);
378  break;
379  default:
380  std::cout<<"Wrong EMC module in PndEmcClusterHistCalibrator"<<std::endl;
381  }
382  }
383 
384  Double_t thetaCorrected = valzTh+thetaRad;
385  Double_t thetaCorrectedRad = thetaCorrected*(TMath::Pi()/180.);
386 
387  TVector3 correctedPos;
388  correctedPos.SetMagThetaPhi(mag,thetaCorrectedRad,phiRad);
389 
390  return correctedPos;
391 }
392 
393 //-------------
394 // Methods --
395 //-------------
396 Int_t
397 PndEmcClusterHistCalibrator::FindTheBin(TH2* lookup_table, Float_t value_x, Float_t value_y, Int_t &bin_x, Int_t &bin_y)
398 {
399  bin_x = lookup_table->GetXaxis()->FindBin(value_x);
400  bin_y = lookup_table->GetYaxis()->FindBin(value_y);
401 
402  if ((bin_x < 1) || (bin_x > lookup_table->GetXaxis()->GetNbins()))
403  {
404  bin_x = -1; bin_y = -1;
405  return -1;
406  }
407 
408  if ((bin_y < 1) || (bin_y > lookup_table->GetYaxis()->GetNbins()))
409  {
410  bin_x = -1; bin_y = -1;
411  return -2;
412  }
413 
414  return 0; // Success
415 }
416 
417 Double_t
418 PndEmcClusterHistCalibrator::GetValueInZ(TH2 *lookup_table, Float_t value_x, Float_t value_y, Bool_t use_interpolation)
419 {
420  // We own the EmcLocMaxInfo objects. Delete from last time.
421  // Clean-up res, We need an empty set to store the results.
422 
423  if (use_interpolation)
424  {
425  //cout<<"use_interpolation = kTRUE "<<endl;
426  //
427  // Use the interpolarion routine of ROOT:
428  // Interpolate approximates the value via bilinear
429  // interpolation based on the four nearest bin centers
430  // see Wikipedia, Bilinear Interpolation
431  // Andy Mastbaum 10/8/2008
432  // vaguely based on R.Raja 6-Sep-2008
433  //
434  //cout<<"value_x = "<< value_x <<", value_y = "<<value_y <<endl;
435 
436  // If values are outside histogram range return 1
437  Int_t binx, biny, retval;
438  retval = FindTheBin(lookup_table, value_x, value_y, binx, biny);
439  if (retval)
440  {
441  //std::cout<<"Energy = "<<value_x<<" theta="<<value_y<<std::endl;
442  return 1.;
443  }
444  return (lookup_table->Interpolate(value_x,value_y));
445  }
446  else
447  {
448  //cout<<"use_interpolation = kFALSE "<<endl;
449  Int_t binx, biny, retval;
450  retval = FindTheBin(lookup_table, value_x, value_y, binx, biny);
451  if (retval)
452  {
453  cout << "<E> Error in FindTheBin, check your table and input values!!!!: " << retval << endl;
454  return 0;
455  }
456 
457  return (lookup_table->GetBinContent(binx,biny));
458  }
459  return 0;
460 }
461 
466 fParObject(new PndEmcClusterCalibrationParObject())
467 {
468  fPath = getenv("VMCWORKDIR");
469  fPath += "/macro/params/";
470 
471  TString fileNamePhoton;
472  fileNamePhoton.Form("emc_correction_par_gamma_%i.root",version);
473  fileNamePhoton=fPath+fileNamePhoton;
474  TFile *fPhoton;
475 
476 // TString fileNameElectron;
477 // TString fileNamePion;
478 // fileNameElectron.Form("emc_correction_par_electron_%i.root",version);
479 // fileNamePion.Form("emc_correction_par_pion_%i.root",version);
480 // fileNameElectron=fPath+fileNameElectron;
481 // fileNamePion=fPath+fileNamePion;
482 // TFile *fElectron, *fPion;
483 
484  fPhoton = new TFile(fileNamePhoton,"READ");
485  if (fPhoton->IsZombie())
486  {
487  std::cout<<"EMC cluster correction file "<<fileNamePhoton<<" for photons does not exist for given version"<<std::endl;
488  } else
489  {
490  // Photon
491  fPhoton->GetObject("PndEmcClusterCalibrationParObject",fParObject);
492  if(fParObject == NULL){
493  std::cout << "-E- PndEmcClusterSimpleCalibrator: Could not get Emc cluster calibration information from file " << fPhoton << std::endl;
494  } else
495  {
496  std::cout<<"EMC photon calibration parameters are read succesfully"<<std::endl;
497  }
498  }
499 // fElectron = new TFile(fileNameElectron,"READ");
500 // if (fElectron->IsZombie())
501 // {
502 // std::cout<<"EMC cluster correction file "<<fileNameElectron<<" for electrons does not exist for given version"<<std::endl;
503 // } else
504 // {
505 // // Photon
506 // fElectron->GetObject("PndEmcClusterCalibrationParObject",fParObject);
507 // if(fParObject == NULL){
508 // std::cout << "-E- PndEmcClusterSimpleCalibrator: Could not get Emc cluster calibration information from file " << fElectron<< std::endl;
509 // }
510 // }
511 //
512 // fPion = new TFile(fileNamePion,"READ");
513 // if (fPion->IsZombie())
514 // {
515 // std::cout<<"EMC cluster correction file "<<fileNamePion<<" for pions does not exist for given version"<<std::endl;
516 // } else
517 // {
518 // // Photon
519 // fPion->GetObject("PndEmcClusterCalibrationParObject",fParObject);
520 // if(fParObject == NULL){
521 // std::cout << "-E- PndEmcClusterSimpleCalibrator: Could not get Emc cluster calibration information from file " << fPion << std::endl;
522 // }
523 // }
524 }
525 
526 TVector3 PndEmcClusterSimpleCalibrator::Where(PndEmcCluster *clust, Int_t )// pid //[R.K.03/2017] unused variable(s)
527 {
528  return clust->where();
529 }
530 
532 {
533  if (pid!=22)
534  {
535  std::cout<<"PndEmcClusterSimpleCalibrator:: EMC Cluster energy correction is not defined for pid="<<pid<<". Photon correction is used"<<std::endl;
536  }
537 
538  Double_t e=clust->energy();
539  TVector3 clusterPosition= clust->where();
540  Double_t theta_cluster=clusterPosition.Theta();
541 
542  Double_t e1=e;
543  Double_t theta1=theta_cluster;
544 
545  if ( (clusterPosition.Z() < 180.0)&&(theta_cluster<141.*TMath::Pi()/180.))
546  {
547  if (e<0.03) e1 = 0.03;
548  if (e>8.0) e1 = 8.0 ;
549  }
550 
551  if ( (clusterPosition.Z() < 180.0)&&(theta_cluster>141.*TMath::Pi()/180.))
552  {
553  if (e<0.03) e1 = 0.03;
554  if (e>2.0) e1 = 2.0 ;
555  }
556 
557  if (clusterPosition.Z() > 180.0)
558  {
559  if (e<0.01) e1 = 0.01;
560  if (e>16.0) e1 = 16.0 ;
561  }
562 
563  Int_t iParSet; // EMC component and energy range (1 - barrel (below 1 GeV, 2 -barrel (above 1 geV, 3 -forward endcap, 4 -backward endcap, 5 -shashlyk) )
564 
565  if ( clusterPosition.Z() > 500.0)
566  {
567  iParSet=5;
568  }
569  else if ( (clusterPosition.Z() < 180.0)&&(theta_cluster>141.*TMath::Pi()/180.))
570  {
571  iParSet=4;
572  }
573  else if ( (clusterPosition.Z() < 180.0)&&(theta_cluster<141.*TMath::Pi()/180.))
574  {
575  if (e1<1.0)
576  iParSet=1;
577  else
578  iParSet=2;
579  }
580  else
581  {
582  iParSet=3;
583  }
584 
585  Double_t pars[10];
586  fParObject->GetCalibrationPar(iParSet, pars);
587 
588  double p0, p1, p2, p3, p4, p5, p6, p7, p8, p9;
589  double eout;
590 
591  if (iParSet==5)
592  {
593  p0=pars[0];
594  p1=pars[1];
595  p2=pars[2];
596  p3=pars[3];
597  p4=pars[4];
598  eout=(p0-p1/sqrt(e1)+p2/e1+p3/(e1*e1)-p4/(e1*sqrt(e1)))*e;
599  } else
600  {
601  p0=pars[0];
602  p1=pars[1];
603  p2=pars[2];
604  p3=pars[3];
605  p4=pars[4];
606  p5=pars[5];
607  p6=pars[6];
608  p7=pars[7];
609  p8=pars[8];
610  p9=pars[9];
611 
612  double factor1= p0
613  +p1*log(e1)
614  +p2*log(e1)*log(e1)
615  +p3*log(e1)*log(e1)*log(e1)
616  +p4*cos(theta1)
617  +p5*cos(theta1)*cos(theta1)
618  +p6*cos(theta1)*cos(theta1)*cos(theta1)
619  +p7*cos(theta1)*cos(theta1)*cos(theta1)*cos(theta1)
620  +p8*cos(theta1)*cos(theta1)*cos(theta1)*cos(theta1)*cos(theta1)
621  +p9*log(e1)*cos(theta1);
622  eout=e* exp(factor1);
623  }
624 
625  return eout;
626 }
627 
629 {
630 }
friend F32vec4 cos(const F32vec4 &a)
Definition: P4_F32vec4.h:112
TVector3 where() const
friend F32vec4 exp(const F32vec4 &a)
Definition: P4_F32vec4.h:109
Short_t GetModule() const
friend F32vec4 sqrt(const F32vec4 &a)
Definition: P4_F32vec4.h:29
int pid()
friend F32vec4 log(const F32vec4 &a)
Definition: P4_F32vec4.h:110
Int_t FindTheBin(TH2 *lookup_table, Float_t value_x, Float_t value_y, Int_t &bin_x, Int_t &bin_y)
virtual TVector3 Where(PndEmcCluster *clust, Int_t pid=22)
void GetCalibrationPar(Int_t iParSet, Double_t *pars)
Double_t
static PndEmcAbsClusterCalibrator * MakeEmcClusterCalibrator(Int_t method, Int_t version=1)
a cluster (group of neighboring crystals) of hit emc crystals
Definition: PndEmcCluster.h:29
virtual Double_t Energy(PndEmcCluster *clust, Int_t pid=22)
TPad * p2
Definition: hist-t7.C:117
virtual Double_t Energy(PndEmcCluster *clust, Int_t pid=22)
virtual Double_t energy() const
TPad * p1
Definition: hist-t7.C:116
Double_t Pi
PndEmcClusterCalibrationParObject * fParObject
Double_t GetValueInZ(TH2 *lookup_table, Float_t value_x, Float_t value_y, Bool_t use_interpolation=kFALSE)
Double_t energy
Definition: plot_dirc.C:15
virtual TVector3 Where(PndEmcCluster *clust, Int_t pid=22)