Add Jochens GTU simulation code
[u/mrichter/AliRoot.git] / TRD / AliTRDtrackletMCM.cxx
CommitLineData
52c19022 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: AliTRDtrackletMCM.cxx 28397 2008-09-02 09:33:00Z cblume $ */
17
18////////////////////////////////////////////////////////////////////////////
19// //
20// MCM tracklet //
21// //
22// Author: J. Klein (Jochen.Klein@cern.ch) //
23// //
24////////////////////////////////////////////////////////////////////////////
25
26#include "AliTRDtrackletMCM.h"
27#include "AliLog.h"
28
29ClassImp(AliTRDtrackletMCM)
30
31AliTRDtrackletMCM::AliTRDtrackletMCM(UInt_t trackletWord) :
32 AliTRDtrackletBase(),
33 fHCId(-1),
34 fTrackletWord(trackletWord),
35 fMCM(-1),
36 fROB(-1)
37{
38
39}
40
41AliTRDtrackletMCM::AliTRDtrackletMCM(UInt_t trackletWord, Int_t hcid) :
42 AliTRDtrackletBase(),
43 fHCId(hcid),
44 fTrackletWord(trackletWord),
45 fMCM(-1),
46 fROB(-1)
47{
48
49}
50
51AliTRDtrackletMCM::AliTRDtrackletMCM(const AliTRDtrackletMCM &rhs) :
52 AliTRDtrackletBase(rhs),
53 fHCId(rhs.fHCId),
54 fTrackletWord(rhs.fTrackletWord),
55 fMCM(rhs.fMCM),
56 fROB(rhs.fROB)
57{
58
59}
60
61AliTRDtrackletMCM::~AliTRDtrackletMCM()
62{
63
64}
65
66Int_t AliTRDtrackletMCM::GetYbin() const {
67 // returns (signed) value of Y
68 if (fTrackletWord & 0x1000) {
69 return -((~(fTrackletWord-1)) & 0x1fff);
70 }
71 else {
72 return (fTrackletWord & 0x1fff);
73 }
74}
75
76Int_t AliTRDtrackletMCM::GetdY() const
77{
78 // returns (signed) value of the deflection length
79 if (fTrackletWord & (1 << 19)) {
80 return -((~((fTrackletWord >> 13) - 1)) & 0x7f);
81 }
82 else {
83 return ((fTrackletWord >> 13) & 0x7f);
84 }
85}