1 // This class calculates the inclusive charged particle density
2 // in each for the 5 FMD rings.
4 #include "AliFMDDensityCalculator.h"
9 #include "AliForwardCorrectionManager.h"
17 ClassImp(AliFMDDensityCalculator)
22 //____________________________________________________________________
23 AliFMDDensityCalculator::AliFMDDensityCalculator()
46 //____________________________________________________________________
47 AliFMDDensityCalculator::AliFMDDensityCalculator(const char* title)
48 : TNamed("fmdDensityCalculator", title),
68 // name Name of object
70 fRingHistos.SetName(GetName());
71 fRingHistos.Add(new RingHistos(1, 'I'));
72 fRingHistos.Add(new RingHistos(2, 'I'));
73 fRingHistos.Add(new RingHistos(2, 'O'));
74 fRingHistos.Add(new RingHistos(3, 'I'));
75 fRingHistos.Add(new RingHistos(3, 'O'));
76 fSumOfWeights = new TH1D("sumOfWeights", "Sum of Landau weights",
78 fSumOfWeights->SetFillColor(kRed+1);
79 fSumOfWeights->SetXTitle("#sum_{i} a_{i} f_{i}(#Delta)");
80 fWeightedSum = new TH1D("weightedSum", "Weighted sum of Landau propability",
82 fWeightedSum->SetFillColor(kBlue+1);
83 fWeightedSum->SetXTitle("#sum_{i} i a_{i} f_{i}(#Delta)");
84 fCorrections = new TH1D("corrections", "Distribution of corrections",
86 fCorrections->SetFillColor(kBlue+1);
87 fCorrections->SetXTitle("correction");
89 fAccI = GenerateAcceptanceCorrection('I');
90 fAccO = GenerateAcceptanceCorrection('O');
93 //____________________________________________________________________
94 AliFMDDensityCalculator::AliFMDDensityCalculator(const
95 AliFMDDensityCalculator& o)
99 fSumOfWeights(o.fSumOfWeights),
100 fWeightedSum(o.fWeightedSum),
101 fCorrections(o.fCorrections),
102 fMaxParticles(o.fMaxParticles),
105 fFMD1iMax(o.fFMD1iMax),
106 fFMD2iMax(o.fFMD2iMax),
107 fFMD2oMax(o.fFMD2oMax),
108 fFMD3iMax(o.fFMD3iMax),
109 fFMD3oMax(o.fFMD3oMax),
116 // o Object to copy from
118 TIter next(&o.fRingHistos);
120 while ((obj = next())) fRingHistos.Add(obj);
123 //____________________________________________________________________
124 AliFMDDensityCalculator::~AliFMDDensityCalculator()
129 fRingHistos.Delete();
132 //____________________________________________________________________
133 AliFMDDensityCalculator&
134 AliFMDDensityCalculator::operator=(const AliFMDDensityCalculator& o)
137 // Assignement operator
140 // o Object to assign from
143 // Reference to this object
145 TNamed::operator=(o);
147 fMultCut = o.fMultCut;
149 fMaxParticles = o.fMaxParticles;
152 fFMD1iMax = o.fFMD1iMax;
153 fFMD2iMax = o.fFMD2iMax;
154 fFMD2oMax = o.fFMD2oMax;
155 fFMD3iMax = o.fFMD3iMax;
156 fFMD3oMax = o.fFMD3oMax;
158 fRingHistos.Delete();
159 TIter next(&o.fRingHistos);
161 while ((obj = next())) fRingHistos.Add(obj);
166 //____________________________________________________________________
168 AliFMDDensityCalculator::Init(const TAxis&)
170 // Intialize this sub-algorithm
177 //____________________________________________________________________
178 AliFMDDensityCalculator::RingHistos*
179 AliFMDDensityCalculator::GetRingHistos(UShort_t d, Char_t r) const
182 // Get the ring histogram container
189 // Ring histogram container
193 case 1: idx = 0; break;
194 case 2: idx = 1 + (r == 'I' || r == 'i' ? 0 : 1); break;
195 case 3: idx = 3 + (r == 'I' || r == 'i' ? 0 : 1); break;
197 if (idx < 0 || idx >= fRingHistos.GetEntries()) return 0;
199 return static_cast<RingHistos*>(fRingHistos.At(idx));
202 //____________________________________________________________________
204 AliFMDDensityCalculator::GetMultCut() const
207 // Get the multiplicity cut. If the user has set fMultCut (via
208 // SetMultCut) then that value is used. If not, then the lower
209 // value of the fit range for the enery loss fits is returned.
212 // Lower cut on multiplicity
214 if (fMultCut > 0) return fMultCut;
216 AliForwardCorrectionManager& fcm = AliForwardCorrectionManager::Instance();
217 AliFMDCorrELossFit* fits = fcm.GetELossFit();
218 return fits->GetLowCut();
221 //____________________________________________________________________
223 AliFMDDensityCalculator::Calculate(const AliESDFMD& fmd,
224 AliForwardUtil::Histos& hists,
229 // Do the calculations
232 // fmd AliESDFMD object (possibly) corrected for sharing
233 // hists Histogram cache
235 // lowFlux Low flux flag.
240 for (UShort_t d=1; d<=3; d++) {
241 UShort_t nr = (d == 1 ? 1 : 2);
242 for (UShort_t q=0; q<nr; q++) {
243 Char_t r = (q == 0 ? 'I' : 'O');
244 UShort_t ns= (q == 0 ? 20 : 40);
245 UShort_t nt= (q == 0 ? 512 : 256);
246 TH2D* h = hists.Get(d,r);
247 RingHistos* rh= GetRingHistos(d,r);
249 for (UShort_t s=0; s<ns; s++) {
250 for (UShort_t t=0; t<nt; t++) {
251 Float_t mult = fmd.Multiplicity(d,r,s,t);
253 if (mult == 0 || mult > 20) continue;
255 Float_t phi = fmd.Phi(d,r,s,t) / 180 * TMath::Pi();
256 Float_t eta = fmd.Eta(d,r,s,t);
258 Float_t n = NParticles(mult,d,r,s,t,vtxbin,eta,lowFlux);
259 rh->fEvsN->Fill(mult,n);
260 rh->fEtaVsN->Fill(eta, n);
262 Float_t c = Correction(d,r,s,t,vtxbin,eta,lowFlux);
263 fCorrections->Fill(c);
265 rh->fEvsM->Fill(mult,n);
266 rh->fEtaVsM->Fill(eta, n);
267 rh->fCorr->Fill(eta, c);
270 rh->fDensity->Fill(eta,phi,n);
279 //_____________________________________________________________________
281 AliFMDDensityCalculator::FindMaxWeight(AliFMDCorrELossFit* cor,
282 UShort_t d, Char_t r, Int_t iEta) const
284 AliFMDCorrELossFit::ELossFit* fit = cor->GetFit(d,r,iEta);
286 // AliWarning(Form("No energy loss fit for FMD%d%c at eta=%f", d, r, eta));
289 return fit->FindMaxWeight();
292 //_____________________________________________________________________
294 AliFMDDensityCalculator::CacheMaxWeights()
296 AliForwardCorrectionManager& fcm = AliForwardCorrectionManager::Instance();
297 AliFMDCorrELossFit* cor = fcm.GetELossFit();
298 const TAxis& eta = cor->GetEtaAxis();
300 Int_t nEta = eta.GetNbins();
307 for (Int_t i = 0; i < nEta; i++) {
308 fFMD1iMax[i] = FindMaxWeight(cor, 1, 'I', i+1);
309 fFMD2iMax[i] = FindMaxWeight(cor, 2, 'I', i+1);
310 fFMD2oMax[i] = FindMaxWeight(cor, 2, 'O', i+1);
311 fFMD3iMax[i] = FindMaxWeight(cor, 3, 'I', i+1);
312 fFMD3oMax[i] = FindMaxWeight(cor, 3, 'O', i+1);
316 //_____________________________________________________________________
318 AliFMDDensityCalculator::GetMaxWeight(UShort_t d, Char_t r, Int_t iEta) const
320 if (iEta < 0) return -1;
322 const TArrayI* max = 0;
324 case 1: max = &fFMD1iMax; break;
325 case 2: max = (r == 'I' || r == 'i' ? &fFMD2iMax : &fFMD2oMax); break;
326 case 3: max = (r == 'I' || r == 'i' ? &fFMD3iMax : &fFMD3oMax); break;
329 AliWarning(Form("No array for FMD%d%c", d, r));
333 if (iEta >= max->fN) {
334 AliWarning(Form("Eta bin %3d out of bounds [0,%d]",
339 AliDebug(30,Form("Max weight for FMD%d%c eta bin %3d: %d", d, r, iEta,
341 return max->At(iEta);
344 //_____________________________________________________________________
346 AliFMDDensityCalculator::GetMaxWeight(UShort_t d, Char_t r, Float_t eta) const
348 AliForwardCorrectionManager& fcm = AliForwardCorrectionManager::Instance();
349 Int_t iEta = fcm.GetELossFit()->FindEtaBin(eta) -1;
351 return GetMaxWeight(d, r, iEta);
354 //_____________________________________________________________________
356 AliFMDDensityCalculator::NParticles(Float_t mult,
363 Bool_t lowFlux) const
366 // Get the number of particles corresponding to the signal mult
373 // t Strip (not used)
375 // eta Pseudo-rapidity
376 // lowFlux Low-flux flag
379 // The number of particles
381 if (mult <= GetMultCut()) return 0;
382 if (lowFlux) return 1;
384 AliForwardCorrectionManager& fcm = AliForwardCorrectionManager::Instance();
385 AliFMDCorrELossFit::ELossFit* fit = fcm.GetELossFit()->FindFit(d,r,eta);
387 AliWarning(Form("No energy loss fit for FMD%d%c at eta=%f", d, r, eta));
391 Int_t m = GetMaxWeight(d,r,eta); // fit->FindMaxWeight();
393 AliWarning(Form("No good fits for FMD%d%c at eta=%f", d, r, eta));
396 UShort_t n = TMath::Min(fMaxParticles, UShort_t(m));
397 Double_t ret = fit->EvaluateWeighted(mult, n);
400 AliInfo(Form("FMD%d%c, eta=%7.4f, %8.5f -> %8.5f", d, r, eta, mult, ret));
403 fWeightedSum->Fill(ret);
404 fSumOfWeights->Fill(ret);
408 Float_t mpv = pars->GetMPV(d,r,eta);
409 Float_t w = pars->GetSigma(d,r,eta);
410 Float_t w2 = pars->Get2MIPWeight(d,r,eta);
411 Float_t w3 = pars->Get3MIPWeight(d,r,eta);
412 Float_t mpv2 = 2*mpv+2*w*TMath::Log(2);
413 Float_t mpv3 = 3*mpv+3*w*TMath::Log(3);
415 Float_t sum = (TMath::Landau(mult,mpv,w,kTRUE) +
416 w2 * TMath::Landau(mult,mpv2,2*w,kTRUE) +
417 w3 * TMath::Landau(mult,mpv3,3*w,kTRUE));
418 Float_t wsum = (TMath::Landau(mult,mpv,w,kTRUE) +
419 2*w2 * TMath::Landau(mult,mpv2,2*w,kTRUE) +
420 3*w3 * TMath::Landau(mult,mpv3,3*w,kTRUE));
422 fWeightedSum->Fill(wsum);
423 fSumOfWeights->Fill(sum);
424 return (sum > 0) ? wsum / sum : 1;
428 //_____________________________________________________________________
430 AliFMDDensityCalculator::Correction(UShort_t d,
436 Bool_t lowFlux) const
439 // Get the inverse correction factor. This consist of
441 // - acceptance correction (corners of sensors)
442 // - double hit correction (for low-flux events)
443 // - dead strip correction
449 // t Strip (not used)
451 // eta Pseudo-rapidity
452 // lowFlux Low-flux flag
457 AliForwardCorrectionManager& fcm = AliForwardCorrectionManager::Instance();
459 Float_t correction = AcceptanceCorrection(r,t);
462 if (fcm.GetDoubleHit())
463 dblHitCor = fcm.GetDoubleHit()->GetCorrection(d,r);
466 Double_t dblC = dblHitCor->GetBinContent(dblHitCor->FindBin(eta));
467 if (dblC > 0) correction *= dblC;
470 AliWarning(Form("Missing double hit correction for FMD%d%c",d,r));
475 TH1F* deadCor = pars->GetFMDDeadCorrection(v);
477 Float_t deadC = deadCor->GetBinContent(deadCor->FindBin(eta));
486 //_____________________________________________________________________
488 AliFMDDensityCalculator::GenerateAcceptanceCorrection(Char_t r) const
491 // Generate the acceptance corrections
494 // r Ring to generate for
497 // Newly allocated histogram of acceptance corrections
499 const Double_t ic1[] = { 4.9895, 15.3560 };
500 const Double_t ic2[] = { 1.8007, 17.2000 };
501 const Double_t oc1[] = { 4.2231, 26.6638 };
502 const Double_t oc2[] = { 1.8357, 27.9500 };
503 const Double_t* c1 = (r == 'I' || r == 'i' ? ic1 : oc1);
504 const Double_t* c2 = (r == 'I' || r == 'i' ? ic2 : oc2);
505 Double_t minR = (r == 'I' || r == 'i' ? 4.5213 : 15.4);
506 Double_t maxR = (r == 'I' || r == 'i' ? 17.2 : 28.0);
507 Int_t nStrips = (r == 'I' || r == 'i' ? 512 : 256);
508 Int_t nSec = (r == 'I' || r == 'i' ? 20 : 40);
509 Float_t basearc = 2 * TMath::Pi() / nSec;
510 Double_t rad = maxR - minR;
511 Float_t segment = rad / nStrips;
512 Float_t cr = TMath::Sqrt(c1[0]*c1[0]+c1[1]*c1[1]);
514 // Numbers used to find end-point of strip.
515 // (See http://mathworld.wolfram.com/Circle-LineIntersection.html)
516 Float_t D = c1[0] * c2[1] - c1[1] * c2[0];
517 Float_t dx = c2[0] - c1[0];
518 Float_t dy = c2[1] - c1[1];
519 Float_t dr = TMath::Sqrt(dx*dx+dy*dy);
521 TH1D* ret = new TH1D(Form("acc%c", r),
522 Form("Acceptance correction for FMDx%c", r),
523 nStrips, -.5, nStrips-.5);
524 ret->SetXTitle("Strip");
525 ret->SetYTitle("#varphi acceptance");
526 ret->SetDirectory(0);
527 ret->SetFillColor(r == 'I' || r == 'i' ? kRed+1 : kBlue+1);
528 ret->SetFillStyle(3001);
530 for (Int_t t = 0; t < nStrips; t++) {
531 Float_t radius = minR + t * segment;
533 // If the radius of the strip is smaller than the radius corresponding
534 // to the first corner we have a full strip length
536 ret->SetBinContent(t+1, 1);
540 // Next, we should find the end-point of the strip - that is,
541 // the coordinates where the line from c1 to c2 intersects a circle
542 // with radius given by the strip.
543 // (See http://mathworld.wolfram.com/Circle-LineIntersection.html)
544 // Calculate the determinant
545 Float_t det = radius * radius * dr * dr - D*D;
548 // <0 means No intersection
549 // =0 means Exactly tangent
550 ret->SetBinContent(t+1, 1);
554 // Calculate end-point and the corresponding opening angle
555 Float_t x = (+D * dy + dx * TMath::Sqrt(det)) / dr / dr;
556 Float_t y = (-D * dx + dy * TMath::Sqrt(det)) / dr / dr;
557 Float_t th = TMath::ATan2(x, y);
559 ret->SetBinContent(t+1, th / basearc);
564 //_____________________________________________________________________
566 AliFMDDensityCalculator::AcceptanceCorrection(Char_t r, UShort_t t) const
569 // Get the acceptance correction for strip @a t in an ring of type @a r
572 // r Ring type ('I' or 'O')
576 // Inverse acceptance correction
578 TH1D* acc = (r == 'I' || r == 'i' ? fAccI : fAccO);
579 return acc->GetBinContent(t+1);
582 const Double_t ic1[] = { 4.9895, 15.3560 };
583 const Double_t ic2[] = { 1.8007, 17.2000 };
584 const Double_t oc1[] = { 4.2231, 26.6638 };
585 const Double_t oc2[] = { 1.8357, 27.9500 };
586 const Double_t* c1 = (r == 'I' ? ic1 : oc1);
587 const Double_t* c2 = (r == 'I' ? ic2 : oc2);
588 Double_t minR = (r == 'I' ? 4.5213 : 15.4);
589 Double_t maxR = (r == 'I' ? 17.2 : 28.0);
590 Int_t nStrips = (r == 'I' ? 512 : 256);
591 Int_t nSec = (r == 'I' ? 20 : 40);
592 Float_t basearc = 2 * TMath::Pi() / nSec;
593 Double_t rad = maxR - minR;
594 Float_t segment = rad / nStrips;
595 Float_t radius = minR + t * segment;
597 // Old method - calculate full strip area and take ratio to extended
599 Float_t baselen = basearc * radius;
600 Float_t slope = (c1[1] - c2[1]) / (c1[0] - c2[0]);
601 Float_t constant = (c2[1] * c1[0] - c2[0] * c1[1]) / (c1[0]-c2[0]);
602 Float_t d = (TMath::Power(TMath::Abs(radius*slope),2) +
603 TMath::Power(radius,2) - TMath::Power(constant,2));
605 // If below corners return 1
606 if (d >= 0) return 1;
608 Float_t x = ((-TMath::Sqrt(d) - slope * constant) /
609 (1+TMath::Power(slope, 2)));
610 Float_t y = slope*x + constant;
612 // If x is larger than corner x or y less than corner y, we have full
614 if(x >= c1[0] || y <= c1[1]) return 1;
616 //One sector since theta is by definition half-hybrid
617 Float_t theta = TMath::ATan2(x,y);
618 Float_t arclen = radius * theta;
620 // Calculate the area of a strip with no cut
621 Float_t basearea1 = 0.5 * baselen * TMath::Power(radius,2);
622 Float_t basearea2 = 0.5 * baselen * TMath::Power((radius-segment),2);
623 Float_t basearea = basearea1 - basearea2;
625 // Calculate the area of a strip with cut
626 Float_t area1 = 0.5 * arclen * TMath::Power(radius,2);
627 Float_t area2 = 0.5 * arclen * TMath::Power((radius-segment),2);
628 Float_t area = area1 - area2;
630 // Acceptance is ratio
631 return area/basearea;
635 //____________________________________________________________________
637 AliFMDDensityCalculator::ScaleHistograms(TList* dir, Int_t nEvents)
640 // Scale the histograms to the total number of events
643 // dir where to put the output
644 // nEvents Number of events
646 if (nEvents <= 0) return;
647 TList* d = static_cast<TList*>(dir->FindObject(GetName()));
650 TIter next(&fRingHistos);
652 while ((o = static_cast<RingHistos*>(next())))
653 o->ScaleHistograms(d, nEvents);
656 //____________________________________________________________________
658 AliFMDDensityCalculator::DefineOutput(TList* dir)
661 // Output diagnostic histograms to directory
664 // dir List to write in
666 TList* d = new TList;
667 d->SetName(GetName());
669 d->Add(fWeightedSum);
670 d->Add(fSumOfWeights);
671 d->Add(fCorrections);
675 TIter next(&fRingHistos);
677 while ((o = static_cast<RingHistos*>(next()))) {
681 //____________________________________________________________________
683 AliFMDDensityCalculator::Print(Option_t* option) const
691 char ind[gROOT->GetDirLevel()+3];
692 for (Int_t i = 0; i < gROOT->GetDirLevel(); i++) ind[i] = ' ';
693 ind[gROOT->GetDirLevel()] = '\0';
694 std::cout << ind << "AliFMDDensityCalculator: " << GetName() << '\n'
695 << ind << " Multiplicity cut: " << fMultCut << '\n'
696 << ind << " Max(particles): " << fMaxParticles
700 if (opt.Contains("nomax")) return;
702 std::cout << ind << " Max weights:\n";
704 for (UShort_t d=1; d<=3; d++) {
705 UShort_t nr = (d == 1 ? 1 : 2);
706 for (UShort_t q=0; q<nr; q++) {
707 ind[gROOT->GetDirLevel()] = ' ';
708 ind[gROOT->GetDirLevel()+1] = '\0';
709 Char_t r = (q == 0 ? 'I' : 'O');
710 std::cout << ind << " FMD" << d << r << ":";
711 ind[gROOT->GetDirLevel()+1] = ' ';
712 ind[gROOT->GetDirLevel()+2] = '\0';
714 const TArrayI& a = (d == 1 ? fFMD1iMax :
715 (d == 2 ? (r == 'I' ? fFMD2iMax : fFMD2oMax) :
716 (r == 'I' ? fFMD3iMax : fFMD3oMax)));
718 for (Int_t i = 0; i < a.fN; i++) {
719 if (a.fArray[i] < 1) continue;
720 if (j % 6 == 0) std::cout << "\n " << ind;
722 std::cout << " " << std::setw(3) << i << ": " << a.fArray[i];
724 std::cout << std::endl;
729 //====================================================================
730 AliFMDDensityCalculator::RingHistos::RingHistos()
731 : AliForwardUtil::RingHistos(),
744 //____________________________________________________________________
745 AliFMDDensityCalculator::RingHistos::RingHistos(UShort_t d, Char_t r)
746 : AliForwardUtil::RingHistos(d,r),
761 fEvsN = new TH2D(Form("%s_Eloss_N_nocorr", fName.Data()),
762 Form("#Delta E/#Delta E_{mip} vs uncorrected inclusive "
763 "N_{ch} in %s", fName.Data()),
764 2500, -.5, 24.5, 2500, -.5, 24.5);
765 fEvsM = new TH2D(Form("%s_Eloss_N_corr", fName.Data()),
766 Form("#Delta E/#Delta E_{mip} vs corrected inclusive "
767 "N_{ch} in %s", fName.Data()),
768 2500, -.5, 24.5, 2500, -.5, 24.5);
769 fEvsN->SetXTitle("#Delta E/#Delta E_{mip}");
770 fEvsN->SetYTitle("Inclusive N_{ch} (uncorrected)");
772 fEvsN->SetDirectory(0);
773 fEvsM->SetXTitle("#Delta E/#Delta E_{mip}");
774 fEvsM->SetYTitle("Inclusive N_{ch} (corrected)");
776 fEvsM->SetDirectory(0);
778 fEtaVsN = new TProfile(Form("%s_Eta_N_nocorr", fName.Data()),
779 Form("Average inclusive N_{ch} vs #eta (uncorrected) "
780 "in %s", fName.Data()), 200, -4, 6);
781 fEtaVsM = new TProfile(Form("%s_Eta_N_corr", fName.Data()),
782 Form("Average inclusive N_{ch} vs #eta (corrected) "
783 "in %s", fName.Data()), 200, -4, 6);
784 fEtaVsN->SetXTitle("#eta");
785 fEtaVsN->SetYTitle("#LT N_{ch,incl}#GT (uncorrected)");
786 fEtaVsN->SetDirectory(0);
787 fEtaVsN->SetLineColor(Color());
788 fEtaVsN->SetFillColor(Color());
789 fEtaVsM->SetXTitle("#eta");
790 fEtaVsM->SetYTitle("#LT N_{ch,incl}#GT (corrected)");
791 fEtaVsM->SetDirectory(0);
792 fEtaVsM->SetLineColor(Color());
793 fEtaVsM->SetFillColor(Color());
796 fCorr = new TProfile(Form("%s_corr", fName.Data()),
797 Form("Average correction in %s", fName.Data()),
799 fCorr->SetXTitle("#eta");
800 fCorr->SetYTitle("#LT correction#GT");
801 fCorr->SetDirectory(0);
802 fCorr->SetLineColor(Color());
803 fCorr->SetFillColor(Color());
805 fDensity = new TH2D(Form("%s_Incl_Density", fName.Data()),
806 Form("Inclusive N_{ch} density in %s", fName.Data()),
807 200, -4, 6, (r == 'I' || r == 'i' ? 20 : 40),
809 fDensity->SetDirectory(0);
810 fDensity->SetXTitle("#eta");
811 fDensity->SetYTitle("#phi [radians]");
812 fDensity->SetZTitle("Inclusive N_{ch} density");
814 //____________________________________________________________________
815 AliFMDDensityCalculator::RingHistos::RingHistos(const RingHistos& o)
816 : AliForwardUtil::RingHistos(o),
828 // o Object to copy from
832 //____________________________________________________________________
833 AliFMDDensityCalculator::RingHistos&
834 AliFMDDensityCalculator::RingHistos::operator=(const RingHistos& o)
837 // Assignment operator
840 // o Object to assign from
845 AliForwardUtil::RingHistos::operator=(o);
847 if (fEvsN) delete fEvsN;
848 if (fEvsM) delete fEvsM;
849 if (fEtaVsN) delete fEtaVsN;
850 if (fEtaVsM) delete fEtaVsM;
851 if (fCorr) delete fCorr;
852 if (fDensity) delete fDensity;
854 fEvsN = static_cast<TH2D*>(o.fEvsN->Clone());
855 fEvsM = static_cast<TH2D*>(o.fEvsM->Clone());
856 fEtaVsN = static_cast<TProfile*>(o.fEtaVsN->Clone());
857 fEtaVsM = static_cast<TProfile*>(o.fEtaVsM->Clone());
858 fCorr = static_cast<TProfile*>(o.fCorr->Clone());
859 fDensity = static_cast<TH2D*>(o.fDensity->Clone());
863 //____________________________________________________________________
864 AliFMDDensityCalculator::RingHistos::~RingHistos()
869 if (fEvsN) delete fEvsN;
870 if (fEvsM) delete fEvsM;
871 if (fEtaVsN) delete fEtaVsN;
872 if (fEtaVsM) delete fEtaVsM;
873 if (fCorr) delete fCorr;
874 if (fDensity) delete fDensity;
877 //____________________________________________________________________
879 AliFMDDensityCalculator::RingHistos::Output(TList* dir)
885 // dir Where to put it
887 TList* d = DefineOutputList(dir);
896 //____________________________________________________________________
898 AliFMDDensityCalculator::RingHistos::ScaleHistograms(TList* dir, Int_t nEvents)
901 // Scale the histograms to the total number of events
904 // dir Where the output is
905 // nEvents Number of events
907 TList* l = GetOutputList(dir);
910 TH1* density = GetOutputHist(l,Form("%s_Incl_Density", fName.Data()));
911 if (density) density->Scale(1./nEvents);
914 //____________________________________________________________________