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 **************************************************************************/
17 #include <TClonesArray.h>
19 #include "AliMUONRegHeader.h"
20 #include "AliMUONLocalStruct.h"
22 //-----------------------------------------------------------------------------
23 /// \class AliMUONRegHeader
24 /// Regional structure for trigger raw data.
25 /// Each Reg structure contains 16 (at most) local card structure.
26 /// The structure includes the information of the Reg. boards and
29 /// \author Christian Finck
30 //-----------------------------------------------------------------------------
33 ClassImp(AliMUONRegHeader)
36 const Int_t AliMUONRegHeader::fgkHeaderLength = 5;
37 const Int_t AliMUONRegHeader::fgkScalerLength = 10;
38 const UInt_t AliMUONRegHeader::fgkEndOfReg = 0xBEEFFACE;
39 const UInt_t AliMUONRegHeader::fgkErrorWord = 0xCAFEDEAD;
41 //___________________________________________
42 AliMUONRegHeader::AliMUONRegHeader()
50 fLocalArray(new TClonesArray("AliMUONLocalStruct",16))
54 fInput[0] = fInput[1] = 0;
56 for (Int_t i = 0; i < 8; i++)
61 //___________________________________________
62 AliMUONRegHeader::~AliMUONRegHeader()
66 fLocalArray->Delete();
70 //___________________________________________
71 AliMUONRegHeader::AliMUONRegHeader(const AliMUONRegHeader& event)
73 fDarcWord(event.fDarcWord),
79 fLocalArray(new TClonesArray("AliMUONLocalStruct", 16))
85 fInput[0] = event.fInput[0];
86 fInput[1] = event.fInput[1];
88 for (Int_t i = 0; i < 8; i++)
89 fScaler[i] = event.fScaler[i];
91 for (Int_t index = 0; index < (event.fLocalArray)->GetEntriesFast(); index++) {
92 {new ((*fLocalArray)[fLocalArray->GetEntriesFast()])
93 AliMUONLocalStruct(*(AliMUONLocalStruct*)(event.fLocalArray)->At(index));}
97 //___________________________________________
98 AliMUONRegHeader& AliMUONRegHeader::operator=(const AliMUONRegHeader& event)
101 /// assignment operator
104 if (this == &event) return *this;
106 fDarcWord = event.fDarcWord;
113 fInput[0] = event.fInput[0];
114 fInput[1] = event.fInput[1];
116 for (Int_t i = 0; i < 8; i++)
117 fScaler[i] = event.fScaler[i];
119 fLocalArray = new TClonesArray("AliMUONLocalStruct", 16);
120 for (Int_t index = 0; index < (event.fLocalArray)->GetEntriesFast(); index++) {
121 {new ((*fLocalArray)[fLocalArray->GetEntriesFast()])
122 AliMUONLocalStruct(*(AliMUONLocalStruct*)(event.fLocalArray)->At(index));}
128 //___________________________________________
129 void AliMUONRegHeader::SetScalersNumbers()
131 /// set numbers for scaler events for Regional header
132 /// since this is provided by the experiment
133 /// put dummy numbers to check the monitoring
138 for (Int_t i = 0; i < 8; i++)
142 //___________________________________________
143 void AliMUONRegHeader::Clear(Option_t* )
145 /// Clear TClones arrays
146 /// instead of deleting
148 fLocalArray->Clear("C");