]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONTriggerSegmentationV2.cxx
Coding conventions
[u/mrichter/AliRoot.git] / MUON / AliMUONTriggerSegmentationV2.cxx
index 4f3764eec0669a998827fd6418e1c02e2769a199..877753f23d4d08a1f8a6bc8c6ab4229c09f99c34 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,20 @@ fLineNumber(-1)
   //
   // Normal ctor.
   //
-       ReadMappingData();
+
+  fSlatSegmentation = dynamic_cast<AliMpTriggerSegmentation*>(segmentation);
+  if (fSlatSegmentation)
+    fSlat = fSlatSegmentation->Slat();
+  else 
+    AliFatal("Wrong mapping segmentation type");
+               
+  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();
                
   AliDebug(1,Form("this=%p detElemId=%3d %s fSlatSegmentation=%p",this,detElemId,
                                                                        ( (bendingOrNonBending==kBendingPlane)?"Bending":"NonBending" ),
@@ -378,7 +390,7 @@ AliMUONTriggerSegmentationV2::HasPad(Int_t ixGlo, Int_t iyGlo)
 //_____________________________________________________________________________
 void
 AliMUONTriggerSegmentationV2::IGlo2ILoc(Int_t ixGlo, Int_t iyGlo,
-                                        Int_t& ixLA, Int_t& iyLA)
+                                        Int_t& ixLA, Int_t& iyLA) const
 {
   Int_t ixPC, iyPC;
   GetPadGlo2Loc(ixGlo,iyGlo,ixPC,iyPC);
@@ -388,20 +400,13 @@ AliMUONTriggerSegmentationV2::IGlo2ILoc(Int_t ixGlo, Int_t iyGlo,
 //_____________________________________________________________________________
 void
 AliMUONTriggerSegmentationV2::ILoc2IGlo(Int_t ixLA, Int_t iyLA,
-                                        Int_t& ixGlo, Int_t& iyGlo)
+                                        Int_t& ixGlo, Int_t& iyGlo) const
 {
   Int_t ixPC, iyPC;
   LA2PC(ixLA,iyLA,ixPC,iyPC);
   GetPadLoc2Glo(ixPC,iyPC,ixGlo,iyGlo);
 }
 
-//_____________________________________________________________________________
-void
-AliMUONTriggerSegmentationV2::Init(int)
-{
-  AliWarning("Not Implemented because not needed ;-)");
-}
-
 //_____________________________________________________________________________
 Int_t
 AliMUONTriggerSegmentationV2::ISector()
@@ -498,7 +503,7 @@ AliMUONTriggerSegmentationV2::Iy()
 //_____________________________________________________________________________
 void
 AliMUONTriggerSegmentationV2::LA2PC(Int_t ixLA, Int_t iyLA,
-                                    Int_t& ixPC, Int_t& iyPC)
+                                    Int_t& ixPC, Int_t& iyPC) const
 {
   //
   // From LA to PC conventions for integers indices.
@@ -605,7 +610,7 @@ AliMUONTriggerSegmentationV2::Npy() const
 //_____________________________________________________________________________
 void
 AliMUONTriggerSegmentationV2::PC2LA(Int_t ixPC, Int_t iyPC,
-                                    Int_t& ixLA, Int_t& iyLA)
+                                    Int_t& ixLA, Int_t& iyLA) const
 {
   //
   // From PC to LA conventions for integers indices.
@@ -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);
-  }
-}
-
-
-