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"
10 #include "AliFMDCorrDoubleHit.h"
11 #include "AliFMDCorrELossFit.h"
19 ClassImp(AliFMDDensityCalculator)
24 //____________________________________________________________________
25 AliFMDDensityCalculator::AliFMDDensityCalculator()
49 //____________________________________________________________________
50 AliFMDDensityCalculator::AliFMDDensityCalculator(const char* title)
51 : TNamed("fmdDensityCalculator", title),
72 // name Name of object
74 fRingHistos.SetName(GetName());
75 fRingHistos.Add(new RingHistos(1, 'I'));
76 fRingHistos.Add(new RingHistos(2, 'I'));
77 fRingHistos.Add(new RingHistos(2, 'O'));
78 fRingHistos.Add(new RingHistos(3, 'I'));
79 fRingHistos.Add(new RingHistos(3, 'O'));
80 fSumOfWeights = new TH1D("sumOfWeights", "Sum of Landau weights",
82 fSumOfWeights->SetFillColor(kRed+1);
83 fSumOfWeights->SetXTitle("#sum_{i} a_{i} f_{i}(#Delta)");
84 fWeightedSum = new TH1D("weightedSum", "Weighted sum of Landau propability",
86 fWeightedSum->SetFillColor(kBlue+1);
87 fWeightedSum->SetXTitle("#sum_{i} i a_{i} f_{i}(#Delta)");
88 fCorrections = new TH1D("corrections", "Distribution of corrections",
90 fCorrections->SetFillColor(kBlue+1);
91 fCorrections->SetXTitle("correction");
93 fAccI = GenerateAcceptanceCorrection('I');
94 fAccO = GenerateAcceptanceCorrection('O');
97 //____________________________________________________________________
98 AliFMDDensityCalculator::AliFMDDensityCalculator(const
99 AliFMDDensityCalculator& o)
102 fMultCut(o.fMultCut),
103 fSumOfWeights(o.fSumOfWeights),
104 fWeightedSum(o.fWeightedSum),
105 fCorrections(o.fCorrections),
106 fMaxParticles(o.fMaxParticles),
107 fUsePoisson(o.fUsePoisson),
110 fFMD1iMax(o.fFMD1iMax),
111 fFMD2iMax(o.fFMD2iMax),
112 fFMD2oMax(o.fFMD2oMax),
113 fFMD3iMax(o.fFMD3iMax),
114 fFMD3oMax(o.fFMD3oMax),
121 // o Object to copy from
123 TIter next(&o.fRingHistos);
125 while ((obj = next())) fRingHistos.Add(obj);
128 //____________________________________________________________________
129 AliFMDDensityCalculator::~AliFMDDensityCalculator()
134 fRingHistos.Delete();
137 //____________________________________________________________________
138 AliFMDDensityCalculator&
139 AliFMDDensityCalculator::operator=(const AliFMDDensityCalculator& o)
142 // Assignement operator
145 // o Object to assign from
148 // Reference to this object
150 TNamed::operator=(o);
152 fMultCut = o.fMultCut;
154 fMaxParticles = o.fMaxParticles;
155 fUsePoisson = o.fUsePoisson;
158 fFMD1iMax = o.fFMD1iMax;
159 fFMD2iMax = o.fFMD2iMax;
160 fFMD2oMax = o.fFMD2oMax;
161 fFMD3iMax = o.fFMD3iMax;
162 fFMD3oMax = o.fFMD3oMax;
164 fRingHistos.Delete();
165 TIter next(&o.fRingHistos);
167 while ((obj = next())) fRingHistos.Add(obj);
172 //____________________________________________________________________
174 AliFMDDensityCalculator::Init(const TAxis& axis)
176 // Intialize this sub-algorithm
182 TIter next(&fRingHistos);
184 while ((o = static_cast<RingHistos*>(next())))
188 //____________________________________________________________________
189 AliFMDDensityCalculator::RingHistos*
190 AliFMDDensityCalculator::GetRingHistos(UShort_t d, Char_t r) const
193 // Get the ring histogram container
200 // Ring histogram container
204 case 1: idx = 0; break;
205 case 2: idx = 1 + (r == 'I' || r == 'i' ? 0 : 1); break;
206 case 3: idx = 3 + (r == 'I' || r == 'i' ? 0 : 1); break;
208 if (idx < 0 || idx >= fRingHistos.GetEntries()) return 0;
210 return static_cast<RingHistos*>(fRingHistos.At(idx));
213 //____________________________________________________________________
215 AliFMDDensityCalculator::GetMultCut() const
218 // Get the multiplicity cut. If the user has set fMultCut (via
219 // SetMultCut) then that value is used. If not, then the lower
220 // value of the fit range for the enery loss fits is returned.
223 // Lower cut on multiplicity
225 if (fMultCut > 0) return fMultCut;
227 AliForwardCorrectionManager& fcm = AliForwardCorrectionManager::Instance();
228 AliFMDCorrELossFit* fits = fcm.GetELossFit();
229 return fits->GetLowCut();
232 //____________________________________________________________________
234 AliFMDDensityCalculator::Calculate(const AliESDFMD& fmd,
235 AliForwardUtil::Histos& hists,
240 // Do the calculations
243 // fmd AliESDFMD object (possibly) corrected for sharing
244 // hists Histogram cache
246 // lowFlux Low flux flag.
251 for (UShort_t d=1; d<=3; d++) {
252 UShort_t nr = (d == 1 ? 1 : 2);
253 for (UShort_t q=0; q<nr; q++) {
254 Char_t r = (q == 0 ? 'I' : 'O');
255 UShort_t ns= (q == 0 ? 20 : 40);
256 UShort_t nt= (q == 0 ? 512 : 256);
257 TH2D* h = hists.Get(d,r);
258 RingHistos* rh= GetRingHistos(d,r);
259 rh->fEmptyStrips->Reset();
260 rh->fTotalStrips->Reset();
261 rh->fBasicHits->Reset();
263 for (UShort_t s=0; s<ns; s++) {
264 for (UShort_t t=0; t<nt; t++) {
265 Float_t mult = fmd.Multiplicity(d,r,s,t);
266 Float_t phi = fmd.Phi(d,r,s,t) / 180 * TMath::Pi();
267 Float_t eta = fmd.Eta(d,r,s,t);
268 rh->fTotalStrips->Fill(eta, phi);
269 if (mult < GetMultCut() || mult > 20) rh->fEmptyStrips->Fill(eta,phi);
270 if (mult == AliESDFMD::kInvalidMult || mult > 20) continue;
273 // rh->fEmptyStrips->Fill(eta,phi);
277 Float_t n = NParticles(mult,d,r,s,t,vtxbin,eta,lowFlux);
279 rh->fEvsN->Fill(mult,n);
280 rh->fEtaVsN->Fill(eta, n);
282 Float_t c = Correction(d,r,s,t,vtxbin,eta,lowFlux);
283 fCorrections->Fill(c);
285 rh->fEvsM->Fill(mult,n);
286 rh->fEtaVsM->Fill(eta, n);
287 rh->fCorr->Fill(eta, c);
289 //if (n < .9) rh->fEmptyStrips->Fill(eta,phi);
290 if (n > 0.9) rh->fBasicHits->Fill(eta,phi);
293 rh->fDensity->Fill(eta,phi,n);
296 //std::cout<<rh->fTotalStrips->GetEntries()<<" "<<rh->fEmptyStrips->GetEntries()<<std::endl;
297 // Loop over poisson histograms
298 for (Int_t ieta = 1; ieta <= h->GetNbinsX(); ieta++) {
299 for (Int_t iphi = 1; iphi <= h->GetNbinsY(); iphi++) {
300 Double_t eLossV = h->GetBinContent(ieta, iphi);
301 // Double_t eLossE = h->GetBinError(ieta, iphi);
302 Float_t eta = h->GetXaxis()->GetBinCenter(ieta);
303 Float_t phi = h->GetYaxis()->GetBinCenter(iphi);
304 Double_t empty = rh->fEmptyStrips->GetBinContent(rh->fEmptyStrips->GetXaxis()->FindBin(eta),
305 rh->fEmptyStrips->GetYaxis()->FindBin(phi)) ;
306 Double_t total = rh->fTotalStrips->GetBinContent(rh->fTotalStrips->GetXaxis()->FindBin(eta),
307 rh->fTotalStrips->GetYaxis()->FindBin(phi));
309 Double_t corr = rh->fCorr->GetBinContent(rh->fCorr->GetXaxis()->FindBin(eta));
312 Double_t hits = rh->fBasicHits->GetBinContent(ieta,iphi);
314 Double_t poissonV = (total <= 0 || empty <= 0 ? 0 :
315 -TMath::Log(empty / total));
317 poissonV = (hits * poissonV) / (1 - TMath::Exp(-1*poissonV));
319 poissonV = poissonV / corr;
323 // std::cout<<"event : "<<total<<" "<<empty<<" "<<hits<<" "<<poissonV<<" "<<eLossV<<std::endl;
324 Double_t poissonE = 0 ;
325 if(poissonE > 0) poissonE = TMath::Sqrt(poissonV);
329 rh->fELossVsPoisson->Fill(eLossV, poissonV);
330 rh->fEmptyVsTotal->Fill(total, empty);
332 h->SetBinContent(ieta,iphi,poissonV);
333 h->SetBinError(ieta,iphi,poissonE);
344 //_____________________________________________________________________
346 AliFMDDensityCalculator::FindMaxWeight(const AliFMDCorrELossFit* cor,
347 UShort_t d, Char_t r, Int_t iEta) const
350 // Find the max weight to use for FMD<i>dr</i> in eta bin @a iEta
358 AliFMDCorrELossFit::ELossFit* fit = cor->GetFit(d,r,iEta);
360 // AliWarning(Form("No energy loss fit for FMD%d%c at eta=%f", d, r, eta));
363 return fit->FindMaxWeight();
366 //_____________________________________________________________________
368 AliFMDDensityCalculator::CacheMaxWeights()
371 // Find the max weights and cache them
373 AliForwardCorrectionManager& fcm = AliForwardCorrectionManager::Instance();
374 AliFMDCorrELossFit* cor = fcm.GetELossFit();
375 const TAxis& eta = cor->GetEtaAxis();
377 Int_t nEta = eta.GetNbins();
384 for (Int_t i = 0; i < nEta; i++) {
385 fFMD1iMax[i] = FindMaxWeight(cor, 1, 'I', i+1);
386 fFMD2iMax[i] = FindMaxWeight(cor, 2, 'I', i+1);
387 fFMD2oMax[i] = FindMaxWeight(cor, 2, 'O', i+1);
388 fFMD3iMax[i] = FindMaxWeight(cor, 3, 'I', i+1);
389 fFMD3oMax[i] = FindMaxWeight(cor, 3, 'O', i+1);
393 //_____________________________________________________________________
395 AliFMDDensityCalculator::GetMaxWeight(UShort_t d, Char_t r, Int_t iEta) const
398 // Find the (cached) maximum weight for FMD<i>dr</i> in
399 // @f$\eta@f$ bin @a iEta
407 // max weight or <= 0 in case of problems
409 if (iEta < 0) return -1;
411 const TArrayI* max = 0;
413 case 1: max = &fFMD1iMax; break;
414 case 2: max = (r == 'I' || r == 'i' ? &fFMD2iMax : &fFMD2oMax); break;
415 case 3: max = (r == 'I' || r == 'i' ? &fFMD3iMax : &fFMD3oMax); break;
418 AliWarning(Form("No array for FMD%d%c", d, r));
422 if (iEta >= max->fN) {
423 AliWarning(Form("Eta bin %3d out of bounds [0,%d]",
428 AliDebug(30,Form("Max weight for FMD%d%c eta bin %3d: %d", d, r, iEta,
430 return max->At(iEta);
433 //_____________________________________________________________________
435 AliFMDDensityCalculator::GetMaxWeight(UShort_t d, Char_t r, Float_t eta) const
438 // Find the (cached) maximum weight for FMD<i>dr</i> iat
447 // max weight or <= 0 in case of problems
449 AliForwardCorrectionManager& fcm = AliForwardCorrectionManager::Instance();
450 Int_t iEta = fcm.GetELossFit()->FindEtaBin(eta) -1;
452 return GetMaxWeight(d, r, iEta);
455 //_____________________________________________________________________
457 AliFMDDensityCalculator::NParticles(Float_t mult,
464 Bool_t lowFlux) const
467 // Get the number of particles corresponding to the signal mult
474 // t Strip (not used)
476 // eta Pseudo-rapidity
477 // lowFlux Low-flux flag
480 // The number of particles
482 if (mult <= GetMultCut()) return 0;
483 if (lowFlux) return 1;
485 AliForwardCorrectionManager& fcm = AliForwardCorrectionManager::Instance();
486 AliFMDCorrELossFit::ELossFit* fit = fcm.GetELossFit()->FindFit(d,r,eta);
488 AliWarning(Form("No energy loss fit for FMD%d%c at eta=%f", d, r, eta));
492 Int_t m = GetMaxWeight(d,r,eta); // fit->FindMaxWeight();
494 AliWarning(Form("No good fits for FMD%d%c at eta=%f", d, r, eta));
497 UShort_t n = TMath::Min(fMaxParticles, UShort_t(m));
498 Double_t ret = fit->EvaluateWeighted(mult, n);
501 AliInfo(Form("FMD%d%c, eta=%7.4f, %8.5f -> %8.5f", d, r, eta, mult, ret));
504 fWeightedSum->Fill(ret);
505 fSumOfWeights->Fill(ret);
510 //_____________________________________________________________________
512 AliFMDDensityCalculator::Correction(UShort_t d,
518 Bool_t lowFlux) const
521 // Get the inverse correction factor. This consist of
523 // - acceptance correction (corners of sensors)
524 // - double hit correction (for low-flux events)
525 // - dead strip correction
531 // t Strip (not used)
533 // eta Pseudo-rapidity
534 // lowFlux Low-flux flag
539 AliForwardCorrectionManager& fcm = AliForwardCorrectionManager::Instance();
541 Float_t correction = AcceptanceCorrection(r,t);
544 if (fcm.GetDoubleHit())
545 dblHitCor = fcm.GetDoubleHit()->GetCorrection(d,r);
548 Double_t dblC = dblHitCor->GetBinContent(dblHitCor->FindBin(eta));
549 if (dblC > 0) correction *= dblC;
552 AliWarning(Form("Missing double hit correction for FMD%d%c",d,r));
558 //_____________________________________________________________________
560 AliFMDDensityCalculator::GenerateAcceptanceCorrection(Char_t r) const
563 // Generate the acceptance corrections
566 // r Ring to generate for
569 // Newly allocated histogram of acceptance corrections
571 const Double_t ic1[] = { 4.9895, 15.3560 };
572 const Double_t ic2[] = { 1.8007, 17.2000 };
573 const Double_t oc1[] = { 4.2231, 26.6638 };
574 const Double_t oc2[] = { 1.8357, 27.9500 };
575 const Double_t* c1 = (r == 'I' || r == 'i' ? ic1 : oc1);
576 const Double_t* c2 = (r == 'I' || r == 'i' ? ic2 : oc2);
577 Double_t minR = (r == 'I' || r == 'i' ? 4.5213 : 15.4);
578 Double_t maxR = (r == 'I' || r == 'i' ? 17.2 : 28.0);
579 Int_t nStrips = (r == 'I' || r == 'i' ? 512 : 256);
580 Int_t nSec = (r == 'I' || r == 'i' ? 20 : 40);
581 Float_t basearc = 2 * TMath::Pi() / nSec;
582 Double_t rad = maxR - minR;
583 Float_t segment = rad / nStrips;
584 Float_t cr = TMath::Sqrt(c1[0]*c1[0]+c1[1]*c1[1]);
586 // Numbers used to find end-point of strip.
587 // (See http://mathworld.wolfram.com/Circle-LineIntersection.html)
588 Float_t D = c1[0] * c2[1] - c1[1] * c2[0];
589 Float_t dx = c2[0] - c1[0];
590 Float_t dy = c2[1] - c1[1];
591 Float_t dr = TMath::Sqrt(dx*dx+dy*dy);
593 TH1D* ret = new TH1D(Form("acc%c", r),
594 Form("Acceptance correction for FMDx%c", r),
595 nStrips, -.5, nStrips-.5);
596 ret->SetXTitle("Strip");
597 ret->SetYTitle("#varphi acceptance");
598 ret->SetDirectory(0);
599 ret->SetFillColor(r == 'I' || r == 'i' ? kRed+1 : kBlue+1);
600 ret->SetFillStyle(3001);
602 for (Int_t t = 0; t < nStrips; t++) {
603 Float_t radius = minR + t * segment;
605 // If the radius of the strip is smaller than the radius corresponding
606 // to the first corner we have a full strip length
608 ret->SetBinContent(t+1, 1);
612 // Next, we should find the end-point of the strip - that is,
613 // the coordinates where the line from c1 to c2 intersects a circle
614 // with radius given by the strip.
615 // (See http://mathworld.wolfram.com/Circle-LineIntersection.html)
616 // Calculate the determinant
617 Float_t det = radius * radius * dr * dr - D*D;
620 // <0 means No intersection
621 // =0 means Exactly tangent
622 ret->SetBinContent(t+1, 1);
626 // Calculate end-point and the corresponding opening angle
627 Float_t x = (+D * dy + dx * TMath::Sqrt(det)) / dr / dr;
628 Float_t y = (-D * dx + dy * TMath::Sqrt(det)) / dr / dr;
629 Float_t th = TMath::ATan2(x, y);
631 ret->SetBinContent(t+1, th / basearc);
636 //_____________________________________________________________________
638 AliFMDDensityCalculator::AcceptanceCorrection(Char_t r, UShort_t t) const
641 // Get the acceptance correction for strip @a t in an ring of type @a r
644 // r Ring type ('I' or 'O')
648 // Inverse acceptance correction
650 TH1D* acc = (r == 'I' || r == 'i' ? fAccI : fAccO);
651 return acc->GetBinContent(t+1);
654 //____________________________________________________________________
656 AliFMDDensityCalculator::ScaleHistograms(const TList* dir, Int_t nEvents)
659 // Scale the histograms to the total number of events
662 // dir where to put the output
663 // nEvents Number of events
665 if (nEvents <= 0) return;
666 TList* d = static_cast<TList*>(dir->FindObject(GetName()));
669 TIter next(&fRingHistos);
671 while ((o = static_cast<RingHistos*>(next())))
672 o->ScaleHistograms(d, nEvents);
675 //____________________________________________________________________
677 AliFMDDensityCalculator::DefineOutput(TList* dir)
680 // Output diagnostic histograms to directory
683 // dir List to write in
685 TList* d = new TList;
686 d->SetName(GetName());
688 d->Add(fWeightedSum);
689 d->Add(fSumOfWeights);
690 d->Add(fCorrections);
694 TIter next(&fRingHistos);
696 while ((o = static_cast<RingHistos*>(next()))) {
700 //____________________________________________________________________
702 AliFMDDensityCalculator::Print(Option_t* option) const
710 char ind[gROOT->GetDirLevel()+3];
711 for (Int_t i = 0; i < gROOT->GetDirLevel(); i++) ind[i] = ' ';
712 ind[gROOT->GetDirLevel()] = '\0';
713 std::cout << ind << "AliFMDDensityCalculator: " << GetName() << '\n'
714 << ind << " Multiplicity cut: " << fMultCut << '\n'
715 << ind << " Max(particles): " << fMaxParticles
719 if (opt.Contains("nomax")) return;
721 std::cout << ind << " Max weights:\n";
723 for (UShort_t d=1; d<=3; d++) {
724 UShort_t nr = (d == 1 ? 1 : 2);
725 for (UShort_t q=0; q<nr; q++) {
726 ind[gROOT->GetDirLevel()] = ' ';
727 ind[gROOT->GetDirLevel()+1] = '\0';
728 Char_t r = (q == 0 ? 'I' : 'O');
729 std::cout << ind << " FMD" << d << r << ":";
730 ind[gROOT->GetDirLevel()+1] = ' ';
731 ind[gROOT->GetDirLevel()+2] = '\0';
733 const TArrayI& a = (d == 1 ? fFMD1iMax :
734 (d == 2 ? (r == 'I' ? fFMD2iMax : fFMD2oMax) :
735 (r == 'I' ? fFMD3iMax : fFMD3oMax)));
737 for (Int_t i = 0; i < a.fN; i++) {
738 if (a.fArray[i] < 1) continue;
739 if (j % 6 == 0) std::cout << "\n " << ind;
741 std::cout << " " << std::setw(3) << i << ": " << a.fArray[i];
743 std::cout << std::endl;
748 //====================================================================
749 AliFMDDensityCalculator::RingHistos::RingHistos()
750 : AliForwardUtil::RingHistos(),
768 //____________________________________________________________________
769 AliFMDDensityCalculator::RingHistos::RingHistos(UShort_t d, Char_t r)
770 : AliForwardUtil::RingHistos(d,r),
790 fEvsN = new TH2D(Form("%s_Eloss_N_nocorr", fName.Data()),
791 Form("#Delta E/#Delta E_{mip} vs uncorrected inclusive "
792 "N_{ch} in %s", fName.Data()),
793 2500, -.5, 24.5, 2500, -.5, 24.5);
794 fEvsM = new TH2D(Form("%s_Eloss_N_corr", fName.Data()),
795 Form("#Delta E/#Delta E_{mip} vs corrected inclusive "
796 "N_{ch} in %s", fName.Data()),
797 2500, -.5, 24.5, 2500, -.5, 24.5);
798 fEvsN->SetXTitle("#Delta E/#Delta E_{mip}");
799 fEvsN->SetYTitle("Inclusive N_{ch} (uncorrected)");
801 fEvsN->SetDirectory(0);
802 fEvsM->SetXTitle("#Delta E/#Delta E_{mip}");
803 fEvsM->SetYTitle("Inclusive N_{ch} (corrected)");
805 fEvsM->SetDirectory(0);
807 fEtaVsN = new TProfile(Form("%s_Eta_N_nocorr", fName.Data()),
808 Form("Average inclusive N_{ch} vs #eta (uncorrected) "
809 "in %s", fName.Data()), 200, -4, 6);
810 fEtaVsM = new TProfile(Form("%s_Eta_N_corr", fName.Data()),
811 Form("Average inclusive N_{ch} vs #eta (corrected) "
812 "in %s", fName.Data()), 200, -4, 6);
813 fEtaVsN->SetXTitle("#eta");
814 fEtaVsN->SetYTitle("#LT N_{ch,incl}#GT (uncorrected)");
815 fEtaVsN->SetDirectory(0);
816 fEtaVsN->SetLineColor(Color());
817 fEtaVsN->SetFillColor(Color());
818 fEtaVsM->SetXTitle("#eta");
819 fEtaVsM->SetYTitle("#LT N_{ch,incl}#GT (corrected)");
820 fEtaVsM->SetDirectory(0);
821 fEtaVsM->SetLineColor(Color());
822 fEtaVsM->SetFillColor(Color());
825 fCorr = new TProfile(Form("%s_corr", fName.Data()),
826 Form("Average correction in %s", fName.Data()),
828 fCorr->SetXTitle("#eta");
829 fCorr->SetYTitle("#LT correction#GT");
830 fCorr->SetDirectory(0);
831 fCorr->SetLineColor(Color());
832 fCorr->SetFillColor(Color());
834 fDensity = new TH2D(Form("%s_Incl_Density", fName.Data()),
835 Form("Inclusive N_{ch} density in %s", fName.Data()),
836 200, -4, 6, (r == 'I' || r == 'i' ? 20 : 40),
838 fDensity->SetDirectory(0);
839 fDensity->SetXTitle("#eta");
840 fDensity->SetYTitle("#phi [radians]");
841 fDensity->SetZTitle("Inclusive N_{ch} density");
843 fELossVsPoisson = new TH2D(Form("%s_eloss_vs_poisson", fName.Data()),
844 Form("N_{ch} from energy loss vs from Poission %s",
845 fName.Data()), 100, 0, 20, 100, 0, 20);
846 fELossVsPoisson->SetDirectory(0);
847 fELossVsPoisson->SetXTitle("N_{ch} from #DeltaE");
848 fELossVsPoisson->SetYTitle("N_{ch} from Poisson");
849 fELossVsPoisson->SetZTitle("Correlation");
851 fEmptyVsTotal = new TH2D(Form("%s_empty_vs_total", fName.Data()),
852 Form("# of empty strips vs. total @ # strips in %s",
853 fName.Data()), 21, -.5, 20.5, 21, -0.5, 20.5);
854 fEmptyVsTotal->SetDirectory(0);
855 fEmptyVsTotal->SetXTitle("Total # strips");
856 fEmptyVsTotal->SetYTitle("Empty # strips");
857 fEmptyVsTotal->SetZTitle("Correlation");
860 fTotalStrips = new TH2D(Form("total%s", fName.Data()),
861 Form("Total number of strips in %s", fName.Data()),
865 (fRing == 'I' || fRing == 'i' ? 5 : 10),
867 fEmptyStrips = new TH2D(Form("empty%s", fName.Data()),
868 Form("Empty number of strips in %s", fName.Data()),
872 (fRing == 'I' || fRing == 'i' ? 5 : 10),
874 fBasicHits = new TH2D(Form("basichits%s", fName.Data()),
875 Form("Basic number of hits in %s", fName.Data()),
879 (fRing == 'I' || fRing == 'i' ? 20 : 40),
882 fTotalStrips->SetDirectory(0);
883 fEmptyStrips->SetDirectory(0);
884 fBasicHits->SetDirectory(0);
885 fTotalStrips->SetXTitle("#eta");
886 fEmptyStrips->SetXTitle("#eta");
887 fBasicHits->SetXTitle("#eta");
888 fTotalStrips->SetYTitle("#varphi [radians]");
889 fEmptyStrips->SetYTitle("#varphi [radians]");
890 fBasicHits->SetYTitle("#varphi [radians]");
891 fTotalStrips->Sumw2();
892 fEmptyStrips->Sumw2();
896 //____________________________________________________________________
897 AliFMDDensityCalculator::RingHistos::RingHistos(const RingHistos& o)
898 : AliForwardUtil::RingHistos(o),
904 fDensity(o.fDensity),
905 fELossVsPoisson(o.fELossVsPoisson),
906 fTotalStrips(o.fTotalStrips),
907 fEmptyStrips(o.fEmptyStrips),
908 fBasicHits(o.fBasicHits),
909 fEmptyVsTotal(o.fEmptyVsTotal)
915 // o Object to copy from
919 //____________________________________________________________________
920 AliFMDDensityCalculator::RingHistos&
921 AliFMDDensityCalculator::RingHistos::operator=(const RingHistos& o)
924 // Assignment operator
927 // o Object to assign from
932 AliForwardUtil::RingHistos::operator=(o);
934 if (fEvsN) delete fEvsN;
935 if (fEvsM) delete fEvsM;
936 if (fEtaVsN) delete fEtaVsN;
937 if (fEtaVsM) delete fEtaVsM;
938 if (fCorr) delete fCorr;
939 if (fDensity) delete fDensity;
940 if (fELossVsPoisson) delete fELossVsPoisson;
941 if (fTotalStrips) delete fTotalStrips;
942 if (fEmptyStrips) delete fEmptyStrips;
944 fEvsN = static_cast<TH2D*>(o.fEvsN->Clone());
945 fEvsM = static_cast<TH2D*>(o.fEvsM->Clone());
946 fEtaVsN = static_cast<TProfile*>(o.fEtaVsN->Clone());
947 fEtaVsM = static_cast<TProfile*>(o.fEtaVsM->Clone());
948 fCorr = static_cast<TProfile*>(o.fCorr->Clone());
949 fDensity = static_cast<TH2D*>(o.fDensity->Clone());
950 fELossVsPoisson = static_cast<TH2D*>(o.fELossVsPoisson);
951 fTotalStrips = static_cast<TH2D*>(o.fTotalStrips);
952 fEmptyStrips = static_cast<TH2D*>(o.fEmptyStrips);
956 //____________________________________________________________________
957 AliFMDDensityCalculator::RingHistos::~RingHistos()
962 if (fEvsN) delete fEvsN;
963 if (fEvsM) delete fEvsM;
964 if (fEtaVsN) delete fEtaVsN;
965 if (fEtaVsM) delete fEtaVsM;
966 if (fCorr) delete fCorr;
967 if (fDensity) delete fDensity;
968 if (fELossVsPoisson) delete fELossVsPoisson;
969 if (fTotalStrips) delete fTotalStrips;
970 if (fEmptyStrips) delete fEmptyStrips;
973 //____________________________________________________________________
975 AliFMDDensityCalculator::RingHistos::Init(const TAxis& /*eAxis*/)
977 /*if (fTotalStrips) delete fTotalStrips;
978 if (fEmptyStrips) delete fEmptyStrips;
979 if (fBasicHits) delete fBasicHits;
981 fTotalStrips = new TH2D(Form("total%s", fName.Data()),
982 Form("Total number of strips in %s", fName.Data()),
986 (fRing == 'I' || fRing == 'i' ? 5 : 5),
988 fEmptyStrips = new TH2D(Form("empty%s", fName.Data()),
989 Form("Empty number of strips in %s", fName.Data()),
993 (fRing == 'I' || fRing == 'i' ? 5 : 10),
995 fBasicHits = new TH2D(Form("basichits%s", fName.Data()),
996 Form("Basic number of hits in %s", fName.Data()),
1000 (fRing == 'I' || fRing == 'i' ? 20 : 40),
1003 fTotalStrips->SetDirectory(0);
1004 fEmptyStrips->SetDirectory(0);
1005 fBasicHits->SetDirectory(0);
1006 fTotalStrips->SetXTitle("#eta");
1007 fEmptyStrips->SetXTitle("#eta");
1008 fBasicHits->SetXTitle("#eta");
1009 fTotalStrips->SetYTitle("#varphi [radians]");
1010 fEmptyStrips->SetYTitle("#varphi [radians]");
1011 fBasicHits->SetYTitle("#varphi [radians]");
1012 fTotalStrips->Sumw2();
1013 fEmptyStrips->Sumw2();
1014 fBasicHits->Sumw2();*/
1017 //____________________________________________________________________
1019 AliFMDDensityCalculator::RingHistos::Output(TList* dir)
1025 // dir Where to put it
1027 TList* d = DefineOutputList(dir);
1034 d->Add(fELossVsPoisson);
1035 d->Add(fEmptyVsTotal);
1036 d->Add(fTotalStrips);
1037 d->Add(fEmptyStrips);
1043 //____________________________________________________________________
1045 AliFMDDensityCalculator::RingHistos::ScaleHistograms(TList* dir, Int_t nEvents)
1048 // Scale the histograms to the total number of events
1051 // dir Where the output is
1052 // nEvents Number of events
1054 TList* l = GetOutputList(dir);
1057 TH1* density = GetOutputHist(l,Form("%s_Incl_Density", fName.Data()));
1058 if (density) density->Scale(1./nEvents);
1061 //____________________________________________________________________