1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
16 /* $Id: AliTRDtrackletMCM.cxx 28397 2008-09-02 09:33:00Z cblume $ */
18 ////////////////////////////////////////////////////////////////////////////
22 // Author: J. Klein (Jochen.Klein@cern.ch) //
24 ////////////////////////////////////////////////////////////////////////////
26 #include "AliTRDtrackletMCM.h"
29 ClassImp(AliTRDtrackletMCM)
31 AliTRDtrackletMCM::AliTRDtrackletMCM(UInt_t trackletWord) :
35 fTrackletWord(trackletWord),
52 fGeo = new AliTRDgeometry();
58 AliTRDtrackletMCM::AliTRDtrackletMCM(UInt_t trackletWord, Int_t hcid) :
62 fTrackletWord(trackletWord),
79 fGeo = new AliTRDgeometry();
85 AliTRDtrackletMCM::AliTRDtrackletMCM(UInt_t trackletWord, Int_t hcid, Int_t rob, Int_t mcm) :
89 fTrackletWord(trackletWord),
106 fGeo = new AliTRDgeometry();
112 AliTRDtrackletMCM::AliTRDtrackletMCM(const AliTRDtrackletMCM &rhs) :
113 AliTRDtrackletBase(rhs),
116 fTrackletWord(rhs.fTrackletWord),
122 fNHits0(rhs.fNHits0),
123 fNHits1(rhs.fNHits1),
125 fOffset(rhs.fOffset),
127 fNClusters(rhs.fNClusters),
133 fGeo = new AliTRDgeometry();
134 fResiduals = new Float_t[fNClusters];
135 fClsCharges = new Float_t[fNClusters];
136 for (Int_t iCls = 0; iCls < fNClusters; iCls++) {
137 fResiduals[iCls] = rhs.fResiduals[iCls];
138 fClsCharges[iCls] = rhs.fClsCharges[iCls];
140 fLabel[0] = rhs.fLabel[0];
141 fLabel[1] = rhs.fLabel[1];
142 fLabel[2] = rhs.fLabel[2];
145 AliTRDtrackletMCM::~AliTRDtrackletMCM()
149 delete [] fResiduals;
150 delete [] fClsCharges;
154 Int_t AliTRDtrackletMCM::GetYbin() const {
155 // returns (signed) value of Y
156 if (fTrackletWord & 0x1000) {
157 return -((~(fTrackletWord-1)) & 0x1fff);
160 return (fTrackletWord & 0x1fff);
164 Int_t AliTRDtrackletMCM::GetdY() const
166 // returns (signed) value of the deflection length
167 if (fTrackletWord & (1 << 19)) {
168 return -((~((fTrackletWord >> 13) - 1)) & 0x7f);
171 return ((fTrackletWord >> 13) & 0x7f);
175 void AliTRDtrackletMCM::SetLabel(Int_t label[])
177 // set the labels (up to 3)
179 fLabel[0] = label[0];
180 fLabel[1] = label[1];
181 fLabel[2] = label[2];
184 void AliTRDtrackletMCM::SetClusters(Float_t *res, Float_t *q, Int_t n)
187 delete [] fResiduals;
188 delete [] fClsCharges;
190 fResiduals = new Float_t[fNClusters];
191 fClsCharges = new Float_t[fNClusters];
193 for (Int_t iCls = 0; iCls < fNClusters; iCls++) {
194 fResiduals[iCls] = res[iCls];
195 fClsCharges[iCls] = q[iCls];