global variables removed, problem with HP compiler solved (PH)
authorpcrochet <pcrochet@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 26 Jun 2000 10:00:14 +0000 (10:00 +0000)
committerpcrochet <pcrochet@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 26 Jun 2000 10:00:14 +0000 (10:00 +0000)
MUON/AliMUONSegmentationTrigger.cxx
MUON/AliMUONSegmentationTrigger.h

index 39f78e1..60a10b9 100644 (file)
@@ -15,6 +15,9 @@
 
 /*
 $Log$
+Revision 1.2  2000/06/15 07:58:48  morsch
+Code from MUON-dev joined
+
 Revision 1.1.2.1  2000/06/09 21:47:24  morsch
 Code from AliMUONSegResTrigger.cxx
 
@@ -37,6 +40,7 @@ Draft version from P. Crochet
 */
 
 #include "AliMUONSegmentationTrigger.h"
+#include "AliMUONTriggerConstants.h"
 #include <TMath.h>
 #include <TRandom.h>
 #include <TArc.h>
@@ -45,6 +49,7 @@ Draft version from P. Crochet
  
 ClassImp(AliMUONSegmentationTrigger)
 
+//------------------------------------------------------------------
 void AliMUONSegmentationTrigger::Init(AliMUONChamber* Chamber)
 {
   // initialize Module geometry
@@ -54,116 +59,6 @@ void AliMUONSegmentationTrigger::Init(AliMUONChamber* Chamber)
   Float_t z1Pos=1603.5;
   fZscale = zPos/z1Pos;
 
-  static Int_t nModule=126;
-  fgNmodule = nModule; 
-// conv : line-column (line : from top to bottom, column : from left to right)
-  static Int_t num[126]=
-  {11,12,13,14,15,16,17,         // right side of the chamber
-   21,22,23,24,25,26,27,
-   31,32,33,34,35,36,37,
-   41,42,43,44,45,46,47,
-   51,52,53,54,55,56,57,
-   61,62,63,64,65,66,67,
-   71,72,73,74,75,76,77,
-   81,82,83,84,85,86,87,
-   91,92,93,94,95,96,97,   
-   -11,-12,-13,-14,-15,-16,-17,     // left side of the chamber
-   -21,-22,-23,-24,-25,-26,-27,
-   -31,-32,-33,-34,-35,-36,-37,
-   -41,-42,-43,-44,-45,-46,-47,
-   -51,-52,-53,-54,-55,-56,-57,
-   -61,-62,-63,-64,-65,-66,-67,
-   -71,-72,-73,-74,-75,-76,-77,
-   -81,-82,-83,-84,-85,-86,-87,
-   -91,-92,-93,-94,-95,-96,-97};
-  fgNum     = num; 
-
-  static Int_t nStripX[126]=
-  {16,16,16,16,16,16,16,  // right side of the chamber 
-   32,32,32,32,32,32,16,
-   32,32,32,32,32,32,16,
-   48,64,64,32,32,32,16,
-   0,64,64,32,32,32,16,
-   48,64,64,32,32,32,16,
-   32,32,32,32,32,32,16,
-   32,32,32,32,32,32,16,
-   16,16,16,16,16,16,16,  // left side of the chamber
-   16,16,16,16,16,16,16,
-   32,32,32,32,32,32,16,
-   32,32,32,32,32,32,16,
-   48,64,64,32,32,32,16,
-   0,64,64,32,32,32,16,
-   48,64,64,32,32,32,16,
-   32,32,32,32,32,32,16,
-   32,32,32,32,32,32,16,
-   16,16,16,16,16,16,16};
-  fgNstripx = nStripX;
-  
-  static Int_t nStripY[126]=
-  { 8, 8, 8, 8, 8, 8,16,  // right side of the chamber
-    8, 8, 8, 8, 8, 8,16,
-    16,16,16,16,16, 8,16,
-    16,16,16,16,16, 8,16,
-    0, 8,16,16,16, 8,16,
-    16,16,16,16,16, 8,16,
-    16,16,16,16,16, 8,16,
-    8, 8, 8, 8, 8, 8,16,
-    8, 8, 8, 8, 8, 8,16,  // left side of the chamber
-    8, 8, 8, 8, 8, 8,16,  // right side of the chamber
-    8, 8, 8, 8, 8, 8,16,
-    16,16,16,16,16, 8,16,
-    16,16,16,16,16, 8,16,
-    0, 8,16,16,16, 8,16,
-    16,16,16,16,16, 8,16,
-    16,16,16,16,16, 8,16,
-    8, 8, 8, 8, 8, 8,16,
-    8, 8, 8, 8, 8, 8,16};
-  fgNstripy = nStripY;
-  
-  static Float_t xCmin[126]=
-  {0.,34.,68.,102.,136.,170.,204., // right
-   0.,34.,68.,102.,136.,170.,204.,
-   0.,34.,68.,102.,136.,170.,204.,
-   0.,34.,68.,102.,136.,170.,204.,
-   0.,51.,68.,102.,136.,170.,204.,
-   0.,34.,68.,102.,136.,170.,204.,
-   0.,34.,68.,102.,136.,170.,204.,
-   0.,34.,68.,102.,136.,170.,204.,
-   0.,34.,68.,102.,136.,170.,204.,
-   -34.,-68.,-102.,-136.,-170.,-204.,-272., //left
-   -34.,-68.,-102.,-136.,-170.,-204.,-272.,
-   -34.,-68.,-102.,-136.,-170.,-204.,-272.,
-   -34.,-68.,-102.,-136.,-170.,-204.,-272.,
-   0.,-68.,-102.,-136.,-170.,-204.,-272.,
-   -34.,-68.,-102.,-136.,-170.,-204.,-272.,
-   -34.,-68.,-102.,-136.,-170.,-204.,-272.,
-   -34.,-68.,-102.,-136.,-170.,-204.,-272.,
-   -34.,-68.,-102.,-136.,-170.,-204.,-272.};
-  fgXcmin   = xCmin;
-  
-  static Float_t xCmax[126]=
-  {34.,68.,102.,136.,170.,204.,272., //right
-   34.,68.,102.,136.,170.,204.,272.,
-   34.,68.,102.,136.,170.,204.,272.,
-   34.,68.,102.,136.,170.,204.,272.,
-   0.,68.,102.,136.,170.,204.,272.,
-   34.,68.,102.,136.,170.,204.,272.,
-   34.,68.,102.,136.,170.,204.,272.,
-   34.,68.,102.,136.,170.,204.,272.,
-   34.,68.,102.,136.,170.,204.,272., 
-   0.,-34.,-68.,-102.,-136.,-170.,-204., // left
-   0.,-34.,-68.,-102.,-136.,-170.,-204.,
-   0.,-34.,-68.,-102.,-136.,-170.,-204.,
-   0.,-34.,-68.,-102.,-136.,-170.,-204.,
-   0.,-51.,-68.,-102.,-136.,-170.,-204.,
-   0.,-34.,-68.,-102.,-136.,-170.,-204.,
-   0.,-34.,-68.,-102.,-136.,-170.,-204.,
-   0.,-34.,-68.,-102.,-136.,-170.,-204.,
-   0.,-34.,-68.,-102.,-136.,-170.,-204.};
-  fgXcmax   = xCmax;
-
-  static Float_t yCmin[126];
-  static Float_t yCmax[126];
   Float_t y1Cmin[126];
   Float_t y1Cmax[126];
 
@@ -175,102 +70,101 @@ void AliMUONSegmentationTrigger::Init(AliMUONChamber* Chamber)
   Float_t z1mp=z1PosMinus/z1PosPlus;
 
   cout << " fZscale = " << fZscale << "\n";
-
-// calculate yCmin and yCmax 
-  for (Int_t i=62; i>=0; i--) {
-    Int_t j=ModuleNumber(-num[i]);  // i == right, j == left 
-    if (Int_t(num[i]/10)==5) {  // start with middle chamber
-      if (num[i]==51) {         // special case (empty module)
-       yCmin[i]=yCmax[i]=yCmin[j]=yCmax[j]=0.;
+  
+// calculate yCmin and fYcmax 
+  Int_t i;  
+  for (i=62; i>=0; i--) {
+    Int_t j=ModuleNumber(-AliMUONTriggerConstants::ModuleId(i));  // i == right, j == left 
+    if (Int_t(AliMUONTriggerConstants::ModuleId(i)/10)==5) {  // start with middle chamber
+      if (AliMUONTriggerConstants::ModuleId(i)==51) {         // special case (empty module)
+       fYcmin[i]=fYcmax[i]=fYcmin[j]=fYcmax[j]=0.;
       } else {
        y1Cmin[i]=y1Cmin[j]=-34;
        y1Cmax[i]=y1Cmax[j]=34;
-       yCmin[i]=yCmin[j]=-34.;
-       yCmax[i]=yCmax[j]=34.;
+       fYcmin[i]=fYcmin[j]=-34.;
+
+       fYcmax[i]=fYcmax[j]=34.;
       }
-    } else if (Int_t(num[i]/10)==4) { // up
-      if (num[i]!=41) {       
+    } else if (Int_t(AliMUONTriggerConstants::ModuleId(i)/10)==4) { // up
+      if (AliMUONTriggerConstants::ModuleId(i)!=41) {       
        y1Cmin[i]=y1Cmax[i+7]*z1pm;
        y1Cmax[i]=y1Cmin[i]+68.;
-       yCmin[i]=y1Cmin[i];
-       yCmax[i]=yCmin[i]+68.;
+       fYcmin[i]=y1Cmin[i];
+       fYcmax[i]=fYcmin[i]+68.;
 
        y1Cmin[j]=y1Cmax[j+7]*z1mp;
        y1Cmax[j]=y1Cmin[j]+68.;
-       yCmin[j]=y1Cmin[j];
-       yCmax[j]=yCmin[j]+68.;
+       fYcmin[j]=y1Cmin[j];
+       fYcmax[j]=fYcmin[j]+68.;
       } else { 
        y1Cmin[i]=y1Cmin[ModuleNumber(42)]+17;
        y1Cmax[i]=y1Cmin[i]+51.;
-       yCmin[i]=y1Cmin[i];
-       yCmax[i]=yCmin[i]+51.;
+       fYcmin[i]=y1Cmin[i];
+       fYcmax[i]=fYcmin[i]+51.;
 
        y1Cmin[j]=y1Cmin[ModuleNumber(-42)]+17;
        y1Cmax[j]=y1Cmin[j]+51.;
-       yCmin[j]=y1Cmin[j];
-       yCmax[j]=yCmin[j]+51.;
+       fYcmin[j]=y1Cmin[j];
+       fYcmax[j]=fYcmin[j]+51.;
       }
-    } else if (Int_t(num[i]/10)==3) { 
+    } else if (Int_t(AliMUONTriggerConstants::ModuleId(i)/10)==3) { 
       y1Cmin[i]=y1Cmax[i+7]*z1mp;
       y1Cmax[i]=y1Cmin[i]+68.;
-      yCmin[i]=y1Cmin[i];
-      yCmax[i]=yCmin[i]+68.;
+      fYcmin[i]=y1Cmin[i];
+      fYcmax[i]=fYcmin[i]+68.;
 
       y1Cmin[j]=y1Cmax[j+7]*z1pm;
       y1Cmax[j]=y1Cmin[j]+68.;
-      yCmin[j]=y1Cmin[j];
-      yCmax[j]=yCmin[j]+68.;
-    } else if (Int_t(num[i]/10)==2) {
+      fYcmin[j]=y1Cmin[j];
+      fYcmax[j]=fYcmin[j]+68.;
+    } else if (Int_t(AliMUONTriggerConstants::ModuleId(i)/10)==2) {
       y1Cmin[i]=y1Cmax[i+7]*z1pm;
       y1Cmax[i]=y1Cmin[i]+68.;
-      yCmin[i]=y1Cmin[i];
-      yCmax[i]=yCmin[i]+68.;
+      fYcmin[i]=y1Cmin[i];
+      fYcmax[i]=fYcmin[i]+68.;
 
       y1Cmin[j]=y1Cmax[j+7]*z1mp;
       y1Cmax[j]=y1Cmin[j]+68.;
-      yCmin[j]=y1Cmin[j];
-      yCmax[j]=yCmin[j]+68.;
-    } else if (Int_t(num[i]/10)==1) {
+      fYcmin[j]=y1Cmin[j];
+      fYcmax[j]=fYcmin[j]+68.;
+    } else if (Int_t(AliMUONTriggerConstants::ModuleId(i)/10)==1) {
       y1Cmin[i]=y1Cmax[i+7]*z1mp;
       y1Cmax[i]=y1Cmin[i]+68.;
-      yCmin[i]=y1Cmin[i];
-      yCmax[i]=yCmin[i]+68.;
+      fYcmin[i]=y1Cmin[i];
+      fYcmax[i]=fYcmin[i]+68.;
 
       y1Cmin[j]=y1Cmax[j+7]*z1pm;
       y1Cmax[j]=y1Cmin[j]+68.;
-      yCmin[j]=y1Cmin[j];
-      yCmax[j]=yCmin[j]+68.;
+      fYcmin[j]=y1Cmin[j];
+      fYcmax[j]=fYcmin[j]+68.;
     }
   }
 
-  for (Int_t i=0; i<63; i++) {      // second loop (fill lower part)
-    Int_t j=ModuleNumber(-num[i]);  // i == right, j == left 
-    if (TMath::Abs(Int_t(num[i]/10))==6) { 
-      yCmin[i]=-yCmax[i-14];
-      yCmax[i]=-yCmin[i-14];
-      yCmin[j]=-yCmax[j-14];
-      yCmax[j]=-yCmin[j-14];
-    } else if (TMath::Abs(Int_t(num[i]/10))==7) { 
-      yCmin[i]=-yCmax[i-28];
-      yCmax[i]=-yCmin[i-28];
-      yCmin[j]=-yCmax[j-28];
-      yCmax[j]=-yCmin[j-28];
-    } else if (TMath::Abs(Int_t(num[i]/10))==8) { 
-      yCmin[i]=-yCmax[i-42];
-      yCmax[i]=-yCmin[i-42];
-      yCmin[j]=-yCmax[j-42];
-      yCmax[j]=-yCmin[j-42];
-    } else if (TMath::Abs(Int_t(num[i]/10))==9) { 
-      yCmin[i]=-yCmax[i-56];
-      yCmax[i]=-yCmin[i-56];
-      yCmin[j]=-yCmax[j-56];
-      yCmax[j]=-yCmin[j-56];
+  for (i=0; i<63; i++) {      // second loop (fill lower part)
+    Int_t j=ModuleNumber(-AliMUONTriggerConstants::ModuleId(i));  // i == right, j == left 
+    if (TMath::Abs(Int_t(AliMUONTriggerConstants::ModuleId(i)/10))==6) { 
+      fYcmin[i]=-fYcmax[i-14];
+      fYcmax[i]=-fYcmin[i-14];
+      fYcmin[j]=-fYcmax[j-14];
+      fYcmax[j]=-fYcmin[j-14];
+    } else if (TMath::Abs(Int_t(AliMUONTriggerConstants::ModuleId(i)/10))==7) { 
+      fYcmin[i]=-fYcmax[i-28];
+      fYcmax[i]=-fYcmin[i-28];
+      fYcmin[j]=-fYcmax[j-28];
+      fYcmax[j]=-fYcmin[j-28];
+    } else if (TMath::Abs(Int_t(AliMUONTriggerConstants::ModuleId(i)/10))==8) { 
+      fYcmin[i]=-fYcmax[i-42];
+      fYcmax[i]=-fYcmin[i-42];
+      fYcmin[j]=-fYcmax[j-42];
+      fYcmax[j]=-fYcmin[j-42];
+    } else if (TMath::Abs(Int_t(AliMUONTriggerConstants::ModuleId(i)/10))==9) { 
+      fYcmin[i]=-fYcmax[i-56];
+      fYcmax[i]=-fYcmin[i-56];
+      fYcmin[j]=-fYcmax[j-56];
+      fYcmax[j]=-fYcmin[j-56];
     } 
   }
 
-  fgYcmin   = yCmin;
-  fgYcmax   = yCmax;
-  
   fNpx=124;
   fNpy=64;  
 
@@ -282,8 +176,8 @@ void AliMUONSegmentationTrigger::Init(AliMUONChamber* Chamber)
 Int_t AliMUONSegmentationTrigger::ModuleNumber(Int_t imodule){
 // returns module number (from 0 to 126) corresponding to module imodule
   Int_t imod=0;
-  for (Int_t i=0; i<fgNmodule; i++) {
-    if (fgNum[i]==imodule) { 
+  for (Int_t i=0; i<AliMUONTriggerConstants::Nmodule(); i++) {
+    if (AliMUONTriggerConstants::ModuleId(i)==imodule) { 
       imod=i;
       break;
     }
@@ -297,12 +191,12 @@ Float_t AliMUONSegmentationTrigger::StripSizeX(Int_t imodule){
 
   Int_t absimodule=TMath::Abs(imodule); 
   Int_t moduleNum=ModuleNumber(imodule);
-  if (fgNum[absimodule]==51) {
+  if (absimodule==51) {
     return 0; 
   } else {
-    return TMath::Abs((fgYcmax[moduleNum]-fgYcmin[moduleNum])/
-                     fgNstripx[moduleNum]);
-  }
+    return TMath::Abs((fYcmax[moduleNum]-fYcmin[moduleNum])/
+                     AliMUONTriggerConstants::NstripX(moduleNum));
+  }  
 }
 
 //------------------------------------------------------------------
@@ -311,11 +205,12 @@ Float_t AliMUONSegmentationTrigger::StripSizeY(Int_t imodule){
         
   Int_t absimodule=TMath::Abs(imodule); 
   Int_t moduleNum=ModuleNumber(imodule);
-  if (fgNum[absimodule]==51) {
+  if (absimodule==51) {
     return 0;
   } else {
-    return TMath::Abs((fgXcmax[moduleNum]-fgXcmin[moduleNum])/
-                     fgNstripy[moduleNum]);
+      return TMath::Abs((AliMUONTriggerConstants::XcMax(moduleNum) - 
+                        AliMUONTriggerConstants::XcMin(moduleNum)) / 
+                       AliMUONTriggerConstants::NstripY(moduleNum));
   }
 }
 
@@ -328,3 +223,12 @@ void AliMUONSegmentationTrigger::SetHit(Float_t xhit, Float_t yhit)
   fxhit=xhit;
   fyhit=yhit;
 }
+
+
+
+
+
+
+
+
+
index a034807..0c95299 100644 (file)
@@ -6,7 +6,6 @@
 
 /* $Id$ */
 
-
 #include "AliMUONSegmentationV0.h"
 class AliMUONChamber;
 //----------------------------------------------
@@ -17,7 +16,7 @@ class AliMUONSegmentationTrigger :
 public AliMUONSegmentationV0 {
  public:
   AliMUONSegmentationTrigger(){};
-  virtual ~AliMUONSegmentationTrigger(){}   
+  virtual ~AliMUONSegmentationTrigger(){}  
   virtual void Init(AliMUONChamber* chamber);         // Initialization
   Int_t ModuleNumber(Int_t imodule);  // returns module number of ModuleId
   // Set pad position -> in SegRes X & Y
@@ -25,30 +24,14 @@ public AliMUONSegmentationV0 {
   // Set hit position
   virtual void     SetHit(Float_t xhit, Float_t yhit);
   
-  // Current Pad during Integration
-  // x-coordinate
-  //    virtual Int_t  Ix();
-  // y-coordinate
-  //    virtual Int_t  Iy();
-  
   ClassDef(AliMUONSegmentationTrigger,1) //Segmentation class for trigger
     protected:
-  //  Returns x-strip size for given module imodule
   Float_t StripSizeX(Int_t imodule);
-  //  Returns y-strip size for given module imodule
   Float_t StripSizeY(Int_t imodule);    
  protected:
-// Geometry Parameters
-
-  Int_t fgNum[126];           // circuit Id. 
-  Int_t fgNmodule;        // total number of modules
-  Int_t fgNstripx[126];       // number of X strip / module
-  Int_t fgNstripy[126];       // number of Y strip / module
-  Float_t fgXcmin[126];       // x min position of modules
-  Float_t fgXcmax[126];       // x max position of modules
-  Float_t fgYcmin[126];       // y min position of modules
-  Float_t fgYcmax[126];       // y max position of modules    
-  Float_t    fZscale;            // scaling factor (Zx/Z1, x=1,2,3,4)
+  Float_t fYcmin[126];       // y min position of modules
+  Float_t fYcmax[126];       // y max position of modules
+  Float_t fZscale;            // scaling factor (Zx/Z1, x=1,2,3,4)
 
 // Current pad during integration (cursor for disintegration)
   Int_t fix;  // pad coord.  x