]>
Commit | Line | Data |
---|---|---|
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 | ||
29 | ClassImp(AliTRDtrackletMCM) | |
30 | ||
31 | AliTRDtrackletMCM::AliTRDtrackletMCM(UInt_t trackletWord) : | |
32 | AliTRDtrackletBase(), | |
4cc89512 | 33 | fGeo(0x0), |
52c19022 | 34 | fHCId(-1), |
35 | fTrackletWord(trackletWord), | |
36 | fMCM(-1), | |
4cc89512 | 37 | fROB(-1), |
48e5462a | 38 | fQ0(0), |
39 | fQ1(0), | |
36dc3337 | 40 | fNHits(0), |
41 | fNHits0(0), | |
42 | fNHits1(0), | |
ce51199c | 43 | fLabel(-1), |
44 | fSlope(0.), | |
45 | fOffset(0.), | |
46 | fError(0.), | |
47 | fNClusters(0), | |
48 | fResiduals(0x0), | |
49 | fClsCharges(0x0) | |
52c19022 | 50 | { |
4cc89512 | 51 | fGeo = new AliTRDgeometry(); |
52c19022 | 52 | } |
53 | ||
54 | AliTRDtrackletMCM::AliTRDtrackletMCM(UInt_t trackletWord, Int_t hcid) : | |
55 | AliTRDtrackletBase(), | |
4cc89512 | 56 | fGeo(0x0), |
52c19022 | 57 | fHCId(hcid), |
58 | fTrackletWord(trackletWord), | |
59 | fMCM(-1), | |
4cc89512 | 60 | fROB(-1), |
48e5462a | 61 | fQ0(0), |
62 | fQ1(0), | |
36dc3337 | 63 | fNHits(0), |
64 | fNHits0(0), | |
65 | fNHits1(0), | |
ce51199c | 66 | fLabel(-1), |
67 | fSlope(0.), | |
68 | fOffset(0.), | |
69 | fError(0.), | |
70 | fNClusters(0), | |
71 | fResiduals(0x0), | |
72 | fClsCharges(0x0) | |
52c19022 | 73 | { |
4cc89512 | 74 | fGeo = new AliTRDgeometry(); |
52c19022 | 75 | } |
76 | ||
b0a41e80 | 77 | AliTRDtrackletMCM::AliTRDtrackletMCM(UInt_t trackletWord, Int_t hcid, Int_t rob, Int_t mcm) : |
78 | AliTRDtrackletBase(), | |
79 | fGeo(0x0), | |
80 | fHCId(hcid), | |
81 | fTrackletWord(trackletWord), | |
82 | fMCM(mcm), | |
83 | fROB(rob), | |
48e5462a | 84 | fQ0(0), |
85 | fQ1(0), | |
36dc3337 | 86 | fNHits(0), |
87 | fNHits0(0), | |
88 | fNHits1(0), | |
ce51199c | 89 | fLabel(-1), |
90 | fSlope(0.), | |
91 | fOffset(0.), | |
92 | fError(0.), | |
93 | fNClusters(0), | |
94 | fResiduals(0x0), | |
95 | fClsCharges(0x0) | |
b0a41e80 | 96 | { |
97 | fGeo = new AliTRDgeometry(); | |
98 | } | |
99 | ||
52c19022 | 100 | AliTRDtrackletMCM::AliTRDtrackletMCM(const AliTRDtrackletMCM &rhs) : |
101 | AliTRDtrackletBase(rhs), | |
4cc89512 | 102 | fGeo(0x0), |
52c19022 | 103 | fHCId(rhs.fHCId), |
104 | fTrackletWord(rhs.fTrackletWord), | |
105 | fMCM(rhs.fMCM), | |
4cc89512 | 106 | fROB(rhs.fROB), |
48e5462a | 107 | fQ0(rhs.fQ0), |
108 | fQ1(rhs.fQ1), | |
36dc3337 | 109 | fNHits(rhs.fNHits), |
110 | fNHits0(rhs.fNHits0), | |
111 | fNHits1(rhs.fNHits1), | |
ce51199c | 112 | fLabel(rhs.fLabel), |
113 | fSlope(rhs.fLabel), | |
114 | fOffset(rhs.fOffset), | |
115 | fError(rhs.fError), | |
116 | fNClusters(rhs.fNClusters), | |
117 | fResiduals(0x0), | |
118 | fClsCharges(0x0) | |
52c19022 | 119 | { |
4cc89512 | 120 | fGeo = new AliTRDgeometry(); |
ce51199c | 121 | fResiduals = new Float_t[fNClusters]; |
122 | fClsCharges = new Float_t[fNClusters]; | |
123 | for (Int_t iCls = 0; iCls < fNClusters; iCls++) { | |
124 | fResiduals[iCls] = rhs.fResiduals[iCls]; | |
125 | fClsCharges[iCls] = rhs.fClsCharges[iCls]; | |
126 | } | |
52c19022 | 127 | } |
128 | ||
129 | AliTRDtrackletMCM::~AliTRDtrackletMCM() | |
130 | { | |
ce51199c | 131 | delete [] fResiduals; |
132 | delete [] fClsCharges; | |
4cc89512 | 133 | delete fGeo; |
52c19022 | 134 | } |
135 | ||
136 | Int_t AliTRDtrackletMCM::GetYbin() const { | |
137 | // returns (signed) value of Y | |
138 | if (fTrackletWord & 0x1000) { | |
139 | return -((~(fTrackletWord-1)) & 0x1fff); | |
140 | } | |
141 | else { | |
142 | return (fTrackletWord & 0x1fff); | |
143 | } | |
144 | } | |
145 | ||
146 | Int_t AliTRDtrackletMCM::GetdY() const | |
147 | { | |
148 | // returns (signed) value of the deflection length | |
149 | if (fTrackletWord & (1 << 19)) { | |
150 | return -((~((fTrackletWord >> 13) - 1)) & 0x7f); | |
151 | } | |
152 | else { | |
153 | return ((fTrackletWord >> 13) & 0x7f); | |
154 | } | |
155 | } | |
ce51199c | 156 | |
157 | void AliTRDtrackletMCM::SetClusters(Float_t *res, Float_t *q, Int_t n) | |
158 | { | |
159 | fNClusters = n; | |
160 | delete [] fResiduals; | |
161 | delete [] fClsCharges; | |
162 | ||
163 | fResiduals = new Float_t[fNClusters]; | |
164 | fClsCharges = new Float_t[fNClusters]; | |
165 | ||
166 | for (Int_t iCls = 0; iCls < fNClusters; iCls++) { | |
167 | fResiduals[iCls] = res[iCls]; | |
168 | fClsCharges[iCls] = q[iCls]; | |
169 | } | |
170 | } |