]>
Commit | Line | Data |
---|---|---|
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 | ||
00e86732 | 21 | /// \class AliMUONDarcHeader |
32def6aa | 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 | /// | |
00e86732 | 29 | /// \author Christian Finck |
32def6aa | 30 | |
13985652 | 31 | /// \cond CLASSIMP |
32def6aa | 32 | ClassImp(AliMUONDarcHeader) |
13985652 | 33 | /// \endcond |
34 | ||
18d3ded7 | 35 | const Int_t AliMUONDarcHeader::fgkDarcHeaderLength = 1; |
36 | const Int_t AliMUONDarcHeader::fgkGlobalHeaderLength = 5; | |
d622a0ec | 37 | const Int_t AliMUONDarcHeader::fgkDarcScalerLength = 8; |
38 | const Int_t AliMUONDarcHeader::fgkGlobalScalerLength = 10; | |
32def6aa | 39 | |
40 | const UInt_t AliMUONDarcHeader::fgkEndOfDarc = 0xDEADFACE; | |
41 | const UInt_t AliMUONDarcHeader::fgkEndOfGlobal = 0xDEADBEEF; | |
42 | ||
32def6aa | 43 | //___________________________________________ |
44 | AliMUONDarcHeader::AliMUONDarcHeader() | |
45 | : TObject(), | |
46 | fWord(0), | |
47 | fGlobalOutput(0), | |
48 | ||
49 | fGlobalL0(0), | |
50 | fGlobalClk(0), | |
51 | fGlobalHold(0), | |
52 | fGlobalSpare(0), | |
53 | ||
54 | fDarcL0R(0), | |
883199be | 55 | fDarcL1P(0), |
56 | fDarcL1S(0), | |
57 | fDarcL2A(0), | |
58 | fDarcL2R(0), | |
32def6aa | 59 | fDarcClk(0), |
d622a0ec | 60 | fDarcHold(0), |
9f5dcca3 | 61 | fDarcSpare(0), |
62 | fRegHeaderArray(new TClonesArray("AliMUONRegHeader",8)) | |
63 | ||
d622a0ec | 64 | |
32def6aa | 65 | { |
00e86732 | 66 | /// ctor |
67 | ||
32def6aa | 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 | //___________________________________________ | |
77 | AliMUONDarcHeader::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 | { |
00e86732 | 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 | //___________________________________________ | |
114 | AliMUONDarcHeader& AliMUONDarcHeader::operator=(const AliMUONDarcHeader& event) | |
115 | { | |
00e86732 | 116 | /// |
117 | /// assignment operator | |
118 | /// | |
32def6aa | 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 | //___________________________________________ | |
153 | AliMUONDarcHeader::~AliMUONDarcHeader() | |
154 | { | |
00e86732 | 155 | /// |
156 | /// dtor | |
157 | /// | |
32def6aa | 158 | fRegHeaderArray->Delete(); |
159 | delete fRegHeaderArray; | |
160 | } | |
161 | ||
162 | //___________________________________________ | |
163 | void AliMUONDarcHeader::SetScalersNumbers() | |
164 | { | |
00e86732 | 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 | |
32def6aa | 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 | //___________________________________________ | |
189 | void AliMUONDarcHeader::Clear(Option_t* ) | |
190 | { | |
00e86732 | 191 | /// Clear TClones arrays |
192 | /// instead of deleting | |
193 | /// | |
32def6aa | 194 | fRegHeaderArray->Clear("C"); |
195 | ||
196 | } |