Added an IntXY method w/o segmentation parameter (used in the new
authorivana <ivana@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 31 Jan 2006 16:43:37 +0000 (16:43 +0000)
committerivana <ivana@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 31 Jan 2006 16:43:37 +0000 (16:43 +0000)
AliMUONResponseV0::DisIntegrate)
(Laurent)

MUON/AliMUONMathieson.cxx
MUON/AliMUONMathieson.h

index 47127b5..c1642fb 100644 (file)
 
 /* $Id$ */
 
-#include <TMath.h>
-#include <TRandom.h>
-
 #include "AliMUONMathieson.h"
+
+#include "AliLog.h"
 #include "AliMUONGeometrySegmentation.h"
 
+#include <TClass.h>
+#include <TMath.h>
+#include <TRandom.h>
 
 ClassImp(AliMUONMathieson)
        
@@ -64,31 +66,39 @@ void AliMUONMathieson::SetSqrtKy3AndDeriveKy2Ky4(Float_t SqrtKy3)
   fKy4 = cy1 / fKy2 / fSqrtKy3;
 }
 
+//_____________________________________________________________________________
+Float_t
+AliMUONMathieson::IntXY(Float_t xi1, Float_t yi1, Float_t xi2, Float_t yi2) const
+{
+  AliDebug(1,Form("xi1=%e yi1=%e xi2=%e yi2=%e",xi1,yi1,xi2,yi2));
+  
+  const Float_t kInversePitch = 1./fPitch;
+  xi1 *= kInversePitch;
+  xi2 *= kInversePitch;
+  yi1 *= kInversePitch;
+  yi2 *= kInversePitch;
+  //
+  // The Mathieson function 
+  Double_t ux1=fSqrtKx3*TMath::TanH(fKx2*xi1);
+  Double_t ux2=fSqrtKx3*TMath::TanH(fKx2*xi2);
+  
+  Double_t uy1=fSqrtKy3*TMath::TanH(fKy2*yi1);
+  Double_t uy2=fSqrtKy3*TMath::TanH(fKy2*yi2);
+  
+  
+  return Float_t(4.*fKx4*(TMath::ATan(ux2)-TMath::ATan(ux1))*
+                 fKy4*(TMath::ATan(uy2)-TMath::ATan(uy1)));
+}
+
 // -------------------------------------------
 Float_t AliMUONMathieson::IntXY(Int_t idDE, AliMUONGeometrySegmentation* segmentation)
 {
 // Calculate charge on current pad according to Mathieson distribution
 // using Detection elt
-   
-    const Float_t kInversePitch = 1./fPitch;
 //
 //  Integration limits defined by segmentation model
 //  
     Float_t xi1, xi2, yi1, yi2;
     segmentation->IntegrationLimits(idDE, xi1,xi2,yi1,yi2);
-    xi1=xi1*kInversePitch;
-    xi2=xi2*kInversePitch;
-    yi1=yi1*kInversePitch;
-    yi2=yi2*kInversePitch;
-//
-// The Mathieson function 
-    Double_t ux1=fSqrtKx3*TMath::TanH(fKx2*xi1);
-    Double_t ux2=fSqrtKx3*TMath::TanH(fKx2*xi2);
-
-    Double_t uy1=fSqrtKy3*TMath::TanH(fKy2*yi1);
-    Double_t uy2=fSqrtKy3*TMath::TanH(fKy2*yi2);
-
-    
-    return Float_t(4.*fKx4*(TMath::ATan(ux2)-TMath::ATan(ux1))*
-                     fKy4*(TMath::ATan(uy2)-TMath::ATan(uy1)));
+    return IntXY(xi1,yi1,xi2,yi2);
 }
index dbed0a6..395366f 100644 (file)
 /// \class AliMUONMathieson
 /// \brief Implementation of Mathieson response
 
+#ifndef ROOT_TObject
+#  include "TObject.h"
+#endif
+
 class AliMUONGeometrySegmentation;
 
-class AliMUONMathieson 
+class AliMUONMathieson : public TObject
 {
  public:
     AliMUONMathieson();
@@ -40,11 +44,12 @@ class AliMUONMathieson
     void    SetKy2(Float_t p1) {fKy2 = p1;};
     // Mathieson Ky4
     void    SetKy4(Float_t p1) {fKy4 = p1;};
-    // Charge disintegration
+    /// \deprecated To be removed when old (s)digitizers go off.
     Float_t  IntXY(Int_t id, AliMUONGeometrySegmentation* segmentation);
-
-    ClassDef(AliMUONMathieson,1) // Implementation of Mathieson response
- protected:
+    /// Charge integration on region (x1,y1,x2,y2).
+    Float_t IntXY(Float_t xi1, Float_t yi1, Float_t xi2, Float_t yi2) const;
+    
+ private:
   
     Float_t fSqrtKx3;                  // Mathieson Sqrt(Kx3)
     Float_t fKx2;                      // Mathieson Kx2
@@ -53,6 +58,8 @@ class AliMUONMathieson
     Float_t fKy2;                      // Mathieson Ky2
     Float_t fKy4;                      // Mathieson Ky4 = Ky1/Ky2/Sqrt(Ky3)
     Float_t fPitch;                    // anode-cathode pitch
+    
+    ClassDef(AliMUONMathieson,2) // Implementation of Mathieson response
 };
 #endif