- Passing mapping segmentation via constructor (removed ReadMappingData());
authorivana <ivana@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 11 Jan 2006 09:11:07 +0000 (09:11 +0000)
committerivana <ivana@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 11 Jan 2006 09:11:07 +0000 (09:11 +0000)
- Removed customised streamer

MUON/AliMUONSt12QuadrantSegmentation.cxx
MUON/AliMUONSt12QuadrantSegmentation.h
MUON/AliMUONSt345SlatSegmentationV2.cxx
MUON/AliMUONSt345SlatSegmentationV2.h
MUON/AliMUONTriggerSegmentationV2.cxx
MUON/AliMUONTriggerSegmentationV2.h

index 69d67d3..99944b9 100644 (file)
@@ -48,6 +48,7 @@ const Float_t  AliMUONSt12QuadrantSegmentation::fgkWireD = 0.21;
 
 //______________________________________________________________________________
 AliMUONSt12QuadrantSegmentation::AliMUONSt12QuadrantSegmentation(
+                                       AliMpVSegmentation* segmentation,
                                        AliMpStationType stationType,
                                       AliMpPlaneType planeType) 
 : AliMUONVGeometryDESegmentation(),
@@ -78,7 +79,11 @@ AliMUONSt12QuadrantSegmentation::AliMUONSt12QuadrantSegmentation(
 {
 // Normal constructor
 
-  ReadMappingData();
+  fSectorSegmentation = dynamic_cast<AliMpSectorSegmentation*>(segmentation);
+  if (fSectorSegmentation)
+    fSector = fSectorSegmentation->GetSector();
+  else 
+    AliFatal("Wrong mapping segmentation type");
 
   fCorrA = new TObjArray(3);
   fCorrA->AddAt(0,0);
@@ -175,26 +180,6 @@ void AliMUONSt12QuadrantSegmentation::UpdateCurrentPadValues(const AliMpPad& pad
 }  
 
 
-//______________________________________________________________________________
-void AliMUONSt12QuadrantSegmentation::ReadMappingData()
-{
-// Reads mapping data
-// ---
-
-  // set path to mapping data files
-   if (!gSystem->Getenv("MINSTALL")) {    
-     TString dirPath = gSystem->Getenv("ALICE_ROOT");
-     dirPath += "/MUON/mapping"; 
-     AliMpFiles::SetTopPath(dirPath);
-     gSystem->Setenv("MINSTALL", dirPath.Data());
-     //cout << "AliMpFiles top path set to " << dirPath << endl;         
-   }
-  
-  AliMpSectorReader r(fStationType, fPlaneType);
-  fSector = r.BuildSector();
-  fSectorSegmentation = new AliMpSectorSegmentation(fSector);
-}
-
 //
 // public methods
 //
@@ -451,7 +436,7 @@ void  AliMUONSt12QuadrantSegmentation::FirstPad(Float_t xhit, Float_t yhit, Floa
         ->CreateIterator(AliMpArea(TVector2(fXhit,fYhit),TVector2(dx,dy)));
 
   AliDebug(1,Form("CreateIterator area=%e,%e +- %e,%e %s",
-                  fXhit,fYhit,dx,dy,PlaneTypeName(fPlaneType)));
+                  fXhit,fYhit,dx,dy,PlaneTypeName(fPlaneType).Data()));
   
   fSectorIterator->First();            
 
@@ -684,19 +669,3 @@ TF1* AliMUONSt12QuadrantSegmentation::CorrFunc(Int_t isec) const
 
   return (TF1*) fCorrA->At(isec);
 } 
-
-//______________________________________________________________________________
-void AliMUONSt12QuadrantSegmentation::Streamer(TBuffer &R__b)
-{
-// Stream an object of class AliMUONSt12QuadrantSegmentation.
-
-  if (R__b.IsReading()) {
-    AliMUONSt12QuadrantSegmentation::Class()->ReadBuffer(R__b, this);
-    ReadMappingData();
-  } 
-  else {
-    AliMUONSt12QuadrantSegmentation::Class()->WriteBuffer(R__b, this);
-  }
-}
-
-
index 2ce5162..16bd4d0 100644 (file)
@@ -35,7 +35,8 @@ class AliMUONChamber;
 class AliMUONSt12QuadrantSegmentation : public AliMUONVGeometryDESegmentation 
 {
   public:
-    AliMUONSt12QuadrantSegmentation(AliMpStationType stationType,
+    AliMUONSt12QuadrantSegmentation(AliMpVSegmentation* segmentation,
+                                    AliMpStationType stationType, 
                                     AliMpPlaneType planeType);
     AliMUONSt12QuadrantSegmentation();
     
@@ -162,7 +163,6 @@ class AliMUONSt12QuadrantSegmentation : public AliMUONVGeometryDESegmentation
   private:
     // methods
     void UpdateCurrentPadValues(const AliMpPad& pad);
-    void ReadMappingData();
   
     // constants
     static const Float_t  fgkWireD;     // default wire pitch
@@ -173,8 +173,8 @@ class AliMUONSt12QuadrantSegmentation : public AliMUONVGeometryDESegmentation
     //
     AliMpStationType         fStationType;       // station type
     AliMpPlaneType           fPlaneType;         // plane type
-    AliMpSector*             fSector;            // ! sector (from mapping)
-    AliMpSectorSegmentation* fSectorSegmentation;// sector segmentation (from mapping)
+    const AliMpSector*       fSector;            // sector (from mapping)
+    AliMpSectorSegmentation* fSectorSegmentation;// sector segmentation (from mapping)
     AliMpVPadIterator*       fSectorIterator;    // ! iterator over pads
 
     // Wire pitch
index d634b3c..aff04f6 100644 (file)
@@ -16,8 +16,8 @@
 /* $Id$ */
 
 #include "AliMUONSt345SlatSegmentationV2.h"
+#include "AliMUONConstants.h"
 
-#include "AliLog.h"
 #include "AliMpArea.h"
 #include "AliMpSlat.h"
 #include "AliMpSlatSegmentation.h"
 // Dpx, Dpy, Sector offer now to the clustering. That indeed should be
 // handled directly at the level of AliMpVSegmentation...
 #include "AliMpVPadIterator.h"
-#include "AliMUONSegmentationManager.h"
-#include "AliMUONConstants.h"
 
-#include "Riostream.h"
+#include "AliLog.h"
 
+#include "Riostream.h"
 #include "TClass.h"
 
 ClassImp(AliMUONSt345SlatSegmentationV2)
@@ -62,7 +61,9 @@ fYhit(FMAX)
 }
 
 //_____________________________________________________________________________
-AliMUONSt345SlatSegmentationV2::AliMUONSt345SlatSegmentationV2(Int_t detElemId, AliMpPlaneType bendingOrNonBending)
+AliMUONSt345SlatSegmentationV2::AliMUONSt345SlatSegmentationV2(
+                                   AliMpVSegmentation* segmentation,
+                                   Int_t detElemId, AliMpPlaneType bendingOrNonBending)
 : AliMUONVGeometryDESegmentation(),
 fDetElemId(detElemId),
 fPlaneType(bendingOrNonBending),
@@ -75,8 +76,12 @@ fYhit(FMAX)
   //
   // Normal ctor.
   //
-       
-       ReadMappingData();
+
+  fSlatSegmentation = dynamic_cast<AliMpSlatSegmentation*>(segmentation);
+  if (fSlatSegmentation)
+    fSlat = fSlatSegmentation->Slat();
+  else 
+    AliFatal("Wrong mapping segmentation type");
                
   AliDebug(1,Form("this=%p detElemId=%3d %s fSlatSegmentation=%p",this,detElemId,
                                                                        ( (bendingOrNonBending==kBendingPlane)?"Bending":"NonBending" ),
@@ -475,20 +480,6 @@ AliMUONSt345SlatSegmentationV2::Print(Option_t*) const
   << " fSlatSegmentation->Slat()=" << fSlatSegmentation->Slat() << endl;
 }
 
-//_____________________________________________________________________________
-void
-AliMUONSt345SlatSegmentationV2::ReadMappingData()
-{
-       fSlatSegmentation = dynamic_cast<AliMpSlatSegmentation*>
-  (AliMUONSegmentationManager::Segmentation(fDetElemId,fPlaneType));
-       
-  if (!fSlatSegmentation)
-       {
-               AliFatal("Wrong segmentation type encountered");
-       }
-  fSlat = fSlatSegmentation->Slat();
-}
-
 //_____________________________________________________________________________
 Int_t
 AliMUONSt345SlatSegmentationV2::Sector(Int_t ix, Int_t)
@@ -573,19 +564,3 @@ AliMUONSt345SlatSegmentationV2::SigGenInit(Float_t,Float_t,Float_t)
 {
   AliFatal("Not Implemented");
 }
-
-//_____________________________________________________________________________
-void
-AliMUONSt345SlatSegmentationV2::Streamer(TBuffer &R__b)
-{
-  if (R__b.IsReading()) 
-       {
-    AliMUONSt345SlatSegmentationV2::Class()->ReadBuffer(R__b, this);
-    ReadMappingData();
-  } 
-  else 
-       {
-    AliMUONSt345SlatSegmentationV2::Class()->WriteBuffer(R__b, this);
-  }
-}
-
index 741f1ba..43e7c70 100644 (file)
@@ -31,7 +31,8 @@ class AliMUONSt345SlatSegmentationV2 : public AliMUONVGeometryDESegmentation
  public:
 
   AliMUONSt345SlatSegmentationV2();
-  AliMUONSt345SlatSegmentationV2(Int_t detElemId,
+  AliMUONSt345SlatSegmentationV2(AliMpVSegmentation* segmentation,
+                                 Int_t detElemId,
                                 AliMpPlaneType bendingOrNonBending);
   virtual ~AliMUONSt345SlatSegmentationV2();
 
@@ -121,16 +122,12 @@ class AliMUONSt345SlatSegmentationV2 : public AliMUONVGeometryDESegmentation
   /// Print.
   void Print(Option_t* opt = "") const;
 
- private:
-
-   void ReadMappingData();
-        
  private:
 
   Int_t fDetElemId;
        AliMpPlaneType fPlaneType;
-  const AliMpSlat* fSlat; //!
-  AliMpSlatSegmentation* fSlatSegmentation; //!
+  const AliMpSlat* fSlat;
+  AliMpSlatSegmentation* fSlatSegmentation;
   AliMpVPadIterator* fPadIterator; //!
   AliMpPad fCurrentPad; //!FIXME: should not be needed, if we externalise the SetPad, SetHit, IntegrationLimits methods which have nothing to do here anyway, together with the iteration methods FirstPad, NextPad, MorePads, which have nothing to do here either.
   Float_t fXhit; //!
index 4f3764e..1a4bec8 100644 (file)
 
 #include "AliMUONTriggerSegmentationV2.h"
 
-#include "AliLog.h"
-
 #include "AliMpPCB.h"
 #include "AliMpTrigger.h"
 #include "AliMpTriggerSegmentation.h"
 #include "AliMpSlat.h"
 
-#include "AliMUONSegmentationManager.h"
+#include "AliLog.h"
 
 #include "Riostream.h"
 #include "TClass.h"
@@ -69,8 +67,9 @@ fLineNumber(-1)
 }
 
 //_____________________________________________________________________________
-AliMUONTriggerSegmentationV2::AliMUONTriggerSegmentationV2(Int_t detElemId,
-                                                           AliMpPlaneType bendingOrNonBending) 
+AliMUONTriggerSegmentationV2::AliMUONTriggerSegmentationV2(
+                                   AliMpVSegmentation* segmentation,
+                                   Int_t detElemId, AliMpPlaneType bendingOrNonBending)
 : AliMUONVGeometryDESegmentation(),
 fDetElemId(detElemId),
 fPlaneType(bendingOrNonBending),
@@ -83,7 +82,13 @@ fLineNumber(-1)
   //
   // Normal ctor.
   //
-       ReadMappingData();
+
+  fSlatSegmentation = dynamic_cast<AliMpTriggerSegmentation*>(segmentation);
+  if (fSlatSegmentation)
+    fSlat = fSlatSegmentation->Slat();
+  else 
+    AliFatal("Wrong mapping segmentation type");
+               
                
   AliDebug(1,Form("this=%p detElemId=%3d %s fSlatSegmentation=%p",this,detElemId,
                                                                        ( (bendingOrNonBending==kBendingPlane)?"Bending":"NonBending" ),
@@ -650,27 +655,6 @@ AliMUONTriggerSegmentationV2::Print(Option_t* opt) const
   }
 }
 
-//_____________________________________________________________________________
-void 
-AliMUONTriggerSegmentationV2::ReadMappingData()
-{
-  fSlatSegmentation = dynamic_cast<AliMpTriggerSegmentation*>
-  (AliMUONSegmentationManager::Segmentation(fDetElemId,fPlaneType));
-  
-       if (!fSlatSegmentation)
-       {
-               AliFatal("Wrong segmentation type encountered");
-       }
-  fSlat = fSlatSegmentation->Slat();
-  TString id(fSlat->GetID());
-  Ssiz_t pos = id.Last('L');
-  if ( pos <= 0 )
-  {
-    AliFatal(Form("Cannot infer line number for slat %s",id.Data()));
-  }
-  fLineNumber = TString(id(pos+1),1).Atoi();
-}
-
 //_____________________________________________________________________________
 Int_t
 AliMUONTriggerSegmentationV2::Sector(Int_t ix, Int_t iy)
@@ -783,23 +767,6 @@ AliMUONTriggerSegmentationV2::SigGenInit(Float_t,Float_t,Float_t)
   AliFatal("Not Implemented");
 }
 
-//_____________________________________________________________________________
-void
-AliMUONTriggerSegmentationV2::Streamer(TBuffer &R__b)
-{
-  if (R__b.IsReading()) 
-       {
-    AliMUONTriggerSegmentationV2::Class()->ReadBuffer(R__b, this);
-    ReadMappingData();
-  } 
-  else 
-       {
-    AliMUONTriggerSegmentationV2::Class()->WriteBuffer(R__b, this);
-  }
-}
-
-
-
 
 
 
index c1ac5f3..57bf342 100644 (file)
@@ -32,7 +32,8 @@ class AliMUONTriggerSegmentationV2 : public AliMUONVGeometryDESegmentation
  public:
 
   AliMUONTriggerSegmentationV2();
-  AliMUONTriggerSegmentationV2(Int_t detElemId, AliMpPlaneType bendingOrNonBending);
+  AliMUONTriggerSegmentationV2(AliMpVSegmentation* segmentation,
+                               Int_t detElemId, AliMpPlaneType bendingOrNonBending);
   virtual ~AliMUONTriggerSegmentationV2();
       
   /// Distance between 1 pad and a position
@@ -120,14 +121,11 @@ public:
     
     Int_t ModuleColNum(Int_t ixGlo) const;
     
-private:    
-    void ReadMappingData();
-    
 private:
     Int_t fDetElemId;
     AliMpPlaneType fPlaneType;
-    const AliMpTrigger* fSlat; //!
-    AliMpTriggerSegmentation* fSlatSegmentation; //!
+    const AliMpTrigger* fSlat;
+    AliMpTriggerSegmentation* fSlatSegmentation;
 //    AliMpVPadIterator* fPadIterator; //!
     AliMpPad fCurrentPad; //!FIXME: should not be needed, if we externalise the SetPad, SetHit, IntegrationLimits methods which have nothing to do here anyway, together with the iteration methods FirstPad, NextPad, MorePads, which have nothing to do here either.
     Float_t fXhit; //!