Line data Source code
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 48 : ClassImp(AliTRDtrackletMCM)
30 :
31 : AliTRDtrackletMCM::AliTRDtrackletMCM(UInt_t trackletWord) :
32 17 : AliTRDtrackletBase(),
33 17 : fGeo(0x0),
34 17 : fHCId(-1),
35 17 : fTrackletWord(trackletWord),
36 17 : fMCM(-1),
37 17 : fROB(-1),
38 17 : fQ0(0),
39 17 : fQ1(0),
40 17 : fNHits(0),
41 17 : fNHits0(0),
42 17 : fNHits1(0),
43 17 : fSlope(0.),
44 17 : fOffset(0.),
45 17 : fError(0.),
46 17 : fNClusters(0),
47 17 : fResiduals(0x0),
48 17 : fClsCharges(0x0)
49 85 : {
50 : // constructor
51 :
52 51 : fGeo = new AliTRDgeometry();
53 17 : fLabel[0] = -1;
54 17 : fLabel[1] = -1;
55 17 : fLabel[2] = -1;
56 34 : }
57 :
58 : AliTRDtrackletMCM::AliTRDtrackletMCM(UInt_t trackletWord, Int_t hcid) :
59 0 : AliTRDtrackletBase(),
60 0 : fGeo(0x0),
61 0 : fHCId(hcid),
62 0 : fTrackletWord(trackletWord),
63 0 : fMCM(-1),
64 0 : fROB(-1),
65 0 : fQ0(0),
66 0 : fQ1(0),
67 0 : fNHits(0),
68 0 : fNHits0(0),
69 0 : fNHits1(0),
70 0 : fSlope(0.),
71 0 : fOffset(0.),
72 0 : fError(0.),
73 0 : fNClusters(0),
74 0 : fResiduals(0x0),
75 0 : fClsCharges(0x0)
76 0 : {
77 : // constructor
78 :
79 0 : fGeo = new AliTRDgeometry();
80 0 : fLabel[0] = -1;
81 0 : fLabel[1] = -1;
82 0 : fLabel[2] = -1;
83 0 : }
84 :
85 : AliTRDtrackletMCM::AliTRDtrackletMCM(UInt_t trackletWord, Int_t hcid, Int_t rob, Int_t mcm) :
86 719 : AliTRDtrackletBase(),
87 719 : fGeo(0x0),
88 719 : fHCId(hcid),
89 719 : fTrackletWord(trackletWord),
90 719 : fMCM(mcm),
91 719 : fROB(rob),
92 719 : fQ0(0),
93 719 : fQ1(0),
94 719 : fNHits(0),
95 719 : fNHits0(0),
96 719 : fNHits1(0),
97 719 : fSlope(0.),
98 719 : fOffset(0.),
99 719 : fError(0.),
100 719 : fNClusters(0),
101 719 : fResiduals(0x0),
102 719 : fClsCharges(0x0)
103 3595 : {
104 : // constructor
105 :
106 2157 : fGeo = new AliTRDgeometry();
107 719 : fLabel[0] = -1;
108 719 : fLabel[1] = -1;
109 719 : fLabel[2] = -1;
110 1438 : }
111 :
112 : AliTRDtrackletMCM::AliTRDtrackletMCM(const AliTRDtrackletMCM &rhs) :
113 720 : AliTRDtrackletBase(rhs),
114 720 : fGeo(0x0),
115 720 : fHCId(rhs.fHCId),
116 720 : fTrackletWord(rhs.fTrackletWord),
117 720 : fMCM(rhs.fMCM),
118 720 : fROB(rhs.fROB),
119 720 : fQ0(rhs.fQ0),
120 720 : fQ1(rhs.fQ1),
121 720 : fNHits(rhs.fNHits),
122 720 : fNHits0(rhs.fNHits0),
123 720 : fNHits1(rhs.fNHits1),
124 720 : fSlope(rhs.fSlope),
125 720 : fOffset(rhs.fOffset),
126 720 : fError(rhs.fError),
127 720 : fNClusters(rhs.fNClusters),
128 720 : fResiduals(0x0),
129 720 : fClsCharges(0x0)
130 3600 : {
131 : // copy constructor
132 :
133 2160 : fGeo = new AliTRDgeometry();
134 1440 : fResiduals = new Float_t[fNClusters];
135 1440 : fClsCharges = new Float_t[fNClusters];
136 1440 : for (Int_t iCls = 0; iCls < fNClusters; iCls++) {
137 0 : fResiduals[iCls] = rhs.fResiduals[iCls];
138 0 : fClsCharges[iCls] = rhs.fClsCharges[iCls];
139 : }
140 720 : fLabel[0] = rhs.fLabel[0];
141 720 : fLabel[1] = rhs.fLabel[1];
142 720 : fLabel[2] = rhs.fLabel[2];
143 1440 : }
144 :
145 : AliTRDtrackletMCM::~AliTRDtrackletMCM()
146 5208 : {
147 : // destructor
148 :
149 1012 : delete [] fResiduals;
150 1012 : delete [] fClsCharges;
151 1736 : delete fGeo;
152 2604 : }
153 :
154 : Int_t AliTRDtrackletMCM::GetYbin() const {
155 : // returns (signed) value of Y
156 2452 : if (fTrackletWord & 0x1000) {
157 555 : return -((~(fTrackletWord-1)) & 0x1fff);
158 : }
159 : else {
160 671 : return (fTrackletWord & 0x1fff);
161 : }
162 1226 : }
163 :
164 : Int_t AliTRDtrackletMCM::GetdY() const
165 : {
166 : // returns (signed) value of the deflection length
167 2160 : if (fTrackletWord & (1 << 19)) {
168 1128 : return -((~((fTrackletWord >> 13) - 1)) & 0x7f);
169 : }
170 : else {
171 312 : return ((fTrackletWord >> 13) & 0x7f);
172 : }
173 720 : }
174 :
175 : void AliTRDtrackletMCM::SetLabel(Int_t label[])
176 : {
177 : // set the labels (up to 3)
178 :
179 1438 : fLabel[0] = label[0];
180 719 : fLabel[1] = label[1];
181 719 : fLabel[2] = label[2];
182 719 : }
183 :
184 : void AliTRDtrackletMCM::SetClusters(Float_t *res, Float_t *q, Int_t n)
185 : {
186 0 : fNClusters = n;
187 0 : delete [] fResiduals;
188 0 : delete [] fClsCharges;
189 :
190 0 : fResiduals = new Float_t[fNClusters];
191 0 : fClsCharges = new Float_t[fNClusters];
192 :
193 0 : for (Int_t iCls = 0; iCls < fNClusters; iCls++) {
194 0 : fResiduals[iCls] = res[iCls];
195 0 : fClsCharges[iCls] = q[iCls];
196 : }
197 0 : }
|