]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONChamberTrigger.cxx
Use AddLine() when registering SSD digits.
[u/mrichter/AliRoot.git] / MUON / AliMUONChamberTrigger.cxx
index a0df22c142288aeb3b11a1a6c2dddc60ee0bca30..58f4fe13a6edbaf4c927f8ee7f2e1cd913df040a 100644 (file)
 #include "AliMUONChamberTrigger.h"
 #include "AliMUONResponseTrigger.h"
 #include "AliMUONHit.h"
+#include "AliMUON.h"
+#include "AliMUONSegmentation.h"
 #include "AliMUONGeometrySegmentation.h"
+#include "AliMUONGeometryTransformer.h"
 #include "AliLog.h"
 
+///
+/// \class AliMUONChamberTrigger
+///
+/// Implementation of AliMUONChamber for the trigger
+///
+/// This class is to be deprecated.
+///
+
+/// \cond CLASSIMP
 ClassImp(AliMUONChamberTrigger)
+/// \endcond
 
 //-------------------------------------------
 
 AliMUONChamberTrigger::AliMUONChamberTrigger()
-  : AliMUONChamber()
+  : AliMUONChamber(),
+    fkGeomTransformer(0)
+{
+/// Default constructor
+}
+
+//-------------------------------------------
+
+AliMUONChamberTrigger:: ~AliMUONChamberTrigger()
 {
-// Default constructor
+/// Destructor
 }
 
+//-------------------------------------------
 
-AliMUONChamberTrigger::AliMUONChamberTrigger(Int_t id) 
-  : AliMUONChamber(id)
+AliMUONChamberTrigger::AliMUONChamberTrigger(Int_t id,
+                              const AliMUONGeometryTransformer* kGeometryTransformer) 
+  : AliMUONChamber(id),
+    fkGeomTransformer(kGeometryTransformer)
 {
-// Constructor using chamber id
+/// Constructor using chamber id
 }
 
 //-------------------------------------------
@@ -43,9 +67,8 @@ void AliMUONChamberTrigger::DisIntegration(AliMUONHit* hit,
                                           Int_t& nnew,
                                           Float_t newclust[6][500]) 
 {
-//    
-//  Generates pad hits (simulated cluster) 
-//  using the segmentation and the response model
+///  Generates pad hits (simulated cluster) 
+///  using the segmentation and the response model
 
 
   Float_t   tof = hit->Age();
@@ -64,34 +87,42 @@ void AliMUONChamberTrigger::DisIntegration(AliMUONHit* hit,
   Float_t qp;
   nnew=0;
   for (Int_t i = 1; i <= 2; i++) {
-    AliMUONGeometrySegmentation * segmentation=
-      (AliMUONGeometrySegmentation*) (*fSegmentation2)[i-1];
+
+    AliMUONGeometrySegmentation* segmentation=
+      fMUON->GetSegmentation()->GetModuleSegmentationByDEId(id, i-1); 
+
     
 // Find the module & strip Id. which has fired
-    Int_t ix,iy;
+    Int_t ix(-1);
+    Int_t iy(-1);
     segmentation->GetPadI(id,xhit,yhit,0,ix,iy);
 // treatment of GEANT hits w/o corresponding strip (due to the fact that
 // geometry & segmentation are computed in a very slightly different way) 
-    if (ix==100||iy==100) {
-       AliInfo(Form("AliMUONChamberTrigger hit w/o strip %i %f %f \n",id,xhit,yhit));
-    } else {          
-       segmentation->SetPad(id,ix,iy);
-       if (xhit<0) ix = -ix;
-//    printf(" fId id fnsec xhit yhit zhit ix iy %i %i %i %f %f %f %i %i \n",fId,i,id,xhit,yhit,zhit,ix,iy);
-//     if (ix < 0 || ix > 10000) return;
-//     if (iy < 0 || iy > 10000) return;
-
+    if ( ix<0 || iy<0 ) 
+    {
+      Float_t lx,ly,lz;
+      fkGeomTransformer->Global2Local(id,xhit,yhit,0,lx,ly,lz);
+      AliWarning(Form("AliMUONChamberTrigger hit w/o strip %i-%d %e %e "
+                      "local %e %e %e ix,iy=%d,%d\n",id,i-1,xhit,yhit,lx,ly,lz,ix,iy));
+    } else 
+    {          
+      segmentation->SetPad(id,ix,iy);
+      if (xhit<0) ix = -ix;
+      //    printf(" fId id fnsec xhit yhit zhit ix iy %i %i %i %f %f %f %i %i \n",fId,i,id,xhit,yhit,zhit,ix,iy);
+      //     if (ix < 0 || ix > 10000) return;
+      //     if (iy < 0 || iy > 10000) return;
+      
       // --- store signal information for this strip
-       newclust[0][nnew]=1.;                       // total charge
-       newclust[1][nnew]=ix;                       // ix-position of pad
-       newclust[2][nnew]=iy;                       // iy-position of pad
-       newclust[3][nnew]=twentyNano;               // time of flight
-       newclust[4][nnew]=segmentation->ISector();  // sector id
-       newclust[5][nnew]=(Float_t) i;              // counter
-       nnew++;
-       
-// cluster-size if AliMUONResponseTriggerV1, nothing if AliMUONResponseTrigger
-       if (((AliMUONResponseTrigger*) fResponse)->SetGenerCluster()) {
+      newclust[0][nnew]=1.;                       // total charge
+      newclust[1][nnew]=ix;                       // ix-position of pad
+      newclust[2][nnew]=iy;                       // iy-position of pad
+      newclust[3][nnew]=twentyNano;               // time of flight
+      newclust[4][nnew]=segmentation->ISector();  // sector id
+      newclust[5][nnew]=(Float_t) i;              // counter
+      nnew++;
+      
+      // cluster-size if AliMUONResponseTriggerV1, nothing if AliMUONResponseTrigger
+      if (((AliMUONResponseTrigger*) fResponse)->SetGenerCluster()) {
            
            // set hits
            segmentation->SetHit(id,xhit,yhit,zhit);