1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
18 authors: Roberto Preghenella, preghenella@bo.infn.it
19 with contribution from Chiara Zampolli, zampolli@bo.infn.it
23 ////////////////////////////////////////////////////////////////////////
25 // This class provides access to TOF raw data in DDL files. //
27 // It loops over all TOF raw data given by the AliRawReader. //
29 ////////////////////////////////////////////////////////////////////////
32 #include "AliTOFHitDataBuffer.h"
34 ClassImp(AliTOFHitDataBuffer)
36 AliTOFHitDataBuffer::AliTOFHitDataBuffer(Int_t BufferSize = 1000) :
38 fBufferSize(BufferSize),
42 fBuffer = new AliTOFHitData[BufferSize];
44 //-----------------------------------------------------------------------------
45 AliTOFHitDataBuffer::AliTOFHitDataBuffer(const AliTOFHitDataBuffer &source):
49 fEntries(source.fEntries)
52 this->fBufferSize = source.fBufferSize;
53 this->fBuffer = new AliTOFHitData[this->fBufferSize];
54 this->fEntries = source.fEntries;
55 for (Int_t i = 0; i < this->fEntries; i++)
56 this->fBuffer[i] = source.fBuffer[i];
59 //-----------------------------------------------------------------------------
60 AliTOFHitDataBuffer& AliTOFHitDataBuffer::operator=(const AliTOFHitDataBuffer & source)
63 this->fEntries = source.fEntries < this->fBufferSize ? source.fEntries : this->fBufferSize;
64 for (Int_t i = 0; i < this->fEntries; i++)
65 this->fBuffer[i] = source.fBuffer[i];
69 //-----------------------------------------------------------------------------
70 AliTOFHitDataBuffer::~AliTOFHitDataBuffer()
75 //-----------------------------------------------------------------------------
76 Bool_t AliTOFHitDataBuffer::Add(AliTOFHitData &HitData) {
78 if (fEntries >= fBufferSize){
79 printf("buffer limit: current entries = %d\n", fEntries);
82 fBuffer[fEntries++] = HitData;