1 ////////////////////////////////////////////////////////////////////////////////
3 // AliFemtoCorrFctnDEtaDPhiCorrections - A correlation function that analyzes //
4 // two particle correlations with respect to the azimuthal angle (phi) //
5 // and pseudorapidity (eta) difference //
7 // Authors: Adam Kisiel Adam.Kisiel@cern.ch //
9 ////////////////////////////////////////////////////////////////////////////////
11 #include "AliFemtoCorrFctnDEtaDPhiCorrections.h"
12 #include "AliFemtoModelHiddenInfo.h"
13 //#include "AliFemtoHisto.hh"
19 ClassImp(AliFemtoCorrFctnDEtaDPhiCorrections)
22 #define PIH 1.57079632679489656
23 #define PIT 6.28318530717958623
28 //____________________________
29 AliFemtoCorrFctnDEtaDPhiCorrections::AliFemtoCorrFctnDEtaDPhiCorrections(char* title, const int& aPhiBins=20, const int& aEtaBins=20):
31 fDPhiDEtaNumerator(0),
32 fDPhiDEtaDenominator(0),
37 fDoFullAnalysis(kFALSE),
46 fEtaCorrectionsNum(0),
47 fEtaCorrectionsDen(0),
50 fPartType(kNoCorrection),
73 fphiL = (-(int)(aPhiBins/4)+0.5)*2.*TMath::Pi()/aPhiBins;
74 fphiT = 2*TMath::Pi()+(-(int)(aPhiBins/4)+0.5)*2.*TMath::Pi()/aPhiBins;
77 char tTitNumD[101] = "NumDPhiDEta";
78 strncat(tTitNumD,title, 100);
79 fDPhiDEtaNumerator = new TH2D(tTitNumD,title,aPhiBins,fphiL,fphiT,aEtaBins,-2.0,2.0);
81 char tTitDenD[101] = "DenDPhiDEta";
82 strncat(tTitDenD,title, 100);
83 fDPhiDEtaDenominator = new TH2D(tTitDenD,title,aPhiBins,fphiL,fphiT,aEtaBins,-2.0,2.0);
86 char tTitNum[101] = "PtSumDist";
87 strncat(tTitNum,title, 100);
88 fPtSumDist = new TH1D(tTitNum,title,200,0,10);
90 fDPhiDEtaNumerator->Sumw2();
91 fDPhiDEtaDenominator->Sumw2();
96 // to enable error bar calculation...
103 //____________________________
104 AliFemtoCorrFctnDEtaDPhiCorrections::AliFemtoCorrFctnDEtaDPhiCorrections(const AliFemtoCorrFctnDEtaDPhiCorrections& aCorrFctn) :
106 fDPhiDEtaNumerator(0),
107 fDPhiDEtaDenominator(0),
112 fDoFullAnalysis(kFALSE),
119 fPtCorrectionsNum(0),
120 fPtCorrectionsDen(0),
121 fEtaCorrectionsNum(0),
122 fEtaCorrectionsDen(0),
125 fPartType(kNoCorrection),
148 if (aCorrFctn.fDPhiDEtaNumerator)
149 fDPhiDEtaNumerator = new TH2D(*aCorrFctn.fDPhiDEtaNumerator);
151 fDPhiDEtaNumerator = 0;
152 if (aCorrFctn.fDPhiDEtaDenominator)
153 fDPhiDEtaDenominator = new TH2D(*aCorrFctn.fDPhiDEtaDenominator);
155 fDPhiDEtaDenominator = 0;
157 if (aCorrFctn.fDPhiNumerator)
158 fDPhiNumerator = new TH1D(*aCorrFctn.fDPhiNumerator);
161 if (aCorrFctn.fDPhiDenominator)
162 fDPhiDenominator = new TH1D(*aCorrFctn.fDPhiDenominator);
164 fDPhiDenominator = 0;
166 if (aCorrFctn.fDCosNumerator)
167 fDCosNumerator = new TH1D(*aCorrFctn.fDCosNumerator);
170 if (aCorrFctn.fDCosDenominator)
171 fDCosDenominator = new TH1D(*aCorrFctn.fDCosDenominator);
173 fDCosDenominator = 0;
176 fPhi = new TH1D(*aCorrFctn.fPhi);
180 fEta = new TH1D(*aCorrFctn.fEta);
184 if (aCorrFctn.fPtSumDist)
185 fPtSumDist = new TH1D(*aCorrFctn.fPtSumDist);
189 if (aCorrFctn.fYtYtNumerator)
190 fYtYtNumerator = new TH2D(*aCorrFctn.fDPhiDEtaDenominator);
194 if (aCorrFctn.fYtYtDenominator)
195 fYtYtDenominator = new TH2D(*aCorrFctn.fDPhiDEtaDenominator);
197 fYtYtDenominator = 0;
199 fphiL = aCorrFctn.fphiL;
200 fphiT = aCorrFctn.fphiT;
202 fPartType = aCorrFctn.fPartType;
204 // if (aCorrFctn.fPtCorrectionsNum)
205 // fPtCorrectionsNum = new THnSparseF(*aCorrFctn.fPtCorrectionsNum);
207 // fPtCorrectionsNum = 0;
209 // if (aCorrFctn.fPtCorrectionsDen)
210 // fPtCorrectionsDen = new THnSparseF(*aCorrFctn.fPtCorrectionsDen);
212 // fPtCorrectionsDen = 0;
217 //____________________________
218 AliFemtoCorrFctnDEtaDPhiCorrections::~AliFemtoCorrFctnDEtaDPhiCorrections(){
220 delete fDPhiDEtaNumerator;
221 delete fDPhiDEtaDenominator;
224 if (fDoFullAnalysis) {
225 delete fDPhiNumerator;
226 delete fDPhiDenominator;
227 delete fDCosNumerator;
228 delete fDCosDenominator;
230 delete fYtYtNumerator;
231 delete fYtYtDenominator;
234 delete fPtCorrectionsNum;
235 delete fPtCorrectionsDen;
236 delete fEtaCorrectionsNum;
237 delete fEtaCorrectionsDen;
247 if(fh1Reco1) delete fh1Reco1;
248 if(fh1Reco2) delete fh1Reco2;
249 if(fh2Reco1) delete fh2Reco1;
250 if(fh2Reco2) delete fh2Reco2;
251 if(fh3Reco1) delete fh3Reco1;
252 if(fh3Reco2) delete fh3Reco2;
255 //_________________________
256 AliFemtoCorrFctnDEtaDPhiCorrections& AliFemtoCorrFctnDEtaDPhiCorrections::operator=(const AliFemtoCorrFctnDEtaDPhiCorrections& aCorrFctn)
258 // assignment operator
259 if (this == &aCorrFctn)
262 if (aCorrFctn.fDPhiDEtaNumerator)
263 fDPhiDEtaNumerator = new TH2D(*aCorrFctn.fDPhiDEtaNumerator);
265 fDPhiDEtaNumerator = 0;
266 if (aCorrFctn.fDPhiDEtaDenominator)
267 fDPhiDEtaDenominator = new TH2D(*aCorrFctn.fDPhiDEtaDenominator);
269 fDPhiDEtaDenominator = 0;
271 if (aCorrFctn.fDPhiNumerator)
272 fDPhiNumerator = new TH1D(*aCorrFctn.fDPhiNumerator);
275 if (aCorrFctn.fDPhiDenominator)
276 fDPhiDenominator = new TH1D(*aCorrFctn.fDPhiDenominator);
278 fDPhiDenominator = 0;
280 if (aCorrFctn.fDCosNumerator)
281 fDCosNumerator = new TH1D(*aCorrFctn.fDCosNumerator);
284 if (aCorrFctn.fDCosDenominator)
285 fDCosDenominator = new TH1D(*aCorrFctn.fDCosDenominator);
287 fDCosDenominator = 0;
290 fPhi = new TH1D(*aCorrFctn.fPhi);
294 fEta = new TH1D(*aCorrFctn.fEta);
298 if (aCorrFctn.fPtSumDist)
299 fPtSumDist = new TH1D(*aCorrFctn.fPtSumDist);
303 if (aCorrFctn.fYtYtNumerator)
304 fYtYtNumerator = new TH2D(*aCorrFctn.fDPhiDEtaDenominator);
308 if (aCorrFctn.fYtYtDenominator)
309 fYtYtDenominator = new TH2D(*aCorrFctn.fDPhiDEtaDenominator);
311 fYtYtDenominator = 0;
313 fphiL = aCorrFctn.fphiL;
314 fphiT = aCorrFctn.fphiT;
316 fPartType = aCorrFctn.fPartType;
318 // if (aCorrFctn.fPtCorrectionsNum)
319 // fPtCorrectionsNum = new THnSparseF(*aCorrFctn.fPtCorrectionsNum);
321 // fPtCorrectionsNum = 0;
323 // if (aCorrFctn.fPtCorrectionsDen)
324 // fPtCorrectionsDen = new THnSparseF(*aCorrFctn.fPtCorrectionsDen);
326 // fPtCorrectionsDen = 0;
332 //_________________________
333 void AliFemtoCorrFctnDEtaDPhiCorrections::Finish(){
334 // here is where we should normalize, fit, etc...
335 // we should NOT Draw() the histos (as I had done it below),
336 // since we want to insulate ourselves from root at this level
337 // of the code. Do it instead at root command line with browser.
338 // mShareNumerator->Draw();
339 //mShareDenominator->Draw();
344 //____________________________
345 AliFemtoString AliFemtoCorrFctnDEtaDPhiCorrections::Report(){
347 string stemp = "TPC Ncls Correlation Function Report:\n";
349 snprintf(ctemp , 100, "Number of entries in numerator:\t%E\n",fDPhiDEtaNumerator->GetEntries());
351 snprintf(ctemp , 100, "Number of entries in denominator:\t%E\n",fDPhiDEtaDenominator->GetEntries());
353 // stemp += mCoulombWeight->Report();
354 AliFemtoString returnThis = stemp;
357 //____________________________
358 void AliFemtoCorrFctnDEtaDPhiCorrections::AddRealPair( AliFemtoPair* pair){
359 // add real (effect) pair
361 if (!fPairCut->Pass(pair)) return;
363 /*double phi1 = pair->Track1()->Track()->P().Phi();
364 double phi2 = pair->Track2()->Track()->P().Phi();
365 double eta1 = pair->Track1()->Track()->P().PseudoRapidity();
366 double eta2 = pair->Track2()->Track()->P().PseudoRapidity();*/
368 double phi1 = pair->Track1()->FourMomentum().Phi();
369 double phi2 = pair->Track2()->FourMomentum().Phi();
370 double eta1 = pair->Track1()->FourMomentum().PseudoRapidity();
371 double eta2 = pair->Track2()->FourMomentum().PseudoRapidity();
373 double dphi = phi1 - phi2;
374 while (dphi<fphiL) dphi+=PIT;
375 while (dphi>fphiT) dphi-=PIT;
377 double deta = eta1 - eta2;
379 double px1 = pair->Track1()->Track()->P().x();
380 double py1 = pair->Track1()->Track()->P().y();
381 //double pz1 = pair->Track1()->Track()->P().z();
383 double px2 = pair->Track2()->Track()->P().x();
384 double py2 = pair->Track2()->Track()->P().y();
385 //double pz2 = pair->Track2()->Track()->P().z();
387 double pt1 = TMath::Hypot(px1, py1);
388 double pt2 = TMath::Hypot(px2, py2);
391 pair->Track1()->Track()->GetPrimaryVertex(vert1);
393 pair->Track2()->Track()->GetPrimaryVertex(vert2);
395 double corrweight=0; //double corrweightpT1=1; double corrweightpT2=1;
396 //if (fIfCorrection) corrweight = CalculateCorrectionWeight(pt1, pt2);
399 corrweight = CalculateCorrectionWeight(pt1, pt2, eta1, eta2, phi1, phi2, vert1[2], vert2[2]);
403 corrweight = CalculateCorrectionWeight(pt1, pt2);
404 //corrweightpT1 = CalculateCorrectionWeight(pt1);
405 //corrweightpT2 = CalculateCorrectionWeight(pt2);
408 fPtSumDist->Fill(pt1+pt2,corrweight);
409 /* double ptmin = pt1>pt2 ? pt2 : pt1;
411 double cosphi = (px1*px2 + py1*py2 + pz1*pz2)/
412 sqrt((px1*px1 + py1*py1 + pz1*pz1)*(px2*px2 + py2*py2 + pz2*pz2));
414 if (fIfCorrection || fCorr1D)
416 fDPhiDEtaNumerator->Fill(dphi, deta, corrweight);
419 fDPhiDEtaNumerator->Fill(dphi, deta);
423 if (fDoFullAnalysis) {
424 //fDPhiPtNumerator->Fill(dphi, ptmin);
425 //fDCosPtNumerator->Fill(cosphi, ptmin);
427 fDPhiNumerator->Fill(dphi);
428 //fDCosNumerator->Fill(cosphi);
429 double PionMass = 0.13956995;
430 double yt1 = TMath::Log(sqrt(1+(pt1/PionMass)*(pt1/PionMass))+(pt1/PionMass));
431 double yt2 = TMath::Log(sqrt(1+(pt2/PionMass)*(pt2/PionMass))+(pt2/PionMass));
432 fYtYtNumerator->Fill(yt1,yt2);
440 //____________________________
441 void AliFemtoCorrFctnDEtaDPhiCorrections::AddMixedPair( AliFemtoPair* pair){
442 // add mixed (background) pair
444 if (!fPairCut->Pass(pair)) return;
446 /*double phi1 = pair->Track1()->Track()->P().Phi();
447 double phi2 = pair->Track2()->Track()->P().Phi();
448 double eta1 = pair->Track1()->Track()->P().PseudoRapidity();
449 double eta2 = pair->Track2()->Track()->P().PseudoRapidity();*/
451 double phi1 = pair->Track1()->FourMomentum().Phi();
452 double phi2 = pair->Track2()->FourMomentum().Phi();
453 double eta1 = pair->Track1()->FourMomentum().PseudoRapidity();
454 double eta2 = pair->Track2()->FourMomentum().PseudoRapidity();
456 double dphi = phi1 - phi2;
457 while (dphi<fphiL) dphi+=PIT;
458 while (dphi>fphiT) dphi-=PIT;
460 double deta = eta1 - eta2;
462 double px1 = pair->Track1()->Track()->P().x();
463 double py1 = pair->Track1()->Track()->P().y();
464 //double pz1 = pair->Track1()->Track()->P().z();
466 double px2 = pair->Track2()->Track()->P().x();
467 double py2 = pair->Track2()->Track()->P().y();
468 //double pz2 = pair->Track2()->Track()->P().z();
470 double pt1 = TMath::Hypot(px1, py1);
471 double pt2 = TMath::Hypot(px2, py2);
472 // double ptmin = pt1>pt2 ? pt2 : pt1;
473 // double cosphi = (px1*px2 + py1*py2 + pz1*pz2)/
474 // sqrt((px1*px1 + py1*py1 + pz1*pz1)*(px2*px2 + py2*py2 + pz2*pz2));
478 pair->Track1()->Track()->GetPrimaryVertex(vert1);
480 pair->Track2()->Track()->GetPrimaryVertex(vert2);
482 double corrweight=-999;
483 //if (fIfCorrection) corrweight = CalculateCorrectionWeight(pt1, pt2);
486 corrweight = CalculateCorrectionWeight(pt1, pt2, eta1, eta2, phi1, phi2, vert1[2], vert2[2]);
490 corrweight = CalculateCorrectionWeight(pt1, pt2);
494 if(fIfCorrection || fCorr1D)
495 fDPhiDEtaDenominator->Fill(dphi, deta, corrweight);
497 fDPhiDEtaDenominator->Fill(dphi, deta);
499 if (fDoFullAnalysis) {
500 //fDPhiPtDenominator->Fill(dphi, ptmin);
501 //fDCosPtDenominator->Fill(cosphi, ptmin);
502 fDPhiDenominator->Fill(dphi);
504 double PionMass = 0.13956995;
505 double yt1 = TMath::Log(sqrt(1+(pt1/PionMass)*(pt1/PionMass))+(pt1/PionMass));
506 double yt2 = TMath::Log(sqrt(1+(pt2/PionMass)*(pt2/PionMass))+(pt2/PionMass));
507 fYtYtDenominator->Fill(yt1,yt2);
513 void AliFemtoCorrFctnDEtaDPhiCorrections::WriteHistos()
515 // Write out result histograms
516 fDPhiDEtaNumerator->Write();
517 fDPhiDEtaDenominator->Write();
519 /*fDPhiNumerator->Write();
520 fDPhiDenominator->Write();
521 fDCosNumerator->Write();
522 fDCosDenominator->Write();
523 if (fDoFullAnalysis) {
524 fDPhiPtNumerator->Write();
525 fDPhiPtDenominator->Write();
526 fDCosPtNumerator->Write();
527 fDCosPtDenominator->Write();
534 TList* AliFemtoCorrFctnDEtaDPhiCorrections::GetOutputList()
536 // Prepare the list of objects to be written to the output
537 TList *tOutputList = new TList();
539 tOutputList->Add(fDPhiDEtaNumerator);
540 tOutputList->Add(fDPhiDEtaDenominator);
541 tOutputList->Add(fPtSumDist);
543 if (fDoFullAnalysis) {
544 // tOutputList->Add(fDPhiPtNumerator);
545 // tOutputList->Add(fDPhiPtDenominator);
546 //tOutputList->Add(fDCosPtNumerator);
547 //tOutputList->Add(fDCosPtDenominator);
548 tOutputList->Add(fDPhiNumerator);
549 tOutputList->Add(fDPhiDenominator);
550 tOutputList->Add(fDCosNumerator);
551 tOutputList->Add(fDCosDenominator);
553 tOutputList->Add(fYtYtNumerator);
554 tOutputList->Add(fYtYtDenominator);
555 tOutputList->Add(fPhi);
556 tOutputList->Add(fEta);
566 void AliFemtoCorrFctnDEtaDPhiCorrections::SetDoFullAnalysis(Bool_t do2d)
568 fDoFullAnalysis = do2d;
573 int aPhiBins = fDPhiDEtaNumerator->GetNbinsX();
574 int aEtaBins = fDPhiDEtaNumerator->GetNbinsY();
575 const char *title = fDPhiDEtaNumerator->GetTitle();
578 char tTitNumDPhi[101] = "NumDPhi";
579 strncat(tTitNumDPhi,title, 100);
580 fDPhiNumerator = new TH1D(tTitNumDPhi,title,aPhiBins*2,fphiL, fphiT);
581 // set up denominator
582 char tTitDenDPhi[101] = "DenDPhi";
583 strncat(tTitDenDPhi,title, 100);
584 fDPhiDenominator = new TH1D(tTitDenDPhi,title,aPhiBins*2,fphiL, fphiT);
587 char tTitNumDCos[101] = "NumDCos";
588 strncat(tTitNumDCos,title, 100);
589 fDCosNumerator = new TH1D(tTitNumDCos,title,aPhiBins*2,-1.0,1.0);
590 // set up denominator
591 char tTitDenDCos[101] = "DenDCos";
592 strncat(tTitDenDCos,title, 100);
593 fDCosDenominator = new TH1D(tTitDenDCos,title,aPhiBins*2,-1.0,1.0);
596 char tTitYtNum[101] = "NumYtYt";
597 strncat(tTitYtNum,title, 100);
598 fYtYtNumerator = new TH2D(tTitYtNum,title,aPhiBins,1,5,aEtaBins,1,5);
599 // set up denominator
600 char tTitYtYtDen[101] = "DenYtYt";
601 strncat(tTitYtYtDen,title, 100);
602 fYtYtDenominator = new TH2D(tTitYtYtDen,title,aPhiBins,1,5,aEtaBins,1,5);
605 char tTitPhi[101] = "Phi";
606 strncat(tTitPhi,title, 100);
607 fPhi = new TH1D(tTitPhi,title,90,-TMath::Pi(),TMath::Pi());
609 char tTitEta[101] = "Eta";
610 strncat(tTitEta,title, 100);
611 fEta = new TH1D(tTitEta,title,90,-1.2,1.2);
613 char tTitPtCorrectionsNum[101] = "NumpT1pT2EtaPhi";
614 strncat(tTitPtCorrectionsNum,title, 100);
615 char tTitPtCorrectionsDen[101] = "DenpT1pT2EtaPhi";
616 strncat(tTitPtCorrectionsDen,title, 100);
618 Int_t nbins[4] = {20,20,aPhiBins,aEtaBins};
619 Double_t xmin[4] = {0,0,-0.5*TMath::Pi(),-2.0};
620 Double_t xmax[4] = {4,4,1.5*TMath::Pi(),2.0};
622 fPtCorrectionsNum = new THnSparseF(tTitPtCorrectionsNum,title,4,nbins,xmin,xmax);
623 fPtCorrectionsDen = new THnSparseF(tTitPtCorrectionsDen,title,4,nbins,xmin,xmax);
625 char tTitEtaCorrectionsNum[101] = "NumEta1Eta2EtaPhi";
626 strncat(tTitEtaCorrectionsNum,title, 100);
627 char tTitEtaCorrectionsDen[101] = "DenEta1Eta2EtaPhi";
628 strncat(tTitEtaCorrectionsDen,title, 100);
630 Double_t xmineta[4] = {-1,1,-0.5*TMath::Pi(),-2.0};
631 Double_t xmaxeta[4] = {-1,1,1.5*TMath::Pi(),2.0};
633 fEtaCorrectionsNum = new THnSparseF(tTitEtaCorrectionsNum,title,4,nbins,xmineta,xmaxeta);
634 fEtaCorrectionsDen = new THnSparseF(tTitEtaCorrectionsDen,title,4,nbins,xmineta,xmaxeta);
635 // THnSparse(const char* name, const char* title, Int_t dim,
636 // const Int_t* nbins, const Double_t* xmin, const Double_t* xmax,
639 // to enable error bar calculation...
640 fDPhiNumerator->Sumw2();
641 fDPhiDenominator->Sumw2();
642 fDCosNumerator->Sumw2();
643 fDCosDenominator->Sumw2();
644 fYtYtNumerator->Sumw2();
647 fYtYtDenominator->Sumw2();
648 fPtCorrectionsNum->Sumw2();
649 fPtCorrectionsDen->Sumw2();
657 void AliFemtoCorrFctnDEtaDPhiCorrections::LoadCorrectionTabFromROOTFile(const char *file, ParticleType partType1, ParticleType partType2, bool doPtCorr, bool doEtaCorr, bool doPhiCorr, bool doZVertCorr)
659 fIfCorrection = kTRUE;
661 ifileCorrTab = TFile::Open(file);
662 fdoPtCorr = doPtCorr;
663 fdoEtaCorr = doEtaCorr;
664 fdoPhiCorr = doPhiCorr;
665 fdoZVertCorr = doZVertCorr;
666 fpartType1 = partType1;
667 fpartType2 = partType2;
669 char* type1 = new char[12];
670 char* type2 = new char[12];
673 if(fpartType1==kPion) strcpy(type1,"Pion");
674 else if(fpartType1==kKaon) strcpy(type1,"Kaon");
675 else if (fpartType1==kProton)strcpy(type1,"Proton");
676 else if (fpartType1==kAll) strcpy(type1,"All");
677 else if(fpartType1==kPionMinus) strcpy(type1,"PionMinus");
678 else if(fpartType1==kKaonMinus) strcpy(type1,"KaonMinus");
679 else if (fpartType1==kProtonMinus)strcpy(type1,"ProtonMinus");
680 else strcpy(type1,"");
682 if(fpartType2==kPion) strcpy(type2,"Pion");
683 else if(fpartType2==kKaon) strcpy(type2,"Kaon");
684 else if (fpartType2==kProton) strcpy(type2,"Proton");
685 else if (fpartType2==kAll) strcpy(type2,"All");
686 else if(fpartType2==kPionMinus) strcpy(type1,"PionMinus");
687 else if(fpartType2==kKaonMinus) strcpy(type1,"KaonMinus");
688 else if (fpartType2==kProtonMinus)strcpy(type1,"ProtonMinus");
689 else strcpy(type1,"");
693 fhntReco1 = (THnT<float>*)(ifileCorrTab->Get(Form("fCorrectionMapData%s",type1)))->Clone();
694 fhntReco2 = (THnT<float>*)(ifileCorrTab->Get(Form("fCorrectionMapData%s",type2)))->Clone();
695 fhCont1 = (TH1D*)(ifileCorrTab->Get(Form("SecondariesContamination%s",type1)))->Clone();
696 fhCont2 = (TH1D*)(ifileCorrTab->Get(Form("SecondariesContamination%s",type2)))->Clone();
701 double fhntReco1_nbins = fhntReco1->GetNbins();
702 double fhntReco2_nbins = fhntReco2->GetNbins();
704 int boolSum = fdoPtCorr+fdoEtaCorr+fdoPhiCorr+fdoZVertCorr;
714 fh1Reco1 = (TH1F*)(fhntReco1->Projection(0))->Clone();
715 fh1Reco2 = (TH1F*)(fhntReco2->Projection(0))->Clone();
716 fh1Reco1->Scale(1./fhntReco1_nbins*fh1Reco1->GetNbinsX());
717 fh1Reco2->Scale(1./fhntReco2_nbins*fh1Reco2->GetNbinsX());
721 else if(fdoEtaCorr == 1)
723 fh1Reco1 = (TH1F*)(fhntReco1->Projection(1))->Clone();
724 fh1Reco2 = (TH1F*)(fhntReco2->Projection(1))->Clone();
725 fh1Reco1->Scale(1./fhntReco1_nbins*fh1Reco1->GetNbinsX());
726 fh1Reco2->Scale(1./fhntReco2_nbins*fh1Reco2->GetNbinsX());
729 else if(fdoPhiCorr == 1)
731 fh1Reco1 = (TH1F*)(fhntReco1->Projection(2))->Clone();
732 fh1Reco2 = (TH1F*)(fhntReco2->Projection(2))->Clone();
733 fh1Reco1->Scale(1./fhntReco1_nbins*fh1Reco1->GetNbinsX());
734 fh1Reco2->Scale(1./fhntReco2_nbins*fh1Reco2->GetNbinsX());
737 else if(fdoZVertCorr == 1)
739 fh1Reco1 = (TH1F*)(fhntReco1->Projection(3))->Clone();
740 fh1Reco2 = (TH1F*)(fhntReco2->Projection(3))->Clone();
741 fh1Reco1->Scale(1./fhntReco1_nbins*fh1Reco1->GetNbinsX());
742 fh1Reco2->Scale(1./fhntReco2_nbins*fh1Reco2->GetNbinsX());
747 else if(boolSum == 2)
749 if(fdoPtCorr == 1 && fdoEtaCorr == 1)
751 fh2Reco1 = (TH2F*)(fhntReco1->Projection(1,0))->Clone();
752 fh2Reco2 = (TH2F*)(fhntReco2->Projection(1,0))->Clone();
753 fh2Reco1->Scale(1./fhntReco1_nbins*fh2Reco1->GetNbinsX()*fh2Reco1->GetNbinsY());
754 fh2Reco2->Scale(1./fhntReco2_nbins*fh2Reco2->GetNbinsX()*fh2Reco2->GetNbinsY());
757 else if(fdoPtCorr == 1 && fdoPhiCorr == 1)
759 fh2Reco1 = (TH2F*)(fhntReco1->Projection(2,0))->Clone();
760 fh2Reco2 = (TH2F*)(fhntReco2->Projection(2,0))->Clone();
761 fh2Reco1->Scale(1./fhntReco1_nbins*fh2Reco1->GetNbinsX()*fh2Reco1->GetNbinsY());
762 fh2Reco2->Scale(1./fhntReco2_nbins*fh2Reco2->GetNbinsX()*fh2Reco2->GetNbinsY());
765 else if(fdoPtCorr == 1 && fdoZVertCorr == 1)
767 fh2Reco1 = (TH2F*)(fhntReco1->Projection(3,0))->Clone();
768 fh2Reco2 = (TH2F*)(fhntReco2->Projection(3,0))->Clone();
769 fh2Reco1->Scale(1./fhntReco1_nbins*fh2Reco1->GetNbinsX()*fh2Reco1->GetNbinsY());
770 fh2Reco2->Scale(1./fhntReco2_nbins*fh2Reco2->GetNbinsX()*fh2Reco2->GetNbinsY());
772 else if(fdoEtaCorr == 1 && fdoPhiCorr == 1)
774 fh2Reco1 = (TH2F*)(fhntReco1->Projection(2,1))->Clone();
775 fh2Reco2 = (TH2F*)(fhntReco2->Projection(2,1))->Clone();
776 fh2Reco1->Scale(1./fhntReco1_nbins*fh2Reco1->GetNbinsX()*fh2Reco1->GetNbinsY());
777 fh2Reco2->Scale(1./fhntReco2_nbins*fh2Reco2->GetNbinsX()*fh2Reco2->GetNbinsY());
779 else if(fdoEtaCorr == 1 && fdoZVertCorr == 1)
781 fh2Reco1 = (TH2F*)(fhntReco1->Projection(3,1))->Clone();
782 fh2Reco2 = (TH2F*)(fhntReco2->Projection(3,1))->Clone();
783 fh2Reco1->Scale(1./fhntReco1_nbins*fh2Reco1->GetNbinsX()*fh2Reco1->GetNbinsY());
784 fh2Reco2->Scale(1./fhntReco2_nbins*fh2Reco2->GetNbinsX()*fh2Reco2->GetNbinsY());
786 else if(fdoPhiCorr == 1 && fdoZVertCorr == 1)
788 fh2Reco1 = (TH2F*)(fhntReco1->Projection(3,2))->Clone();
789 fh2Reco2 = (TH2F*)(fhntReco2->Projection(3,2))->Clone();
790 fh2Reco1->Scale(1./fhntReco1_nbins*fh2Reco1->GetNbinsX()*fh2Reco1->GetNbinsY());
791 fh2Reco2->Scale(1./fhntReco2_nbins*fh2Reco2->GetNbinsX()*fh2Reco2->GetNbinsY());
796 else if(boolSum == 3)
798 if(fdoPtCorr == 1 && fdoEtaCorr == 1 && fdoPhiCorr == 1)
800 fh3Reco1 = (TH3F*)(fhntReco1->Projection(0,1,2))->Clone();
801 fh3Reco2 = (TH3F*)(fhntReco2->Projection(0,1,2))->Clone();
802 fh3Reco1->Scale(1./fhntReco1_nbins*fh3Reco1->GetNbinsX()*fh3Reco1->GetNbinsY()*fh3Reco1->GetNbinsZ());
803 fh3Reco2->Scale(1./fhntReco2_nbins*fh3Reco2->GetNbinsX()*fh3Reco2->GetNbinsY()*fh3Reco2->GetNbinsZ());
807 else if(fdoPtCorr == 1 && fdoEtaCorr == 1 && fdoZVertCorr == 1)
809 fh3Reco1 = (TH3F*)(fhntReco1->Projection(0,1,3))->Clone();
810 fh3Reco2 = (TH3F*)(fhntReco2->Projection(0,1,3))->Clone();
811 fh3Reco1->Scale(1./fhntReco1_nbins*fh3Reco1->GetNbinsX()*fh3Reco1->GetNbinsY()*fh3Reco1->GetNbinsZ());
812 fh3Reco2->Scale(1./fhntReco2_nbins*fh3Reco2->GetNbinsX()*fh3Reco2->GetNbinsY()*fh3Reco2->GetNbinsZ());
815 else if(fdoPtCorr == 1 && fdoPhiCorr == 1 && fdoZVertCorr == 1)
817 fh3Reco1 = (TH3F*)(fhntReco1->Projection(0,2,3))->Clone();
818 fh3Reco2 = (TH3F*)(fhntReco2->Projection(0,2,3))->Clone();
819 fh3Reco1->Scale(1./fhntReco1_nbins*fh3Reco1->GetNbinsX()*fh3Reco1->GetNbinsY()*fh3Reco1->GetNbinsZ());
820 fh3Reco2->Scale(1./fhntReco2_nbins*fh3Reco2->GetNbinsX()*fh3Reco2->GetNbinsY()*fh3Reco2->GetNbinsZ());
823 else if(fdoEtaCorr == 1 && fdoPhiCorr == 1 && fdoZVertCorr == 1)
825 fh3Reco1 = (TH3F*)(fhntReco1->Projection(1,2,3))->Clone();
826 fh3Reco2 = (TH3F*)(fhntReco2->Projection(1,2,3))->Clone();
827 fh3Reco1->Scale(1./fhntReco1_nbins*fh3Reco1->GetNbinsX()*fh3Reco1->GetNbinsY()*fh3Reco1->GetNbinsZ());
828 fh3Reco2->Scale(1./fhntReco2_nbins*fh3Reco2->GetNbinsX()*fh3Reco2->GetNbinsY()*fh3Reco2->GetNbinsZ());
832 /*else if(boolSum == 4)
836 ifileCorrTab->Close();
840 void AliFemtoCorrFctnDEtaDPhiCorrections::LoadCorrectionTabFromROOTFile1D(const char *file, ParticleType partType1, ParticleType partType2)
844 ifileCorrTab = TFile::Open(file);
846 fpartType1 = partType1;
847 fpartType2 = partType2;
854 if(fpartType1==kPion) strcpy(type1,"Pion");
855 else if(fpartType1==kKaon) strcpy(type1,"Kaon");
856 else if (fpartType1==kProton)strcpy(type1,"Proton");
857 else if (fpartType1==kAll) strcpy(type1,"All");
858 else if(fpartType1==kPionMinus) strcpy(type1,"PionMinus");
859 else if (fpartType1==kKaonMinus) strcpy(type1,"KaonMinus");
860 else if (fpartType1==kProtonMinus)strcpy(type1,"ProtonMinus");
861 else strcpy(type1,"");
863 if(fpartType2==kPion) strcpy(type2,"Pion");
864 else if(fpartType2==kKaon) strcpy(type2,"Kaon");
865 else if (fpartType2==kProton) strcpy(type2,"Proton");
866 else if (fpartType2==kAll) strcpy(type2,"All");
867 else if(fpartType2==kPionMinus) strcpy(type1,"PionMinus");
868 else if(fpartType2==kKaonMinus) strcpy(type1,"KaonMinus");
869 else if (fpartType2==kProtonMinus)strcpy(type1,"ProtonMinus");
870 else strcpy(type1,"");
872 fhCont1 = (TH1D*)(ifileCorrTab->Get(Form("CorrectionFactorPtEffandCont%s",type1)));//->Clone();
873 fhCont2 = (TH1D*)(ifileCorrTab->Get(Form("CorrectionFactorPtEffandCont%s",type2)));//->Clone();
875 ifileCorrTab->Close();
879 void AliFemtoCorrFctnDEtaDPhiCorrections::SetCorrectionTab(ParticleType partType)
882 double pttab[] = {0, 0.025, 0.05, 0.075, 0.1, 0.125, 0.15, 0.175, 0.2, 0.225, 0.25, 0.275, 0.3, 0.325, 0.35, 0.375, 0.4, 0.425, 0.45, 0.475, 0.5, 0.525, 0.55, 0.575, 0.6, 0.625, 0.65, 0.675, 0.7, 0.725, 0.75, 0.775, 0.8, 0.825, 0.85, 0.875, 0.9, 0.925, 0.95, 0.975, 1, 1.025, 1.05, 1.075, 1.1, 1.125, 1.15, 1.175, 1.2, 1.225, 1.25, 1.275, 1.3, 1.325, 1.35, 1.375, 1.4, 1.425, 1.45, 1.475, 1.5, 1.525, 1.55, 1.575, 1.6, 1.625, 1.65, 1.675, 1.7, 1.725, 1.75, 1.775, 1.8, 1.825, 1.85, 1.875, 1.9, 1.925, 1.95, 1.975, 2, 2.025, 2.05, 2.075, 2.1, 2.125, 2.15, 2.175, 2.2, 2.225, 2.25, 2.275, 2.3, 2.325, 2.35, 2.375, 2.4, 2.425, 2.45, 2.475, 2.5, 2.525, 2.55, 2.575, 2.6, 2.625, 2.65, 2.675, 2.7, 2.725, 2.75, 2.775, 2.8, 2.825, 2.85, 2.875, 2.9, 2.925, 2.95, 2.975, 3, 3.025, 3.05, 3.075, 3.1, 3.125, 3.15, 3.175, 3.2, 3.225, 3.25, 3.275, 3.3, 3.325, 3.35, 3.375, 3.4, 3.425, 3.45, 3.475, 3.5, 3.525, 3.55, 3.575, 3.6, 3.625, 3.65, 3.675, 3.7, 3.725, 3.75, 3.775, 3.8, 3.825, 3.85, 3.875, 3.9, 3.925, 3.95, 3.975, 4, 4.025, 4.05, 4.075, 4.1, 4.125, 4.15, 4.175, 4.2, 4.225, 4.25, 4.275, 4.3, 4.325, 4.35, 4.375, 4.4, 4.425, 4.45, 4.475, 4.5, 4.525, 4.55, 4.575, 4.6, 4.625, 4.65, 4.675, 4.7, 4.725, 4.75};
884 double pioncorrtab[] = {0, 0, 0, 0, 0, 0, 0, 1.40089, 1.40089, 1.29482, 1.29482, 1.25595, 1.22529, 1.22529, 1.23099, 1.32027, 1.32027, 1.44774, 1.44774, 1.74645, 1.8619, 1.8619, 1.82089, 1.78506, 1.78506, 1.75918, 1.75918, 1.74951, 1.74614, 1.74614, 1.74006, 1.73229, 1.73229, 1.72844, 1.72844, 1.72306, 1.71906, 1.71906, 1.71375, 1.71301, 1.71301, 1.70381, 1.70381, 1.69975, 1.69242, 1.69242, 1.69013, 1.67698, 1.67698, 1.6772, 1.6772, 1.67118, 1.66607, 1.66607, 1.66131, 1.67228, 1.67228, 1.66834, 1.66834, 1.66031, 1.6588, 1.6588, 1.6555, 1.64923, 1.64923, 1.6467, 1.6467, 1.63894, 1.63682, 1.63682, 1.6297, 1.62904, 1.62904, 1.63007, 1.63007, 1.62832, 1.62557, 1.62557, 1.62687, 1.62928, 1.62928, 1.62767, 1.62767, 1.62767, 1.62767, 1.62767, 1.62767, 1.63415, 1.63415, 1.63415, 1.63415, 1.63415, 1.63415, 1.63415, 1.64141, 1.64141, 1.64141, 1.64141, 1.64141, 1.64141, 1.65191, 1.65191, 1.65191, 1.65191, 1.65191, 1.65191, 1.65191, 1.66838, 1.66838, 1.66838, 1.66838, 1.66838, 1.66838, 1.6839, 1.6839, 1.6839, 1.6839, 1.6839, 1.6839, 1.69601, 1.69601, 1.69601, 1.69601, 1.69601, 1.69601, 1.69601, 1.70062, 1.70062, 1.70062, 1.70062, 1.70062, 1.70062, 1.68668, 1.68668, 1.68668, 1.68668, 1.68668, 1.68668, 1.68668, 1.68182, 1.68182, 1.68182, 1.68182, 1.68182, 1.68182, 1.681, 1.681, 1.681, 1.681, 1.681, 1.681, 1.67749, 1.67749, 1.67749, 1.67749, 1.67749, 1.67749, 1.67749, 1.66558, 1.67223, 1.67223, 1.67223, 1.67223, 1.67223, 1.67223, 1.67223, 1.67223, 1.67223, 1.67223, 1.67223, 1.67223, 1.67223, 1.67223, 1.67223, 1.66872, 1.66872, 1.66872, 1.66872, 1.66872, 1.66872, 1.66872, 1.66872, 1.66872, 1.66872, 1.66872, 1.66872, 1.66872, 1.66872, 1.66872, 1.66872, 1.64419};
886 double protoncorrtab[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 357.585, 357.585, 8.66944, 2.10995, 2.10995, 1.50443, 1.73168, 1.73168, 2.3605, 2.3605, 4.7726, 4.40359, 4.40359, 3.0307, 2.49649, 2.49649, 2.2231, 2.2231, 2.11247, 2.05862, 2.05862, 2.00703, 1.9623, 1.9623, 1.93393, 1.93393, 1.9101, 1.89334, 1.89334, 1.87734, 1.86342, 1.86342, 1.85075, 1.85075, 1.83985, 1.83684, 1.83684, 1.82915, 1.81832, 1.81832, 1.81215, 1.81215, 1.7998, 1.79524, 1.79524, 1.78568, 1.79989, 1.79989, 1.7973, 1.7973, 1.79591, 1.78468, 1.78468, 1.78037, 1.77394, 1.77394, 1.77198, 1.77198, 1.76736, 1.76875, 1.76875, 1.76221, 1.75729, 1.75729, 1.75397, 1.75397, 1.75229, 1.74918, 1.74918, 1.75064, 1.75643, 1.75643, 1.75765, 1.75765, 1.75765, 1.75765, 1.75765, 1.75765, 1.76345, 1.76345, 1.76345, 1.76345, 1.76345, 1.76345, 1.76345, 1.76901, 1.76901, 1.76901, 1.76901, 1.76901, 1.76901, 1.78291, 1.78291, 1.78291, 1.78291, 1.78291, 1.78291, 1.78291, 1.80009, 1.80009, 1.80009, 1.80009, 1.80009, 1.80009, 1.81064, 1.81064, 1.81064, 1.81064, 1.81064, 1.81064, 1.81765, 1.81765, 1.81765, 1.81765, 1.81765, 1.81765, 1.81765, 1.79549, 1.79549, 1.79549, 1.79549, 1.79549, 1.79549, 1.80455, 1.80455, 1.80455, 1.80455, 1.80455, 1.80455, 1.80455, 1.78912, 1.78912, 1.78912, 1.78912, 1.78912, 1.78912, 1.78501, 1.78501, 1.78501, 1.78501, 1.78501, 1.78501, 1.79512, 1.79512, 1.79512, 1.79512, 1.79512, 1.79512, 1.79512, 1.77138, 1.784, 1.784, 1.784, 1.784, 1.784, 1.784, 1.784, 1.784, 1.784, 1.784, 1.784, 1.784, 1.784, 1.784, 1.784, 1.75152, 1.75152, 1.75152, 1.75152, 1.75152, 1.75152, 1.75152, 1.75152, 1.75152, 1.75152, 1.75152, 1.75152, 1.75152, 1.75152, 1.75152};
888 double kaoncorrtab[] = {0, 0, 0, 0, 0, 0, 0, 8.43268, 8.43268, 3.30657, 3.30657, 2.5102, 2.16256, 2.16256, 2.03757, 2.27166, 2.27166, 2.70432, 2.70432, 4.06234, 4.69199, 4.69199, 4.13074, 3.75139, 3.75139, 3.48381, 3.48381, 3.29762, 3.15261, 3.15261, 3.03022, 2.91874, 2.91874, 2.82421, 2.82421, 2.7388, 2.65961, 2.65961, 2.58426, 2.5174, 2.5174, 2.45378, 2.45378, 2.39687, 2.34699, 2.34699, 2.30247, 2.25299, 2.25299, 2.22443, 2.22443, 2.18303, 2.16012, 2.16012, 2.13083, 2.12806, 2.12806, 2.11376, 2.11376, 2.09566, 2.07526, 2.07526, 2.05378, 2.03252, 2.03252, 2.02466, 2.02466, 2.00531, 1.98945, 1.98945, 1.97877, 1.97226, 1.97226, 1.95475, 1.95475, 1.94838, 1.9314, 1.9314, 1.92571, 1.96346, 1.96346, 1.92849, 1.92849, 1.92849, 1.92849, 1.92849, 1.92849, 1.90949, 1.90949, 1.90949, 1.90949, 1.90949, 1.90949, 1.90949, 1.88743, 1.88743, 1.88743, 1.88743, 1.88743, 1.88743, 1.87486, 1.87486, 1.87486, 1.87486, 1.87486, 1.87486, 1.87486, 1.87785, 1.87785, 1.87785, 1.87785, 1.87785, 1.87785, 1.8757, 1.8757, 1.8757, 1.8757, 1.8757, 1.8757, 1.87948, 1.87948, 1.87948, 1.87948, 1.87948, 1.87948, 1.87948, 1.86148, 1.86148, 1.86148, 1.86148, 1.86148, 1.86148, 1.84329, 1.84329, 1.84329, 1.84329, 1.84329, 1.84329, 1.84329, 1.83105, 1.83105, 1.83105, 1.83105, 1.83105, 1.83105, 1.81955, 1.81955, 1.81955, 1.81955, 1.81955, 1.81955, 1.79944, 1.79944, 1.79944, 1.79944, 1.79944, 1.79944, 1.79944, 1.79345, 1.80077, 1.80077, 1.80077, 1.80077, 1.80077, 1.80077, 1.80077, 1.80077, 1.80077, 1.80077, 1.80077, 1.80077, 1.80077, 1.80077, 1.80077, 1.78333, 1.78333, 1.78333, 1.78333, 1.78333, 1.78333, 1.78333, 1.78333, 1.78333, 1.78333, 1.78333, 1.78333, 1.78333, 1.78333, 1.78333, 1.78333, 1.74958};
890 double allcorrtab[] = {0, 0, 0, 0, 0, 0, 0, 1.46883, 1.46883, 1.3528, 1.3528, 1.30939, 1.26936, 1.26936, 1.23645, 1.21359, 1.21359, 1.19759, 1.19759, 1.18565, 1.17772, 1.17772, 1.17203, 1.16739, 1.16739, 1.16398, 1.16398, 1.16201, 1.16065, 1.16065, 1.16012, 1.16009, 1.16009, 1.16044, 1.16044, 1.16104, 1.16139, 1.16139, 1.16134, 1.16278, 1.16278, 1.1631, 1.1631, 1.16227, 1.16152, 1.16152, 1.16066, 1.15984, 1.15984, 1.15932, 1.15932, 1.15912, 1.15818, 1.15818, 1.15877, 1.16754, 1.16754, 1.17075, 1.17075, 1.17047, 1.16995, 1.16995, 1.16885, 1.16845, 1.16845, 1.16824, 1.16824, 1.16771, 1.16704, 1.16704, 1.16681, 1.16723, 1.16723, 1.16819, 1.16819, 1.16811, 1.16974, 1.16974, 1.17217, 1.16759, 1.16759, 1.17376, 1.17376, 1.17376, 1.17376, 1.17376, 1.17376, 1.18247, 1.18247, 1.18247, 1.18247, 1.18247, 1.18247, 1.18247, 1.18916, 1.18916, 1.18916, 1.18916, 1.18916, 1.18916, 1.19649, 1.19649, 1.19649, 1.19649, 1.19649, 1.19649, 1.19649, 1.20315, 1.20315, 1.20315, 1.20315, 1.20315, 1.20315, 1.20984, 1.20984, 1.20984, 1.20984, 1.20984, 1.20984, 1.21236, 1.21236, 1.21236, 1.21236, 1.21236, 1.21236, 1.21236, 1.21272, 1.21272, 1.21272, 1.21272, 1.21272, 1.21272, 1.21416, 1.21416, 1.21416, 1.21416, 1.21416, 1.21416, 1.21416, 1.21308, 1.21308, 1.21308, 1.21308, 1.21308, 1.21308, 1.21332, 1.21332, 1.21332, 1.21332, 1.21332, 1.21332, 1.21204, 1.21204, 1.21204, 1.21204, 1.21204, 1.21204, 1.21204, 1.21006, 1.21141, 1.21141, 1.21141, 1.21141, 1.21141, 1.21141, 1.21141, 1.21141, 1.21141, 1.21141, 1.21141, 1.21141, 1.21141, 1.21141, 1.21141, 1.2092, 1.2092, 1.2092, 1.2092, 1.2092, 1.2092, 1.2092, 1.2092, 1.2092, 1.2092, 1.2092, 1.2092, 1.2092, 1.2092, 1.2092, 1.2092, 1.2066};
892 fpTab = new double[190];
893 for(int i=0;i<190;i++)
896 if(partType==kPion || partType==kPionMinus)
898 fCorrFactorTab = new double[190];
899 for(int i=0;i<190;i++)
900 fCorrFactorTab[i] = pioncorrtab[i];
902 else if(partType==kKaon || partType==kKaonMinus)
904 fCorrFactorTab = new double[190];
905 for(int i=0;i<190;i++)
906 fCorrFactorTab[i] = kaoncorrtab[i];
908 else if(partType==kProton||partType==kProtonMinus)
910 fCorrFactorTab = new double[190];
911 for(int i=0;i<190;i++)
912 fCorrFactorTab[i] = protoncorrtab[i];
914 else if(partType==kAll)
916 fCorrFactorTab = new double[190];
917 for(int i=0;i<190;i++)
918 fCorrFactorTab[i] = allcorrtab[i];
922 double AliFemtoCorrFctnDEtaDPhiCorrections::CalculateCorrectionWeight(double pT1, double pT2)
925 if(pT1 > fhCont1->GetXaxis()->GetXmin() && pT1 < fhCont1->GetXaxis()->GetXmax() && pT2 > fhCont2->GetXaxis()->GetXmin() && pT2 < fhCont2->GetXaxis()->GetXmax())
927 w1 = fhCont1->GetBinContent(fhCont1->FindFixBin(pT1));
928 w2 = fhCont2->GetBinContent(fhCont2->FindFixBin(pT2));
937 double AliFemtoCorrFctnDEtaDPhiCorrections::CalculateCorrectionWeight(double pT1)
940 if(pT1 > fhCont1->GetXaxis()->GetXmin() && pT1 < fhCont1->GetXaxis()->GetXmax())
942 w1 = fhCont1->GetBinContent(fhCont1->FindFixBin(pT1));
949 double AliFemtoCorrFctnDEtaDPhiCorrections::CalculateCorrectionWeight(double pT1, double pT2, double eta1, double eta2, double phi1, double phi2, double zvert1, double zvert2)
953 double eps1=0., eps2=0;
954 double cont1=0., cont2=0; //w=(1-cont)/eps
958 if(pT1 > fhCont1->GetXaxis()->GetXmin() && pT1 < fhCont1->GetXaxis()->GetXmax() && pT2 > fhCont2->GetXaxis()->GetXmin() && pT2 < fhCont2->GetXaxis()->GetXmax())
960 cont1 = fhCont1->GetBinContent(fhCont1->FindFixBin(pT1));
961 cont2 = fhCont1->GetBinContent(fhCont2->FindFixBin(pT2));
966 int boolSum = fdoPtCorr+fdoEtaCorr+fdoPhiCorr+fdoZVertCorr;
971 else if(boolSum == 1)
976 if(pT1 > fh1Reco1->GetXaxis()->GetXmin() && pT1 < fh1Reco1->GetXaxis()->GetXmax() && pT2 > fh1Reco2->GetXaxis()->GetXmin() && pT2 < fh1Reco2->GetXaxis()->GetXmax())
978 eps1 = fh1Reco1->GetBinContent(fh1Reco1->FindFixBin(pT1));
979 eps2 = fh1Reco2->GetBinContent(fh1Reco2->FindFixBin(pT2));
989 else if(fdoEtaCorr == 1)
991 if(eta1 > fh1Reco1->GetXaxis()->GetXmin() && eta1 < fh1Reco1->GetXaxis()->GetXmax() && eta2 > fh1Reco2->GetXaxis()->GetXmin() && eta2 < fh1Reco2->GetXaxis()->GetXmax())
993 eps1 = fh1Reco1->GetBinContent(fh1Reco1->FindFixBin(eta1));
994 eps2 = fh1Reco2->GetBinContent(fh1Reco2->FindFixBin(eta2));
1005 else if(fdoPhiCorr == 1)
1007 if(phi1 > fh1Reco1->GetXaxis()->GetXmin() && phi1 < fh1Reco1->GetXaxis()->GetXmax() && phi2 > fh1Reco2->GetXaxis()->GetXmin() && phi2 < fh1Reco2->GetXaxis()->GetXmax())
1009 eps1 = fh1Reco1->GetBinContent(fh1Reco1->FindFixBin(phi1));
1010 eps2 = fh1Reco2->GetBinContent(fh1Reco2->FindFixBin(phi2));
1012 w1 = (1-cont1)/eps1;
1013 w2 = (1-cont2)/eps2;
1022 else if(fdoZVertCorr == 1)
1024 if(zvert1 > fh1Reco1->GetXaxis()->GetXmin() && zvert1 < fh1Reco1->GetXaxis()->GetXmax() && zvert2 > fh1Reco2->GetXaxis()->GetXmin() && zvert2 < fh1Reco2->GetXaxis()->GetXmax())
1026 eps1 = fh1Reco1->GetBinContent(fh1Reco1->FindFixBin(zvert1));
1027 eps2 = fh1Reco2->GetBinContent(fh1Reco2->FindFixBin(zvert2));
1029 w1 = (1-cont1)/eps1;
1030 w2 = (1-cont2)/eps2;
1040 else if(boolSum == 2)
1042 if(fdoPtCorr == 1 && fdoEtaCorr == 1)
1044 if(pT1 > fh2Reco1->GetXaxis()->GetXmin() && pT1 < fh2Reco1->GetXaxis()->GetXmax() && pT2 > fh2Reco2->GetXaxis()->GetXmin() && pT2 < fh2Reco2->GetXaxis()->GetXmax() && eta1 > fh2Reco1->GetYaxis()->GetXmin() && eta1 < fh2Reco1->GetYaxis()->GetXmax() && eta2 > fh2Reco2->GetYaxis()->GetXmin() && eta2 < fh2Reco2->GetYaxis()->GetXmax())
1046 eps1 = fh2Reco1->GetBinContent(fh2Reco1->GetXaxis()->FindFixBin(pT1),fh2Reco1->GetYaxis()->FindFixBin(eta1));
1047 eps2 = fh2Reco2->GetBinContent(fh2Reco2->GetXaxis()->FindFixBin(pT2),fh2Reco2->GetYaxis()->FindFixBin(eta2));
1049 w1 = (1-cont1)/eps1;
1050 w2 = (1-cont2)/eps2;
1059 if(fdoPtCorr == 1 && fdoPhiCorr == 1)
1062 if(pT1 > fh2Reco1->GetXaxis()->GetXmin() && pT1 < fh2Reco1->GetXaxis()->GetXmax() && pT2 > fh2Reco2->GetXaxis()->GetXmin() && pT2 < fh2Reco2->GetXaxis()->GetXmax() && phi1 > fh2Reco1->GetYaxis()->GetXmin() && phi1 < fh2Reco1->GetYaxis()->GetXmax() && phi2 > fh2Reco2->GetYaxis()->GetXmin() && phi2 < fh2Reco2->GetYaxis()->GetXmax())
1064 eps1 = fh2Reco1->GetBinContent(fh2Reco1->GetXaxis()->FindFixBin(pT1),fh2Reco1->GetYaxis()->FindFixBin(phi1));
1065 eps2 = fh2Reco2->GetBinContent(fh2Reco2->GetXaxis()->FindFixBin(pT2),fh2Reco2->GetYaxis()->FindFixBin(phi2));
1067 w1 = (1-cont1)/eps1;
1068 w2 = (1-cont2)/eps2;
1077 else if(fdoPtCorr == 1 && fdoZVertCorr == 1)
1080 if(pT1 > fh2Reco1->GetXaxis()->GetXmin() && pT1 < fh2Reco1->GetXaxis()->GetXmax() && pT2 > fh2Reco2->GetXaxis()->GetXmin() && pT2 < fh2Reco2->GetXaxis()->GetXmax() && zvert1 > fh2Reco1->GetYaxis()->GetXmin() && zvert1 < fh2Reco1->GetYaxis()->GetXmax() && zvert2 > fh2Reco2->GetYaxis()->GetXmin() && zvert2 < fh2Reco2->GetYaxis()->GetXmax())
1082 eps1 = fh2Reco1->GetBinContent(fh2Reco1->GetXaxis()->FindFixBin(pT1),fh2Reco1->GetYaxis()->FindFixBin(zvert1));
1083 eps2 = fh2Reco2->GetBinContent(fh2Reco2->GetXaxis()->FindFixBin(pT2),fh2Reco2->GetYaxis()->FindFixBin(zvert2));
1085 w1 = (1-cont1)/eps1;
1086 w2 = (1-cont2)/eps2;
1093 else if(fdoEtaCorr == 1 && fdoPhiCorr == 1)
1096 if(eta1 > fh2Reco1->GetXaxis()->GetXmin() && eta1 < fh2Reco1->GetXaxis()->GetXmax() && eta2 > fh2Reco2->GetXaxis()->GetXmin() && eta2 < fh2Reco2->GetXaxis()->GetXmax() && phi1 > fh2Reco1->GetYaxis()->GetXmin() && phi1 < fh2Reco1->GetYaxis()->GetXmax() && phi2 > fh2Reco2->GetYaxis()->GetXmin() && phi2 < fh2Reco2->GetYaxis()->GetXmax())
1098 eps1 = fh2Reco1->GetBinContent(fh2Reco1->GetXaxis()->FindFixBin(eta1),fh2Reco1->GetYaxis()->FindFixBin(phi1));
1099 eps2 = fh2Reco2->GetBinContent(fh2Reco2->GetXaxis()->FindFixBin(eta2),fh2Reco2->GetYaxis()->FindFixBin(phi2));
1101 w1 = (1-cont1)/eps1;
1102 w2 = (1-cont2)/eps2;
1111 else if(fdoEtaCorr == 1 && fdoZVertCorr == 1)
1114 if(eta1 > fh2Reco1->GetXaxis()->GetXmin() && eta1 < fh2Reco1->GetXaxis()->GetXmax() && eta2 > fh2Reco2->GetXaxis()->GetXmin() && eta2 < fh2Reco2->GetXaxis()->GetXmax() && zvert1 > fh2Reco1->GetYaxis()->GetXmin() && zvert1 < fh2Reco1->GetYaxis()->GetXmax() && zvert2 > fh2Reco2->GetXaxis()->GetXmin() && zvert2 < fh2Reco2->GetXaxis()->GetXmax())
1116 eps1 = fh2Reco1->GetBinContent(fh2Reco1->GetXaxis()->FindFixBin(eta1),fh2Reco1->GetYaxis()->FindFixBin(zvert1));
1117 eps1 = fh2Reco2->GetBinContent(fh2Reco2->GetXaxis()->FindFixBin(eta2),fh2Reco2->GetYaxis()->FindFixBin(zvert2));
1120 w1 = (1-cont1)/eps1;
1121 w2 = (1-cont2)/eps2;
1129 else if(fdoPhiCorr == 1 && fdoZVertCorr == 1)
1132 if(phi1 > fh2Reco1->GetXaxis()->GetXmin() && phi1 < fh2Reco1->GetXaxis()->GetXmax() && phi2 > fh2Reco2->GetXaxis()->GetXmin() && phi2 < fh2Reco2->GetXaxis()->GetXmax() && zvert1 > fh2Reco1->GetYaxis()->GetXmin() && zvert1 < fh2Reco1->GetYaxis()->GetXmax() && zvert2 > fh2Reco2->GetYaxis()->GetXmin() && zvert2 < fh2Reco2->GetYaxis()->GetXmax())
1134 eps1 = fh2Reco1->GetBinContent(fh2Reco1->GetXaxis()->FindFixBin(phi1),fh2Reco1->GetYaxis()->FindFixBin(zvert1));
1135 eps2 = fh2Reco2->GetBinContent(fh2Reco2->GetXaxis()->FindFixBin(phi2),fh2Reco2->GetYaxis()->FindFixBin(zvert2));
1137 w1 = (1-cont1)/eps1;
1138 w2 = (1-cont2)/eps2;
1149 else if(boolSum == 3)
1151 if(fdoPtCorr == 1 && fdoEtaCorr == 1 && fdoPhiCorr == 1)
1153 if(pT1 >fh3Reco1->GetXaxis()->GetXmin() && pT1 <fh3Reco1->GetXaxis()->GetXmax() &&
1154 pT2 > fh3Reco2->GetXaxis()->GetXmin() && pT2 <fh3Reco2->GetXaxis()->GetXmax() &&
1155 eta1 > fh3Reco1->GetYaxis()->GetXmin() && eta1 <fh3Reco1->GetYaxis()->GetXmax() &&
1156 eta2 > fh3Reco2->GetYaxis()->GetXmin() && eta2 <fh3Reco2->GetYaxis()->GetXmax() &&
1157 phi1 > fh3Reco1->GetZaxis()->GetXmin() && phi1 < fh3Reco1->GetZaxis()->GetXmax() &&
1158 phi2 > fh3Reco2->GetZaxis()->GetXmin() && phi2 < fh3Reco2->GetZaxis()->GetXmax())
1160 eps1 = fh3Reco1->GetBinContent(fh3Reco1->GetXaxis()->FindFixBin(pT1),fh3Reco1->GetYaxis()->FindFixBin(eta1),fh3Reco1->GetZaxis()->FindFixBin(phi1));
1161 eps2 = fh3Reco2->GetBinContent(fh3Reco2->GetXaxis()->FindFixBin(pT2),fh3Reco2->GetYaxis()->FindFixBin(eta2),fh3Reco2->GetZaxis()->FindFixBin(phi2));
1163 w1 = (1-cont1)/eps1;
1164 w2 = (1-cont2)/eps2;
1174 else if(fdoPtCorr == 1 && fdoEtaCorr == 1 && fdoZVertCorr == 1)
1177 if(pT1 >fh3Reco1->GetXaxis()->GetXmin() && pT1 <fh3Reco1->GetXaxis()->GetXmax() && pT2 > fh3Reco2->GetXaxis()->GetXmin() && pT2 <fh3Reco2->GetXaxis()->GetXmax() && eta1 > fh3Reco1->GetYaxis()->GetXmin() && eta1 <fh3Reco1->GetYaxis()->GetXmax() && eta2 > fh3Reco2->GetYaxis()->GetXmin() && eta2 <fh3Reco2->GetYaxis()->GetXmax() && zvert1 > fh3Reco1->GetZaxis()->GetXmin() && zvert1 < fh3Reco1->GetZaxis()->GetXmax() && zvert2 > fh3Reco2->GetZaxis()->GetXmin() && zvert2 < fh3Reco2->GetZaxis()->GetXmax())
1179 eps1 = fh3Reco1->GetBinContent(fh3Reco1->GetXaxis()->FindFixBin(pT1),fh3Reco1->GetYaxis()->FindFixBin(eta1),fh3Reco1->GetZaxis()->FindFixBin(zvert1));
1180 eps2 = fh3Reco2->GetBinContent(fh3Reco2->GetXaxis()->FindFixBin(pT2),fh3Reco2->GetYaxis()->FindFixBin(eta2),fh3Reco2->GetZaxis()->FindFixBin(zvert2));
1182 w1 = (1-cont1)/eps1;
1183 w2 = (1-cont2)/eps2;
1191 else if(fdoPtCorr == 1 && fdoPhiCorr == 1 && fdoZVertCorr == 1)
1194 if(pT1 >fh3Reco1->GetXaxis()->GetXmin() && pT1 <fh3Reco1->GetXaxis()->GetXmax() && pT2 > fh3Reco2->GetXaxis()->GetXmin() && pT2 <fh3Reco2->GetXaxis()->GetXmax() && phi1 > fh3Reco1->GetYaxis()->GetXmin() && phi1 <fh3Reco1->GetYaxis()->GetXmax() && phi2 > fh3Reco2->GetYaxis()->GetXmin() && phi2 <fh3Reco2->GetYaxis()->GetXmax() && zvert1 > fh3Reco1->GetZaxis()->GetXmin() && zvert1 < fh3Reco1->GetZaxis()->GetXmax() && zvert2 > fh3Reco2->GetZaxis()->GetXmin() && zvert2 < fh3Reco2->GetZaxis()->GetXmax())
1196 eps1 = fh3Reco1->GetBinContent(fh3Reco1->GetXaxis()->FindFixBin(pT1),fh3Reco1->GetYaxis()->FindFixBin(phi1),fh3Reco1->GetZaxis()->FindFixBin(zvert1));
1197 eps2 = fh3Reco2->GetBinContent(fh3Reco2->GetXaxis()->FindFixBin(pT2),fh3Reco2->GetYaxis()->FindFixBin(phi2),fh3Reco2->GetZaxis()->FindFixBin(zvert2));
1199 w1 = (1-cont1)/eps1;
1200 w2 = (1-cont2)/eps2;
1209 else if(fdoEtaCorr == 1 && fdoPhiCorr == 1 && fdoZVertCorr == 1)
1212 if(eta1 >fh3Reco1->GetXaxis()->GetXmin() && eta1 <fh3Reco1->GetXaxis()->GetXmax() && eta2 > fh3Reco2->GetXaxis()->GetXmin() && eta2 <fh3Reco2->GetXaxis()->GetXmax() && phi1 > fh3Reco1->GetYaxis()->GetXmin() && phi1 <fh3Reco1->GetYaxis()->GetXmax() && phi2 > fh3Reco2->GetYaxis()->GetXmin() && phi2 <fh3Reco2->GetYaxis()->GetXmax() && zvert1 > fh3Reco1->GetZaxis()->GetXmin() && zvert1 < fh3Reco1->GetZaxis()->GetXmax() && zvert2 > fh3Reco2->GetZaxis()->GetXmin() && zvert2 < fh3Reco2->GetZaxis()->GetXmax())
1214 eps1 = fh3Reco1->GetBinContent(fh3Reco1->GetXaxis()->FindFixBin(eta1),fh3Reco1->GetYaxis()->FindFixBin(phi1),fh3Reco1->GetZaxis()->FindFixBin(zvert1));
1215 eps2 = fh3Reco2->GetBinContent(fh3Reco2->GetXaxis()->FindFixBin(eta2),fh3Reco2->GetYaxis()->FindFixBin(phi2),fh3Reco2->GetZaxis()->FindFixBin(zvert2));
1217 w1 = (1-cont1)/eps1;
1218 w2 = (1-cont2)/eps2;
1228 else if(boolSum == 4)
1231 if(pT1 > fhntReco1->GetAxis(0)->GetXmin() && pT1 < fhntReco1->GetAxis(0)->GetXmax() && pT2 > fhntReco2->GetAxis(0)->GetXmin() && pT2 < fhntReco2->GetAxis(0)->GetXmax() && eta1 > fhntReco1->GetAxis(1)->GetXmin() && eta1 <fhntReco1->GetAxis(1)->GetXmax() && eta2 > fhntReco2->GetAxis(1)->GetXmin() && eta2 < fhntReco2->GetAxis(1)->GetXmax() && phi1 > fhntReco1->GetAxis(2)->GetXmin() && phi2 < fhntReco2->GetAxis(2)->GetXmax() && phi2 > fhntReco2->GetAxis(2)->GetXmin() && phi2 < fhntReco2->GetAxis(2)->GetXmax() && zvert1 > fhntReco1->GetAxis(3)->GetXmin() && zvert1 < fhntReco1->GetAxis(3)->GetXmax() && zvert2 > fhntReco2->GetAxis(3)->GetXmin() && zvert2 < fhntReco2->GetAxis(3)->GetXmax())
1234 int tab1[] = {fhntReco1->GetAxis(0)->FindFixBin(pT1),fhntReco1->GetAxis(1)->FindFixBin(eta1),fhntReco1->GetAxis(2)->FindFixBin(phi1),fhntReco1->GetAxis(3)->FindFixBin(zvert1)};
1235 int tab2[] = {fhntReco2->GetAxis(0)->FindFixBin(pT2),fhntReco2->GetAxis(1)->FindFixBin(eta2),fhntReco2->GetAxis(2)->FindFixBin(phi2),fhntReco2->GetAxis(3)->FindFixBin(zvert2)};
1237 eps1 = fhntReco1->GetBinContent(tab1);
1238 eps2 = fhntReco2->GetBinContent(tab2);
1240 w1 = (1-cont1)/eps1;
1241 w2 = (1-cont2)/eps2;