Record changes.
[u/mrichter/AliRoot.git] / MUON / AliMUONDarcHeader.cxx
CommitLineData
32def6aa 1/**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
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 **************************************************************************/
15
13985652 16/* $Id$ */
17
32def6aa 18#include "AliMUONDarcHeader.h"
19#include "AliMUONRegHeader.h"
20
21///
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.
28///
29
13985652 30/// \cond CLASSIMP
32def6aa 31ClassImp(AliMUONDarcHeader)
13985652 32/// \endcond
33
18d3ded7 34 const Int_t AliMUONDarcHeader::fgkDarcHeaderLength = 1;
35 const Int_t AliMUONDarcHeader::fgkGlobalHeaderLength = 5;
d622a0ec 36 const Int_t AliMUONDarcHeader::fgkDarcScalerLength = 8;
37 const Int_t AliMUONDarcHeader::fgkGlobalScalerLength = 10;
32def6aa 38
39 const UInt_t AliMUONDarcHeader::fgkEndOfDarc = 0xDEADFACE;
40 const UInt_t AliMUONDarcHeader::fgkEndOfGlobal = 0xDEADBEEF;
41
32def6aa 42//___________________________________________
43AliMUONDarcHeader::AliMUONDarcHeader()
44 : TObject(),
45 fWord(0),
46 fGlobalOutput(0),
47
48 fGlobalL0(0),
49 fGlobalClk(0),
50 fGlobalHold(0),
51 fGlobalSpare(0),
52
53 fDarcL0R(0),
883199be 54 fDarcL1P(0),
55 fDarcL1S(0),
56 fDarcL2A(0),
57 fDarcL2R(0),
32def6aa 58 fDarcClk(0),
d622a0ec 59 fDarcHold(0),
9f5dcca3 60 fDarcSpare(0),
61 fRegHeaderArray(new TClonesArray("AliMUONRegHeader",8))
62
d622a0ec 63
32def6aa 64{
65 //
66 // ctor
67 //
68 for (Int_t i = 0; i < 4; i++)
69 fGlobalInput[i] = 0;
70
71 for (Int_t i = 0; i < 6; i++)
72 fGlobalScaler[i] = 0;
73
32def6aa 74}
75
76//___________________________________________
77AliMUONDarcHeader::AliMUONDarcHeader(const AliMUONDarcHeader& event)
9f5dcca3 78 : TObject(event),
79 fWord(event.fWord),
80 fGlobalOutput(event.fGlobalOutput),
81 fGlobalL0(event.fGlobalL0),
82 fGlobalClk(event.fGlobalClk),
83 fGlobalHold(event.fGlobalHold),
84 fGlobalSpare(event.fGlobalSpare),
85
86 fDarcL0R(event.fDarcL0R),
87 fDarcL1P(event.fDarcL1P),
88 fDarcL1S(event.fDarcL1S),
89 fDarcL2A(event.fDarcL2A),
90 fDarcL2R(event.fDarcL2R),
91 fDarcClk(event.fDarcClk),
92 fDarcHold(event.fDarcHold),
93 fDarcSpare(event.fDarcSpare),
94 fRegHeaderArray(new TClonesArray("AliMUONRegHeader", 8))
95
32def6aa 96{
97 //
98 // copy ctor
99 //
32def6aa 100
101 for (Int_t i = 0; i < 4; i++)
102 fGlobalInput[i] = event.fGlobalInput[i];
103
104 for (Int_t i = 0; i < 6; i++)
105 fGlobalScaler[i] = event.fGlobalScaler[i];
106
32def6aa 107 for (Int_t index = 0; index < (event.fRegHeaderArray)->GetEntriesFast(); index++) {
108 new ((*fRegHeaderArray)[fRegHeaderArray->GetEntriesFast()])
109 AliMUONRegHeader(*(AliMUONRegHeader*)(event.fRegHeaderArray)->At(index));
110 }
111}
112
113//___________________________________________
114AliMUONDarcHeader& AliMUONDarcHeader::operator=(const AliMUONDarcHeader& event)
115{
116 //
117 // assignment operator
118 //
119 if (this == &event) return *this;
120
121 fWord = event.fWord;
122 fGlobalOutput = event.fGlobalOutput;
123 fGlobalL0 = event.fGlobalL0;
124 fGlobalClk = event.fGlobalClk;
125 fGlobalHold = event.fGlobalHold;
126 fGlobalSpare = event.fGlobalSpare;
127
d622a0ec 128 fDarcL0R = event.fDarcL0R;
129 fDarcL1P = event.fDarcL1P;
130 fDarcL1S = event.fDarcL1S;
131 fDarcL2A = event.fDarcL2A;
132 fDarcL2R = event.fDarcL2R;
133 fDarcClk = event.fDarcClk;
134 fDarcHold = event.fDarcHold;
135 fDarcSpare = event.fDarcSpare;
32def6aa 136
137 for (Int_t i = 0; i < 4; i++)
138 fGlobalInput[i] = event.fGlobalInput[i];
139
140 for (Int_t i = 0; i < 6; i++)
141 fGlobalScaler[i] = event.fGlobalScaler[i];
142
143 fRegHeaderArray = new TClonesArray("AliMUONRegHeader", 8);
144 for (Int_t index = 0; index < (event.fRegHeaderArray)->GetEntriesFast(); index++) {
145 new ((*fRegHeaderArray)[fRegHeaderArray->GetEntriesFast()])
146 AliMUONRegHeader(*(AliMUONRegHeader*)(event.fRegHeaderArray)->At(index));
147 }
148
149 return *this;
150}
151
152//___________________________________________
153AliMUONDarcHeader::~AliMUONDarcHeader()
154{
155 //
156 // dtor
157 //
158 fRegHeaderArray->Delete();
159 delete fRegHeaderArray;
160}
161
162//___________________________________________
163void AliMUONDarcHeader::SetScalersNumbers()
164{
165 // set numbers for scaler events for Darc header
166 // since this is provided by the experiment
167 // put dummy numbers to check the monitoring
168
169 fGlobalL0 = 1000;
170 fGlobalClk = 10000;
171 fGlobalHold = 100;
172 fGlobalSpare = 1;
173
d622a0ec 174 fDarcL0R = 1000;
175 fDarcL1P = 900;
176 fDarcL1S = 800;
177 fDarcL2A = 700;
178 fDarcL2R = 700;
179 fDarcClk = 10000;
180 fDarcHold = 100;
181 fDarcSpare = 0;
32def6aa 182
183 for (Int_t i = 0; i < 6; i++)
184 fGlobalScaler[i] = i;
185
186}
187
188//___________________________________________
189void AliMUONDarcHeader::Clear(Option_t* )
190{
191 // Clear TClones arrays
192 // instead of deleting
193 //
194 fRegHeaderArray->Clear("C");
195
196}