]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PHOS/AliPHOSRecEmcManager.cxx
Reducing the search window used to find the max in the ADC samples. Needed because...
[u/mrichter/AliRoot.git] / PHOS / AliPHOSRecEmcManager.cxx
index 475db7a61142bcefd78c62c3e0aadddc7ddcc729..7ed77ad908115742b7a36af238b51bd787ec8947 100644 (file)
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
 
+/* $Id$ */
 
 //_________________________________________________________________________
 // Class for the management by the Emc reconstruction.
-//                  
+////                  
 //*-- Author   : Boris Polichtchouk (IHEP, Protvino) 6 Mar 2001
 //
 // --- ROOT system ---
 
-// --- Standard library ---
+#include <TMath.h>
 
-#include <iostream.h>
+// --- Standard library ---
 
 // --- AliRoot header files ---
 
 #include "AliPHOSRecEmcManager.h"
-#include "AliPHOS.h"
-#include "AliRun.h"
 
 ClassImp(AliPHOSRecEmcManager) 
 
 //____________________________________________________________________________
 
-  AliPHOSRecEmcManager::AliPHOSRecEmcManager()
+AliPHOSRecEmcManager::AliPHOSRecEmcManager():
+  fOneGamChisqCut(1.3f),
+  fOneGamInitialStep(0.00005f),
+  fOneGamChisqMin(1.f),
+  fOneGamStepMin(0.0005f),
+  fOneGamNumOfIterations(50),
+  fTwoGamInitialStep(0.00005f),
+  fTwoGamChisqMin(1.f),
+  fTwoGamEmin(0.1f),
+  fTwoGamStepMin(0.00005),
+  fTwoGamNumOfIterations(50),
+  fThr0(0.f),
+  fSqdCut(0.f)
 {
-
-//    fOneGamChisqCut = 3.;
-  fOneGamChisqCut = 1.3; // bvp 31.08.2001 
-
-  fOneGamInitialStep = 0.00005;
-  fOneGamChisqMin = 1.;
-  fOneGamStepMin = 0.0005;
-  fOneGamNumOfIterations = 50;
-
-  fTwoGamInitialStep = 0.00005;
-  fTwoGamChisqMin = 1.;
-  fTwoGamEmin = 0.1;
-  fTwoGamStepMin = 0.00005;
-  fTwoGamNumOfIterations = 50;  
-
-//    fThr0 = 0.6;
-  fThr0 = 0.;
-//    fSqdCut = 3.;
-//    fSqdCut = 0.5; // bvp 31.08.2001
-  fSqdCut = 0.;
-
+  // default ctor
   SetTitle("Emc Reconstruction Manager");
-
 }
 
 AliPHOSRecEmcManager::~AliPHOSRecEmcManager(void) {}
 
-Float_t AliPHOSRecEmcManager::Dispersion(Float_t Etot, Float_t Ai, Float_t Ei)
+Float_t AliPHOSRecEmcManager::Dispersion(Float_t ei) const
 {
   //"Dispresion" of energy deposition in the cell.
-  // Etot is the total shower energy, Ai is the
+  // eTot is the total shower energy, ai is the
   // calculated cell response,
-  // Ei is the measured cell response.
+  // ei is the measured cell response.
 
-  return Ei;
+  return ei;
 }
 
-Float_t AliPHOSRecEmcManager::OneGamChi2(Float_t Ai, Float_t Ei, Float_t Etot, Float_t& Gi)
+Float_t AliPHOSRecEmcManager::OneGamChi2(Float_t ai, Float_t ei, Float_t, Float_t& gi) const
 {
   // Chi2 used in OneGam (one-gamma fitting).
-  // Gi is d(Chi2)/d(Ai).
+  // gi is d(Chi2)/d(ai).
 
-  Float_t da = Ai - Ei;
-  Float_t D = Ei; // we assume that sigma(E) = sqrt(E)
-  Gi = 2.*(Ai-Ei)/D;
+  Float_t da = ai - ei;
+  Float_t d = ei; // we assume that sigma(E) = sqrt(E)
+  gi = 2.*(ai-ei)/d;
 
-  return da*da/D;
+  return da*da/d;
 
 }
 
-Float_t AliPHOSRecEmcManager::TwoGamChi2(Float_t Ai, Float_t Ei, Float_t Etot, Float_t& Gi)
+Float_t AliPHOSRecEmcManager::TwoGamChi2(Float_t ai, Float_t ei, Float_t, Float_t& gi) const
 {
+  // calculates chi^2
+  Float_t da = ai - ei;
+  Float_t d = ei; // we assume that sigma(E) = sqrt(E)
+  gi = 2.*(ai-ei)/d;
 
-  Float_t da = Ai - Ei;
-  Float_t D = Ei; // we assume that sigma(E) = sqrt(E)
-  Gi = 2.*(Ai-Ei)/D;
-
-  return da*da/D;
+  return da*da/d;
 
 }
 
-void AliPHOSRecEmcManager::AG(Float_t Ei, Float_t Xi, Float_t Yi, Float_t& Ai, Float_t& GXi, Float_t& GYi )
+void AliPHOSRecEmcManager::AG(Float_t ei, Float_t xi, Float_t yi, Float_t& ai, Float_t& gxi, Float_t& gyi )
 {
-  //Calculates amplitude (Ai) and gradients (GXi, GYi) of CPV pad response.
+  //Calculates amplitude (ai) and gradients (gxi, gyi) of CPV pad response.
   //Integrated response (total "shower energy") is E, 
-  //Xi and Yi are the distances along x and y from reference point 
+  //xi and yi are the distances along x and y from reference point 
   // to the pad center.
   //Shape of the shower is from PHOS TDR.
 
 
-  Float_t r = TMath::Sqrt(Xi*Xi + Yi*Yi);
+  Float_t r = TMath::Sqrt(xi*xi + yi*yi);
   Float_t r4    = r*r*r*r ;
   Float_t r295  = TMath::Power(r, 2.95) ;
-  Float_t shape = Ei*TMath::Exp( -r4 * (1. / (2.32 + 0.26 * r4) + 0.0316 / (1 + 0.0652 * r295) ) ) ;
-  Ai = shape;
+  Float_t shape = ei*TMath::Exp( -r4 * (1. / (2.32 + 0.26 * r4) + 0.0316 / (1 + 0.0652 * r295) ) ) ;
+  ai = shape;
 
 
-  //d(shape)/d(Xi)
-  GXi = (-(TMath::Power(TMath::Power(Xi,2) + TMath::Power(Yi,2),2)*
-       ((-0.006077944*Xi*TMath::Power(TMath::Power(Xi,2) + TMath::Power(Yi,2),
+  //d(shape)/d(xi)
+  gxi = (-(TMath::Power(TMath::Power(xi,2) + TMath::Power(yi,2),2)*
+       ((-0.006077944*xi*TMath::Power(TMath::Power(xi,2) + TMath::Power(yi,2),
              0.4750000000000001))/
-          TMath::Power(1 + 0.0652*TMath::Power(TMath::Power(Xi,2) + TMath::Power(Yi,2),1.475),2) - 
-         (1.04*Xi*(TMath::Power(Xi,2) + TMath::Power(Yi,2)))/
-          TMath::Power(2.32 + 0.26*TMath::Power(TMath::Power(Xi,2) + TMath::Power(Yi,2),2),2))) - 
-    4*Xi*(TMath::Power(Xi,2) + TMath::Power(Yi,2))*
-     (0.0316/(1 + 0.0652*TMath::Power(TMath::Power(Xi,2) + TMath::Power(Yi,2),1.475)) + 
-       1./(2.32 + 0.26*TMath::Power(TMath::Power(Xi,2) + TMath::Power(Yi,2),2))))/
-  TMath::Power(TMath::E(),TMath::Power(TMath::Power(Xi,2) + TMath::Power(Yi,2),2)*
-    (0.0316/(1 + 0.0652*TMath::Power(TMath::Power(Xi,2) + TMath::Power(Yi,2),1.475)) + 
-     1./(2.32 + 0.26*TMath::Power(TMath::Power(Xi,2) + TMath::Power(Yi,2),2))));
+          TMath::Power(1 + 0.0652*TMath::Power(TMath::Power(xi,2) + TMath::Power(yi,2),1.475),2) - 
+         (1.04*xi*(TMath::Power(xi,2) + TMath::Power(yi,2)))/
+          TMath::Power(2.32 + 0.26*TMath::Power(TMath::Power(xi,2) + TMath::Power(yi,2),2),2))) - 
+    4*xi*(TMath::Power(xi,2) + TMath::Power(yi,2))*
+     (0.0316/(1 + 0.0652*TMath::Power(TMath::Power(xi,2) + TMath::Power(yi,2),1.475)) + 
+       1./(2.32 + 0.26*TMath::Power(TMath::Power(xi,2) + TMath::Power(yi,2),2))))/
+  TMath::Power(TMath::E(),TMath::Power(TMath::Power(xi,2) + TMath::Power(yi,2),2)*
+    (0.0316/(1 + 0.0652*TMath::Power(TMath::Power(xi,2) + TMath::Power(yi,2),1.475)) + 
+     1./(2.32 + 0.26*TMath::Power(TMath::Power(xi,2) + TMath::Power(yi,2),2))));
   
-  GXi = GXi*Ei;
+  gxi = gxi*ei;
 
-  //d(shape)/d(Yi)
-  GYi = (-(TMath::Power(TMath::Power(Xi,2) + TMath::Power(Yi,2),2)*
-       ((-0.006077944*Yi*TMath::Power(TMath::Power(Xi,2) + TMath::Power(Yi,2),
+  //d(shape)/d(yi)
+  gyi = (-(TMath::Power(TMath::Power(xi,2) + TMath::Power(yi,2),2)*
+       ((-0.006077944*yi*TMath::Power(TMath::Power(xi,2) + TMath::Power(yi,2),
              0.4750000000000001))/
-          TMath::Power(1 + 0.0652*TMath::Power(TMath::Power(Xi,2) + TMath::Power(Yi,2),1.475),2) - 
-         (1.04*Yi*(TMath::Power(Xi,2) + TMath::Power(Yi,2)))/
-          TMath::Power(2.32 + 0.26*TMath::Power(TMath::Power(Xi,2) + TMath::Power(Yi,2),2),2))) - 
-    4*Yi*(TMath::Power(Xi,2) + TMath::Power(Yi,2))*
-     (0.0316/(1 + 0.0652*TMath::Power(TMath::Power(Xi,2) + TMath::Power(Yi,2),1.475)) + 
-       1./(2.32 + 0.26*TMath::Power(TMath::Power(Xi,2) + TMath::Power(Yi,2),2))))/
-  TMath::Power(TMath::E(),TMath::Power(TMath::Power(Xi,2) + TMath::Power(Yi,2),2)*
-    (0.0316/(1 + 0.0652*TMath::Power(TMath::Power(Xi,2) + TMath::Power(Yi,2),1.475)) + 
-     1./(2.32 + 0.26*TMath::Power(TMath::Power(Xi,2) + TMath::Power(Yi,2),2))));
-
-
-  GYi = GYi*Ei;
+          TMath::Power(1 + 0.0652*TMath::Power(TMath::Power(xi,2) + TMath::Power(yi,2),1.475),2) - 
+         (1.04*yi*(TMath::Power(xi,2) + TMath::Power(yi,2)))/
+          TMath::Power(2.32 + 0.26*TMath::Power(TMath::Power(xi,2) + TMath::Power(yi,2),2),2))) - 
+    4*yi*(TMath::Power(xi,2) + TMath::Power(yi,2))*
+     (0.0316/(1 + 0.0652*TMath::Power(TMath::Power(xi,2) + TMath::Power(yi,2),1.475)) + 
+       1./(2.32 + 0.26*TMath::Power(TMath::Power(xi,2) + TMath::Power(yi,2),2))))/
+  TMath::Power(TMath::E(),TMath::Power(TMath::Power(xi,2) + TMath::Power(yi,2),2)*
+    (0.0316/(1 + 0.0652*TMath::Power(TMath::Power(xi,2) + TMath::Power(yi,2),1.475)) + 
+     1./(2.32 + 0.26*TMath::Power(TMath::Power(xi,2) + TMath::Power(yi,2),2))));
+
+
+  gyi = gyi*ei;
 
 }