]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
global variables removed
authorpcrochet <pcrochet@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 26 Jun 2000 10:01:26 +0000 (10:01 +0000)
committerpcrochet <pcrochet@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 26 Jun 2000 10:01:26 +0000 (10:01 +0000)
MUON/AliMUONSegmentationTriggerX.cxx
MUON/AliMUONSegmentationTriggerY.cxx

index 6007d6657a5ace68bc8b84f42829641709eb2372..7daba873354bf56e9a36854e581e1995099943b0 100644 (file)
 
 /*
 $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:51:03  morsch
 Code from AliMUONSegResTrigger.cxx
 
 */
 
 
+
 /*
 Old Log:
 Revision 1.1.2.4  2000/04/26 12:33:25  morsch
@@ -38,27 +42,32 @@ Draft version from P. Crochet
 */
 
 #include "AliMUONSegmentationTriggerX.h"
+#include "AliMUONTriggerConstants.h"
 #include "TMath.h"
 #include "TRandom.h"
 #include "TArc.h"
 #include "AliMUONChamber.h"
 #include <iostream.h> 
 ClassImp(AliMUONSegmentationTriggerX)
-    
+
+//------------------------------------------------------------------
 void AliMUONSegmentationTriggerX::Init(AliMUONChamber* Chamber)
 {
+// intialize X segmentation 
   cout << "Initialize Trigger Chamber Geometry X " << "\n";    
   AliMUONSegmentationTrigger::Init(Chamber);
 
 // calculate x & y position of X strips
-  for (Int_t imodule=0; imodule<fgNmodule; imodule++) {
-    Float_t width=StripSizeX(fgNum[imodule]);     
-    for (Int_t istrip=0; istrip<fgNstripx[imodule]; istrip++){    
-      fXofxsmin[imodule][istrip] = fgXcmin[imodule]*fZscale;
-      fXofxsmax[imodule][istrip] = fgXcmax[imodule]*fZscale;
+  Int_t nModule=AliMUONTriggerConstants::Nmodule();
+  for (Int_t imodule=0; imodule<nModule; imodule++) {
+    Float_t width=StripSizeX(AliMUONTriggerConstants::ModuleId(imodule));     
+    Int_t nStrip=AliMUONTriggerConstants::NstripX(imodule);
+    for (Int_t istrip=0; istrip<nStrip; istrip++){    
+      fXofxsmin[imodule][istrip] = AliMUONTriggerConstants::XcMin(imodule)*fZscale;
+      fXofxsmax[imodule][istrip] = AliMUONTriggerConstants::XcMax(imodule)*fZscale;
       
-      fYofxsmin[imodule][istrip] = (fgYcmin[imodule]+width*(istrip))*fZscale;
-      fYofxsmax[imodule][istrip] = (fgYcmin[imodule]+width*(istrip+1))*fZscale;
+      fYofxsmin[imodule][istrip] = (fYcmin[imodule]+width*(istrip))*fZscale;
+      fYofxsmax[imodule][istrip] = (fYcmin[imodule]+width*(istrip+1))*fZscale;
     }
   }
 }
@@ -69,14 +78,16 @@ void AliMUONSegmentationTriggerX::GetPadIxy(Float_t x,Float_t y,Int_t &ix,Int_t
 //  x,y = real coordinates; ix = module number , iy = strip number
   ix = 0;    
   iy = 0;
-  for (Int_t imodule=0; imodule<fgNmodule; imodule++) {
-    for (Int_t istrip=0; istrip<fgNstripx[imodule]; istrip++){
-      if (x>fXofxsmin[imodule][istrip]&&x<fXofxsmax[imodule][istrip]&&
-         y>fYofxsmin[imodule][istrip]&&y<fYofxsmax[imodule][istrip]){
-         ix = fgNum[imodule];
-         iy = istrip;
+  Int_t nModule=AliMUONTriggerConstants::Nmodule();
+  for (Int_t imodule=0; imodule<nModule; imodule++) {
+      Int_t nStrip=AliMUONTriggerConstants::NstripX(imodule);
+      for (Int_t istrip=0; istrip<nStrip; istrip++){
+         if (x>fXofxsmin[imodule][istrip]&&x<fXofxsmax[imodule][istrip]&&
+             y>fYofxsmin[imodule][istrip]&&y<fYofxsmax[imodule][istrip]){
+             ix = AliMUONTriggerConstants::ModuleId(imodule);
+             iy = istrip;
+         }
       }
-    }
   }
 }
 
@@ -86,9 +97,10 @@ void AliMUONSegmentationTriggerX::GetPadCxy(Int_t ix, Int_t iy, Float_t &x, Floa
 //  ix = module number , iy = strip number;  x,y = center of strip
   x = 0.;    
   y = 0.; 
-  
-  for (Int_t imodule=0; imodule<fgNmodule; imodule++) {
-    if (fgNum[imodule]==ix){
+  Int_t nModule=AliMUONTriggerConstants::Nmodule();
+
+  for (Int_t imodule=0; imodule<nModule; imodule++) {
+    if (AliMUONTriggerConstants::ModuleId(imodule)==ix){
       x=fXofxsmin[imodule][iy]+(fXofxsmax[imodule][iy]-fXofxsmin[imodule][iy])/2.;
       y=fYofxsmin[imodule][iy]+(fYofxsmax[imodule][iy]-fYofxsmin[imodule][iy])/2.;
     }
@@ -115,7 +127,7 @@ Neighbours(Int_t iX, Int_t iY, Int_t* Nlist, Int_t Xlist[2], Int_t Ylist[2]){
   if (absiX!=0) {                           
     Int_t numModule=ModuleNumber(absiX);
     
-    if (iY<fgNstripx[numModule]-1) {          // strip up in same module 
+    if (iY<AliMUONTriggerConstants::NstripX(numModule)-1) { // strip up in same module 
       *Nlist=1;
       Xlist[0]=absiX;
       Ylist[0]=iY+1;
@@ -157,7 +169,8 @@ Int_t AliMUONSegmentationTriggerX::Iy()
 
 //------------------------------------------------------------------
 Float_t AliMUONSegmentationTriggerX::Dpx(Int_t isec)
-{ // returns x size of x strips for sector isec
+{ 
+// returns x size of x strips for sector isec
     
   if (isec==1) {
     return 17.0*fZscale;
@@ -178,8 +191,8 @@ Float_t AliMUONSegmentationTriggerX::Dpx(Int_t isec)
 
 //------------------------------------------------------------------
 Float_t AliMUONSegmentationTriggerX::Dpy(Int_t isec)
-{ // returns y size of x strips for sector isec
-    // cout << " In AliMUONSegmentationTriggerX::Dpx" << "\n";  
+{ 
+// returns y size of x strips for sector isec
 
   if (isec==1) {
     return 1.0625*fZscale;
@@ -200,16 +213,20 @@ Float_t AliMUONSegmentationTriggerX::Dpy(Int_t isec)
 
 //------------------------------------------------------------------   
 void AliMUONSegmentationTriggerX::SetHit(Float_t xhit, Float_t yhit)
-{ AliMUONSegmentationTrigger::SetHit(xhit,yhit);}
+{ 
+// set hit during disIntegration
+AliMUONSegmentationTrigger::SetHit(xhit,yhit);
+}
 
 //------------------------------------------------------------------   
 Int_t AliMUONSegmentationTriggerX::Sector(Int_t ix, Int_t iy)
 {
 // Returns sector number for given module
 // 
+    
   Int_t absix=TMath::Abs(ix);
   Int_t iwidth=Int_t(StripSizeX(absix));
-  
+
   if (absix==52) {
     return 1;
   } else if (absix==41||absix==61) {
@@ -230,8 +247,9 @@ Int_t AliMUONSegmentationTriggerX::Sector(Int_t ix, Int_t iy)
 //------------------------------------------------------------------   
 void AliMUONSegmentationTriggerX::
 IntegrationLimits(Float_t& x1, Float_t& x2, Float_t& x3, Float_t& width) 
-{ // returns quantities needed to evaluate neighbour strip response
-//  cout << " In AliMUONSegmentationTriggerX::IntegrationLimits" << "\n";
+{ 
+// returns quantities needed to evaluate neighbour strip response
+
   Int_t ix,iy;
   Float_t xstrip,ystrip;
   GetPadIxy(fxhit,fyhit,ix,iy);  
index c96efd44157967cbfd94899a5f0687fc409fee4f..b8ad1db17bc84a4378e1b399c39b55e5497ca599 100644 (file)
 
 /*
 $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:51:58  morsch
 Code from AliMUONSegResTriggerY.cxx
 
 */
 
+
 /*
 Old Log:
 Revision 1.1.2.4  2000/05/05 10:17:04  morsch
@@ -37,6 +41,7 @@ Draft version from P. Crochet
 */
 
 #include "AliMUONSegmentationTriggerY.h"
+#include "AliMUONTriggerConstants.h"
 #include "TMath.h"
 #include "TRandom.h"
 #include "TArc.h"
@@ -44,24 +49,30 @@ Draft version from P. Crochet
 #include <iostream.h> 
 ClassImp(AliMUONSegmentationTriggerY)
 
+//------------------------------------------------------------------
 void AliMUONSegmentationTriggerY::Init(AliMUONChamber* Chamber)
 {
+// intialize Y segmentation 
   cout << "Initialize Trigger Chamber Geometry Y " << "\n";    
   AliMUONSegmentationTrigger::Init(Chamber);
     
 // calculate x & y position of Y strips
-  for (Int_t imodule=0; imodule<fgNmodule; imodule++) {    
-    Float_t width=StripSizeY(fgNum[imodule]);
-    for (Int_t istrip=0; istrip<fgNstripy[imodule]; istrip++){
+  Int_t nModule=AliMUONTriggerConstants::Nmodule();  
+  for (Int_t imodule=0; imodule<nModule; imodule++) {    
+    Float_t width=StripSizeY(AliMUONTriggerConstants::ModuleId(imodule));
+    Int_t nStrip=AliMUONTriggerConstants::NstripY(imodule);    
+    for (Int_t istrip=0; istrip<nStrip; istrip++){
       if (imodule<63) {
-       fXofysmin[imodule][istrip]=(fgXcmin[imodule]+width*(istrip))*fZscale;
-       fXofysmax[imodule][istrip]=(fgXcmin[imodule]+width*(istrip+1))*fZscale;
+       fXofysmin[imodule][istrip]=
+           (AliMUONTriggerConstants::XcMin(imodule)+width*(istrip))*fZscale;
+       fXofysmax[imodule][istrip]=
+           (AliMUONTriggerConstants::XcMin(imodule)+width*(istrip+1))*fZscale;
       } else { 
        fXofysmin[imodule][istrip]=-1.*fXofysmax[imodule-63][istrip];
        fXofysmax[imodule][istrip]=-1.*fXofysmin[imodule-63][istrip];
       }      
-      fYofysmin[imodule][istrip] = fgYcmin[imodule]*fZscale;
-      fYofysmax[imodule][istrip] = fgYcmax[imodule]*fZscale;
+      fYofysmin[imodule][istrip] = fYcmin[imodule]*fZscale;
+      fYofysmax[imodule][istrip] = fYcmax[imodule]*fZscale;
     }
   }
 
@@ -74,11 +85,13 @@ void AliMUONSegmentationTriggerY::GetPadIxy(Float_t x,Float_t y,Int_t &ix,Int_t
 
   ix = 0;    
   iy = 0;
-  for (Int_t imodule=0; imodule<fgNmodule; imodule++) {
-    for (Int_t istrip=0; istrip<fgNstripy[imodule]; istrip++){
+  Int_t nModule=AliMUONTriggerConstants::Nmodule();
+  for (Int_t imodule=0; imodule<nModule; imodule++) {
+      Int_t nStrip=AliMUONTriggerConstants::NstripY(imodule);      
+    for (Int_t istrip=0; istrip<nStrip; istrip++){
       if (x>fXofysmin[imodule][istrip]&&x<fXofysmax[imodule][istrip]&&
          y>fYofysmin[imodule][istrip]&&y<fYofysmax[imodule][istrip]){
-       ix = fgNum[imodule];
+       ix = AliMUONTriggerConstants::ModuleId(imodule);
        iy = istrip;
       }
     }
@@ -91,8 +104,9 @@ void AliMUONSegmentationTriggerY::GetPadCxy(Int_t ix, Int_t iy, Float_t &x, Floa
 //  ix = module number , iy = strip number;  x,y = center of strip
   x = 0.;    
   y = 0.;
-  for (Int_t imodule=0; imodule<fgNmodule; imodule++) {
-    if (fgNum[imodule]==ix){
+  Int_t nModule=AliMUONTriggerConstants::Nmodule();
+  for (Int_t imodule=0; imodule<nModule; imodule++) {
+    if (AliMUONTriggerConstants::ModuleId(imodule)==ix){
       x=fXofysmin[imodule][iy]+(fXofysmax[imodule][iy]-fXofysmin[imodule][iy])/2.;
       y=fYofysmin[imodule][iy]+(fYofysmax[imodule][iy]-fYofysmin[imodule][iy])/2.;
     }
@@ -118,7 +132,7 @@ Neighbours(Int_t iX, Int_t iY, Int_t* Nlist, Int_t Xlist[2], Int_t Ylist[2]){
   if (absiX!=0) {                         
     Int_t numModule=ModuleNumber(absiX);
     
-    if (iY==fgNstripy[numModule]-1) {                      // strip right 
+    if (iY==AliMUONTriggerConstants::NstripY(numModule)-1) { // strip right 
       if (absiX%10!=7) {
        *Nlist=1;
        Xlist[0]=absiX+1;
@@ -134,7 +148,7 @@ Neighbours(Int_t iX, Int_t iY, Int_t* Nlist, Int_t Xlist[2], Int_t Ylist[2]){
       if (absiX%10!=1&&absiX!=52) {
        *Nlist=*Nlist+1;
        Xlist[*Nlist-1]=absiX-1;
-       Ylist[*Nlist-1]=fgNstripy[numModule-1]-1;
+       Ylist[*Nlist-1]=AliMUONTriggerConstants::NstripY(numModule-1)-1;
       } 
     } else {
       *Nlist=*Nlist+1;
@@ -172,8 +186,8 @@ Int_t AliMUONSegmentationTriggerY::Iy()
 
 //------------------------------------------------------------------
 Float_t AliMUONSegmentationTriggerY::Dpx(Int_t isec)
-{ // returns x size of y strips for sector isec
-
+{ 
+// returns x size of y strips for sector isec
   if (isec==1) {
     return 2.125*fZscale;
   } else if (isec==2) {
@@ -189,9 +203,8 @@ Float_t AliMUONSegmentationTriggerY::Dpx(Int_t isec)
 
 //------------------------------------------------------------------
 Float_t AliMUONSegmentationTriggerY::Dpy(Int_t isec)
-{ // returns y size of y strips for sector isec
-    // cout << " In AliMUONSegmentationTriggerX::Dpx" << "\n";  
-
+{ 
+// returns y size of y strips for sector isec
   if (isec==1) {
     return 68.0*fZscale;
   } else if (isec==2) {
@@ -210,7 +223,10 @@ Float_t AliMUONSegmentationTriggerY::Dpy(Int_t isec)
 
 //------------------------------------------------------------------   
 void AliMUONSegmentationTriggerY::SetHit(Float_t xhit, Float_t yhit)
-{ AliMUONSegmentationTrigger::SetHit(xhit,yhit);}
+{ 
+// set hits during diintegration
+    AliMUONSegmentationTrigger::SetHit(xhit,yhit);
+}
 
 //------------------------------------------------------------------   
 Int_t AliMUONSegmentationTriggerY::Sector(Int_t ix, Int_t iy)
@@ -219,7 +235,7 @@ Int_t AliMUONSegmentationTriggerY::Sector(Int_t ix, Int_t iy)
 // 
   Int_t absix=TMath::Abs(ix);
   Int_t iwidth=Int_t(StripSizeY(absix));
-    
+
   if (absix==52) {
     return 1;
   } else if (absix==41||absix==61) {