]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONTriggerSegmentationV2.cxx
Updated comments for Doxygen - corrected warnings
[u/mrichter/AliRoot.git] / MUON / AliMUONTriggerSegmentationV2.cxx
index 1c1f25957ee9f2b82951ce37d0e520bd71b654b8..a3df482ca57a87512556b92c5522625080a13b87 100644 (file)
 
 /* $Id$ */
 
-#include "AliMUONTriggerSegmentationV2.h"
+// -------------------------------------
+// Class AliMUONTriggerSegmentation
+// -------------------------------------
+// Segmentation for MUON trigger stations using 
+// the mapping package
 
-#include "AliLog.h"
+#include "AliMUONTriggerSegmentationV2.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 +73,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 +88,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" ),
@@ -93,14 +111,15 @@ fLineNumber(-1)
 //_____________________________________________________________________________
 AliMUONTriggerSegmentationV2::AliMUONTriggerSegmentationV2(const AliMUONTriggerSegmentationV2& rhs) : AliMUONVGeometryDESegmentation(rhs)
 {
+// Copy constructor
   AliFatal("Not implemented.");
 }
 
 //_____________________________________________________________________________
 AliMUONTriggerSegmentationV2::~AliMUONTriggerSegmentationV2() 
 { 
-  AliDebug(1,Form("this=%p",this));                    
   // Destructor
+  AliDebug(1,Form("this=%p",this));                    
 }
 
 //_____________________________________________________________________________
@@ -116,6 +135,8 @@ AliMUONTriggerSegmentationV2& AliMUONTriggerSegmentationV2::operator=(const AliM
 TF1*
 AliMUONTriggerSegmentationV2::CorrFunc(Int_t) const
 {
+// Not implemented
+
   AliFatal("Not implemented");
   return 0x0;
 }
@@ -125,6 +146,8 @@ Float_t
 AliMUONTriggerSegmentationV2::Distance2AndOffset(Int_t, Int_t, 
                                                  Float_t, Float_t, Int_t*)
 {
+// Not implemented
+
   AliFatal("Not implemented");
   return 0;
 }
@@ -133,6 +156,8 @@ AliMUONTriggerSegmentationV2::Distance2AndOffset(Int_t, Int_t,
 void
 AliMUONTriggerSegmentationV2::Draw(Option_t*)
 {
+// Not implemented
+
   AliFatal("Not Implemented");
 }
 
@@ -140,6 +165,8 @@ AliMUONTriggerSegmentationV2::Draw(Option_t*)
 Float_t
 AliMUONTriggerSegmentationV2::Dpx() const
 {
+// Not implemented
+
   AliFatal("Not Implemented");
   return 0.0;
 }
@@ -148,15 +175,19 @@ AliMUONTriggerSegmentationV2::Dpx() const
 Float_t
 AliMUONTriggerSegmentationV2::Dpy() const
 {
+// Not implemented
+
   AliFatal("Not Implemented");
   return 0.0;
 }
 
 //_____________________________________________________________________________
 Float_t
-AliMUONTriggerSegmentationV2::Dpx(int sectorCode) const
+AliMUONTriggerSegmentationV2::Dpx(Int_t sectorCode) const
 {
-  Int_t ixLA, iyLA;
+// Get pad size in x
+
+ Int_t ixLA, iyLA;
   Decode(sectorCode,ixLA,iyLA);
   AliMpPad pad = fSlatSegmentation->PadByIndices(AliMpIntPair(ixLA,iyLA),kFALSE);
   if ( !pad.IsValid() ) return 0.0;
@@ -165,8 +196,10 @@ AliMUONTriggerSegmentationV2::Dpx(int sectorCode) const
 
 //_____________________________________________________________________________
 Float_t
-AliMUONTriggerSegmentationV2::Dpy(int sectorCode) const
+AliMUONTriggerSegmentationV2::Dpy(Int_t sectorCode) const
 {
+// Get pad size in y
+
   Int_t ixLA, iyLA;
   Decode(sectorCode,ixLA,iyLA);
   AliMpPad pad = fSlatSegmentation->PadByIndices(AliMpIntPair(ixLA,iyLA),kFALSE);
@@ -176,10 +209,11 @@ AliMUONTriggerSegmentationV2::Dpy(int sectorCode) const
 
 //_____________________________________________________________________________
 void
-AliMUONTriggerSegmentationV2::FirstPad(Float_t /*xhit*/, Float_t /*yhit*/, 
-                                                                                                                                                                Float_t /*zhit*/, 
-                                                                                                                                                                Float_t /*dx*/, Float_t /*dy*/)
+AliMUONTriggerSegmentationV2::FirstPad(Float_t /*xhit*/, Float_t /*yhit*/, Float_t /*zhit*/,
+                                       Float_t /*dx*/, Float_t /*dy*/)
 {
+// Not implemented
+
   AliFatal("Not implemented");
 }
 
@@ -187,6 +221,8 @@ AliMUONTriggerSegmentationV2::FirstPad(Float_t /*xhit*/, Float_t /*yhit*/,
 Float_t
 AliMUONTriggerSegmentationV2::GetAnod(Float_t) const
 {
+// Not implemented
+
   AliFatal("Not implemented");
   return 0.0;
 }
@@ -195,14 +231,28 @@ AliMUONTriggerSegmentationV2::GetAnod(Float_t) const
 AliMUONGeometryDirection
 AliMUONTriggerSegmentationV2::GetDirection()
 {
+// Not implemented
+
   //AliWarning("Not Implemented");
   return kDirUndefined;
 }
 
+//______________________________________________________________________________
+const AliMpVSegmentation*  
+AliMUONTriggerSegmentationV2::GetMpSegmentation() const
+{
+// Returns the mapping segmentation
+// (provides access to electronics info)
+
+  return fSlatSegmentation;
+}  
+
 //_____________________________________________________________________________
 void 
 AliMUONTriggerSegmentationV2::GetNParallelAndOffset(Int_t,Int_t,Int_t*,Int_t*)
 {
+// Not implemented
+
   AliFatal("Not Implemented");
 }
 
@@ -211,6 +261,8 @@ void
 AliMUONTriggerSegmentationV2::GetPadC(Int_t ix, Int_t iy, 
                                       Float_t& x, Float_t& y, Float_t& z)
 {
+// Transform from pad to real coordinates
+
   z = 0;
   GetPadC(ix,iy,x,y);
 }
@@ -220,6 +272,8 @@ void
 AliMUONTriggerSegmentationV2::GetPadC(Int_t ixGlo, Int_t iyGlo, 
                                       Float_t& x, Float_t& y)
 {
+// Transform from pad to real coordinates
+
   Int_t ixLA,iyLA;
   IGlo2ILoc(ixGlo,iyGlo,ixLA,iyLA);
   AliMpPad pad = fSlatSegmentation->PadByIndices(AliMpIntPair(ixLA,iyLA),kTRUE);
@@ -232,6 +286,8 @@ void
 AliMUONTriggerSegmentationV2::GetPadI(Float_t x, Float_t y, Float_t,
                                       Int_t& ix, Int_t& iy)
 {
+//  Returns pad coordinates (ix,iy) for given real coordinates (x,y)
+
   GetPadI(x,y,ix,iy);
 }
 
@@ -240,14 +296,14 @@ void
 AliMUONTriggerSegmentationV2::GetPadI(Float_t x, Float_t y,
                                       Int_t& ixGlo, Int_t& iyGlo)
 {
+//  Returns pad coordinates (ix,iy) for given real coordinates (x,y)
+
   AliDebug(2,Form("%s x=%e y=%e ixGlo,iyGlo=%d,%d\n",
                   fSlatSegmentation->GetName(),
                   x,y,ixGlo,iyGlo));
   
-  Double_t slatx = fSlat->DX();
-  Double_t slaty = fSlat->DY();
   AliMpPad pad = 
-    fSlatSegmentation->PadByPosition(TVector2(x+slatx,y+slaty), kTRUE);
+    fSlatSegmentation->PadByPosition(TVector2(x,y), kTRUE);
        
   if ( pad != AliMpPad::Invalid() )
        {
@@ -329,15 +385,20 @@ AliMUONTriggerSegmentationV2::GetPadGlo2Loc(Int_t ixGlo, Int_t iyGlo,
 
 //_____________________________________________________________________________
 void 
-AliMUONTriggerSegmentationV2::GiveTestPoints(Int_t&,Float_t*,Float_t*) const
+AliMUONTriggerSegmentationV2::GiveTestPoints(Int_t& /*n*/, 
+                                             Float_t* /*x*/, Float_t*/*y*/) const
 {
+// Not implemented
+
   AliFatal("Not Implemented");
 }
 
 //_____________________________________________________________________________
 Bool_t
-AliMUONTriggerSegmentationV2::HasPad(Float_t x, Float_t y, Float_t)
+AliMUONTriggerSegmentationV2::HasPad(Float_t x, Float_t y, Float_t /*z*/)
 {
+// Returns true if a pad exists in the given position
+
   //
   // Well, 2 implementations are possible here
   // Either reuse HasPad(int,int), or get it from scratch using
@@ -354,8 +415,7 @@ AliMUONTriggerSegmentationV2::HasPad(Float_t x, Float_t y, Float_t)
 //  Bool_t ok1 = HasPad(ixPC,iyPC);
 
   AliMpPad pad = 
-    fSlatSegmentation->PadByPosition(TVector2(x+fSlat->DX(),y+fSlat->DY()),
-                                     kFALSE);
+  fSlatSegmentation->PadByPosition(TVector2(x,y),kFALSE);
   return pad.IsValid();
 }
 
@@ -363,6 +423,8 @@ AliMUONTriggerSegmentationV2::HasPad(Float_t x, Float_t y, Float_t)
 Bool_t
 AliMUONTriggerSegmentationV2::HasPad(Int_t ixGlo, Int_t iyGlo)
 {
+// Returns true if a pad with given indices exists
+
   Int_t ixLA, iyLA;
   IGlo2ILoc(ixGlo,iyGlo,ixLA,iyLA);
   return fSlatSegmentation->HasPad(AliMpIntPair(ixLA,iyLA));
@@ -371,8 +433,10 @@ 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
 {
+// FIXME: add comment
+
   Int_t ixPC, iyPC;
   GetPadGlo2Loc(ixGlo,iyGlo,ixPC,iyPC);
   PC2LA(ixPC,iyPC,ixLA,iyLA);
@@ -381,20 +445,15 @@ 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
 {
+// FIXME: add comment
+
   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()
@@ -463,6 +522,9 @@ void AliMUONTriggerSegmentationV2::IntegrationLimits(Float_t& x1,
 Int_t 
 AliMUONTriggerSegmentationV2::Ix()
 {
+// Current pad cursor during disintegration
+// x, y-coordinate
+
   if ( fCurrentPad.IsValid() )
   {
     Int_t ixGlo,iyGlo;
@@ -477,6 +539,9 @@ AliMUONTriggerSegmentationV2::Ix()
 Int_t 
 AliMUONTriggerSegmentationV2::Iy()
 {
+// Current pad cursor during disintegration
+// x, y-coordinate
+
   if ( fCurrentPad.IsValid() )
   {
     Int_t ixGlo,iyGlo;
@@ -491,7 +556,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.
@@ -523,7 +588,9 @@ AliMUONTriggerSegmentationV2::LA2PC(Int_t ixLA, Int_t iyLA,
 Int_t
 AliMUONTriggerSegmentationV2::LineNumber() const
 {
-  return 10-fLineNumber;
+// FIXME: add comment
+
+ return 10-fLineNumber;
 }
 
 //_____________________________________________________________________________
@@ -539,6 +606,8 @@ AliMUONTriggerSegmentationV2::ModuleColNum(Int_t ixGlo) const
 Int_t
 AliMUONTriggerSegmentationV2::MorePads()
 {
+// Not implemented
+
   AliFatal("Not implemented");
   return 0;
 }
@@ -575,6 +644,8 @@ void AliMUONTriggerSegmentationV2::Neighbours(Int_t /*iX*/, Int_t /*iY*/,
 void
 AliMUONTriggerSegmentationV2::NextPad()
 {
+// Not implemented
+
   AliFatal("Not implemented");
 }
 
@@ -582,6 +653,9 @@ AliMUONTriggerSegmentationV2::NextPad()
 Int_t
 AliMUONTriggerSegmentationV2::Npx() const
 {
+// Maximum number of Pads in x
+// hard coded for the time being
+
   return 124;// FIXME: this should not have to be done, if only we'd stick 
   // to a local (ix,iy) convention !!! 
   // return fSlatSegmentation->MaxPadIndexX()+1;
@@ -591,6 +665,9 @@ AliMUONTriggerSegmentationV2::Npx() const
 Int_t
 AliMUONTriggerSegmentationV2::Npy() const
 {
+// Maximum number of Pads in y
+// hard coded for the time being
+
   return 64;
 //  return fSlatSegmentation->MaxPadIndexY()+1;
 }
@@ -598,7 +675,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.
@@ -629,6 +706,8 @@ AliMUONTriggerSegmentationV2::PC2LA(Int_t ixPC, Int_t iyPC,
 void
 AliMUONTriggerSegmentationV2::Print(Option_t* opt) const
 {
+// Printing
+
   TString sopt(opt);
   
   cout << "DetElemId=" << fDetElemId << " PlaneType=" 
@@ -643,31 +722,12 @@ 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)
 {
+// Calculate sector from pad coordinates
+
   Int_t ixLA, iyLA;
   IGlo2ILoc(ix,iy,ixLA,iyLA);
   AliMpPad pad = fSlatSegmentation->PadByIndices(AliMpIntPair(ixLA,iyLA),kFALSE);
@@ -693,6 +753,8 @@ AliMUONTriggerSegmentationV2::Sector(Int_t ix, Int_t iy)
 Int_t
 AliMUONTriggerSegmentationV2::Sector(Float_t, Float_t)
 {
+// Not implemented
+
   AliFatal("Not implemented");
   return 0;
 }
@@ -701,13 +763,17 @@ AliMUONTriggerSegmentationV2::Sector(Float_t, Float_t)
 void
 AliMUONTriggerSegmentationV2::SetCorrFunc(Int_t,TF1*)
 {
+// Not implemented
+
   AliFatal("Not Implemented");
 }
 
 //_____________________________________________________________________________
 void
-AliMUONTriggerSegmentationV2::SetDAnod(float)
+AliMUONTriggerSegmentationV2::SetDAnod(Float_t)
 {
+// Not implemented
+
   AliFatal("Not Implemented");
 }
 
@@ -715,6 +781,10 @@ AliMUONTriggerSegmentationV2::SetDAnod(float)
 void
 AliMUONTriggerSegmentationV2::SetHit(Float_t x, Float_t y)
 {
+// Set hit position
+// Sets virtual hit position, needed for evaluating pad response 
+// outside the tracking program 
+
   fXhit = x;
   fYhit = y;
        
@@ -738,6 +808,10 @@ AliMUONTriggerSegmentationV2::SetHit(Float_t x, Float_t y)
 void
 AliMUONTriggerSegmentationV2::SetHit(Float_t x, Float_t y, Float_t)
 {
+// Set hit position
+// Sets virtual hit position, needed for evaluating pad response 
+// outside the tracking program 
+
   SetHit(x,y);
 }
 
@@ -745,6 +819,10 @@ AliMUONTriggerSegmentationV2::SetHit(Float_t x, Float_t y, Float_t)
 void
 AliMUONTriggerSegmentationV2::SetPad(Int_t ix, Int_t iy)
 {
+// Set pad position.
+// Sets virtual pad coordinates, needed for evaluating pad response 
+// outside the tracking program.
+
   Int_t ixLA, iyLA;
   IGlo2ILoc(ix,iy,ixLA,iyLA);
   fCurrentPad = fSlatSegmentation->PadByIndices(AliMpIntPair(ixLA,iyLA),kTRUE);
@@ -756,8 +834,10 @@ AliMUONTriggerSegmentationV2::SetPad(Int_t ix, Int_t iy)
 
 //_____________________________________________________________________________
 void
-AliMUONTriggerSegmentationV2::SetPadSize(float,float)
+AliMUONTriggerSegmentationV2::SetPadSize(Float_t,Float_t)
 {
+// Not implemented
+
   AliFatal("Not Implemented");
 }
 
@@ -765,6 +845,8 @@ AliMUONTriggerSegmentationV2::SetPadSize(float,float)
 Int_t 
 AliMUONTriggerSegmentationV2::SigGenCond(Float_t,Float_t,Float_t)
 {
+// Not implemented
+
   AliFatal("Not Implemented");
   return 0;
 }
@@ -773,27 +855,12 @@ AliMUONTriggerSegmentationV2::SigGenCond(Float_t,Float_t,Float_t)
 void 
 AliMUONTriggerSegmentationV2::SigGenInit(Float_t,Float_t,Float_t)
 {
-  AliFatal("Not Implemented");
-}
+// 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);
-  }
+  AliFatal("Not Implemented");
 }
 
 
 
 
 
-
-