]> git.uio.no Git - u/mrichter/AliRoot.git/blame_incremental - TRD/AliTRDtrackletGTU.cxx
Modifications in the filtering task: 1) add switch for 3 prong LS candidates; 2)...
[u/mrichter/AliRoot.git] / TRD / AliTRDtrackletGTU.cxx
... / ...
CommitLineData
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: AliTRDtrackletGTU.cxx 28397 2008-09-02 09:33:00Z cblume $ */
17
18////////////////////////////////////////////////////////////////////////////
19// //
20// GTU tracklet //
21// //
22// Author: J. Klein (Jochen.Klein@cern.ch) //
23// //
24////////////////////////////////////////////////////////////////////////////
25
26#include "TMath.h"
27#include "TClass.h"
28
29#include "AliTRDtrackletGTU.h"
30#include "AliTRDtrackletWord.h"
31#include "AliTRDtrackletMCM.h"
32#include "AliLog.h"
33#include "AliTRDgtuParam.h"
34#include "AliTRDgeometry.h"
35#include "AliTRDpadPlane.h"
36
37ClassImp(AliTRDtrackletGTU)
38
39AliTRDtrackletBase* AliTRDtrackletGTU::fgkDummyTracklet = new AliTRDtrackletWord(0);
40
41AliTRDtrackletGTU::AliTRDtrackletGTU() :
42 AliTRDtrackletBase(),
43 fGtuParam(AliTRDgtuParam::Instance()),
44 fTracklet(fgkDummyTracklet),
45 fTrackletESD(0x0),
46 fAssignedZ(kFALSE),
47 fAlpha(0),
48 fYProj(0),
49 fYPrime(0),
50 fIndex(0)
51{
52 // ctor for any tracklet deriving from AliTRDtrackletBase
53
54 for (Int_t zch = 0; zch < fGtuParam->GetNZChannels(); zch++)
55 fSubChannel[zch] = 0;
56}
57
58AliTRDtrackletGTU::AliTRDtrackletGTU(AliTRDtrackletBase *tracklet) :
59 AliTRDtrackletBase(*tracklet),
60 fGtuParam(AliTRDgtuParam::Instance()),
61 fTracklet(fgkDummyTracklet),
62 fTrackletESD(0x0),
63 fAssignedZ(kFALSE),
64 fAlpha(0),
65 fYProj(0),
66 fYPrime(0),
67 fIndex(0)
68{
69 // ctor for any tracklet deriving from AliTRDtrackletBase
70
71 for (Int_t zch = 0; zch < fGtuParam->GetNZChannels(); zch++)
72 fSubChannel[zch] = 0;
73 fTracklet = tracklet;
74 if ( fTracklet->IsA() == TClass::GetClass("AliTRDtrackletMCM")) {
75 AliDebug(5,Form("label from mcm tracklet: %i", ((AliTRDtrackletMCM*) fTracklet)->GetLabel()));
76 }
77}
78
79AliTRDtrackletGTU::AliTRDtrackletGTU(AliESDTrdTracklet *tracklet) :
80 AliTRDtrackletBase(),
81 fGtuParam(AliTRDgtuParam::Instance()),
82 fTracklet(fgkDummyTracklet),
83 fTrackletESD(tracklet),
84 fAssignedZ(kFALSE),
85 fAlpha(0),
86 fYProj(0),
87 fYPrime(0),
88 fIndex(0)
89{
90 // ctor for an AliESDTrdTracklet
91
92 for (Int_t zch = 0; zch < fGtuParam->GetNZChannels(); zch++)
93 fSubChannel[zch] = 0;
94}
95
96AliTRDtrackletGTU::AliTRDtrackletGTU(const AliTRDtrackletGTU& tracklet) :
97 AliTRDtrackletBase(tracklet),
98 fGtuParam(AliTRDgtuParam::Instance()),
99 fTracklet(tracklet.fTracklet),
100 fTrackletESD(tracklet.fTrackletESD),
101 fAssignedZ(tracklet.fAssignedZ),
102 fAlpha(tracklet.fAlpha),
103 fYProj(tracklet.fYProj),
104 fYPrime(tracklet.fYPrime),
105 fIndex(tracklet.fIndex)
106{
107 // copy ctor
108
109 for (Int_t zch = 0; zch < fGtuParam->GetNZChannels(); zch++)
110 fSubChannel[zch] = tracklet.fSubChannel[zch];
111}
112
113AliTRDtrackletGTU& AliTRDtrackletGTU::operator=(const AliTRDtrackletGTU &rhs)
114{
115 // assignment operator
116
117 if (&rhs != this) {
118 fTracklet = rhs.fTracklet;
119 fTrackletESD = rhs.fTrackletESD;
120 for (Int_t zch = 0; zch < fGtuParam->GetNZChannels(); zch++)
121 fSubChannel[zch] = rhs.fSubChannel[zch];
122 fIndex = rhs.fIndex;
123 fYPrime = rhs.fYPrime;
124 fYProj = rhs.fYProj;
125 fAlpha = rhs.fAlpha;
126 fAssignedZ = rhs.fAssignedZ;
127 }
128
129 return *this;
130}
131
132AliTRDtrackletGTU::~AliTRDtrackletGTU()
133{
134 // dtor
135}
136
137void AliTRDtrackletGTU::SetSubChannel(Int_t zch, Int_t subch)
138{
139 // set the subchannel in the given z-channel
140 fAssignedZ = kTRUE;
141 fSubChannel[zch] = subch;
142}
143
144Int_t AliTRDtrackletGTU::GetSubChannel(Int_t zch) const
145{
146 // get the subchannel in the given z-channel
147 return fSubChannel[zch];
148}
149
150Int_t AliTRDtrackletGTU::GetLabel() const
151{
152 // get the MC label for the tracklet, -1 if none
153
154 if (fTrackletESD)
155 return fTrackletESD->GetLabel();
156 else if ( fTracklet->IsA() == TClass::GetClass("AliTRDtrackletMCM"))
157 return ((AliTRDtrackletMCM*) fTracklet)->GetLabel();
158 else
159 return -1;
160}
161
162/*
163Float_t AliTRDtrackletGTU::GetPhysX(Int_t layer)
164{
165 // get the x-position (in the local system) assuming the tracklet is in the given layer
166 return fGtuParam->GetGeo()->GetTime0(layer);
167}
168
169Float_t AliTRDtrackletGTU::GetPhysY()
170{
171 //
172 return GetYbin() * 0.0160;
173}
174
175Float_t AliTRDtrackletGTU::GetPhysAlpha()
176{
177 return GetAlpha() * 0.01; // wrong factor!
178}
179
180Float_t AliTRDtrackletGTU::GetPhysZ(Int_t stack, Int_t layer)
181{
182 return fGtuParam->GetGeo()->GetPadPlane(layer, stack)->GetRowPos(GetZbin()); // not the middle of a pad!
183}
184*/