]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TRD/AliTRDtrackletMCM.cxx
- feed data to mcmSim in pads, write back in channels
[u/mrichter/AliRoot.git] / TRD / AliTRDtrackletMCM.cxx
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(),
33   fGeo(0x0),
34   fHCId(-1),
35   fTrackletWord(trackletWord), 
36   fMCM(-1), 
37   fROB(-1), 
38   fQ0(0),
39   fQ1(0),
40   fNHits(0),
41   fNHits0(0),
42   fNHits1(0),
43   fLabel(-1),
44   fSlope(0.),
45   fOffset(0.),
46   fError(0.),
47   fNClusters(0),
48   fResiduals(0x0),
49   fClsCharges(0x0)
50
51     fGeo = new AliTRDgeometry();
52 }
53
54 AliTRDtrackletMCM::AliTRDtrackletMCM(UInt_t trackletWord, Int_t hcid) :
55   AliTRDtrackletBase(),
56   fGeo(0x0),
57   fHCId(hcid),
58   fTrackletWord(trackletWord), 
59   fMCM(-1),
60   fROB(-1),
61   fQ0(0),
62   fQ1(0),
63   fNHits(0),
64   fNHits0(0),
65   fNHits1(0),
66   fLabel(-1),
67   fSlope(0.),
68   fOffset(0.),
69   fError(0.),
70   fNClusters(0),
71   fResiduals(0x0),
72   fClsCharges(0x0)
73
74     fGeo = new AliTRDgeometry();
75 }
76
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),
84   fQ0(0),
85   fQ1(0),
86   fNHits(0),
87   fNHits0(0),
88   fNHits1(0),
89   fLabel(-1),
90   fSlope(0.),
91   fOffset(0.),
92   fError(0.),
93   fNClusters(0),
94   fResiduals(0x0),
95   fClsCharges(0x0)
96
97     fGeo = new AliTRDgeometry();
98 }
99
100 AliTRDtrackletMCM::AliTRDtrackletMCM(const AliTRDtrackletMCM &rhs) :
101   AliTRDtrackletBase(rhs),
102   fGeo(0x0),
103   fHCId(rhs.fHCId),
104   fTrackletWord(rhs.fTrackletWord),
105   fMCM(rhs.fMCM),
106   fROB(rhs.fROB),
107   fQ0(rhs.fQ0),
108   fQ1(rhs.fQ1),
109   fNHits(rhs.fNHits),
110   fNHits0(rhs.fNHits0),
111   fNHits1(rhs.fNHits1),
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)
119 {
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];
126     }
127 }
128
129 AliTRDtrackletMCM::~AliTRDtrackletMCM() 
130 {
131   delete [] fResiduals;
132   delete [] fClsCharges;
133     delete fGeo;
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 }
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 }