LCOV - code coverage report
Current view: top level - ITSMFT/MFT/MFTbase - AliMFTChipSegmentation.cxx (source / functions) Hit Total Coverage
Test: coverage.info Lines: 1 34 2.9 %
Date: 2016-06-14 17:26:59 Functions: 1 7 14.3 %

          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             : 
      18             : //-----------------------------------------------------------------------------
      19             : /// \class AliMFTChipSegmentation
      20             : ///
      21             : /// Description of the virtual segmentation of the chips
      22             : ///
      23             : // author Raphael Tieulent <raphael.tieulent@cern.ch>
      24             : //-----------------------------------------------------------------------------
      25             : 
      26             : #include "AliLog.h"
      27             : 
      28             : #include "AliMFTConstants.h"
      29             : #include "AliMFTChipSegmentation.h"
      30             : #include "AliMFTGeometry.h"
      31             : 
      32             : /// \cond CLASSIMP
      33          14 : ClassImp(AliMFTChipSegmentation);
      34             : /// \endcond
      35             : 
      36             : //====================================================================================================================================================
      37             : /// Default constructor
      38             : 
      39             : AliMFTChipSegmentation::AliMFTChipSegmentation():
      40           0 :   AliMFTVSegmentation()
      41           0 : {
      42           0 : }
      43             : 
      44             : //====================================================================================================================================================
      45             : /// Constructor
      46             : AliMFTChipSegmentation::AliMFTChipSegmentation(UInt_t uniqueID):
      47           0 :   AliMFTVSegmentation()
      48           0 : {
      49             :   // constructor
      50           0 :   AliMFTGeometry * mftGeom = AliMFTGeometry::Instance();
      51             : 
      52           0 :   SetUniqueID(uniqueID);
      53             : 
      54           0 :   SetName(Form("MFT_S_%d_%d_%d_%d",
      55           0 :                mftGeom->GetHalfMFTID(GetUniqueID()),
      56           0 :                mftGeom->GetHalfDiskID(GetUniqueID()),
      57           0 :                mftGeom->GetLadderID(GetUniqueID()),
      58           0 :                mftGeom->GetSensorID(GetUniqueID()) ));
      59             : 
      60           0 :   Double_t pos[3];
      61           0 :   pos[0] = mftGeom->GetSensorID(GetUniqueID())*(AliMFTGeometry::kSensorLength + AliMFTGeometry::kSensorInterspace)
      62           0 :                   + AliMFTGeometry::kSensorSideOffset;
      63           0 :   pos[1] = AliMFTGeometry::kSensorTopOffset ;
      64           0 :   pos[2] = AliMFTGeometry::kFlexThickness ;
      65           0 :   SetPosition(pos);
      66             :   
      67           0 :   AliDebug(2,Form("Creating %s, UniqueID = %d, Position = (%.2f, %.2f, %.2f)",GetName(), GetUniqueID(), pos[0], pos[1], pos[2]));
      68             :   
      69           0 : }
      70             : 
      71             : 
      72             : //====================================================================================================================================================
      73             : /// Returns the pixel ID corresponding to a hit at (x,y) in the Sensor  frame
      74             : ///
      75             : /// \param [in] xHit Double_t : x Position of the Hit
      76             : /// \param [in] yHit Double_t : y Position of the Hit
      77             : ///
      78             : /// \param [out] xPixel Int_t : x position of the pixel hit on the sensor matrix
      79             : /// \param [out] yPixel Int_t : y position of the pixel hit on the sensor matrix
      80             : /// \retval <kTRUE> if hit into the active part of the sensor
      81             : /// \retval <kFALSE> if hit outside the active part
      82             : //
      83             : 
      84             : Bool_t AliMFTChipSegmentation::Hit2PixelID(Double_t xHit, Double_t yHit, Int_t &xPixel, Int_t &yPixel) {
      85             :   // TODO Need to work on the Misalignment
      86             :   
      87           0 :   Double_t xHitLocal = xHit-AliMFTConstants::kSensorMargin;
      88           0 :   Double_t yHitLocal = yHit-(AliMFTConstants::kSensorMargin + AliMFTConstants::kSensorHeight - AliMFTConstants::kSensorActiveHeight);
      89             : 
      90             : //  Double_t xHitLocal = (xHit-(fActiveOrigin[0]+fMisalignmentShift[0]))*fSignLength[0];
      91             : //  Double_t yHitLocal = (yHit-(fActiveOrigin[1]+fMisalignmentShift[1]))*fSignLength[1];
      92           0 :   AliDebug(2,Form("Hit %f %f --> Pixel Pitch %f  %f ",xHitLocal,yHitLocal,AliMFTConstants::kXPixelPitch,AliMFTConstants::kYPixelPitch));
      93             : 
      94           0 :   if (xHitLocal<0. || xHitLocal>AliMFTConstants::kSensorActiveWidth) return kFALSE;
      95           0 :   if (yHitLocal<0. || yHitLocal>AliMFTConstants::kSensorActiveHeight) return kFALSE;
      96             : 
      97           0 :   xPixel = Int_t( xHitLocal / AliMFTConstants::kXPixelPitch );
      98           0 :   yPixel = Int_t( yHitLocal / AliMFTConstants::kYPixelPitch );
      99           0 :   AliDebug(1,Form("--> Hit in Pixel %d ; %d ",xPixel,yPixel));
     100             : 
     101           0 :   return kTRUE;
     102             : 
     103           0 : }
     104             : 
     105             : //==================================================================================================================
     106             : /// \brief Print out Sensor information (Name, ID, position, orientation)
     107             : void AliMFTChipSegmentation::Print(Option_t* /*option*/){
     108             :   
     109           0 :   AliInfo(Form("Sensor %s (Unique ID = %d)",GetName(),GetUniqueID()));
     110           0 :   GetTransformation()->Print();
     111           0 : }

Generated by: LCOV version 1.11