+//____________________________________________________________________
+Float_t
+AliFMDReconstructor::Adc2Energy(AliFMDDigit* digit,
+ Float_t eta,
+ UShort_t count) const
+{
+ // Converts number of ADC counts to energy deposited.
+ // Note, that this member function can be overloaded by derived
+ // classes to do strip-specific look-ups in databases or the like,
+ // to find the proper gain for a strip.
+ //
+ // In this simple version, we calculate the energy deposited as
+ //
+ // EnergyDeposited = cos(theta) * gain * count
+ //
+ // where
+ //
+ // Pre_amp_MIP_Range
+ // gain = ----------------- * Energy_deposited_per_MIP
+ // ADC_channel_size
+ //
+ // is constant and the same for all strips.
+ if (count <= 0) return 0;
+ AliFMDParameters* param = AliFMDParameters::Instance();
+ Float_t gain = param->GetPulseGain(digit->Detector(),
+ digit->Ring(),
+ digit->Sector(),
+ digit->Strip());
+ AliFMDDebug(15, ("Converting counts %d to energy via factor %f",
+ count, gain));
+
+ Double_t edep = count * gain;
+ if (fDiagStep2) fDiagStep2->Fill(count, edep);
+ if (fAngleCorrect) {
+ Double_t theta = 2 * TMath::ATan(TMath::Exp(-eta));
+ Double_t corr = TMath::Abs(TMath::Cos(theta));
+ Double_t cedep = corr * edep;
+ AliFMDDebug(10, ("correcting for path %f * %f = %f (eta=%f, theta=%f)",
+ edep, corr, cedep, eta, theta));
+ if (fDiagStep3) fDiagStep3->Fill(edep, cedep);
+ edep = cedep;
+ }
+ return edep;
+}
+
+//____________________________________________________________________
+Float_t
+AliFMDReconstructor::Energy2Multiplicity(AliFMDDigit* /* digit */,
+ Float_t edep) const
+{
+ // Converts an energy signal to number of particles.
+ // Note, that this member function can be overloaded by derived
+ // classes to do strip-specific look-ups in databases or the like,
+ // to find the proper gain for a strip.
+ //
+ // In this simple version, we calculate the multiplicity as
+ //
+ // multiplicity = Energy_deposited / Energy_deposited_per_MIP
+ //
+ // where
+ //
+ // Energy_deposited_per_MIP = 1.664 * SI_density * SI_thickness
+ //
+ // is constant and the same for all strips
+ AliFMDParameters* param = AliFMDParameters::Instance();
+ Double_t edepMIP = param->GetEdepMip();
+ Float_t mult = edep / edepMIP;
+ if (edep > 0)
+ AliFMDDebug(15, ("Translating energy %f to multiplicity via "
+ "divider %f->%f", edep, edepMIP, mult));
+ if (fDiagStep4) fDiagStep4->Fill(edep, mult);
+ return mult;
+}
+
+//____________________________________________________________________
+void
+AliFMDReconstructor::PhysicalCoordinates(AliFMDDigit* digit,
+ Float_t& eta,
+ Float_t& phi) const
+{
+ // Get the eta and phi of a digit
+ //
+ // Get geometry.
+ AliFMDGeometry* geom = AliFMDGeometry::Instance();
+ Double_t x, y, z, r, theta;
+ geom->Detector2XYZ(digit->Detector(), digit->Ring(), digit->Sector(),
+ digit->Strip(), x, y, z);
+ // Correct for vertex offset.
+ z += fCurrentVertex;
+ phi = TMath::ATan2(y, x);
+ r = TMath::Sqrt(y * y + x * x);
+ theta = TMath::ATan2(r, z);
+ eta = -TMath::Log(TMath::Tan(theta / 2));
+}
+
+
+