]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONSegmentationV0.cxx
includes cleanup
[u/mrichter/AliRoot.git] / MUON / AliMUONSegmentationV0.cxx
index 6f998359ea8e2a59259efb3b19cc5de5cb3f643e..2b5d7c5c4c998a8f942f9835344f7e0ba302be82 100644 (file)
  **************************************************************************/
 /*
 $Log$
+Revision 1.9  2000/11/06 09:20:43  morsch
+AliMUON delegates part of BuildGeometry() to AliMUONSegmentation using the
+Draw() method. This avoids code and parameter replication.
+
+Revision 1.8  2000/10/18 11:42:06  morsch
+- AliMUONRawCluster contains z-position.
+- Some clean-up of useless print statements during initialisations.
+
+Revision 1.7  2000/10/03 21:48:07  morsch
+Adopt to const declaration of some of the methods in AliSegmentation.
+
+Revision 1.6  2000/10/02 16:58:29  egangler
+Cleaning of the code :
+-> coding conventions
+-> void Streamers
+-> some useless includes removed or replaced by "class" statement
+
+Revision 1.5  2000/07/13 16:19:44  fca
+Mainly coding conventions + some small bug fixes
+
+Revision 1.4  2000/07/03 11:54:57  morsch
+AliMUONSegmentation and AliMUONHitMap have been replaced by AliSegmentation and AliHitMap in STEER
+The methods GetPadIxy and GetPadXxy of AliMUONSegmentation have changed name to GetPadI and GetPadC.
+
 Revision 1.3  2000/06/29 12:34:09  morsch
 AliMUONSegmentation class has been made independent of AliMUONChamber. This makes
 it usable with any other geometry class. The link to the object to which it belongs is
@@ -50,20 +74,21 @@ ClassImp(AliMUONSegmentationV0)
 //  owned by Chamber
 //
     AliMUON *pMUON  = (AliMUON *) gAlice->GetModule("MUON");
-    AliMUONChamber* iChamber=&(pMUON->Chamber(chamber));
+    fChamber=&(pMUON->Chamber(chamber));
     
 //  Initialise maximum number of pads in x ans y
-    fNpx=(Int_t) (iChamber->ROuter()/fDpx+1);
-    fNpy=(Int_t) (iChamber->ROuter()/fDpy+1);
+    fNpx=(Int_t) (fChamber->ROuter()/fDpx+1);
+    fNpy=(Int_t) (fChamber->ROuter()/fDpy+1);
 //  Initialize inner and outer radius of the sensitive region     
-    fRmin=iChamber->RInner();
-    fRmax=iChamber->ROuter();    
+    fRmin=fChamber->RInner();
+    fRmax=fChamber->ROuter();    
     fCorr=0;
-    
+    fZ=fChamber->Z();
+    fId=chamber;
 }
 
 
-Float_t AliMUONSegmentationV0::GetAnod(Float_t xhit)
+Float_t AliMUONSegmentationV0::GetAnod(Float_t xhit) const
 {
 // Returns for a hit position xhit the position of the nearest anode wire    
     Float_t wire= (xhit>0)? Int_t(xhit/fWireD)+0.5:Int_t(xhit/fWireD)-0.5;
@@ -77,8 +102,9 @@ void AliMUONSegmentationV0::SetPadSize(Float_t p1, Float_t p2)
     fDpx=p1;
     fDpy=p2;
 }
+
 void AliMUONSegmentationV0::
-    GetPadI(Float_t x, Float_t y, Int_t &ix, Int_t &iy)
+    GetPadI(Float_t x, Float_t y, Int_t &ix, Int_t &iy) 
 {
 //  Returns pad coordinates (ix,iy) for given real coordinates (x,y)
 //
@@ -89,8 +115,9 @@ void AliMUONSegmentationV0::
     if (ix >  fNpx) ix= fNpx;
     if (ix < -fNpx) ix=-fNpx;
 }
+
 void AliMUONSegmentationV0::
-GetPadC(Int_t ix, Int_t iy, Float_t &x, Float_t &y)
+GetPadC(Int_t ix, Int_t iy, Float_t &x, Float_t &y) 
 {
 //  Returns real coordinates (x,y) for given pad coordinates (ix,iy)
 //
@@ -113,8 +140,8 @@ SetHit(Float_t xhit, Float_t yhit)
     //
     // Sets virtual hit position, needed for evaluating pad response 
     // outside the tracking program 
-    fxhit=xhit;
-    fyhit=yhit;
+    fXhit=xhit;
+    fYhit=yhit;
 }
 
 void AliMUONSegmentationV0::
@@ -123,7 +150,7 @@ SetPad(Int_t ix, Int_t iy)
     //
     // Sets virtual pad coordinates, needed for evaluating pad response 
     // outside the tracking program 
-    GetPadC(ix,iy,fx,fy);
+    GetPadC(ix,iy,fX,fY);
 }
 
 void AliMUONSegmentationV0::
@@ -134,8 +161,8 @@ FirstPad(Float_t xhit, Float_t yhit, Float_t dx, Float_t dy)
     //
     // Find the wire position (center of charge distribution)
     Float_t x0a=GetAnod(xhit);
-    fxhit=x0a;
-    fyhit=yhit;
+    fXhit=x0a;
+    fYhit=yhit;
     //
     // and take fNsigma*sigma around this center
     Float_t x01=x0a  - dx;
@@ -144,13 +171,13 @@ FirstPad(Float_t xhit, Float_t yhit, Float_t dx, Float_t dy)
     Float_t y02=yhit + dy;
     //
     // find the pads over which the charge distributes
-    GetPadI(x01,y01,fixmin,fiymin);
-    GetPadI(x02,y02,fixmax,fiymax);    
+    GetPadI(x01,y01,fIxmin,fIymin);
+    GetPadI(x02,y02,fIxmax,fIymax);    
     // 
     // Set current pad to lower left corner
-    fix=fixmin;
-    fiy=fiymin;
-    GetPadC(fix,fiy,fx,fy);
+    fIx=fIxmin;
+    fIy=fIymin;
+    GetPadC(fIx,fIy,fX,fY);
 }
 
 void AliMUONSegmentationV0::NextPad()
@@ -160,25 +187,26 @@ void AliMUONSegmentationV0::NextPad()
   // Comments and Critics:
   // Boundary crossing at x=0 or y=0 not correctly handled !
   // Step to next pad in the integration region
-    if (fix != fixmax) {
-       if (fix==-1) fix++;
-       fix++;
-    } else if (fiy != fiymax) {
-       fix=fixmin;
-       if (fiy==-1) fiy++;
-       fiy++;
+    if (fIx != fIxmax) {
+       if (fIx==-1) fIx++;
+       fIx++;
+    } else if (fIy != fIymax) {
+       fIx=fIxmin;
+       if (fIy==-1) fIy++;
+       fIy++;
     } else {
        printf("\n Error: Stepping outside integration region\n ");
     }
-    GetPadC(fix,fiy,fx,fy);
+    GetPadC(fIx,fIy,fX,fY);
 }
 
 Int_t AliMUONSegmentationV0::MorePads()
+{
 // Stopping condition for the iterator over pads
 //
 // Are there more pads in the integration region ? 
-{
-    if (fix == fixmax && fiy == fiymax) {
+
+    if (fIx == fIxmax && fIy == fIymax) {
        return 0;
     } else {
        return 1;
@@ -190,13 +218,13 @@ void AliMUONSegmentationV0::SigGenInit(Float_t x,Float_t y,Float_t z)
 {
 //
 //  Initialises pad and wire position during stepping
-    fxt =x;
-    fyt =y;
-    GetPadI(x,y,fixt,fiyt);
-    fiwt= (x>0) ? Int_t(x/fWireD)+1 : Int_t(x/fWireD)-1 ;
+    fXt =x;
+    fYt =y;
+    GetPadI(x,y,fIxt,fIyt);
+    fIwt= (x>0) ? Int_t(x/fWireD)+1 : Int_t(x/fWireD)-1 ;
 }
-
-Int_t AliMUONSegmentationV0::SigGenCond(Float_t x,Float_t y,Float_t z)
+Int_t AliMUONSegmentationV0::SigGenCond(Float_t x,Float_t y,Float_t z) 
 {
 //  Signal generation condition during stepping 
 //  0: don't generate signal
@@ -214,7 +242,7 @@ Int_t AliMUONSegmentationV0::SigGenCond(Float_t x,Float_t y,Float_t z)
     Int_t ixt, iyt;
     GetPadI(x,y,ixt,iyt);
     Int_t iwt=(x>0) ? Int_t(x/fWireD)+1 : Int_t(x/fWireD)-1;
-    if ((ixt != fixt) || (iyt !=fiyt) || (iwt != fiwt)) {
+    if ((ixt != fIxt) || (iyt !=fIyt) || (iwt != fIwt)) {
        return 1;
     } else {
        return 0;
@@ -225,14 +253,14 @@ IntegrationLimits(Float_t& x1,Float_t& x2,Float_t& y1, Float_t& y2)
 {
 //  Returns integration limits for current pad
 //
-    x1=fxhit-fx-fDpx/2.;
+    x1=fXhit-fX-fDpx/2.;
     x2=x1+fDpx;
-    y1=fyhit-fy-fDpy/2.;
+    y1=fYhit-fY-fDpy/2.;
     y2=y1+fDpy;    
 }
 
 void AliMUONSegmentationV0::
-Neighbours(Int_t iX, Int_t iY, Int_t* Nlist, Int_t Xlist[10], Int_t Ylist[10])
+Neighbours(Int_t iX, Int_t iY, Int_t* Nlist, Int_t Xlist[10], Int_t Ylist[10]) 
 {
 // Returns list of next neighbours for given Pad (iX, iY)
 //
@@ -251,16 +279,17 @@ Neighbours(Int_t iX, Int_t iY, Int_t* Nlist, Int_t Xlist[10], Int_t Ylist[10])
 
 Float_t AliMUONSegmentationV0::Distance2AndOffset(Int_t iX, Int_t iY, Float_t X, Float_t Y
 , Int_t *dummy)
+{
 // Returns the square of the distance between 1 pad
 // labelled by its Channel numbers and a coordinate
-{
+
   Float_t x,y;
   GetPadC(iX,iY,x,y);
   return (x-X)*(x-X) + (y-Y)*(y-Y);
 }
 
 
-void  AliMUONSegmentationV0::GiveTestPoints(Int_t &n, Float_t *x, Float_t *y)
+void  AliMUONSegmentationV0::GiveTestPoints(Int_t &n, Float_t *x, Float_t *y) const
 {
 // Returns test point on the pad plane.
 // Used during determination of the segmoid correction of the COG-method
@@ -269,7 +298,7 @@ void  AliMUONSegmentationV0::GiveTestPoints(Int_t &n, Float_t *x, Float_t *y)
     y[0]=x[0];
 }
 
-void AliMUONSegmentationV0::Draw()
+void AliMUONSegmentationV0::Draw(const char *) const
 {
 // Draws the segmentation zones
 //