]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HLT/global/AliFlatESDFriendTrack.cxx
LHAPDF: Removing lhapdf 5.3.1 version
[u/mrichter/AliRoot.git] / HLT / global / AliFlatESDFriendTrack.cxx
CommitLineData
ce392def 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
34#include "AliFlatESDFriendTrack.h"
35#include "AliExternalTrackParam.h"
48ec9ee6 36#include "AliESDfriendTrack.h"
37#include "AliTPCseed.h"
ce392def 38#include "Riostream.h"
39
40// _______________________________________________________________________________________________________
48ec9ee6 41 AliFlatESDFriendTrack::AliFlatESDFriendTrack()
42:
a7751eb4 43 AliVfriendTrack()
bbddf50f 44 ,fContentSize(0),
45 fTPCOutPointer(-1),
46 fITSOutPointer(-1),
47 fTRDInPointer(-1),
48 fTPCseedPointer(-1),
49 fBitFlags(0)
ce392def 50{
51 // Default constructor
48ec9ee6 52 fContent[0]=0;
ce392def 53}
54
bbddf50f 55#pragma GCC diagnostic ignored "-Weffc++"
a7751eb4 56AliFlatESDFriendTrack::AliFlatESDFriendTrack( AliVConstructorReinitialisationFlag f )
bbddf50f 57 :
58 AliVfriendTrack( f )
ce392def 59{
a4b2769d 60 // constructor for reinitialisation of vtable
bbddf50f 61 if( fTPCseedPointer >= 0 ){
62 AliFlatTPCseed *fp = reinterpret_cast< AliFlatTPCseed* >( fContent + fTPCseedPointer );
63 fp->Reinitialize();
64 }
ce392def 65}
bbddf50f 66#pragma GCC diagnostic warning "-Weffc++"
48ec9ee6 67
68void AliFlatESDFriendTrack::Reset()
69{
70 // reset
71 fContentSize = 0;
72 fTPCOutPointer = -1;
73 fITSOutPointer = -1;
74 fTRDInPointer = -1;
75 fTPCseedPointer = -1;
76 fBitFlags = 0;
77}
78
79Int_t AliFlatESDFriendTrack::SetFromESDfriendTrack( const AliESDfriendTrack* track, size_t allocatedMemory )
80{
81 if( allocatedMemory < EstimateSize() ) return -1;
82 Reset();
83 if( !track ) return 0;
84 SetSkipBit(track->TestSkipBit() );
85 SetTrackParamTPCOut( track->GetTPCOut() );
86 SetTrackParamITSOut( track->GetITSOut() );
87 SetTrackParamTRDIn( track->GetTRDIn() );
88 const AliTPCseed* seedP = NULL;
89 {
90 TObject* calibObject = NULL;
91 for (Int_t idx = 0; (calibObject = track->GetCalibObject(idx)); ++idx) {
92 if ((seedP = dynamic_cast<const AliTPCseed*>(calibObject))) {
93 break;
94 }
95 }
96 }
97 SetTPCseed( seedP );
98 return 0;
99}