]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/global/AliFlatESDFriendTrack.cxx
LHAPDF: Removing lhapdf 5.3.1 version
[u/mrichter/AliRoot.git] / HLT / global / AliFlatESDFriendTrack.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
34 #include "AliFlatESDFriendTrack.h"
35 #include "AliExternalTrackParam.h"
36 #include "AliESDfriendTrack.h"
37 #include "AliTPCseed.h"
38 #include "Riostream.h"
39
40 // _______________________________________________________________________________________________________
41  AliFlatESDFriendTrack::AliFlatESDFriendTrack()
42 :
43  AliVfriendTrack()
44  ,fContentSize(0),
45  fTPCOutPointer(-1),
46  fITSOutPointer(-1),
47  fTRDInPointer(-1),
48  fTPCseedPointer(-1),
49  fBitFlags(0)
50 {
51   // Default constructor
52   fContent[0]=0;
53 }
54
55 #pragma GCC diagnostic ignored "-Weffc++" 
56 AliFlatESDFriendTrack::AliFlatESDFriendTrack( AliVConstructorReinitialisationFlag f ) 
57   :
58   AliVfriendTrack( f )
59 {
60   // constructor for reinitialisation of vtable
61   if( fTPCseedPointer >= 0 ){
62     AliFlatTPCseed *fp = reinterpret_cast< AliFlatTPCseed* >( fContent + fTPCseedPointer );
63     fp->Reinitialize();
64   }
65 }
66 #pragma GCC diagnostic warning "-Weffc++" 
67
68 void 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
79 Int_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 }