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),
51 fGeo = new AliTRDgeometry();
54 AliTRDtrackletMCM::AliTRDtrackletMCM(UInt_t trackletWord, Int_t hcid) :
58 fTrackletWord(trackletWord),
74 fGeo = new AliTRDgeometry();
77 AliTRDtrackletMCM::AliTRDtrackletMCM(UInt_t trackletWord, Int_t hcid, Int_t rob, Int_t mcm) :
81 fTrackletWord(trackletWord),
97 fGeo = new AliTRDgeometry();
100 AliTRDtrackletMCM::AliTRDtrackletMCM(const AliTRDtrackletMCM &rhs) :
101 AliTRDtrackletBase(rhs),
104 fTrackletWord(rhs.fTrackletWord),
110 fNHits0(rhs.fNHits0),
111 fNHits1(rhs.fNHits1),
114 fOffset(rhs.fOffset),
116 fNClusters(rhs.fNClusters),
120 fGeo = new AliTRDgeometry();
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];
129 AliTRDtrackletMCM::~AliTRDtrackletMCM()
131 delete [] fResiduals;
132 delete [] fClsCharges;
136 Int_t AliTRDtrackletMCM::GetYbin() const {
137 // returns (signed) value of Y
138 if (fTrackletWord & 0x1000) {
139 return -((~(fTrackletWord-1)) & 0x1fff);
142 return (fTrackletWord & 0x1fff);
146 Int_t AliTRDtrackletMCM::GetdY() const
148 // returns (signed) value of the deflection length
149 if (fTrackletWord & (1 << 19)) {
150 return -((~((fTrackletWord >> 13) - 1)) & 0x7f);
153 return ((fTrackletWord >> 13) & 0x7f);
157 void AliTRDtrackletMCM::SetClusters(Float_t *res, Float_t *q, Int_t n)
160 delete [] fResiduals;
161 delete [] fClsCharges;
163 fResiduals = new Float_t[fNClusters];
164 fClsCharges = new Float_t[fNClusters];
166 for (Int_t iCls = 0; iCls < fNClusters; iCls++) {
167 fResiduals[iCls] = res[iCls];
168 fClsCharges[iCls] = q[iCls];