68 cout<<
"PndEmcClusterCalibrator:: Method "<<method<<
" is not defined. Default PndEmcClusterHistCalibrator is used"<<endl;
79 fVersion(version), fPath(
"")
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)
97 fPath = getenv(
"VMCWORKDIR");
98 fPath +=
"/macro/params/";
101 fileNamePhoton.Form(
"emc_correction_hist_gamma_%i.root",version);
102 fileNamePhoton=
fPath+fileNamePhoton;
104 fPhoton =
new TFile(fileNamePhoton,
"READ");
107 std::cout<<
"EMC cluster correction file "<<fileNamePhoton<<
" for photons does not exist for given version"<<std::endl;
182 Bool_t use_interpolation=kTRUE;
185 TVector3 position=theCluster->
where();
213 std::cout<<
"Wrong EMC module in PndEmcClusterHistCalibrator"<<std::endl;
259 std::cout<<
"Emc cluster correction for pid= "<<pid<<
" is not defined. Photon values is used."<<std::endl;
276 std::cout<<
"Wrong EMC module in PndEmcClusterHistCalibrator"<<std::endl;
280 Double_t energyCorrected = energy/valzEn;
282 return energyCorrected;
288 Bool_t use_interpolation=kTRUE;
291 TVector3 position=theCluster->
where();
317 std::cout<<
"Wrong EMC module in PndEmcClusterHistCalibrator"<<std::endl;
363 std::cout<<
"Emc cluster correction for pid= "<<pid<<
" is not defined. Photon values is used."<<std::endl;
380 std::cout<<
"Wrong EMC module in PndEmcClusterHistCalibrator"<<std::endl;
384 Double_t thetaCorrected = valzTh+thetaRad;
387 TVector3 correctedPos;
388 correctedPos.SetMagThetaPhi(mag,thetaCorrectedRad,phiRad);
399 bin_x = lookup_table->GetXaxis()->FindBin(value_x);
400 bin_y = lookup_table->GetYaxis()->FindBin(value_y);
402 if ((bin_x < 1) || (bin_x > lookup_table->GetXaxis()->GetNbins()))
404 bin_x = -1; bin_y = -1;
408 if ((bin_y < 1) || (bin_y > lookup_table->GetYaxis()->GetNbins()))
410 bin_x = -1; bin_y = -1;
423 if (use_interpolation)
437 Int_t binx, biny, retval;
438 retval =
FindTheBin(lookup_table, value_x, value_y, binx, biny);
444 return (lookup_table->Interpolate(value_x,value_y));
449 Int_t binx, biny, retval;
450 retval =
FindTheBin(lookup_table, value_x, value_y, binx, biny);
453 cout <<
"<E> Error in FindTheBin, check your table and input values!!!!: " << retval << endl;
457 return (lookup_table->GetBinContent(binx,biny));
468 fPath = getenv(
"VMCWORKDIR");
469 fPath +=
"/macro/params/";
472 fileNamePhoton.Form(
"emc_correction_par_gamma_%i.root",version);
473 fileNamePhoton=
fPath+fileNamePhoton;
484 fPhoton =
new TFile(fileNamePhoton,
"READ");
485 if (fPhoton->IsZombie())
487 std::cout<<
"EMC cluster correction file "<<fileNamePhoton<<
" for photons does not exist for given version"<<std::endl;
491 fPhoton->GetObject(
"PndEmcClusterCalibrationParObject",
fParObject);
493 std::cout <<
"-E- PndEmcClusterSimpleCalibrator: Could not get Emc cluster calibration information from file " << fPhoton << std::endl;
496 std::cout<<
"EMC photon calibration parameters are read succesfully"<<std::endl;
528 return clust->
where();
535 std::cout<<
"PndEmcClusterSimpleCalibrator:: EMC Cluster energy correction is not defined for pid="<<pid<<
". Photon correction is used"<<std::endl;
539 TVector3 clusterPosition= clust->
where();
540 Double_t theta_cluster=clusterPosition.Theta();
545 if ( (clusterPosition.Z() < 180.0)&&(theta_cluster<141.*
TMath::Pi()/180.))
547 if (e<0.03) e1 = 0.03;
548 if (e>8.0) e1 = 8.0 ;
551 if ( (clusterPosition.Z() < 180.0)&&(theta_cluster>141.*
TMath::Pi()/180.))
553 if (e<0.03) e1 = 0.03;
554 if (e>2.0) e1 = 2.0 ;
557 if (clusterPosition.Z() > 180.0)
559 if (e<0.01) e1 = 0.01;
560 if (e>16.0) e1 = 16.0 ;
565 if ( clusterPosition.Z() > 500.0)
569 else if ( (clusterPosition.Z() < 180.0)&&(theta_cluster>141.*
TMath::Pi()/180.))
573 else if ( (clusterPosition.Z() < 180.0)&&(theta_cluster<141.*
TMath::Pi()/180.))
588 double p0,
p1,
p2, p3, p4, p5, p6, p7, p8, p9;
598 eout=(p0-p1/
sqrt(e1)+p2/e1+p3/(e1*e1)-p4/(e1*
sqrt(e1)))*e;
617 +p5*
cos(theta1)*
cos(theta1)
622 eout=e*
exp(factor1);
virtual ~PndEmcClusterCalibrator()
virtual ~PndEmcAbsClusterCalibrator()
friend F32vec4 cos(const F32vec4 &a)
friend F32vec4 exp(const F32vec4 &a)
Short_t GetModule() const
TH2F * fHThetaDiffBarrelPhoton
friend F32vec4 sqrt(const F32vec4 &a)
TH2F * fHEnergyRatioBwdPhoton
friend F32vec4 log(const F32vec4 &a)
TH2F * fHEnergyRatioShashlykPhoton
Int_t FindTheBin(TH2 *lookup_table, Float_t value_x, Float_t value_y, Int_t &bin_x, Int_t &bin_y)
virtual ~PndEmcClusterHistCalibrator()
TH2F * fHThetaDiffFwdPhoton
virtual TVector3 Where(PndEmcCluster *clust, Int_t pid=22)
void GetCalibrationPar(Int_t iParSet, Double_t *pars)
static PndEmcAbsClusterCalibrator * MakeEmcClusterCalibrator(Int_t method, Int_t version=1)
virtual ~PndEmcClusterSimpleCalibrator()
PndEmcClusterHistCalibrator(Int_t version=1)
TH2F * fHThetaDiffBwdPhoton
a cluster (group of neighboring crystals) of hit emc crystals
virtual Double_t Energy(PndEmcCluster *clust, Int_t pid=22)
TH2F * fHEnergyRatioFwdPhoton
TH2F * fHEnergyRatioBarrelPhoton
TH2F * fHThetaDiffShashlykPhoton
virtual Double_t Energy(PndEmcCluster *clust, Int_t pid=22)
virtual Double_t energy() const
PndEmcAbsClusterCalibrator(Int_t version=1)
PndEmcClusterCalibrationParObject * fParObject
PndEmcClusterCalibrator()
Double_t GetValueInZ(TH2 *lookup_table, Float_t value_x, Float_t value_y, Bool_t use_interpolation=kFALSE)
PndEmcClusterSimpleCalibrator(Int_t version=1)
virtual TVector3 Where(PndEmcCluster *clust, Int_t pid=22)