]> git.uio.no Git - u/mrichter/AliRoot.git/blame - MUON/mapping/AliMpConstants.cxx
Adding a couple more constants (Laurent)
[u/mrichter/AliRoot.git] / MUON / mapping / AliMpConstants.cxx
CommitLineData
dee1d5f1 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
5f91c9e8 16// $Id$
13985652 17// $MpId: AliMpConstants.cxx,v 1.11 2006/05/24 13:58:29 ivana Exp $
5f91c9e8 18// Category: basic
19//
20// Class AliMpConstants
21// --------------------
22// Class for globally used constants definition.
dbe945cc 23// Included in AliRoot: 2003/05/02
5f91c9e8 24// Authors: David Guez, Ivana Hrivnacova; IPN Orsay
25
5f91c9e8 26#include "AliMpConstants.h"
27
d08b9187 28#include <TMath.h>
29#include <TVector2.h>
5f91c9e8 30
13985652 31/// \cond CLASSIMP
32ClassImp(AliMpConstants)
33/// \endcond
34
5f91c9e8 35// static data
d08b9187 36const Double_t AliMpConstants::fgkLengthTolerance = 1e-05; // 0.1 mum
37const Double_t AliMpConstants::fgkLengthStep = 0.1; // 1 mm
5f91c9e8 38const Int_t AliMpConstants::fgkStartPadIndex = 1;
185ce53f 39const Int_t AliMpConstants::fgkNofChambers = 14;
6061eac6 40const Int_t AliMpConstants::fgkNofTrackingChambers = 10;
185ce53f 41const Int_t AliMpConstants::fgkNofGeomModules = 20;
fa09302e 42const Int_t AliMpConstants::fgkNofLocalBoards = 234;
35a22829 43const Int_t AliMpConstants::fgkNonBendingManuMask(1<<10);
44const Int_t AliMpConstants::fgkManuNofChannels(64);
45const Int_t AliMpConstants::fgkLocalBoardNofChannels(16);
d08b9187 46
5f91c9e8 47//_____________________________________________________________________________
48AliMpConstants::AliMpConstants()
dee1d5f1 49 : TObject()
50{
51/// Default constructor
5f91c9e8 52}
53
54//_____________________________________________________________________________
dee1d5f1 55AliMpConstants::~AliMpConstants()
56{
57///Destructor
5f91c9e8 58}
59
60//_____________________________________________________________________________
61Bool_t AliMpConstants::IsEqual(Double_t length1, Double_t length2)
62{
dee1d5f1 63/// Compare lengths within the length tolerance.
5f91c9e8 64
65 return TMath::Abs(length1 - length2) < fgkLengthTolerance;
66}
67
68
69//_____________________________________________________________________________
70Bool_t AliMpConstants::IsEqual(const TVector2& v1, const TVector2& v2)
71{
dee1d5f1 72/// Compare x, y vector coordinates within the length tolerance.
5f91c9e8 73
74 return ( TMath::Abs(v1.X() - v2.X())
75 + TMath::Abs(v1.Y() - v2.Y())) < 2.*fgkLengthTolerance;
76}
d08b9187 77
78//_____________________________________________________________________________
fa09302e 79Int_t AliMpConstants::ManuMask(AliMp::PlaneType planeType)
d08b9187 80{
f5671fc3 81/// The manuIDs get an offset if they are in the non-bending plane
82
cddd101e 83 return ( planeType == AliMp::kNonBendingPlane ) ? fgkNonBendingManuMask : 0;
d08b9187 84}
fa09302e 85
86//_____________________________________________________________________________
87Int_t AliMpConstants::NofTriggerChambers()
88{
89/// Return number of trigger chambers
90
91 return fgkNofChambers - fgkNofTrackingChambers;
92}