]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONv1.cxx
AliHitMap and AliSegmentation added
[u/mrichter/AliRoot.git] / MUON / AliMUONv1.cxx
index b37974bf808f99e6eee8cd7c13b0d382856a7206..b382dc46a5c4d1f9d6aac15cab26244bcdf173ae 100644 (file)
 
 /*
 $Log$
+Revision 1.4  2000/06/26 14:02:38  morsch
+Add class AliMUONConstants with MUON specific constants using static memeber data and access methods.
+
+Revision 1.3  2000/06/22 14:10:05  morsch
+HP scope problems corrected (PH)
+
+Revision 1.2  2000/06/15 07:58:49  morsch
+Code from MUON-dev joined
+
 Revision 1.1.2.14  2000/06/14 14:37:25  morsch
 Initialization of TriggerCircuit added (PC)
 
@@ -47,6 +56,7 @@ Log messages included.
 #include "AliMUONChamber.h"
 #include "AliMUONHit.h"
 #include "AliMUONPadHit.h"
+#include "AliMUONConstants.h"
 
 ClassImp(AliMUONv1)
  
@@ -1455,8 +1465,8 @@ void AliMUONv1::Init()
    //
 
    printf("\n\n\n Start Init for version 1 - CPC chamber type\n\n\n");
-
-   for (Int_t i=0; i<kNCH; i++) {
+   Int_t i;
+   for (i=0; i<AliMUONConstants::NCh(); i++) {
        ( (AliMUONChamber*) (*fChambers)[i])->Init();
    }
    
@@ -1482,7 +1492,7 @@ void AliMUONv1::Init()
 
    //cp 
    printf("\n\n\n Start Init for Trigger Circuits\n\n\n");
-   for (Int_t i=0; i<kNTriggerCircuit; i++) {
+   for (i=0; i<AliMUONConstants::NTriggerCircuit(); i++) {
      ( (AliMUONTriggerCircuit*) (*fTriggerCircuits)[i])->Init(i);
    }
    printf(" Finished Init for Trigger Circuits\n\n\n");
@@ -1504,7 +1514,6 @@ void AliMUONv1::StepManager()
   
   static Float_t eloss, eloss2, xhit, yhit, tof, tlength;
   const  Float_t kBig=1.e10;
-  
   //  modifs perso
   static Float_t hits[15];
 
@@ -1522,7 +1531,7 @@ void AliMUONv1::StepManager()
   idvol=-1;
   id=gMC->CurrentVolID(copy);
   
-    for (Int_t i=1; i<=kNCH; i++) {
+    for (Int_t i=1; i<=AliMUONConstants::NCh(); i++) {
       if(id==((AliMUONChamber*)(*fChambers)[i-1])->GetGid()){ 
          vol[0]=i; 
          idvol=i-1;
@@ -1603,20 +1612,27 @@ void AliMUONv1::StepManager()
       eloss   += destep;
       tlength += step;
       
-      Float_t x0,y0;
+      Float_t x0,y0,z0;
+      Float_t localPos[3];
+      Float_t globalPos[3] = {pos[0], pos[1], pos[2]};
       
+      
+      gMC->Gmtod(globalPos,localPos,1); 
+
       if(idvol<10) {
 // tracking chambers
          x0 = 0.5*(xhit+pos[0]);
          y0 = 0.5*(yhit+pos[1]);
+         z0 = localPos[2];
       } else {
 // trigger chambers
          x0=xhit;
          y0=yhit;
+         z0=0.;
       }
       
       
-      if (eloss >0)  MakePadHits(x0,y0,eloss,tof,idvol);
+      if (eloss >0)  MakePadHits(x0,y0,z0,eloss,tof,idvol);
       
          
       hits[6]=tlength;
@@ -1639,9 +1655,15 @@ void AliMUONv1::StepManager()
   {
       ((AliMUONChamber*) (*fChambers)[idvol])
          ->SigGenInit(pos[0], pos[1], pos[2]);
+      
+      Float_t localPos[3];
+      Float_t globalPos[3] = {pos[0], pos[1], pos[2]};
+      gMC->Gmtod(globalPos,localPos,1); 
+
+
 //      printf("\n-> MakePadHits, reason special %d",ipart);
       if (eloss > 0 && idvol < 10)
-         MakePadHits(0.5*(xhit+pos[0]),0.5*(yhit+pos[1]),eloss,tof,idvol);
+         MakePadHits(0.5*(xhit+pos[0]),0.5*(yhit+pos[1]),localPos[2],eloss,tof,idvol);
       xhit     = pos[0];
       yhit     = pos[1]; 
       eloss    = destep;