Modifications in the filtering task: 1) add switch for 3 prong LS candidates; 2)...
[u/mrichter/AliRoot.git] / TRD / AliTRDtrackletGTU.cxx
CommitLineData
52c19022 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"
4cc89512 27#include "TClass.h"
52c19022 28
29#include "AliTRDtrackletGTU.h"
30#include "AliTRDtrackletWord.h"
4cc89512 31#include "AliTRDtrackletMCM.h"
52c19022 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()),
44eafcf2 44 fTracklet(fgkDummyTracklet),
45 fTrackletESD(0x0),
52c19022 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
5f006bd7 54 for (Int_t zch = 0; zch < fGtuParam->GetNZChannels(); zch++)
52c19022 55 fSubChannel[zch] = 0;
56}
57
58AliTRDtrackletGTU::AliTRDtrackletGTU(AliTRDtrackletBase *tracklet) :
59 AliTRDtrackletBase(*tracklet),
60 fGtuParam(AliTRDgtuParam::Instance()),
44eafcf2 61 fTracklet(fgkDummyTracklet),
62 fTrackletESD(0x0),
52c19022 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
5f006bd7 71 for (Int_t zch = 0; zch < fGtuParam->GetNZChannels(); zch++)
52c19022 72 fSubChannel[zch] = 0;
73 fTracklet = tracklet;
4cc89512 74 if ( fTracklet->IsA() == TClass::GetClass("AliTRDtrackletMCM")) {
c8b1590d 75 AliDebug(5,Form("label from mcm tracklet: %i", ((AliTRDtrackletMCM*) fTracklet)->GetLabel()));
4cc89512 76 }
52c19022 77}
78
44eafcf2 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
52c19022 96AliTRDtrackletGTU::AliTRDtrackletGTU(const AliTRDtrackletGTU& tracklet) :
97 AliTRDtrackletBase(tracklet),
98 fGtuParam(AliTRDgtuParam::Instance()),
5f006bd7 99 fTracklet(tracklet.fTracklet),
44eafcf2 100 fTrackletESD(tracklet.fTrackletESD),
52c19022 101 fAssignedZ(tracklet.fAssignedZ),
102 fAlpha(tracklet.fAlpha),
103 fYProj(tracklet.fYProj),
5f006bd7 104 fYPrime(tracklet.fYPrime),
52c19022 105 fIndex(tracklet.fIndex)
106{
107 // copy ctor
108
5f006bd7 109 for (Int_t zch = 0; zch < fGtuParam->GetNZChannels(); zch++)
52c19022 110 fSubChannel[zch] = tracklet.fSubChannel[zch];
111}
112
113AliTRDtrackletGTU& AliTRDtrackletGTU::operator=(const AliTRDtrackletGTU &rhs)
114{
36dc3337 115 // assignment operator
116
52c19022 117 if (&rhs != this) {
118 fTracklet = rhs.fTracklet;
44eafcf2 119 fTrackletESD = rhs.fTrackletESD;
5f006bd7 120 for (Int_t zch = 0; zch < fGtuParam->GetNZChannels(); zch++)
52c19022 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 }
5f006bd7 128
52c19022 129 return *this;
130}
131
5f006bd7 132AliTRDtrackletGTU::~AliTRDtrackletGTU()
52c19022 133{
134 // dtor
52c19022 135}
136
5f006bd7 137void AliTRDtrackletGTU::SetSubChannel(Int_t zch, Int_t subch)
52c19022 138{
139 // set the subchannel in the given z-channel
140 fAssignedZ = kTRUE;
141 fSubChannel[zch] = subch;
142}
143
36dc3337 144Int_t AliTRDtrackletGTU::GetSubChannel(Int_t zch) const
52c19022 145{
146 // get the subchannel in the given z-channel
147 return fSubChannel[zch];
148}
149
4cc89512 150Int_t AliTRDtrackletGTU::GetLabel() const
151{
36dc3337 152 // get the MC label for the tracklet, -1 if none
153
44eafcf2 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;
4cc89512 160}
161
52c19022 162/*
5f006bd7 163Float_t AliTRDtrackletGTU::GetPhysX(Int_t layer)
52c19022 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
5f006bd7 169Float_t AliTRDtrackletGTU::GetPhysY()
52c19022 170{
5f006bd7 171 //
172 return GetYbin() * 0.0160;
52c19022 173}
174
5f006bd7 175Float_t AliTRDtrackletGTU::GetPhysAlpha()
52c19022 176{
177 return GetAlpha() * 0.01; // wrong factor!
178}
179
5f006bd7 180Float_t AliTRDtrackletGTU::GetPhysZ(Int_t stack, Int_t layer)
52c19022 181{
182 return fGtuParam->GetGeo()->GetPadPlane(layer, stack)->GetRowPos(GetZbin()); // not the middle of a pad!
183}
184*/