]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONResponseTriggerV1.cxx
Applying the trigger chamber response to the cluster and not to each pad
[u/mrichter/AliRoot.git] / MUON / AliMUONResponseTriggerV1.cxx
index 57e05d763f8010b3426f3ca0717f68ced415e5b9..4d8070ec7cbb3c12df701e127343e7a36af7bd4c 100644 (file)
 
 /* $Id$ */
 
-// ------------------
+//-----------------------------------------------------------------------------
 // Class AliMUONTriggerResponseV1
 // ------------------
 // Trigger chamber response 
 // with cluster size activated
+//-----------------------------------------------------------------------------
 
 #include "AliMUONResponseTriggerV1.h"
-#include "AliMUONGeometrySegmentation.h"
 #include "AliMUON.h"
 #include "AliMUONDigit.h"
 #include "AliMUONGeometryTransformer.h"
-#include "AliMUONSegmentation.h"
 #include "AliMUONConstants.h"
 
 #include "AliMpPad.h"
@@ -63,11 +62,6 @@ namespace
     transformer->Global2Local(detElemId,xg,yg,zg,xl,yl,zl);
   }
 
-  AliMUONSegmentation* Segmentation()
-  {
-    static AliMUONSegmentation* segmentation = muon()->GetSegmentation();
-    return segmentation;
-  }
 }
 
 //------------------------------------------------------------------   
@@ -155,6 +149,8 @@ void AliMUONResponseTriggerV1::DisIntegrate(const AliMUONHit& hit, TList& digits
     twentyNano=1;
   }
 
+  Bool_t isTrig[2]={kTRUE, kTRUE};
+
   for ( Int_t cath = AliMp::kCath0; cath <= AliMp::kCath1; ++cath )
   {
     const AliMpVSegmentation* seg 
@@ -165,15 +161,22 @@ void AliMUONResponseTriggerV1::DisIntegrate(const AliMUONHit& hit, TList& digits
     Int_t ix = pad.GetIndices().GetFirst();
     Int_t iy = pad.GetIndices().GetSecond();
     
-    AliMUONDigit* d = new AliMUONDigit;
-    d->SetDetElemId(detElemId);
+    AliMUONDigit* d = new AliMUONDigit(detElemId,pad.GetLocation(0).GetFirst(),
+                                       pad.GetLocation(0).GetSecond(),
+                                       cath);
+    d->SetPadXY(ix,iy);
 
-    d->SetPadX(ix);
-    d->SetPadY(iy);
+    d->SetCharge(twentyNano);
+
+    if(fTriggerEfficiency){
+      if(cath==0){
+       Int_t nboard = pad.GetLocation(0).GetFirst();
+       fTriggerEfficiency->IsTriggered(detElemId, nboard, 
+                                       isTrig[0], isTrig[1]);
+      }
+      if(!isTrig[cath]) continue;
+    }
 
-    d->SetSignal(twentyNano);
-    d->AddPhysicsSignal(d->Signal());
-    d->SetCathode(cath);
     digits.Add(d);
 
     SetGenerCluster(); // 1 randum number per cathode (to be checked)
@@ -214,15 +217,12 @@ void AliMUONResponseTriggerV1::DisIntegrate(const AliMUONHit& hit, TList& digits
                else qp = 0;
                
                if (qp == 1) { // this digit is fired    
-                   AliMUONDigit* dNeigh = new AliMUONDigit;
-                   dNeigh->SetDetElemId(detElemId);
-                   
-                   dNeigh->SetPadX(ixNeigh);
-                   dNeigh->SetPadY(iyNeigh);
+                   AliMUONDigit* dNeigh = new AliMUONDigit(detElemId,padNeigh.GetLocation(0).GetFirst(),
+                                                padNeigh.GetLocation(0).GetSecond(),
+                                                cath);
                    
-                   dNeigh->SetSignal(twentyNano);
-                   dNeigh->AddPhysicsSignal(dNeigh->Signal());
-                   dNeigh->SetCathode(cath);
+                   dNeigh->SetPadXY(ixNeigh,iyNeigh);      
+                   dNeigh->SetCharge(twentyNano);
                    digits.Add(dNeigh);
                } // digit fired                
            } // pad is valid