Some bugs fixed
[u/mrichter/AliRoot.git] / FMD / AliFMDMultNaiive.cxx
index 2d9baa7d35c0451c339f6e38c7b85c11035ae39b..f1357b9630d60d3864b3ad991d51f9b3871b0cf5 100644 (file)
 
 //____________________________________________________________________
 // 
-// Base class for FMD naiive algorithms. 
-//
-// Derived classes will implement various ways of reconstructing the
-// charge particle multiplicity in the FMD.  
+// Reconstruct charged particle multiplicity in the FMD 
+// 
+// [See also the AliFMDReconstructor class]
+// 
+// This class reconstructs the multiplicity based on the assumption
+// that all particles are minimum ionizing. 
 // 
 #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()
@@ -46,8 +52,9 @@ AliFMDMultNaiive::PreRun(AliFMD* fmd)
 {
   // Initialise before a run 
   AliFMDMultAlgorithm::PreRun(fmd);
-  fEdepMip = fmd->GetEdepMip();
-  fGain = (fmd->GetVA1MipRange() / fmd->GetAltroChannelSize() 
+  AliFMDParameters* pars = AliFMDParameters::Instance();
+  fEdepMip = pars->GetEdepMip();
+  fGain = (Float_t(pars->GetVA1MipRange()) / pars->GetAltroChannelSize() 
           * fEdepMip);
 }
 
@@ -99,14 +106,16 @@ AliFMDMultNaiive::ProcessDigit(AliFMDDigit* digit,
   if (!digit) return;
   Double_t edep  = Adc2Energy(digit, eta, count);
   Double_t mult  = Energy2Multiplicity(digit, edep);
-
-  new ((*fMult)[fNMult]) AliFMDMultStrip(digit->Detector(), 
-                                        digit->Ring(), 
-                                        digit->Sector(),
-                                        digit->Strip(),
-                                        eta, phi, 
-                                        edep, mult, 
-                                        AliFMDMult::kNaiive);
+  
+  AliFMDMultStrip* m = 
+    new ((*fMult)[fNMult]) AliFMDMultStrip(digit->Detector(), 
+                                          digit->Ring(), 
+                                          digit->Sector(),
+                                          digit->Strip(),
+                                          eta, phi, 
+                                          edep, mult,
+                                  AliFMDMult::kNaiive);
+  (void)m;
   fNMult++;
 }
 //____________________________________________________________________
@@ -132,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;
 }