3 /**************************************************************************
4 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
6 * Author: The ALICE Off-line Project. *
7 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
19 * >> Flat structure representing an ESDTrack <<
21 * To be used in the online and offline calibration schema.
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
29 * Primary Authors : Sergey Gorbunov, Jochen Thaeder, Chiara Zampolli
31 **************************************************************************/
34 #include "AliFlatESDTrack.h"
35 #include "AliFlatExternalTrackParam.h"
36 #include "AliESDtrack.h"
37 #include "AliExternalTrackParam.h"
38 #include "Riostream.h"
43 // _______________________________________________________________________________________________________
46 // _______________________________________________________________________________________________________
47 Int_t AliFlatESDTrack::SetFromESDTrack(const AliESDtrack* track)
49 // Fill external track parameters
55 if( !track ) return 0;
57 Int_t iResult = SetExternalTrackParam( track,
58 track->GetInnerParam(),
59 track->GetTPCInnerParam(),
60 track->GetOuterParam(),
61 track->GetConstrainedParam(), NULL );
62 fNTPCClusters = track->GetTPCNcls();
63 fNITSClusters = track->GetITSNcls();
68 // _______________________________________________________________________________________________________
69 Int_t AliFlatESDTrack::SetExternalTrackParam(
70 const AliExternalTrackParam* refittedParam,
71 const AliExternalTrackParam* innerParam,
72 const AliExternalTrackParam* innerTPC,
73 const AliExternalTrackParam* outerParam,
74 const AliExternalTrackParam* constrainedParam,
75 const AliExternalTrackParam* outerITS
77 // Fill external track parameters
86 iResult = FillExternalTrackParam(refittedParam, flag);
89 iResult = FillExternalTrackParam(innerParam, flag);
92 iResult = FillExternalTrackParam(innerTPC, flag);
95 iResult = FillExternalTrackParam(outerParam, flag);
98 iResult = FillExternalTrackParam(constrainedParam, flag);
101 iResult = FillExternalTrackParam(outerITS, flag);
106 // _______________________________________________________________________________________________________
107 Int_t AliFlatESDTrack::FillExternalTrackParam(const AliExternalTrackParam* param, UShort_t flag) {
108 // Fill external track parameters
110 if (!param) return -1;
112 //Printf(" DEBUG: CONTENT %d >> %p + 0x%07llx = %p", flag, fContent, fContentSize, fContent + fContentSize);
114 AliFlatExternalTrackParam * current = reinterpret_cast<AliFlatExternalTrackParam*> (fContent + fContentSize);
115 current->SetExternalTrackParam( param );
116 fTrackParamMask |= flag;
117 fContentSize += sizeof(AliFlatExternalTrackParam);
123 // _______________________________________________________________________________________________________
124 Bool_t AliFlatESDTrack::GetXYZ(Double_t *p) const {
125 const AliFlatExternalTrackParam *f = GetFlatTrackParam();
126 if (!f) { return kFALSE; }