]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/global/AliFlatESDFriend.cxx
AliVVfriend* moved to AliVfriend*, unnecessary AliVV* classes removed
[u/mrichter/AliRoot.git] / HLT / global / AliFlatESDFriend.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 ESD friend <<
20  *
21  * To be used in the online and offline calibration schema.
22  *
23  * Class provides interface methods for 
24  *   - Filling from AliESDfriend, but also from HLT 
25  *   - Getter methods
26  *
27  * In the online case, the structure can be directly written into a shared 
28  * memory, in the offline case, the size has to be estimated first.
29  *
30  * 
31  * Primary Authors : Sergey Gorbunov, Jochen Thaeder, Chiara Zampolli
32  *
33  * ************************************************************************
34  **/
35
36 #include "AliFlatESDFriend.h"
37 #include "AliFlatESDFriendTrack.h"
38 #include "Riostream.h"
39
40 // _______________________________________________________________________________________________________
41 AliFlatESDFriend::AliFlatESDFriend() :
42   fContentSize(0),
43   fBitFlags(0),
44   fNTracks(0),
45   fNTrackEntries(0),
46   fTrackTablePointer(0),
47   fTracksPointer(0)
48 {
49   // Default constructor
50   Reset();
51 }
52
53 void AliFlatESDFriend::Reset() 
54 {
55   fBitFlags = 0;
56   fNTracks = 0;
57   fNTrackEntries = 0; 
58   fTrackTablePointer = 0;
59   fTracksPointer = 0;
60   for( int i=0; i<72; i++ ){
61     fNclustersTPC[i]=0;
62     fNclustersTPCused[i]=0;
63   }
64   // We set size of the fContent array such, that it reaches the end of the AliFlatESDFriend structure. 
65   // To be sure that actual GetSize() is always >= size of the structure. 
66   // First, it makes the memory alignment better. Second, just for a case..
67   fContentSize = sizeof(AliFlatESDFriend) - (fContent - reinterpret_cast<const Byte_t*>(this));
68   for( UInt_t i=0; i<fContentSize; i++ ) fContent[i]=0;
69 }
70  
71 // _______________________________________________________________________________________________________
72 AliFlatESDFriend::AliFlatESDFriend(AliVConstructorReinitialisationFlag f) :
73   AliVfriendEvent(),
74   fContentSize(),
75   fBitFlags(),
76   fNTracks(),
77   fNTrackEntries(),
78   fTrackTablePointer(),
79   fTracksPointer()
80 {
81   //special constructor, used to restore the vtable pointer
82   //uses the special dummy constructors of contained objects
83
84   // the vtable pointer for this AliFlatESDFriend object is already reset when this constructor is called
85   // we should only initialise vtable pointers for all contained objects
86
87   if(f == AliVReinitialize){   
88     for( int i=0; i<fNTracks; i++ ){
89       AliFlatESDFriendTrack  *tr = GetFlatTrackNonConst(i);
90       if( tr ) tr->Reinitialize();
91     }
92   }
93   else{
94     AliFlatESDFriend();
95   }
96 }
97
98 void AliFlatESDFriend::Ls() const
99 {
100   cout<<"Flat ESD friend: "<<endl;
101   cout<<"  N tracks: "<<fNTracks<<endl;
102   cout<<"  N track entries: "<<fNTrackEntries<<endl;
103 }