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),
50 fGeo = new AliTRDgeometry();
56 AliTRDtrackletMCM::AliTRDtrackletMCM(UInt_t trackletWord, Int_t hcid) :
60 fTrackletWord(trackletWord),
75 fGeo = new AliTRDgeometry();
81 AliTRDtrackletMCM::AliTRDtrackletMCM(UInt_t trackletWord, Int_t hcid, Int_t rob, Int_t mcm) :
85 fTrackletWord(trackletWord),
100 fGeo = new AliTRDgeometry();
106 AliTRDtrackletMCM::AliTRDtrackletMCM(const AliTRDtrackletMCM &rhs) :
107 AliTRDtrackletBase(rhs),
110 fTrackletWord(rhs.fTrackletWord),
116 fNHits0(rhs.fNHits0),
117 fNHits1(rhs.fNHits1),
119 fOffset(rhs.fOffset),
121 fNClusters(rhs.fNClusters),
125 fGeo = new AliTRDgeometry();
126 fResiduals = new Float_t[fNClusters];
127 fClsCharges = new Float_t[fNClusters];
128 for (Int_t iCls = 0; iCls < fNClusters; iCls++) {
129 fResiduals[iCls] = rhs.fResiduals[iCls];
130 fClsCharges[iCls] = rhs.fClsCharges[iCls];
132 fLabel[0] = rhs.fLabel[0];
133 fLabel[1] = rhs.fLabel[1];
134 fLabel[2] = rhs.fLabel[2];
137 AliTRDtrackletMCM::~AliTRDtrackletMCM()
139 delete [] fResiduals;
140 delete [] fClsCharges;
144 Int_t AliTRDtrackletMCM::GetYbin() const {
145 // returns (signed) value of Y
146 if (fTrackletWord & 0x1000) {
147 return -((~(fTrackletWord-1)) & 0x1fff);
150 return (fTrackletWord & 0x1fff);
154 Int_t AliTRDtrackletMCM::GetdY() const
156 // returns (signed) value of the deflection length
157 if (fTrackletWord & (1 << 19)) {
158 return -((~((fTrackletWord >> 13) - 1)) & 0x7f);
161 return ((fTrackletWord >> 13) & 0x7f);
165 void AliTRDtrackletMCM::SetLabel(Int_t label[])
167 fLabel[0] = label[0];
168 fLabel[1] = label[1];
169 fLabel[2] = label[2];
172 void AliTRDtrackletMCM::SetClusters(Float_t *res, Float_t *q, Int_t n)
175 delete [] fResiduals;
176 delete [] fClsCharges;
178 fResiduals = new Float_t[fNClusters];
179 fClsCharges = new Float_t[fNClusters];
181 for (Int_t iCls = 0; iCls < fNClusters; iCls++) {
182 fResiduals[iCls] = res[iCls];
183 fClsCharges[iCls] = q[iCls];