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 Revision 1.1 2007/04/27 11:03:09 arcelli
19 container for TOF raw data
21 authors: Roberto Preghenella, preghenella@bo.infn.it
22 with contribution from Chiara Zampolli, zampolli@bo.infn.it
26 ////////////////////////////////////////////////////////////////////////
28 // This class provides access to TOF raw data in DDL files. //
30 // It loops over all TOF raw data given by the AliRawReader. //
32 ////////////////////////////////////////////////////////////////////////
36 //#include "AliTOFHitData.h"
37 #include "AliTOFHitDataBuffer.h"
39 ClassImp(AliTOFHitDataBuffer)
41 AliTOFHitDataBuffer::AliTOFHitDataBuffer(Int_t BufferSize) :
43 fBufferSize(BufferSize),
47 fBuffer = new AliTOFHitData[BufferSize];
49 //-----------------------------------------------------------------------------
50 AliTOFHitDataBuffer::AliTOFHitDataBuffer(const AliTOFHitDataBuffer &source):
54 fEntries(source.fEntries)
57 this->fBufferSize = source.fBufferSize;
58 this->fBuffer = new AliTOFHitData[this->fBufferSize];
59 this->fEntries = source.fEntries;
60 for (Int_t i = 0; i < this->fEntries; i++)
61 this->fBuffer[i] = source.fBuffer[i];
64 //-----------------------------------------------------------------------------
65 AliTOFHitDataBuffer& AliTOFHitDataBuffer::operator=(const AliTOFHitDataBuffer & source)
68 this->fEntries = source.fEntries < this->fBufferSize ? source.fEntries : this->fBufferSize;
69 for (Int_t i = 0; i < this->fEntries; i++)
70 this->fBuffer[i] = source.fBuffer[i];
74 //-----------------------------------------------------------------------------
75 AliTOFHitDataBuffer::~AliTOFHitDataBuffer()
80 //-----------------------------------------------------------------------------
81 Bool_t AliTOFHitDataBuffer::Add(AliTOFHitData &HitData) {
83 if (fEntries >= fBufferSize){
84 AliError("The buffer is completely full. ");
87 fBuffer[fEntries++] = HitData;