]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONSegmentationSlat.cxx
Merge MC labels for 4 neighbour bins in the Hough space in order to reduce the size...
[u/mrichter/AliRoot.git] / MUON / AliMUONSegmentationSlat.cxx
index e2905b8863019ae5922c97706fe1b253b2b3fe8c..6986364bb94e7536a3b5ac786b80d503a8f2c2df 100644 (file)
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
 
-/*
-$Log$
-Revision 1.17  2001/12/01 20:00:45  hristov
-New protections added
-
-Revision 1.16  2001/10/30 08:25:14  jchudoba
-Small correction to prevent crash when hit is at the edge of a slat
-
-Revision 1.15  2001/09/07 08:38:30  hristov
-Pointers initialised to 0 in the default constructors
-
-Revision 1.14  2001/08/30 09:52:12  hristov
-The operator[] is replaced by At() or AddAt() in case of TObjArray.
-
-Revision 1.13  2001/07/20 10:03:14  morsch
-Changes needed to work with Root 3.01 (substitute lhs [] operator). (Jiri Chudoba)
-
-Revision 1.12  2001/05/16 14:57:17  alibrary
-New files for folders and Stack
-
-Revision 1.11  2001/01/26 21:25:48  morsch
-Empty default constructors and.
-
-Revision 1.10  2001/01/23 18:58:19  hristov
-Initialisation of some pointers
-
-Revision 1.9  2001/01/17 20:53:40  hristov
-Destructors corrected to avoid memory leaks
-
-Revision 1.8  2000/12/21 22:12:41  morsch
-Clean-up of coding rule violations,
-
-Revision 1.7  2000/11/08 13:01:40  morsch
-Chamber half-planes of stations 3-5 at different z-positions.
-
-Revision 1.6  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.5  2000/10/23 13:37:40  morsch
-Correct z-position of slat planes.
-
-Revision 1.4  2000/10/22 16:55:43  morsch
-Use only x-symmetry in global to local transformations and delegation.
-
-Revision 1.3  2000/10/18 11:42:06  morsch
-- AliMUONRawCluster contains z-position.
-- Some clean-up of useless print statements during initialisations.
-
-Revision 1.2  2000/10/09 14:06:18  morsch
-Some type cast problems of type  (TMath::Sign((Float_t)1.,x)) corrected (P.H.)
-
-Revision 1.1  2000/10/06 09:00:47  morsch
-Segmentation class for chambers built out of slats.
-
-*/
+/* $Id$ */
 
 #include "AliMUONSegmentationSlat.h"
 #include "AliMUONSegmentationSlatModule.h"
@@ -81,12 +26,13 @@ Segmentation class for chambers built out of slats.
 #include <TBRIK.h>
 #include <TNode.h>
 #include <TGeometry.h>
-#include <iostream.h>
+#include <Riostream.h>
 
 //___________________________________________
 ClassImp(AliMUONSegmentationSlat)
 
 AliMUONSegmentationSlat::AliMUONSegmentationSlat() 
+  :  AliSegmentation() 
 {
 // Default constructor
   fChamber = 0;
@@ -95,7 +41,8 @@ AliMUONSegmentationSlat::AliMUONSegmentationSlat()
   fCurrentSlat = 0;
 }
 
-AliMUONSegmentationSlat::AliMUONSegmentationSlat(Int_t nsec) 
+AliMUONSegmentationSlat::AliMUONSegmentationSlat(Int_t /*nsec*/) 
+  :  AliSegmentation() 
 {
 // Non default constructor
     fSlats=0;            
@@ -104,6 +51,14 @@ AliMUONSegmentationSlat::AliMUONSegmentationSlat(Int_t nsec)
     fCurrentSlat = 0;
 }
 
+AliMUONSegmentationSlat::AliMUONSegmentationSlat(const AliMUONSegmentationSlat& rhs)
+  :  AliSegmentation(rhs) 
+{
+// Protected copy constructor
+
+  Fatal("AliMUONSegmentationSlatModule", "Not implemented.");
+}
+
 AliMUONSegmentationSlat::~AliMUONSegmentationSlat(){
   //PH Delete TObjArrays
   if (fSlats) {
@@ -117,6 +72,21 @@ AliMUONSegmentationSlat::~AliMUONSegmentationSlat(){
 
 }
 
+//----------------------------------------------------------------------
+AliMUONSegmentationSlat& 
+AliMUONSegmentationSlat::operator=(const AliMUONSegmentationSlat& rhs)
+{
+// Protected assignement operator
+
+  if (this == &rhs) return *this;
+
+  Fatal("operator=", "Not implemented.");
+    
+  return *this;  
+}    
+          
+
+//-----------------------------------------------------------
 void AliMUONSegmentationSlat::SetPadSize(Float_t p1, Float_t p2)
 {
 //  Sets the pad (strip) size 
@@ -124,14 +94,28 @@ void AliMUONSegmentationSlat::SetPadSize(Float_t p1, Float_t p2)
     fDpx=p1;
     fDpy=p2;
 }
-
+//-----------------------------------------------------------
 Float_t AliMUONSegmentationSlat::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;
     return fWireD*wire;
 }
-
+//-----------------------------------------------------------
+void AliMUONSegmentationSlat::GetNParallelAndOffset(Int_t /*iX*/, Int_t /*iY*/, Int_t *Nparallel, Int_t *Offset) 
+{
+  *Nparallel=1;
+  *Offset=0;
+}
+//-----------------------------------------------------------
+void AliMUONSegmentationSlat::GiveTestPoints(Int_t & /*n*/, Float_t */*x*/, Float_t */*y*/)  const 
+{;}
+//-----------------------------------------------------------
+Float_t AliMUONSegmentationSlat::Distance2AndOffset(Int_t /*iX*/, Int_t /*iY*/, Float_t /*X*/, Float_t /*Y*/, Int_t * /*dummy*/) 
+{
+  return 0.;
+}
+//-----------------------------------------------------------
 Float_t AliMUONSegmentationSlat::Dpx(Int_t isec) const
 {
 //
@@ -144,7 +128,7 @@ Float_t AliMUONSegmentationSlat::Dpx(Int_t isec) const
     return Slat(islat)->Dpx(iregion);
 }
 
-Float_t AliMUONSegmentationSlat::Dpy(Int_t isec) const
+Float_t AliMUONSegmentationSlat::Dpy(Int_t /*isec*/) const
 {
 //
 // Returns y-pad (strip)  size for given sector isec
@@ -178,15 +162,17 @@ void AliMUONSegmentationSlat::GlobalToLocal(
 //                                                 positive side is shifted up
 // by half the overlap
     zlocal = z-fChamber->Z();
-    zlocal = (x>0) ? zlocal-2.*fDz : zlocal+2.*fDz;
+
+//     zlocal = (x>0) ? zlocal-2.*fDz : zlocal+2.*fDz;
+    zlocal = (x>0) ? zlocal+2.*fDz : zlocal-2.*fDz;      //Change?
+
 //  Set the signs for the symmetry transformation and transform to first quadrant
     SetSymmetry(x);
     Float_t xabs=TMath::Abs(x);
 
-    Int_t ifirst = (zlocal < Float_t(0))? 0:1;
-//
+
 // Find slat number                      
-    for (i=ifirst; i<fNSlats; i+=2) {
+    for (i=0; i<fNSlats; i+=1) {       //Loop on all slats (longuer but more secure)
        index=i;
        if ((y >= fYPosition[i]-eps) && (y <= fYPosition[i]+fSlatY+eps)) break;
     }
@@ -244,7 +230,7 @@ LocalToGlobal(Int_t islat, Float_t  xlocal, Float_t  ylocal, Float_t  &x, Float_
     x = (xlocal+fXPosition[islat])*fSym;
     y=(ylocal+fYPosition[islat]);
 
-    z = (TMath::Even(islat)) ?     -fDz : fDz ; 
+    z = (TMath::Even(islat)) ?     fDz : -fDz ; //Change for new referential
     z = (x>0)                ? z+2.*fDz : z-2.*fDz ; 
 
     z+=fChamber->Z();
@@ -318,7 +304,7 @@ GetPadC(Int_t ix, Int_t iy, Float_t &x, Float_t &y, Float_t &z)
     x=x*TMath::Sign(1,ix);
 
 // z-position
-    z = (TMath::Even(islat)) ?      -fDz : fDz ; 
+    z = (TMath::Even(islat)) ?      fDz : -fDz ; //Change for new referential
     z = (x>0)                ?  z+2.*fDz : z-2.*fDz ; 
     z += fChamber->Z();
 }