]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HLT/global/AliFlatESDTrack.cxx
Reinitialization methods added to AliFlat*
[u/mrichter/AliRoot.git] / HLT / global / AliFlatESDTrack.cxx
CommitLineData
251a2c81 1/* $Id$ */
2
3/**************************************************************************
4 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * *
6 * Author: The ALICE Off-line Project. *
7 * Contributors are mentioned in the code where appropriate. *
8 * *
9 * Permission to use, copy, modify and distribute this software and its *
10 * documentation strictly for non-commercial purposes is hereby granted *
11 * without fee, provided that the above copyright notice appears in all *
12 * copies and that both the copyright notice and this permission notice *
13 * appear in the supporting documentation. The authors make no claims *
14 * about the suitability of this software for any purpose. It is *
15 * provided "as is" without express or implied warranty. *
16 **************************************************************************/
17
18/**
19 * >> Flat structure representing an ESDTrack <<
20 *
21 * To be used in the online and offline calibration schema.
22 *
23 * Class provides interface methods for
24 * - Filling from AliESDtrack and AliExternalTrackParam, as well
25 * as clusters from ESD friends (if requested)
26 * - HLT Filling to be added
27 *
28 *
29 * Primary Authors : Sergey Gorbunov, Jochen Thaeder, Chiara Zampolli
30 *
31 **************************************************************************/
32
888585e5 33#include "Rtypes.h"
34#include "AliFlatESDTrack.h"
35#include "AliFlatExternalTrackParam.h"
251a2c81 36#include "AliESDtrack.h"
251a2c81 37#include "AliExternalTrackParam.h"
251a2c81 38#include "Riostream.h"
39
40// _______________________________________________________________________________________________________
41AliFlatESDTrack::AliFlatESDTrack() :
42 // Default constructor
c2ea967e 43 AliVVtrack(),
251a2c81 44 fTrackParamMask(0),
45 fNTPCClusters(0),
46 fNITSClusters(0),
888585e5 47 fContentSize(0)
48{
251a2c81 49}
50
c2ea967e 51AliFlatESDTrack::AliFlatESDTrack( AliVVConstructorReinitialisationFlag f )
52 :
53 AliVVtrack( f ),
54 fTrackParamMask(fTrackParamMask ),
55 fNTPCClusters( fNTPCClusters ),
56 fNITSClusters( fNITSClusters ),
57 fContentSize( fContentSize )
58{
59 // Constructor for reinitialisation of vtable
60}
61
251a2c81 62// _______________________________________________________________________________________________________
251a2c81 63
251a2c81 64
65// _______________________________________________________________________________________________________
888585e5 66Int_t AliFlatESDTrack::Set(const AliESDtrack* track)
67{
68 // Fill external track parameters
251a2c81 69 fTrackParamMask = 0;
70 fNTPCClusters = 0;
71 fNITSClusters = 0;
888585e5 72 fContentSize = 0;
251a2c81 73
74 if( !track ) return 0;
75
888585e5 76 Int_t iResult = SetExternalTrackParam( track,
77 track->GetInnerParam(),
78 track->GetTPCInnerParam(),
79 track->GetOuterParam(),
80 track->GetConstrainedParam(), NULL );
81 fNITSClusters = track->GetTPCNcls();
251a2c81 82
83 return iResult;
84}
85
86// _______________________________________________________________________________________________________
888585e5 87Int_t AliFlatESDTrack::SetExternalTrackParam(
88 const AliExternalTrackParam* refittedParam,
89 const AliExternalTrackParam* innerParam,
90 const AliExternalTrackParam* innerTPC,
91 const AliExternalTrackParam* outerParam,
92 const AliExternalTrackParam* constrainedParam,
93 const AliExternalTrackParam* outerITS
94 ){
251a2c81 95 // Fill external track parameters
96
97 fTrackParamMask = 0;
98 fNTPCClusters = 0;
888585e5 99 fContentSize = 0;
251a2c81 100
101 Int_t iResult = 0;
102
103 Byte_t flag = 0x1;
104 iResult = FillExternalTrackParam(refittedParam, flag);
105
106 flag = 0x2;
107 iResult = FillExternalTrackParam(innerParam, flag);
108
109 flag = 0x4;
110 iResult = FillExternalTrackParam(innerTPC, flag);
111
112 flag = 0x8;
113 iResult = FillExternalTrackParam(outerParam, flag);
114
115 flag = 0x10;
116 iResult = FillExternalTrackParam(constrainedParam, flag);
117
118 flag = 0x20;
119 iResult = FillExternalTrackParam(outerITS, flag);
120
121 return iResult;
122}
123
124// _______________________________________________________________________________________________________
125Int_t AliFlatESDTrack::FillExternalTrackParam(const AliExternalTrackParam* param, UShort_t flag) {
126 // Fill external track parameters
127
128 if (!param)
129 return -1;
130
888585e5 131 Printf(" DEBUG: CONTENT %d >> %p + 0x%07llx = %p", flag, fContent, fContentSize, fContent + fContentSize);
251a2c81 132
888585e5 133 AliFlatExternalTrackParam * current = reinterpret_cast<AliFlatExternalTrackParam*> (fContent + fContentSize);
251a2c81 134 current->SetAlpha(param->GetAlpha());
135 current->SetX(param->GetX());
136 current->SetY(param->GetY());
137 current->SetZ(param->GetZ());
138 current->SetSnp(param->GetSnp());
139 current->SetTgl(param->GetTgl());
140 current->SetSigned1Pt(param->GetSigned1Pt());
141
142 const Double_t *cov = param->GetCovariance();
143 for (Int_t idx = 0; idx <15; ++idx)
144 current->fC[idx] = cov[idx];
145
146 fTrackParamMask |= flag;
888585e5 147 fContentSize += sizeof(AliFlatExternalTrackParam);
251a2c81 148
149 return 0;
150}
151
152// _______________________________________________________________________________________________________