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 **************************************************************************/
16 #include "AliMUONSubEventTracker.h"
18 ClassImp(AliMUONSubEventTracker)
20 //___________________________________________
21 AliMUONSubEventTracker::AliMUONSubEventTracker()
30 fData = new UInt_t[fBufSize];
32 //___________________________________________
33 AliMUONSubEventTracker::~AliMUONSubEventTracker()
39 //___________________________________________
40 void AliMUONSubEventTracker::SetAlloc(Int_t size)
47 //___________________________________________
48 void AliMUONSubEventTracker::AddData(UInt_t data)
50 // could have used class from ROOT
51 // but the structure must be as simple as possible
52 // to be written on disc blockwise
53 if (fLength == fBufSize)
55 fData[fLength++] = data;
56 fTotalLength = fLength + 4;
59 //___________________________________________
60 void AliMUONSubEventTracker::ResizeData(Int_t size)
66 UInt_t* newData = new UInt_t[fBufSize];
67 for (Int_t i = 0; i < fLength; i++)
68 newData[i] = fData[i];
72 //___________________________________________
73 AliMUONSubEventTracker::
74 AliMUONSubEventTracker(const AliMUONSubEventTracker& event): TObject(event)
76 fTotalLength = event.fTotalLength;
77 fLength = event.fLength;
78 fBusPatchId = event.fBusPatchId;
79 fTriggerWord = event.fTriggerWord;
81 fData = new UInt_t[event.fBufSize];
82 for (int i = 0; i < event.fBufSize; i++)
83 fData[i] = event.fData[i];
85 //___________________________________________
86 AliMUONSubEventTracker&
87 AliMUONSubEventTracker::operator=(const AliMUONSubEventTracker& event)
89 if (this == &event) return *this;
90 fTotalLength = event.fTotalLength;
91 fLength = event.fLength;
92 fBusPatchId = event.fBusPatchId;
93 fTriggerWord = event.fTriggerWord;
95 for (int i = 0; i < event.fLength; i++)
96 fData[i] = event.fData[i];
100 //___________________________________________
101 Int_t AliMUONSubEventTracker::Compare(const TObject *obj) const
103 AliMUONSubEventTracker* event = (AliMUONSubEventTracker*) obj;
104 return (fBusPatchId > event->GetBusPatchId()) ? 1 : -1;