]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONResponseV0.cxx
Fix in taking into account alignment in simulation:
[u/mrichter/AliRoot.git] / MUON / AliMUONResponseV0.cxx
index ac7fd128ce00196f9ef6880679df06ce1560d60e..78b04a1f7b4e26e905adab459e2ac042a0a76922 100644 (file)
 
 /* $Id$ */
 
-// --------------------------
+//-----------------------------------------------------------------------------
 // Class AliMUONResponseV0
 // --------------------------
 // Implementation of 
 // Mathieson response
+//-----------------------------------------------------------------------------
 
 #include "AliMUONResponseV0.h"
 #include "AliMUON.h"
@@ -77,7 +78,8 @@ AliMUONResponseV0::AliMUONResponseV0()
   fZeroSuppression(0),
   fChargeCorrel(0.0),
   fMathieson(new AliMUONMathieson),
-  fChargeThreshold(1e-4)
+  fChargeThreshold(1e-4),
+  fIsTailEffect(kFALSE)
 {
     /// Normal constructor
     AliDebug(1,Form("Default ctor"));
@@ -95,7 +97,8 @@ fSaturation(0),
 fZeroSuppression(0),
 fChargeCorrel(0.0),
 fMathieson(0),
-fChargeThreshold(1e-4)
+fChargeThreshold(1e-4),
+fIsTailEffect(kFALSE)
 {
   /// copy ctor
   other.CopyTo(*this);
@@ -208,15 +211,55 @@ AliMUONResponseV0::DisIntegrate(const AliMUONHit& hit, TList& digits)
   digits.Clear();
   
   Int_t detElemId = hit.DetElemId();
-  
+  Double_t hitX = hit.X() ;
+  Double_t hitY = hit.Y() ;
+  Double_t hitZ = hit.Z() ;
+
   // Width of the integration area
   Double_t dx = SigmaIntegration()*ChargeSpreadX();
   Double_t dy = SigmaIntegration()*ChargeSpreadY();
   
+  //Modify to take the tailing effect.
+  if(fIsTailEffect){
+    Double_t locX,locY,locZ,globXCenter,globYCenter,globZ;
+    Int_t para = 5; // This parameter is a natural number(excluding zero), higher the value less is the tailing effect 
+    Double_t termA = 1.0;
+    Double_t termB = 1.0;
+    if(para>0){
+      for ( Int_t cath = AliMp::kCath0; cath <= AliMp::kCath1; ++cath )
+       {
+         // Get an iterator to loop over pads, within the given area.
+         const AliMpVSegmentation* seg = 
+           AliMpSegmentation::Instance()
+           ->GetMpSegmentation(detElemId,AliMp::GetCathodType(cath));
+         AliMp::PlaneType plane = seg->PlaneType();
+         
+         if(plane == AliMp::kBendingPlane) {
+           Global2Local(detElemId,hitX,hitY,hitZ,locX,locY,locZ);
+           TVector2 hitPoint(locX,locY);
+           AliMpPad pad = seg->PadByPosition(hitPoint,kFALSE);
+            if(pad.IsValid()){
+              Double_t locYCenter = pad.Position().Y();
+              Double_t locXCenter = pad.Position().X();
+              const AliMUONGeometryTransformer* transformer = muon()->GetGeometryTransformer();
+              transformer->Local2Global(detElemId,locXCenter,locYCenter,locZ,globXCenter,globYCenter,globZ);
+              for(Int_t itime = 0; itime<para; itime++)
+                termA *= 10.0;
+            
+              for(Int_t itime = 0; itime<Int_t((2*para) + 1); itime++)
+                termB *= (hitY - globYCenter) ; 
+            
+              hitY = hitY + termA*termB;
+            }// if the pad is a valid one
+         }// if bending plane
+       }// cathode loop
+    }// if para > 0 condn
+  }// if tail effect
+
   // Use that (dx,dy) to specify the area upon which
   // we will iterate to spread charge into.
   Double_t x,y,z;
-  Global2Local(detElemId,hit.X(),hit.Y(),hit.Z(),x,y,z);
+  Global2Local(detElemId,hitX,hitY,hitZ,x,y,z);
   x = GetAnod(x);
   TVector2 hitPosition(x,y);
   AliMpArea area(hitPosition,TVector2(dx,dy));