LCOV - code coverage report
Current view: top level - MUON/MUONmapping - AliMpSectorSegmentation.cxx (source / functions) Hit Total Coverage
Test: coverage.info Lines: 98 222 44.1 %
Date: 2016-06-14 17:26:59 Functions: 26 36 72.2 %

          Line data    Source code
       1             : /**************************************************************************
       2             :  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
       3             :  *                                                                        *
       4             :  * Author: The ALICE Off-line Project.                                    *
       5             :  * Contributors are mentioned in the code where appropriate.              *
       6             :  *                                                                        *
       7             :  * Permission to use, copy, modify and distribute this software and its   *
       8             :  * documentation strictly for non-commercial purposes is hereby granted   *
       9             :  * without fee, provided that the above copyright notice appears in all   *
      10             :  * copies and that both the copyright notice and this permission notice   *
      11             :  * appear in the supporting documentation. The authors make no claims     *
      12             :  * about the suitability of this software for any purpose. It is          *
      13             :  * provided "as is" without express or implied warranty.                  *
      14             :  **************************************************************************/
      15             : 
      16             : // $Id$
      17             : // $MpId: AliMpSectorSegmentation.cxx,v 1.15 2006/05/24 13:58:46 ivana Exp $
      18             : // Category: sector
      19             : 
      20             : //-----------------------------------------------------------------------------
      21             : // Class AliMpSectorSegmentation
      22             : // -----------------------------
      23             : // Class describing the segmentation of the sector.        
      24             : // Provides methods related to pads:
      25             : // conversion between pad indices, pad location, pad position;
      26             : // finding pad neighbour.
      27             : //
      28             : // Authors: David Guez, Ivana Hrivnacova; IPN Orsay
      29             : //-----------------------------------------------------------------------------
      30             : 
      31             : #include "AliMpSectorSegmentation.h"
      32             : #include "AliMpSector.h"
      33             : #include "AliMpZone.h"
      34             : #include "AliMpSubZone.h"
      35             : #include "AliMpRow.h"
      36             : #include "AliMpVRowSegment.h"
      37             : #include "AliMpMotifMap.h"
      38             : #include "AliMpVMotif.h"
      39             : #include "AliMpMotifPosition.h"
      40             : #include "AliMpConnection.h"
      41             : #include "AliMpSectorAreaHPadIterator.h"
      42             : #include "AliMpSectorAreaVPadIterator.h"
      43             : #include "AliMpSectorPadIterator.h"
      44             : #include "AliMpArea.h"
      45             : #include "AliMpConstants.h"
      46             : #include "AliMpEncodePair.h"
      47             : 
      48             : #include "AliLog.h"
      49             : 
      50             : #include <Riostream.h>
      51             : #include <TMath.h>
      52             : 
      53             : using std::cout;
      54             : using std::endl;
      55             : /// \cond CLASSIMP
      56          18 : ClassImp(AliMpSectorSegmentation)
      57             : /// \endcond
      58             : 
      59             : //______________________________________________________________________________
      60             : AliMpSectorSegmentation::AliMpSectorSegmentation(
      61             :                             const AliMpSector* sector, Bool_t own) 
      62          12 :   : AliMpVSegmentation(),
      63          12 :     fkSector(sector),
      64          12 :     fIsOwner(own),
      65          12 :     fPadBuffer(0),
      66          12 :     fMaxIndexInX(0),
      67          12 :     fMaxIndexInY(0)
      68          36 : {
      69             : /// Standard constructor
      70             : 
      71          60 :   AliDebugStream(1) << "this = " << this << endl;
      72             : 
      73          36 :   fPadBuffer = new AliMpPad(AliMpPad::Invalid());
      74             :   
      75             :   //FillPadDimensionsMap();
      76          24 : }
      77             : 
      78             : //______________________________________________________________________________
      79             : AliMpSectorSegmentation::AliMpSectorSegmentation() 
      80           0 :   : AliMpVSegmentation(),
      81           0 :     fkSector(0),
      82           0 :     fIsOwner(false),
      83           0 :     fPadBuffer(0),
      84           0 :     fMaxIndexInX(0),
      85           0 :     fMaxIndexInY(0)
      86           0 : {
      87             : /// Default constructor
      88             : 
      89           0 :   AliDebugStream(1) << "this = " << this << endl;
      90           0 : }
      91             : 
      92             : //______________________________________________________________________________
      93             : AliMpSectorSegmentation::~AliMpSectorSegmentation() 
      94          48 : {
      95             : /// Destructor 
      96             : 
      97          40 :   AliDebugStream(1) << "this = " << this << endl;
      98             : 
      99          24 :   if ( fIsOwner ) delete fkSector;
     100             : 
     101          16 :   delete fPadBuffer;
     102             :   
     103          24 : }
     104             : 
     105             : //
     106             : // private methods
     107             : //
     108             : 
     109             : //______________________________________________________________________________
     110             : AliMpMotifPosition* 
     111             : AliMpSectorSegmentation::FindMotifPosition(Int_t ix, Int_t iy) const
     112             : {
     113             : /// Find the motif position which contains the given pad indices
     114             : /// return 0 if not found
     115             : 
     116           0 :   switch ( fkSector->GetDirection() ) {
     117             :     case AliMp::kX : {
     118             :     // Case where all the pads have the same size along X direction
     119             : 
     120           0 :       for ( Int_t irow=0; irow<fkSector->GetNofRows(); ++irow ) {
     121           0 :         AliMpRow* row = fkSector->GetRow(irow);
     122           0 :         if ( row->GetLowLimitIx() <= ix &&
     123           0 :              row->GetHighLimitIx()>= ix ) {
     124             :             
     125           0 :           for ( Int_t iseg=0;iseg<row->GetNofRowSegments();++iseg ) {
     126           0 :             AliMpVRowSegment* seg = row->GetRowSegment(iseg);
     127           0 :             if ( seg->GetLowLimitIx() <= ix &&
     128           0 :                  seg->GetHighLimitIx() >= ix ) {
     129             : 
     130             :               AliMpMotifPosition* motifPos;
     131           0 :               for ( Int_t imot=0;imot<seg->GetNofMotifs();++imot ) {
     132             :                 motifPos 
     133           0 :                   = fkSector->GetMotifMap()
     134           0 :                     ->FindMotifPosition(seg->GetMotifPositionId(imot));
     135           0 :                 if (motifPos && motifPos->HasPadByIndices(AliMp::Pair(ix,iy))) return motifPos;
     136             :               }
     137           0 :             }
     138           0 :           }
     139             :         }
     140           0 :       }
     141           0 :       return 0;
     142             :     }
     143             :     break;
     144             :     ////////////////////////////////////////////////////////////////////////////////
     145             :     case AliMp::kY : {
     146             :       // Case where all the pads have the same size along Y direction   
     147             :       // look for the row which contains the indices
     148             :       AliMpRow* row=0;
     149             :       Int_t irow;
     150           0 :       for ( irow=0; irow<fkSector->GetNofRows(); ++irow ) {
     151           0 :         row = fkSector->GetRow(irow);
     152           0 :         AliMpVRowSegment* lastSeg = row->GetRowSegment(row->GetNofRowSegments()-1);
     153           0 :         if ( lastSeg->GetLowLimitIy() <= iy &&
     154           0 :              lastSeg->GetHighLimitIy() >= iy ) break;
     155             :         // NOTE : We use the last row segment in order to ensure that
     156             :         // we are not on a special motif
     157           0 :       }
     158           0 :       if ( irow==fkSector->GetNofRows() ) return 0;
     159             :       // look for the row segment, in the found row, which contains the indices
     160             :       AliMpVRowSegment* seg=0;
     161             :       Int_t iseg;
     162           0 :       for ( iseg=0;iseg<row->GetNofRowSegments();++iseg ) {
     163           0 :         seg = row->GetRowSegment(iseg);
     164           0 :         if (seg->HasIndices(AliMp::Pair(ix, iy))) break;
     165             :       }
     166           0 :       if ( iseg==row->GetNofRowSegments() ) return 0;
     167             :   
     168             :       // look for the motif position which contains the indices
     169             :       AliMpMotifPosition* motifPos=0;
     170             :       Int_t imot=0;
     171           0 :       for ( imot=0;imot<seg->GetNofMotifs();++imot ) {
     172             :         motifPos 
     173           0 :           = fkSector->GetMotifMap()
     174           0 :             ->FindMotifPosition(seg->GetMotifPositionId(imot));
     175           0 :         if (motifPos && motifPos->HasPadByIndices(AliMp::Pair(ix, iy))) break;
     176             :       }      
     177           0 :       if (imot==seg->GetNofMotifs()) return 0;
     178             :    
     179           0 :       return motifPos;      
     180             :     }
     181           0 :     default: return 0;
     182             :   }
     183           0 : }
     184             : 
     185             : //______________________________________________________________________________
     186             : AliMpPad 
     187             : AliMpSectorSegmentation::PadByXDirection(Double_t startx, Double_t starty, 
     188             :                                          Double_t maxX) const
     189             : {
     190             : /// Find the first valid pad from starting position in the
     191             : /// direction of pad lines up to distance dx.
     192             : 
     193             :   // Define step limits
     194        2672 :   Double_t  stepX = fkSector->GetMinPadDimensionX();
     195             :  
     196             :   // Search in X direction
     197        1336 :   AliMpPad pad;
     198             :   Double_t posx = startx;
     199        1336 :   do {
     200        4008 :     pad = PadByPosition(posx, starty, false);
     201        1336 :     posx += stepX;
     202           0 :   }   
     203        1336 :   while ( ! pad.IsValid() && 
     204           0 :             posx - fkSector->GetMaxPadDimensionX() < maxX ); 
     205             :   
     206             :   // Invalidate pad if it is outside limits
     207        1336 :   if ( ( pad.GetPositionX() - pad.GetDimensionX()) > maxX ) 
     208         774 :     pad = AliMpPad::Invalid();
     209             : 
     210             :   return pad;
     211        2672 : }
     212             : 
     213             : //______________________________________________________________________________
     214             : AliMpPad 
     215             : AliMpSectorSegmentation::PadByYDirection(Double_t startx, Double_t starty, 
     216             :                                          Double_t maxY) const
     217             : {
     218             : /// Find the first valid pad from starting position in the
     219             : /// direction of pad columns up to distance dx.
     220             :   
     221             :   // Define step limits
     222        2386 :   Double_t stepY = fkSector->GetMinPadDimensionY();
     223             :  
     224             :   // Search in Y direction
     225        1193 :   AliMpPad pad;
     226             :   Double_t posy = starty;
     227        1193 :   do {
     228        3579 :     pad = PadByPosition(startx, posy, false);
     229        1193 :     posy += stepY;
     230           0 :   }   
     231        1193 :   while ( ! pad.IsValid() && 
     232           0 :             posy - fkSector->GetMaxPadDimensionY()< maxY ); 
     233             :   
     234             :   // Invalidate pad if it is outside limits
     235        1193 :   if (( pad.GetPositionY() - pad.GetDimensionY()) > maxY ) 
     236         546 :     pad = AliMpPad::Invalid();
     237             : 
     238             :   return pad;
     239        2386 : }
     240             : 
     241             : //
     242             : // public methods
     243             : //
     244             : 
     245             : //______________________________________________________________________________
     246             : AliMpVPadIterator* 
     247             : AliMpSectorSegmentation::CreateIterator(const AliMpArea& area) const
     248             : {
     249             : /// Create the area iterator. 
     250             : 
     251         128 :   switch (fkSector->GetDirection()) {
     252             :   
     253          64 :     case AliMp::kX: return new AliMpSectorAreaVPadIterator(this, area);
     254             :              ;;
     255          64 :     case AliMp::kY: return new AliMpSectorAreaHPadIterator(this, area);
     256             :              ;;
     257             :   }
     258             :   
     259           0 :   Fatal("CreateIterator", "Incomplete switch on Sector direction");
     260           0 :   return 0;  
     261          64 : }   
     262             :   
     263             : //______________________________________________________________________________
     264             : AliMpVPadIterator* 
     265             : AliMpSectorSegmentation::CreateIterator() const
     266             : {
     267             : /// Create the sector iterator
     268             : 
     269         192 :   return new AliMpSectorPadIterator(fkSector);
     270           0 : }
     271             : 
     272             : //______________________________________________________________________________
     273             : Int_t 
     274             : AliMpSectorSegmentation::GetNeighbours(const AliMpPad& pad, TObjArray& neighbours,
     275             :                                        Bool_t includeSelf,
     276             :                                        Bool_t includeVoid) const
     277             : {
     278             :   /// Uses default implementation
     279           0 :   return AliMpVSegmentation::GetNeighbours(pad,neighbours,includeSelf,includeVoid);
     280             : }
     281             : 
     282             : //______________________________________________________________________________
     283             : AliMpPad 
     284             : AliMpSectorSegmentation::PadByLocation(Int_t manuId, Int_t manuChannel, 
     285             :                                        Bool_t warning) const
     286             : {
     287             : /// Find the pad which corresponds to the given location
     288             :  
     289      336948 :   if ( fPadBuffer->GetManuId() == manuId &&
     290      167133 :        fPadBuffer->GetManuChannel() == manuChannel ) return (*fPadBuffer);
     291             :   
     292             :   AliMpMotifPosition* motifPos = 
     293      169815 :     fkSector->GetMotifMap()->FindMotifPosition(manuId);
     294      169815 :   if (!motifPos){
     295           0 :     if (warning) Warning("PadByLocation","The pad motif position ID doesn't exists");
     296           0 :     return AliMpPad::Invalid();
     297             :   }
     298             :   
     299      169815 :   AliMpVMotif* motif = motifPos->GetMotif();
     300             :   MpPair_t localIndices = 
     301      169815 :     motif->GetMotifType()->FindLocalIndicesByGassiNum(manuChannel);
     302      169815 :   if ( localIndices < 0 ) {
     303           0 :     if (warning) Warning("PadByLocation","The pad number doesn't exists");
     304           0 :     return AliMpPad::Invalid();
     305             :   }
     306             : 
     307      169815 :   Double_t posx, posy;
     308      169815 :   motif->PadPositionLocal(localIndices, posx, posy);
     309      169815 :   posx += motifPos->GetPositionX();
     310      169815 :   posy += motifPos->GetPositionY();
     311             : 
     312      169815 :   Double_t dx, dy;
     313      169815 :   motif->GetPadDimensionsByIndices(localIndices, dx, dy);
     314             : 
     315      679260 :   return (*fPadBuffer) = AliMpPad(manuId, manuChannel,
     316      169815 :               motifPos->GlobalIndices(localIndices),
     317      169815 :               posx, posy, dx, dy);
     318      339630 : }
     319             : //______________________________________________________________________________
     320             : AliMpPad 
     321             : AliMpSectorSegmentation::PadByIndices(Int_t ix, Int_t iy, Bool_t warning ) const
     322             : {
     323             : /// Find the pad which corresponds to the given indices  
     324             : 
     325           0 :   if ( fPadBuffer->GetIx() == ix &&
     326           0 :        fPadBuffer->GetIy() == iy ) return (*fPadBuffer);    
     327             :        
     328           0 :   MpPair_t indices = AliMp::Pair(ix, iy);     
     329           0 :   AliMpMotifPosition* motifPos = FindMotifPosition(ix, iy);
     330           0 :   if (!motifPos) {    
     331           0 :     if (warning) 
     332           0 :       Warning("PadByIndices","Pad indices not contained in any motif!");
     333           0 :     return AliMpPad::Invalid();
     334             :   }
     335             :   
     336             :   // retrieve the local indices in the found motif
     337           0 :   AliMpVMotif* motif = motifPos->GetMotif();
     338           0 :   MpPair_t localIndices = indices - motifPos->GetLowIndicesLimit();
     339             :   
     340             :   AliMpConnection* connection=
     341           0 :     motif->GetMotifType()->FindConnectionByLocalIndices(localIndices);
     342             :     
     343           0 :   if (!connection){
     344           0 :     if (warning) Warning("PadByIndices","No connection with the given indices!");
     345           0 :     return AliMpPad::Invalid();
     346             :   }
     347             : 
     348           0 :   Double_t posx, posy;
     349           0 :   motif->PadPositionLocal(localIndices, posx, posy);
     350           0 :   posx += motifPos->GetPositionX();
     351           0 :   posy += motifPos->GetPositionY();
     352             : 
     353           0 :   Double_t dx, dy;
     354           0 :   motif->GetPadDimensionsByIndices(localIndices, dx, dy);
     355             : 
     356           0 :   return (*fPadBuffer) 
     357           0 :     = AliMpPad(motifPos->GetID(),connection->GetManuChannel(),
     358           0 :                ix, iy, posx, posy, dx, dy);
     359           0 : }
     360             : 
     361             : //______________________________________________________________________________
     362             : AliMpPad 
     363             : AliMpSectorSegmentation::PadByPosition(Double_t x, Double_t y,
     364             :                                        Bool_t warning) const
     365             : {
     366             : /// Find the pad which corresponds to the given position
     367             : 
     368        3670 :   if (fPadBuffer->GetPositionX()==x && 
     369        1013 :       fPadBuffer->GetPositionY()==y) return (*fPadBuffer);  
     370             : 
     371        2657 :   Int_t motifPosID = fkSector->FindMotifPositionId(x,y);
     372             :   AliMpMotifPosition* motifPos 
     373        2657 :     = fkSector->GetMotifMap()
     374             :         ->FindMotifPosition(motifPosID);
     375             :     
     376        2657 :   if (!motifPos){
     377           0 :     if (warning) Warning("PadByPosition","Position outside limits");
     378           0 :     return AliMpPad::Invalid();
     379             :   }
     380             : 
     381        2657 :   AliMpVMotif* motif =  motifPos->GetMotif();  
     382             :   MpPair_t localIndices 
     383        5314 :     = motif->PadIndicesLocal(x-motifPos->GetPositionX(),
     384        2657 :                              y-motifPos->GetPositionY());
     385             : 
     386        2657 :   if ( localIndices < 0 ) {
     387           0 :     if (warning) Warning("PadByPosition","Position outside motif limits");
     388           0 :     return AliMpPad::Invalid();
     389             :   }
     390             :     
     391             :   AliMpConnection* connect = 
     392        2657 :     motif->GetMotifType()->FindConnectionByLocalIndices(localIndices);
     393             : 
     394        2657 :   if ( ! connect ) {
     395           0 :     if (warning) Warning("PadByPosition","Position outside motif limits");
     396           0 :     return AliMpPad::Invalid();
     397             :   }
     398             : 
     399        2657 :   Double_t posx, posy;
     400        2657 :   motif->PadPositionLocal(localIndices, posx, posy);
     401        2657 :   posx += motifPos->GetPositionX();
     402        2657 :   posy += motifPos->GetPositionY();
     403             : 
     404        2657 :   Double_t dx, dy;
     405        2657 :   motif->GetPadDimensionsByIndices(localIndices, dx, dy);
     406             :   
     407        7971 :   return (*fPadBuffer)
     408        5314 :     = AliMpPad(motifPosID, connect->GetManuChannel(),
     409        2657 :                motifPos->GlobalIndices(localIndices),
     410        2657 :                posx, posy, dx, dy);
     411        5314 : }
     412             : 
     413             : //______________________________________________________________________________
     414             : AliMpPad 
     415             : AliMpSectorSegmentation::PadByDirection(Double_t startx, Double_t starty, 
     416             :                                         Double_t distance) const
     417             : {
     418             : /// Find the first valid pad from starting position in the
     419             : /// direction of pad lines/columns up to the specified distance.
     420             : /// Pad lines are the lines of pads in the sector with constant pad y size,
     421             : /// pad columns are the columns of pads in the sector with constant pad x size. 
     422             : 
     423        5058 :   switch (fkSector->GetDirection()) {
     424             :   
     425        1193 :     case AliMp::kX: return PadByYDirection(startx, starty, distance);
     426             :              ;;
     427        1336 :     case AliMp::kY: return PadByXDirection(startx, starty, distance);
     428             :              ;;
     429             :   }
     430             :   
     431           0 :   Fatal("PadByDirection", "Incomplete switch on Sector direction");
     432           0 :   return AliMpPad::Invalid();  
     433        2529 : }
     434             : 
     435             : //_____________________________________________________________________________
     436             : Bool_t 
     437             : AliMpSectorSegmentation::HasPadByIndices(Int_t ix, Int_t iy) const
     438             : {
     439             :   ///  Whether or not we have a pad at indices=(ix,iy) 
     440             :   
     441           0 :   MpPair_t indices = AliMp::Pair(ix, iy);
     442             : 
     443           0 :   AliMpMotifPosition* motifPos = FindMotifPosition(ix, iy);
     444             :   
     445           0 :   if (motifPos) return motifPos->HasPadByIndices(indices);
     446             :   
     447           0 :   return kFALSE;
     448           0 : }
     449             : 
     450             : //_____________________________________________________________________________
     451             : Bool_t 
     452             : AliMpSectorSegmentation::HasPadByLocation(Int_t manuId, Int_t manuChannel) const
     453             : {
     454             :   /// Whether or not we have a pad at location=(manuId,manuChannel)
     455             :   
     456             :   AliMpMotifPosition* motifPos 
     457      343296 :     = fkSector->GetMotifMap()->FindMotifPosition(manuId);
     458             :   
     459      343296 :   if ( motifPos ) return motifPos->HasPadByManuChannel(manuChannel);
     460             :   
     461           0 :   return kFALSE;
     462      171648 : }
     463             : 
     464             : //______________________________________________________________________________
     465             : Int_t  AliMpSectorSegmentation::MaxPadIndexX() const
     466             : {
     467             : /// Return maximum pad index in x
     468             : 
     469         256 :   return AliMp::PairFirst(fkSector->GetMaxPadIndices());
     470             : }
     471             : 
     472             : //______________________________________________________________________________
     473             : Int_t  AliMpSectorSegmentation::MaxPadIndexY() const
     474             : {
     475             : /// Return maximum pad index in y
     476             : 
     477         256 :   return AliMp::PairSecond(fkSector->GetMaxPadIndices());
     478             : }
     479             : 
     480             : //______________________________________________________________________________
     481             : Int_t  AliMpSectorSegmentation::NofPads() const
     482             : {
     483             : /// Return number of pads defined in the sector
     484             : 
     485         256 :   return fkSector->GetNofPads();
     486             : }
     487             : 
     488             : //_____________________________________________________________________________
     489             : void 
     490             : AliMpSectorSegmentation::GetAllElectronicCardIDs(TArrayI& ecn) const
     491             : {
     492             :   /// Fill the array ecn with all manuIds
     493             : 
     494         600 :   GetSector()->GetAllMotifPositionsIDs(ecn);
     495         300 : }
     496             : 
     497             : //_____________________________________________________________________________
     498             : Int_t 
     499             : AliMpSectorSegmentation::GetNofElectronicCards() const
     500             : {
     501             :   /// Get the number of manus of this sector
     502             :   
     503           0 :   return fkSector->GetNofMotifPositions();  
     504             : }
     505             : 
     506             : //_____________________________________________________________________________
     507             : Bool_t 
     508             : AliMpSectorSegmentation::HasMotifPosition(Int_t manuId) const
     509             : {
     510             :   /// Whether we get a given manu. Uses default implementation
     511           0 :   return (AliMpVSegmentation::HasMotifPosition(manuId) != 0x0);
     512             : }
     513             : 
     514             : //_____________________________________________________________________________
     515             : AliMpMotifPosition* 
     516             : AliMpSectorSegmentation::MotifPosition(Int_t manuId) const
     517             : {
     518             :   /// Return a given manu
     519        5364 :   return fkSector->GetMotifMap()->FindMotifPosition(manuId);
     520             : }
     521             : 
     522             : //______________________________________________________________________________
     523             : AliMp::PlaneType
     524             : AliMpSectorSegmentation::PlaneType() const
     525             : {
     526         850 :   return GetSector()->GetPlaneType();
     527             : }
     528             : 
     529             : //_____________________________________________________________________________
     530             : Double_t  
     531             : AliMpSectorSegmentation::GetDimensionX() const
     532             : {
     533             : /// Return sector x dimensions
     534          64 :   return GetSector()->GetDimensionX();
     535             : }
     536             : 
     537             : //_____________________________________________________________________________
     538             : Double_t  
     539             : AliMpSectorSegmentation::GetDimensionY() const
     540             : {
     541             : /// Return sector y dimensions
     542          64 :   return GetSector()->GetDimensionY();
     543             : }
     544             : 
     545             : //_____________________________________________________________________________
     546             : Double_t  
     547             : AliMpSectorSegmentation::GetPositionX() const
     548             : {
     549             : /// Return x position 
     550          24 :   return 0.;
     551             : }
     552             : 
     553             : //_____________________________________________________________________________
     554             : Double_t  
     555             : AliMpSectorSegmentation::GetPositionY() const
     556             : {
     557             : /// Return y position 
     558          24 :   return 0.;
     559             : }
     560             : 
     561             : //______________________________________________________________________________
     562             : void
     563             : AliMpSectorSegmentation::Print(Option_t* opt) const
     564             : {
     565             : /// Print the sector
     566             : 
     567           0 :   fkSector->Print(opt);
     568           0 : }
     569             : 
     570             : //______________________________________________________________________________
     571             : Double_t AliMpSectorSegmentation::GetMinPadDimensionX() const
     572             : {
     573             : /// Return the x dimension of the smallest pad.
     574             : 
     575         428 :   return fkSector->GetMinPadDimensionX();
     576             : }  
     577             : 
     578             : 
     579             : //______________________________________________________________________________
     580             : Double_t AliMpSectorSegmentation::GetMinPadDimensionY() const
     581             : {
     582             : /// Return the y dimension of the smallest pad.
     583             : 
     584         580 :   return fkSector->GetMinPadDimensionY();
     585             : }  
     586             : 
     587             : 
     588             : //______________________________________________________________________________
     589             : Bool_t AliMpSectorSegmentation::CircleTest(Int_t ix, Int_t iy) const
     590             : {
     591             : /// Verify that all methods for retrieving pads are consistents between them.
     592             : /// Return true if the pad with specified indices was found and verified,
     593             : /// false otherwise.
     594             : 
     595           0 :   if ( ! HasPadByIndices(ix, iy) ) return false;
     596             : 
     597             :   // Verify the indice->location->position->indice way
     598           0 :   AliMpPad pad1 = PadByIndices(ix, iy);  
     599           0 :   AliMpPad pad2 = PadByLocation(pad1.GetManuId(), pad1.GetManuChannel());
     600           0 :   AliMpPad pad3 = PadByPosition(pad2.GetPositionX(),pad2.GetPositionY());
     601             :                                       
     602           0 :   MpPair_t retIndices = pad3.GetIndices();
     603             :     
     604           0 :   if ( retIndices != AliMp::Pair(ix, iy) ) {
     605           0 :     cout << "Pad (" << ix << ',' << iy << ") lead to inconsistency" << endl;
     606           0 :     cout << "in indice->location->position->indice way..." << endl;
     607           0 :     cout << "starting from indices " << pad1 << endl
     608           0 :          << "--> location " << pad2 << endl
     609           0 :          << "--> position " 
     610           0 :          << '(' << pad3.GetPositionX() << ',' << pad3.GetPositionY() << ')'
     611           0 :          <<  endl << endl;
     612             :   }
     613             :     
     614             :   // Verify the indice->position->location->indice way  
     615           0 :   AliMpPad pad2bis = PadByPosition(pad1.GetPositionX(),pad1.GetPositionY());
     616           0 :   AliMpPad pad3bis = PadByLocation(pad2bis.GetManuId(), pad2bis.GetManuChannel());
     617             :   
     618           0 :   retIndices = pad3bis.GetIndices();
     619             : 
     620           0 :   if ( retIndices != AliMp::Pair(ix, iy) ) {
     621           0 :     cout << "Pad (" << ix << ',' << iy << ") lead to inconsistency" << endl;
     622           0 :     cout << "in indice->position->location->indice way..." << endl;
     623           0 :     cout << "starting from indices " << pad1 << endl
     624           0 :          << "--> position " 
     625           0 :          << '(' << pad2bis.GetPositionX() << ',' << pad2bis.GetPositionY() << ')' << endl
     626           0 :          << "--> location " << pad3bis
     627           0 :          << endl << endl;
     628             :   }
     629             :   
     630             :   return true;
     631           0 : }

Generated by: LCOV version 1.11