- fDiagStep1 = new TH2I("diagStep1", "Read ADC vs. Noise surpressed ADC",
- 1024, -.5, 1023.5, 1024, -.5, 1023.5);
- fDiagStep1->SetDirectory(0);
- fDiagStep1->GetXaxis()->SetTitle("ADC (read)");
- fDiagStep1->GetYaxis()->SetTitle(Form("ADC (noise surpressed %4.f)",
- fNoiseFactor));
- fDiagStep2 = new TH2F("diagStep2", "ADC vs Edep deduced",
- 1024, -.5, 1023.5, 100, 0, 2);
- fDiagStep2->SetDirectory(0);
- fDiagStep2->GetXaxis()->SetTitle("ADC (noise surpressed)");
- fDiagStep2->GetYaxis()->SetTitle("#Delta E [GeV]");
- fDiagStep3 = new TH2F("diagStep3", "Edep vs Edep path corrected",
- 100, 0., 2., 100, 0., 2.);
- fDiagStep3->SetDirectory(0);
- fDiagStep3->GetXaxis()->SetTitle("#Delta E [GeV]");
- fDiagStep3->GetYaxis()->SetTitle("#Delta E/#Delta x #times #delta x [GeV]");
- fDiagStep4 = new TH2F("diagStep4", "Edep vs Multiplicity deduced",
- 100, 0., 2., 100, -.1, 19.9);
- fDiagStep4->SetDirectory(0);
- fDiagStep4->GetXaxis()->SetTitle("#Delta E/#Delta x #times #delta x [GeV]");
- fDiagStep4->GetYaxis()->SetTitle("Multiplicity");
- fDiagAll = new TH2F("diagAll", "Read ADC vs Multiplicity deduced",
- 1024, -.5, 1023.5, 100, -.1, 19.9);
- fDiagAll->SetDirectory(0);
- fDiagAll->GetXaxis()->SetTitle("ADC (read)");
- fDiagAll->GetYaxis()->SetTitle("Multiplicity");
+ if (!fDiagStep1) {
+ fDiagStep1 = new TH2I("diagStep1", "Read ADC vs. Noise surpressed ADC",
+ 1024, -.5, 1023.5, 1024, -.5, 1023.5);
+ fDiagStep1->SetDirectory(0);
+ fDiagStep1->GetXaxis()->SetTitle("ADC (read)");
+ fDiagStep1->GetYaxis()->SetTitle(Form("ADC (noise surpressed %4.f)",
+ fNoiseFactor));
+ }
+ if (!fDiagStep2) {
+ fDiagStep2 = new TH2F("diagStep2", "ADC vs Edep deduced",
+ 1024, -.5, 1023.5, 100, 0, 2);
+ fDiagStep2->SetDirectory(0);
+ fDiagStep2->GetXaxis()->SetTitle("ADC (noise surpressed)");
+ fDiagStep2->GetYaxis()->SetTitle("#Delta E [GeV]");
+ }
+ if (!fDiagStep3) {
+ fDiagStep3 = new TH2F("diagStep3", "Edep vs Edep path corrected",
+ 100, 0., 2., 100, 0., 2.);
+ fDiagStep3->SetDirectory(0);
+ fDiagStep3->GetXaxis()->SetTitle("#Delta E [GeV]");
+ fDiagStep3->GetYaxis()->SetTitle("#Delta E/#Delta x #times #delta x [GeV]");
+ }
+ if (!fDiagStep4) {
+ fDiagStep4 = new TH2F("diagStep4", "Edep vs Multiplicity deduced",
+ 100, 0., 2., 100, -.1, 19.9);
+ fDiagStep4->SetDirectory(0);
+ fDiagStep4->GetXaxis()->SetTitle("#Delta E/#Delta x #times #delta x [GeV]");
+ fDiagStep4->GetYaxis()->SetTitle("Multiplicity");
+ fDiagAll = new TH2F("diagAll", "Read ADC vs Multiplicity deduced",
+ 1024, -.5, 1023.5, 100, -.1, 19.9);
+ }
+ if (fDiagAll) {
+ fDiagAll->SetDirectory(0);
+ fDiagAll->GetXaxis()->SetTitle("ADC (read)");
+ fDiagAll->GetYaxis()->SetTitle("Multiplicity");
+ }
- // Reconstruct directly from raw data (no intermediate output on
- // digit tree or rec point tree).
- //
- // Parameters:
- // reader Raw event reader
- // ctree Not used.
- AliFMDDebug(1, ("Reconstructing from raw reader"));
- AliFMDRawReader rawReader(reader, 0);
+ // Loop over all entries of the ESD and mark
+ // those that are dead as such
+ // - otherwise put in the zero signal.
+ AliFMDParameters* param = AliFMDParameters::Instance();
+
+ for (UShort_t d = 1; d <= 3; d++) {
+ UShort_t nR = (d == 1 ? 1 : 2);
+
+ for (UShort_t q = 0; q < nR; q++) {
+ Char_t r = (q == 0 ? 'I' : 'O');
+ UShort_t nS = (q == 0 ? 20 : 40);
+ UShort_t nT = (q == 0 ? 512 : 256);
+
+ for (UShort_t s = 0; s < nS; s++) {
+ for (UShort_t t = 0; t < nT; t++) {
+ if (fBad(d, r, s, t)) {
+ AliDebug(5, Form("Marking FMD%d%c[%2d,%3d] as bad", d, r, s, t));
+ esd->SetMultiplicity(d, r, s, t, AliESDFMD::kInvalidMult);
+ }
+ if (param->IsDead(d, r, s, t)) {
+ AliDebug(5, Form("Marking FMD%d%c[%2d,%3d] as dead", d, r, s, t));
+ esd->SetMultiplicity(d, r, s, t, AliESDFMD::kInvalidMult);
+ // esd->SetEta(d, r, s, t, AliESDFMD::kInvalidEta);
+ }
+ else if (esd->Multiplicity(d, r, s, t) == AliESDFMD::kInvalidMult) {
+ AliDebug(10, Form("Setting null signal in FMD%d%c[%2d,%3d]",
+ d, r, s, t));
+ esd->SetMultiplicity(d, r, s, t, 0);
+ }
+ }
+ }
+ }
+ }
+}
+//____________________________________________________________________
+void
+AliFMDReconstructor::ProcessDigits(TClonesArray* digits,
+ const AliFMDRawReader& rawRead) const
+{
+ // For each digit, find the pseudo rapdity, azimuthal angle, and
+ // number of corrected ADC counts, and pass it on to the algorithms
+ // used.
+ //
+ // Parameters:
+ // digits Array of digits
+ //
+ if (fZombie) {
+ AliWarning("I'm a zombie - cannot do anything");
+ return;
+ }
+ AliFMDAltroMapping* map = AliFMDParameters::Instance()->GetAltroMap();
+ for (size_t i = 1; i <= 3; i++) {
+ fZS[i-1] = rawRead.IsZeroSuppressed(map->Detector2DDL(i));
+ fZSFactor[i-1] = rawRead.NoiseFactor(map->Detector2DDL(i));
+ }
+ UseRecoParam(kTRUE);
+ ProcessDigits(digits);
+ UseRecoParam(kFALSE);
+}
+
- phi = TMath::ATan2(y, x);
- r = TMath::Sqrt(y * y + x * x);
- theta = TMath::ATan2(r, z);
- eta = -TMath::Log(TMath::Tan(theta / 2));
+ AliFMDGeometry::XYZ2REtaPhiTheta(x, y, z, r, deta, dphi, theta);
+ eta = deta;
+ phi = dphi;
+}
+
+namespace {
+ class ESDPrinter : public AliESDFMD::ForOne
+ {
+ public:
+ ESDPrinter() {}
+ Bool_t operator()(UShort_t d, Char_t r, UShort_t s, UShort_t t,
+ Float_t m, Float_t e)
+ {
+ if (m > 0 && m != AliESDFMD::kInvalidMult)
+ printf(" FMD%d%c[%2d,%3d] = %6.3f / %6.3f\n", d, r, s, t, m, e);
+ return kTRUE;
+ }
+ };