Some bugs fixed
[u/mrichter/AliRoot.git] / FMD / AliFMDMultNaiive.cxx
index 0cb45798cc713fb1b01cc81149f59e8827f208b5..f1357b9630d60d3864b3ad991d51f9b3871b0cf5 100644 (file)
 // 
 #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
 #include <TTree.h>                     // ROOT_TTree
 
 //____________________________________________________________________
-ClassImp(AliFMDMultNaiive);
+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;
 }