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