- //-------------------------------------------------------------
- //
- // Here starts poisson method
- //
- // Calculate eta step per strip, number of eta steps, number of
- // phi steps, and check the sign of the eta increment
- Float_t stripEta = (Float_t(r->GetNStrips()) / (etaIn - etaOut));
- Int_t nEta = Int_t(TMath::Abs(etaIn - etaOut) / fDeltaEta);
- Int_t nPhi = Int_t(360. / fDeltaPhi);
- Float_t sign = TMath::Sign(Float_t(1.), etaIn);
-
- AliDebug(10, Form("FMD%d%c Eta range: %f, %f %d Phi steps",
- sub->GetId(), r->GetId(), etaOut, etaIn, nPhi));
-
- // Loop over relevant phi values
- for (Int_t p = 0; p < nPhi; p++) {
- Float_t minPhi = p * fDeltaPhi;
- Float_t maxPhi = minPhi + fDeltaPhi;
- UShort_t minSector = UShort_t(minPhi / 360) * r->GetNSectors();
- UShort_t maxSector = UShort_t(maxPhi / 360) * r->GetNSectors();
-
- AliDebug(10, Form(" Now in phi range %f, %f (sectors %d,%d)",
- minPhi, maxPhi, minSector, maxSector));
- // Loop over relevant eta values
- for (Int_t e = nEta; e >= 0; --e) {
- Float_t maxEta = etaIn - sign * e * fDeltaEta;
- Float_t minEta = maxEta - sign * fDeltaEta;
- if (sign > 0) minEta = TMath::Max(minEta, etaOut);
- else minEta = TMath::Min(minEta, etaOut);
- Float_t theta1 = 2 * TMath::ATan(TMath::Exp(-minEta));
- Float_t theta2 = 2 * TMath::ATan(TMath::Exp(-maxEta));
- Float_t minR = TMath::Abs(realZ * TMath::Tan(theta2));
- Float_t maxR = TMath::Abs(realZ * TMath::Tan(theta1));
- UShort_t minStrip = UShort_t((etaIn - maxEta) * stripEta + 0.5);
- UShort_t maxStrip = UShort_t((etaIn - minEta) * stripEta + 0.5);
-
- AliDebug(10, Form(" Now in eta range %f, %f (strips %d, %d)\n"
- " [radii %f, %f, thetas %f, %f, sign %d]",
- minEta, maxEta, minStrip, maxStrip,
- minR, maxR, theta1, theta2, sign));
-
- // Count number of empty strips
- Int_t emptyStrips = 0;
- for (Int_t sector = minSector; sector < maxSector; sector++)
- for (Int_t strip = minStrip; strip < maxStrip; strip++) emptyStrips++;
- // if (fAdcs(sub->GetId() - 1, r->GetId(), sector, strip)
- // < fThreshold) emptyStrips++;
-
- // The total number of strips
- Float_t nTotal = (maxSector - minSector) * (maxStrip - minStrip);
-
- // Log ratio of empty to total number of strips
- AliDebug(10, Form("Lambda= %d / %d = %f",
- emptyStrips, nTotal,
- Float_t(emptyStrips) / nTotal));
-
- Double_t lambda = (emptyStrips > 0 ?
- - TMath::Log(Double_t(emptyStrips) / nTotal) :
- 1);
-
- // The reconstructed number of particles is then given by
- Int_t reconstructed = Int_t(lambda * nTotal + 0.5);
-
- // Add a AliFMDParticles to the reconstruction tree.
- new((*fParticles)[nRecon])
- AliFMDParticles(sub->GetId(), r->GetId(),
- minSector, maxSector, minStrip, maxStrip,
- minEta, maxEta, minPhi, maxPhi,
- reconstructed, AliFMDParticles::kPoission);
- nRecon++;
- } // phi
- } // eta
- } // ring
- } // detector