LCOV - code coverage report
Current view: top level - MUON/MUONmapping - AliMpMotifPosition.cxx (source / functions) Hit Total Coverage
Test: coverage.info Lines: 21 43 48.8 %
Date: 2016-06-14 17:26:59 Functions: 10 14 71.4 %

          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: AliMpMotifPosition.cxx,v 1.9 2006/05/24 13:58:41 ivana Exp $
      18             : 
      19             : //-----------------------------------------------------------------------------
      20             : // Class AliMpMotifPosition
      21             : // ------------------------
      22             : // Class that represents a placed motif.
      23             : // Included in AliRoot: 2003/05/02
      24             : // Authors: David Guez, Ivana Hrivnacova; IPN Orsay
      25             : //-----------------------------------------------------------------------------
      26             : 
      27             : #include "AliMpMotifPosition.h"
      28             : #include "AliMpMotifPositionPadIterator.h"
      29             : #include "AliMpMotifType.h"
      30             : #include <Riostream.h>
      31             : 
      32             : using std::cout;
      33             : /// \cond CLASSIMP
      34          18 : ClassImp(AliMpMotifPosition)
      35             : /// \endcond
      36             : 
      37             : //______________________________________________________________________________
      38             : AliMpMotifPosition::AliMpMotifPosition(Int_t id, AliMpVMotif* motif, 
      39             :                                        Double_t x, Double_t y)
      40       22170 :   : AliMpVIndexed(),
      41       22170 :     fID(id),
      42       22170 :     fMotif(motif),
      43       22170 :     fPositionX(x), 
      44       22170 :     fPositionY(y) 
      45      110850 : {
      46             : /// Standard constructor
      47       44340 : }
      48             : 
      49             : //______________________________________________________________________________
      50             : AliMpMotifPosition::AliMpMotifPosition()
      51           0 :   : AliMpVIndexed(), 
      52           0 :     fID(0),
      53           0 :     fMotif(0),
      54           0 :     fPositionX(0.), 
      55           0 :     fPositionY(0.) 
      56           0 : {
      57             : /// Default constructor
      58           0 : }
      59             : 
      60             : //______________________________________________________________________________
      61             : AliMpMotifPosition::~AliMpMotifPosition()
      62       72132 : {
      63             : /// Destructor 
      64       72132 : }
      65             : 
      66             : //______________________________________________________________________________
      67             : AliMpVPadIterator* AliMpMotifPosition::CreateIterator() const
      68             : {
      69             : /// Return motif position iterator
      70             : 
      71           0 :   return new AliMpMotifPositionPadIterator(this);
      72           0 : }  
      73             : 
      74             : //______________________________________________________________________________
      75             : Bool_t AliMpMotifPosition::HasPadByIndices(MpPair_t indices) const
      76             : {
      77             : /// Return true if pad with the specified indices exists in 
      78             : /// this motif position.
      79             : 
      80     2341656 :   if ( ! HasIndices(indices) ) return kFALSE;
      81             :   
      82     1595531 :   if (fMotif->GetMotifType()->IsFull()) return kTRUE;
      83             :   
      84        2078 :   return fMotif->GetMotifType()->HasPadByLocalIndices(
      85        1039 :                                     indices - GetLowIndicesLimit());
      86     1046647 : }
      87             : 
      88             : //______________________________________________________________________________
      89             : Bool_t AliMpMotifPosition::HasPadByManuChannel(Int_t manuChannel) const
      90             : {
      91             :   /// Return true if pad with the specified manuChannel exists in 
      92             :   /// this motif position.
      93             : 
      94      869760 :   return fMotif->GetMotifType()->HasPadByManuChannel(manuChannel);
      95             : }
      96             : 
      97             : //_____________________________________________________________________________
      98             : void
      99             : AliMpMotifPosition::SetID(Int_t id)
     100             : {
     101             : /// Set ID
     102             : 
     103       19458 :   fID = id;
     104        9729 : }
     105             : 
     106             : //_____________________________________________________________________________
     107             : void
     108             : AliMpMotifPosition::SetPosition(Double_t x, Double_t y)
     109             : {
     110             : /// Set position
     111             : 
     112       19458 :   fPositionX = x;
     113        9729 :   fPositionY = y;
     114        9729 : }
     115             : 
     116             : //_____________________________________________________________________________
     117             : void
     118             : AliMpMotifPosition::Print(Option_t* option) const
     119             : {
     120             : /// Printing
     121             : 
     122           0 :   cout << "MOTIFPOSITION " << GetID() << " MOTIF " 
     123           0 :        << GetMotif()->GetID()
     124           0 :        << " at (" << GetPositionX() << "," 
     125           0 :        << GetPositionY() << ") "
     126           0 :        << " iMin=(" << GetLowLimitIx()
     127           0 :        << "," << GetLowLimitIy()
     128           0 :        << ") iMax=(" << GetHighLimitIx()
     129           0 :        << "," << GetHighLimitIy()
     130           0 :        << ")" << std::endl;
     131             : 
     132           0 :   if ( option && option[0] == 'M' )
     133             :     {
     134           0 :       GetMotif()->Print(option+1);
     135           0 :     }
     136           0 : }

Generated by: LCOV version 1.11