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 #include <TClonesArray.h>
20 #include "AliMUONRegHeader.h"
21 #include "AliMUONLocalStruct.h"
23 //-----------------------------------------------------------------------------
24 /// \class AliMUONRegHeader
25 /// Regional structure for trigger raw data.
26 /// Each Reg structure contains 16 (at most) local card structure.
27 /// The structure includes the information of the Reg. boards and
30 /// \author Christian Finck
31 //-----------------------------------------------------------------------------
34 ClassImp(AliMUONRegHeader)
37 const Int_t AliMUONRegHeader::fgkHeaderLength = 5;
38 const Int_t AliMUONRegHeader::fgkScalerLength = 10;
39 const UInt_t AliMUONRegHeader::fgkEndOfReg = 0xBEEFFACE;
40 const UInt_t AliMUONRegHeader::fgkErrorWord = 0xCAFEDEAD;
42 //___________________________________________
43 AliMUONRegHeader::AliMUONRegHeader(TRootIOCtor* /*dummy*/)
54 fInput[0] = fInput[1] = 0;
56 for (Int_t i = 0; i < 8; i++)
60 //___________________________________________
61 AliMUONRegHeader::AliMUONRegHeader()
69 fLocalArray(new TClonesArray("AliMUONLocalStruct",16))
73 fInput[0] = fInput[1] = 0;
75 for (Int_t i = 0; i < 8; i++)
80 //___________________________________________
81 AliMUONRegHeader::~AliMUONRegHeader()
85 fLocalArray->Delete();
89 //___________________________________________
90 AliMUONRegHeader::AliMUONRegHeader(const AliMUONRegHeader& event)
92 fDarcWord(event.fDarcWord),
98 fLocalArray(new TClonesArray("AliMUONLocalStruct", 16))
104 fInput[0] = event.fInput[0];
105 fInput[1] = event.fInput[1];
107 for (Int_t i = 0; i < 8; i++)
108 fScaler[i] = event.fScaler[i];
110 for (Int_t index = 0; index < (event.fLocalArray)->GetEntriesFast(); index++) {
111 {new ((*fLocalArray)[fLocalArray->GetEntriesFast()])
112 AliMUONLocalStruct(*(AliMUONLocalStruct*)(event.fLocalArray)->At(index));}
116 //___________________________________________
117 AliMUONRegHeader& AliMUONRegHeader::operator=(const AliMUONRegHeader& event)
120 /// assignment operator
123 if (this == &event) return *this;
125 fDarcWord = event.fDarcWord;
132 fInput[0] = event.fInput[0];
133 fInput[1] = event.fInput[1];
135 for (Int_t i = 0; i < 8; i++)
136 fScaler[i] = event.fScaler[i];
138 fLocalArray = new TClonesArray("AliMUONLocalStruct", 16);
139 for (Int_t index = 0; index < (event.fLocalArray)->GetEntriesFast(); index++) {
140 {new ((*fLocalArray)[fLocalArray->GetEntriesFast()])
141 AliMUONLocalStruct(*(AliMUONLocalStruct*)(event.fLocalArray)->At(index));}
147 //___________________________________________
148 void AliMUONRegHeader::SetScalersNumbers()
150 /// set numbers for scaler events for Regional header
151 /// since this is provided by the experiment
152 /// put dummy numbers to check the monitoring
157 for (Int_t i = 0; i < 8; i++)
161 //___________________________________________
162 void AliMUONRegHeader::Clear(Option_t* )
164 /// Clear TClones arrays
165 /// instead of deleting
167 fLocalArray->Clear("C");