]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/mapping/AliMpConstants.cxx
Removed class AliMUONGeometryStore
[u/mrichter/AliRoot.git] / MUON / mapping / AliMpConstants.cxx
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: AliMpConstants.cxx,v 1.11 2006/05/24 13:58:29 ivana Exp $
18 // Category: basic
19 //
20 // Class AliMpConstants
21 // --------------------
22 // Class for globally used constants definition.
23 // Included in AliRoot: 2003/05/02
24 // Authors: David Guez, Ivana Hrivnacova; IPN Orsay
25
26 #include "AliMpConstants.h"
27
28 #include <TMath.h>
29 #include <TVector2.h>
30
31 /// \cond CLASSIMP
32 ClassImp(AliMpConstants)
33 /// \endcond
34
35 // static data
36 const Double_t AliMpConstants::fgkLengthTolerance = 1e-05; // 0.1 mum
37 const Double_t AliMpConstants::fgkLengthStep = 0.1; // 1 mm
38 const Int_t    AliMpConstants::fgkStartPadIndex = 1;
39 const Int_t    AliMpConstants::fgkNCh = 14;
40 const Int_t AliMpConstants::fgkNonBendingManuMask(1<<10);
41
42 //_____________________________________________________________________________
43 AliMpConstants::AliMpConstants()
44   : TObject() 
45 {
46 /// Default constructor  
47 }
48
49 //_____________________________________________________________________________
50 AliMpConstants::~AliMpConstants() 
51 {
52 ///Destructor
53 }
54
55 //_____________________________________________________________________________
56 Bool_t  AliMpConstants::IsEqual(Double_t length1, Double_t length2)
57 {
58 /// Compare lengths within the length tolerance.
59
60   return TMath::Abs(length1 - length2) < fgkLengthTolerance;
61 }  
62
63
64 //_____________________________________________________________________________
65 Bool_t  AliMpConstants::IsEqual(const TVector2& v1, const TVector2& v2)
66 {
67 /// Compare x, y vector coordinates within the length tolerance.
68
69   return (  TMath::Abs(v1.X() - v2.X()) 
70           + TMath::Abs(v1.Y() - v2.Y())) < 2.*fgkLengthTolerance;
71 }
72
73 //_____________________________________________________________________________
74 Int_t
75 AliMpConstants::ManuMask(AliMpPlaneType planeType)
76 {
77   //
78   // The manuIDs get an offset if they are in the non-bending plane
79   //
80   return ( planeType == kNonBendingPlane ) ? fgkNonBendingManuMask : 0;
81 }