Some bugs fixed
[u/mrichter/AliRoot.git] / FMD / AliFMDMultNaiive.cxx
index c33eca39e8776f3cba6d961986d687f86a348925..f1357b9630d60d3864b3ad991d51f9b3871b0cf5 100644 (file)
@@ -26,6 +26,7 @@
 // 
 #include "AliFMD.h"                    // ALIFMD_H
 #include "AliFMDMultNaiive.h"          // ALIFMDMULTNAIIVE_H
+#include "AliFMDParameters.h"           // ALIFMDPARAMETERS_H
 #include "AliFMDMultStrip.h"           // ALIFMDMULTNAIIVE_H
 #include "AliFMDDigit.h"               // ALIFMDDIGIT_H
 #include <TClonesArray.h>               // ROOT_TClonesArray
@@ -33,6 +34,9 @@
 
 //____________________________________________________________________
 ClassImp(AliFMDMultNaiive)
+#if 0
+  ; // This is here to keep Emacs for indenting the next line
+#endif
 
 //____________________________________________________________________
 AliFMDMultNaiive::AliFMDMultNaiive()
@@ -48,8 +52,9 @@ AliFMDMultNaiive::PreRun(AliFMD* fmd)
 {
   // Initialise before a run 
   AliFMDMultAlgorithm::PreRun(fmd);
-  fEdepMip = fmd->GetEdepMip();
-  fGain = (Float_t(fmd->GetVA1MipRange()) / fmd->GetAltroChannelSize() 
+  AliFMDParameters* pars = AliFMDParameters::Instance();
+  fEdepMip = pars->GetEdepMip();
+  fGain = (Float_t(pars->GetVA1MipRange()) / pars->GetAltroChannelSize() 
           * fEdepMip);
 }
 
@@ -136,7 +141,7 @@ AliFMDMultNaiive::Adc2Energy(AliFMDDigit* /* digit */,
   // 
   // is constant and the same for all strips. 
   Double_t theta = 2 * TMath::Tan(TMath::Exp(-eta));
-  Double_t edep  = TMath::Cos(theta) * fGain * count;
+  Double_t edep  = TMath::Abs(TMath::Cos(theta)) * fGain * count;
   return edep;
 }