]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/global/AliFlatESDTrack.cxx
make it compile
[u/mrichter/AliRoot.git] / HLT / global / AliFlatESDTrack.cxx
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
33 #include "Rtypes.h"
34 #include "AliFlatESDTrack.h"
35 #include "AliFlatExternalTrackParam.h"
36 #include "AliESDtrack.h"
37 #include "AliExternalTrackParam.h"
38 #include "Riostream.h"
39
40
41
42
43 // _______________________________________________________________________________________________________
44
45
46 // _______________________________________________________________________________________________________
47 Int_t AliFlatESDTrack::SetFromESDTrack(const AliESDtrack* track)
48 {
49   // Fill external track parameters 
50   fTrackParamMask = 0;
51   fNTPCClusters = 0;
52   fNITSClusters = 0;
53   fContentSize = 0;
54   
55   if( !track ) return 0;
56
57   Int_t iResult = SetExternalTrackParam( track,
58                                          track->GetInnerParam(),
59                                          track->GetTPCInnerParam(),
60                                          track->GetOuterParam(),
61                                          track->GetConstrainedParam(), NULL );
62   fNITSClusters = track->GetTPCNcls();
63
64   return iResult;
65 }
66
67 // _______________________________________________________________________________________________________
68 Int_t AliFlatESDTrack::SetExternalTrackParam( 
69                                              const AliExternalTrackParam* refittedParam,
70                                              const AliExternalTrackParam* innerParam,
71                                              const AliExternalTrackParam* innerTPC,
72                                              const AliExternalTrackParam* outerParam,
73                                              const AliExternalTrackParam* constrainedParam,
74                                              const AliExternalTrackParam* outerITS
75                                               ){
76   // Fill external track parameters 
77
78   fTrackParamMask = 0;
79   fNTPCClusters = 0;
80   fContentSize = 0;
81
82   Int_t iResult = 0;
83
84   Byte_t flag = 0x1;
85   iResult = FillExternalTrackParam(refittedParam, flag);
86
87   flag = 0x2;
88   iResult = FillExternalTrackParam(innerParam, flag);
89   
90   flag = 0x4;
91   iResult = FillExternalTrackParam(innerTPC, flag);
92   
93   flag = 0x8;
94   iResult = FillExternalTrackParam(outerParam, flag);
95
96   flag = 0x10;
97   iResult = FillExternalTrackParam(constrainedParam, flag);
98
99   flag = 0x20;
100   iResult = FillExternalTrackParam(outerITS, flag);
101
102   return iResult;
103 }
104
105 // _______________________________________________________________________________________________________
106 Int_t AliFlatESDTrack::FillExternalTrackParam(const AliExternalTrackParam* param, UShort_t flag) {
107   // Fill external track parameters
108
109   if (!param) return -1;
110
111   Printf("  DEBUG: CONTENT %d >> %p + 0x%07llx = %p", flag, fContent, fContentSize, fContent + fContentSize);
112
113   AliFlatExternalTrackParam * current = reinterpret_cast<AliFlatExternalTrackParam*> (fContent + fContentSize);
114   current->SetExternalTrackParam( param );    
115   fTrackParamMask |= flag;
116   fContentSize += sizeof(AliFlatExternalTrackParam);
117
118   return 0;
119 }
120
121
122 // _______________________________________________________________________________________________________
123 Bool_t AliFlatESDTrack::GetXYZ(Double_t *p) const {
124   const AliFlatExternalTrackParam *f = GetFlatTrackParam();
125   if (!f) { return kFALSE; }
126   p[0]=f->GetX();
127   p[1]=f->GetY();
128   p[2]=f->GetZ();
129   return kTRUE;
130 }