]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONSegmentationSlatModule.cxx
Initialize decayer before generation. Important if run inside cocktail.
[u/mrichter/AliRoot.git] / MUON / AliMUONSegmentationSlatModule.cxx
index b26f9b65e18a8cc392e3994bac1fae81eecc1792..d8540e4f6a94f46e25c93b7fd0ddb4a3d2e519a0 100644 (file)
 
 /*
 $Log$
+Revision 1.8  2001/01/17 20:53:40  hristov
+Destructors corrected to avoid memory leaks
+
+Revision 1.7  2000/12/21 22:12:41  morsch
+Clean-up of coding rule violations,
+
+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/26 19:32:04  morsch
+Problem with iteration over y-pads for 2nd cathode corrected.
+
 Revision 1.4  2000/10/25 19:56:55  morsch
 Handle correctly slats with less than 3 segmentation zones.
 
@@ -37,6 +50,8 @@ Segmentation classes for bending and non bending plane slat modules (A. de Falco
 
 
 #include "AliMUONSegmentationSlatModule.h"
+#include "AliRun.h"
+#include "AliMUON.h"
 #include <TMath.h>
 #include <iostream.h>
 
@@ -48,13 +63,25 @@ ClassImp(AliMUONSegmentationSlatModule)
 AliMUONSegmentationSlatModule::AliMUONSegmentationSlatModule() 
 {
 // Default constructor
-    fNsec=4;
+}
+
+AliMUONSegmentationSlatModule::AliMUONSegmentationSlatModule(Int_t nsec) 
+{
+// Non default constructor
+    fNsec = nsec;
     fNDiv = new TArrayI(fNsec);      
     fDpxD = new TArrayF(fNsec);      
     (*fNDiv)[0]=(*fNDiv)[1]=(*fNDiv)[2]=(*fNDiv)[3]=0;     
     (*fDpxD)[0]=(*fDpxD)[1]=(*fDpxD)[2]=(*fDpxD)[3]=0;     
 }
 
+AliMUONSegmentationSlatModule::~AliMUONSegmentationSlatModule() 
+{
+// Destructor
+    if (fNDiv) delete fNDiv;
+    if (fDpxD) delete fDpxD;
+}
+
 void AliMUONSegmentationSlatModule::SetPcbBoards(Int_t n[4])
 {
 //
@@ -153,6 +180,8 @@ SetPad(Int_t ix, Int_t iy)
 void AliMUONSegmentationSlatModule::
 SetHit(Float_t x, Float_t y)
 {
+// Set current hit 
+//
     fXhit = x;
     fYhit = y;
     
@@ -256,10 +285,10 @@ void AliMUONSegmentationSlatModule::NextPad()
 
 
 Int_t AliMUONSegmentationSlatModule::MorePads()
+{
 // Stopping condition for the iterator over pads
 //
 // Are there more pads in the integration region
-{
     
     return  (fIx != -1  || fIy != -1);
 }
@@ -337,7 +366,6 @@ Neighbours(Int_t iX, Int_t iY, Int_t* Nlist, Int_t Xlist[10], Int_t Ylist[10])
 
 void AliMUONSegmentationSlatModule::Init(Int_t chamber)
 {
-    printf("\n Initialise Segmentation SlatModule \n");
 //
 //  Fill the arrays fCx (x-contour) and fNpxS (ix-contour) for each sector
 //  These arrays help in converting from real to pad co-ordinates and
@@ -347,6 +375,8 @@ void AliMUONSegmentationSlatModule::Init(Int_t chamber)
 //  concentric circles as shown below
 //
 //  PCB module size in cm
+    printf("\n Initialise Segmentation SlatModule \n");
+
     fDxPCB=40;
     fDyPCB=40;
 //
@@ -385,7 +415,6 @@ void AliMUONSegmentationSlatModule::Init(Int_t chamber)
     fNpx=fNpxS[3];
 //
     fId = chamber;
-    
 }