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()
51 fLocalArray(new TClonesArray("AliMUONLocalStruct",16))
55 fInput[0] = fInput[1] = 0;
57 for (Int_t i = 0; i < 8; i++)
62 //___________________________________________
63 AliMUONRegHeader::~AliMUONRegHeader()
67 fLocalArray->Delete();
71 //___________________________________________
72 AliMUONRegHeader::AliMUONRegHeader(const AliMUONRegHeader& event)
74 fDarcWord(event.fDarcWord),
80 fLocalArray(new TClonesArray("AliMUONLocalStruct", 16))
86 fInput[0] = event.fInput[0];
87 fInput[1] = event.fInput[1];
89 for (Int_t i = 0; i < 8; i++)
90 fScaler[i] = event.fScaler[i];
92 for (Int_t index = 0; index < (event.fLocalArray)->GetEntriesFast(); index++) {
93 {new ((*fLocalArray)[fLocalArray->GetEntriesFast()])
94 AliMUONLocalStruct(*(AliMUONLocalStruct*)(event.fLocalArray)->At(index));}
98 //___________________________________________
99 AliMUONRegHeader& AliMUONRegHeader::operator=(const AliMUONRegHeader& event)
102 /// assignment operator
105 if (this == &event) return *this;
107 fDarcWord = event.fDarcWord;
114 fInput[0] = event.fInput[0];
115 fInput[1] = event.fInput[1];
117 for (Int_t i = 0; i < 8; i++)
118 fScaler[i] = event.fScaler[i];
120 fLocalArray = new TClonesArray("AliMUONLocalStruct", 16);
121 for (Int_t index = 0; index < (event.fLocalArray)->GetEntriesFast(); index++) {
122 {new ((*fLocalArray)[fLocalArray->GetEntriesFast()])
123 AliMUONLocalStruct(*(AliMUONLocalStruct*)(event.fLocalArray)->At(index));}
129 //___________________________________________
130 void AliMUONRegHeader::SetScalersNumbers()
132 /// set numbers for scaler events for Regional header
133 /// since this is provided by the experiment
134 /// put dummy numbers to check the monitoring
139 for (Int_t i = 0; i < 8; i++)
143 //___________________________________________
144 void AliMUONRegHeader::Clear(Option_t* )
146 /// Clear TClones arrays
147 /// instead of deleting
149 fLocalArray->Clear("C");