/* $Id$ */ /************************************************************************** * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * * * * Author: The ALICE Off-line Project. * * Contributors are mentioned in the code where appropriate. * * * * Permission to use, copy, modify and distribute this software and its * * documentation strictly for non-commercial purposes is hereby granted * * without fee, provided that the above copyright notice appears in all * * copies and that both the copyright notice and this permission notice * * appear in the supporting documentation. The authors make no claims * * about the suitability of this software for any purpose. It is * * provided "as is" without express or implied warranty. * **************************************************************************/ /** * >> Flat structure representing an ESD friend << * * To be used in the online and offline calibration schema. * * Class provides interface methods for * - Filling from AliESDfriend, but also from HLT * - Getter methods * * In the online case, the structure can be directly written into a shared * memory, in the offline case, the size has to be estimated first. * * * Primary Authors : Sergey Gorbunov, Jochen Thaeder, Chiara Zampolli * * ************************************************************************ **/ #include "AliFlatESDFriend.h" #include "AliFlatESDFriendTrack.h" #include "Riostream.h" #include "AliESDfriend.h" // _______________________________________________________________________________________________________ void AliFlatESDFriend::Ls() const { cout<<"Flat ESD friend: "<TestSkipBit() ); for( int iSector=0; iSector<72; iSector++ ){ SetNclustersTPC( iSector, esdFriend->GetNclustersTPC(iSector) ); SetNclustersTPCused( iSector, esdFriend->GetNclustersTPCused(iSector) ); } } // fill track friends { size_t trackSize = 0; int nTracks = 0; int nTrackEntries = 0; Long64_t *table = NULL; AliFlatESDFriendTrack *flatTrack = NULL; err = SetTracksStart( flatTrack, table, esdFriend->GetNumberOfTracks(), freeSpace ); if( err!=0 ) return err; freeSpace = allocatedMemorySize - GetSize(); for (Int_t idxTrack = 0; idxTrack < esdFriend->GetNumberOfTracks(); ++idxTrack) { const AliESDfriendTrack *esdTrack = esdFriend->GetTrack(idxTrack); table[idxTrack] = -1; if (esdTrack) { table[idxTrack] = trackSize; if( freeSpaceEstimateSize() ) return -1; new (flatTrack) AliFlatESDFriendTrack; //flatTrack->SetFromESDTrack( esdTrack ); trackSize += flatTrack->GetSize(); freeSpace -= flatTrack->GetSize(); nTrackEntries++; flatTrack = flatTrack->GetNextTrackNonConst(); } nTracks++; } SetTracksEnd( nTracks, nTrackEntries, trackSize ); } return 0; }