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 "AliMUONDarcHeader.h"
19 #include "AliMUONRegHeader.h"
22 /// Darc structure for trigger raw data.
23 /// Each DDL contains one Darc structure
24 /// The structure includes the information of the Darc boards
25 /// the Global board input and the global board output
26 /// The structure containes the information of the 8 (at most)
27 /// regional structures.
31 ClassImp(AliMUONDarcHeader)
34 const Int_t AliMUONDarcHeader::fgkDarcHeaderLength = 1;
35 const Int_t AliMUONDarcHeader::fgkGlobalHeaderLength = 5;
36 const Int_t AliMUONDarcHeader::fgkDarcScalerLength = 8;
37 const Int_t AliMUONDarcHeader::fgkGlobalScalerLength = 10;
39 const UInt_t AliMUONDarcHeader::fgkEndOfDarc = 0xDEADFACE;
40 const UInt_t AliMUONDarcHeader::fgkEndOfGlobal = 0xDEADBEEF;
42 //___________________________________________
43 AliMUONDarcHeader::AliMUONDarcHeader()
66 for (Int_t i = 0; i < 4; i++)
69 for (Int_t i = 0; i < 6; i++)
72 fRegHeaderArray = new TClonesArray("AliMUONRegHeader",8);
75 //___________________________________________
76 AliMUONDarcHeader::AliMUONDarcHeader(const AliMUONDarcHeader& event)
83 fGlobalOutput = event.fGlobalOutput;
84 fGlobalL0 = event.fGlobalL0;
85 fGlobalClk = event.fGlobalClk;
86 fGlobalHold = event.fGlobalHold;
87 fGlobalSpare = event.fGlobalSpare;
89 fDarcL0R = event.fDarcL0R;
90 fDarcL1P = event.fDarcL1P;
91 fDarcL1S = event.fDarcL1S;
92 fDarcL2A = event.fDarcL2A;
93 fDarcL2R = event.fDarcL2R;
94 fDarcClk = event.fDarcClk;
95 fDarcHold = event.fDarcHold;
96 fDarcSpare = event.fDarcSpare;
99 for (Int_t i = 0; i < 4; i++)
100 fGlobalInput[i] = event.fGlobalInput[i];
102 for (Int_t i = 0; i < 6; i++)
103 fGlobalScaler[i] = event.fGlobalScaler[i];
105 fRegHeaderArray = new TClonesArray("AliMUONRegHeader", 8);
106 for (Int_t index = 0; index < (event.fRegHeaderArray)->GetEntriesFast(); index++) {
107 new ((*fRegHeaderArray)[fRegHeaderArray->GetEntriesFast()])
108 AliMUONRegHeader(*(AliMUONRegHeader*)(event.fRegHeaderArray)->At(index));
112 //___________________________________________
113 AliMUONDarcHeader& AliMUONDarcHeader::operator=(const AliMUONDarcHeader& event)
116 // assignment operator
118 if (this == &event) return *this;
121 fGlobalOutput = event.fGlobalOutput;
122 fGlobalL0 = event.fGlobalL0;
123 fGlobalClk = event.fGlobalClk;
124 fGlobalHold = event.fGlobalHold;
125 fGlobalSpare = event.fGlobalSpare;
127 fDarcL0R = event.fDarcL0R;
128 fDarcL1P = event.fDarcL1P;
129 fDarcL1S = event.fDarcL1S;
130 fDarcL2A = event.fDarcL2A;
131 fDarcL2R = event.fDarcL2R;
132 fDarcClk = event.fDarcClk;
133 fDarcHold = event.fDarcHold;
134 fDarcSpare = event.fDarcSpare;
136 for (Int_t i = 0; i < 4; i++)
137 fGlobalInput[i] = event.fGlobalInput[i];
139 for (Int_t i = 0; i < 6; i++)
140 fGlobalScaler[i] = event.fGlobalScaler[i];
142 fRegHeaderArray = new TClonesArray("AliMUONRegHeader", 8);
143 for (Int_t index = 0; index < (event.fRegHeaderArray)->GetEntriesFast(); index++) {
144 new ((*fRegHeaderArray)[fRegHeaderArray->GetEntriesFast()])
145 AliMUONRegHeader(*(AliMUONRegHeader*)(event.fRegHeaderArray)->At(index));
151 //___________________________________________
152 AliMUONDarcHeader::~AliMUONDarcHeader()
157 fRegHeaderArray->Delete();
158 delete fRegHeaderArray;
161 //___________________________________________
162 void AliMUONDarcHeader::SetScalersNumbers()
164 // set numbers for scaler events for Darc header
165 // since this is provided by the experiment
166 // put dummy numbers to check the monitoring
182 for (Int_t i = 0; i < 6; i++)
183 fGlobalScaler[i] = i;
187 //___________________________________________
188 void AliMUONDarcHeader::Clear(Option_t* )
190 // Clear TClones arrays
191 // instead of deleting
193 fRegHeaderArray->Clear("C");