]>
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 | ||
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 | 31 | ClassImp(AliMUONDarcHeader) |
13985652 | 32 | /// \endcond |
33 | ||
32def6aa | 34 | const Int_t AliMUONDarcHeader::fgkHeaderLength = 8; |
35 | const Int_t AliMUONDarcHeader::fgkDarcScalerLength = 6; | |
36 | const Int_t AliMUONDarcHeader::fgkGlobalScalerLength = 10; | |
37 | ||
38 | const UInt_t AliMUONDarcHeader::fgkEndOfDarc = 0xDEADFACE; | |
39 | const UInt_t AliMUONDarcHeader::fgkEndOfGlobal = 0xDEADBEEF; | |
40 | ||
32def6aa | 41 | //___________________________________________ |
42 | AliMUONDarcHeader::AliMUONDarcHeader() | |
43 | : TObject(), | |
44 | fWord(0), | |
45 | fGlobalOutput(0), | |
46 | ||
47 | fGlobalL0(0), | |
48 | fGlobalClk(0), | |
49 | fGlobalHold(0), | |
50 | fGlobalSpare(0), | |
51 | ||
52 | fDarcL0R(0), | |
53 | fDarcL0U(0), | |
54 | fDarcL0P(0), | |
55 | fDarcL0S(0), | |
56 | fDarcClk(0), | |
57 | fDarcHold(0) | |
58 | { | |
59 | // | |
60 | // ctor | |
61 | // | |
62 | for (Int_t i = 0; i < 4; i++) | |
63 | fGlobalInput[i] = 0; | |
64 | ||
65 | for (Int_t i = 0; i < 6; i++) | |
66 | fGlobalScaler[i] = 0; | |
67 | ||
68 | fRegHeaderArray = new TClonesArray("AliMUONRegHeader",8); | |
69 | } | |
70 | ||
71 | //___________________________________________ | |
72 | AliMUONDarcHeader::AliMUONDarcHeader(const AliMUONDarcHeader& event) | |
73 | : TObject(event) | |
74 | { | |
75 | // | |
76 | // copy ctor | |
77 | // | |
78 | fWord = event.fWord; | |
79 | fGlobalOutput = event.fGlobalOutput; | |
80 | fGlobalL0 = event.fGlobalL0; | |
81 | fGlobalClk = event.fGlobalClk; | |
82 | fGlobalHold = event.fGlobalHold; | |
83 | fGlobalSpare = event.fGlobalSpare; | |
84 | ||
85 | fDarcL0R = event.fDarcL0R; | |
86 | fDarcL0U = event.fDarcL0U; | |
87 | fDarcL0P = event.fDarcL0P; | |
88 | fDarcL0S = event.fDarcL0S; | |
89 | fDarcClk = event.fDarcClk; | |
90 | fDarcHold = event.fDarcHold; | |
91 | ||
92 | ||
93 | for (Int_t i = 0; i < 4; i++) | |
94 | fGlobalInput[i] = event.fGlobalInput[i]; | |
95 | ||
96 | for (Int_t i = 0; i < 6; i++) | |
97 | fGlobalScaler[i] = event.fGlobalScaler[i]; | |
98 | ||
99 | fRegHeaderArray = new TClonesArray("AliMUONRegHeader", 8); | |
100 | for (Int_t index = 0; index < (event.fRegHeaderArray)->GetEntriesFast(); index++) { | |
101 | new ((*fRegHeaderArray)[fRegHeaderArray->GetEntriesFast()]) | |
102 | AliMUONRegHeader(*(AliMUONRegHeader*)(event.fRegHeaderArray)->At(index)); | |
103 | } | |
104 | } | |
105 | ||
106 | //___________________________________________ | |
107 | AliMUONDarcHeader& AliMUONDarcHeader::operator=(const AliMUONDarcHeader& event) | |
108 | { | |
109 | // | |
110 | // assignment operator | |
111 | // | |
112 | if (this == &event) return *this; | |
113 | ||
114 | fWord = event.fWord; | |
115 | fGlobalOutput = event.fGlobalOutput; | |
116 | fGlobalL0 = event.fGlobalL0; | |
117 | fGlobalClk = event.fGlobalClk; | |
118 | fGlobalHold = event.fGlobalHold; | |
119 | fGlobalSpare = event.fGlobalSpare; | |
120 | ||
121 | fDarcL0R = event.fDarcL0R; | |
122 | fDarcL0U = event.fDarcL0U; | |
123 | fDarcL0P = event.fDarcL0P; | |
124 | fDarcL0S = event.fDarcL0S; | |
125 | fDarcClk = event.fDarcClk; | |
126 | fDarcHold = event.fDarcHold; | |
127 | ||
128 | for (Int_t i = 0; i < 4; i++) | |
129 | fGlobalInput[i] = event.fGlobalInput[i]; | |
130 | ||
131 | for (Int_t i = 0; i < 6; i++) | |
132 | fGlobalScaler[i] = event.fGlobalScaler[i]; | |
133 | ||
134 | fRegHeaderArray = new TClonesArray("AliMUONRegHeader", 8); | |
135 | for (Int_t index = 0; index < (event.fRegHeaderArray)->GetEntriesFast(); index++) { | |
136 | new ((*fRegHeaderArray)[fRegHeaderArray->GetEntriesFast()]) | |
137 | AliMUONRegHeader(*(AliMUONRegHeader*)(event.fRegHeaderArray)->At(index)); | |
138 | } | |
139 | ||
140 | return *this; | |
141 | } | |
142 | ||
143 | //___________________________________________ | |
144 | AliMUONDarcHeader::~AliMUONDarcHeader() | |
145 | { | |
146 | // | |
147 | // dtor | |
148 | // | |
149 | fRegHeaderArray->Delete(); | |
150 | delete fRegHeaderArray; | |
151 | } | |
152 | ||
153 | //___________________________________________ | |
154 | void AliMUONDarcHeader::SetScalersNumbers() | |
155 | { | |
156 | // set numbers for scaler events for Darc header | |
157 | // since this is provided by the experiment | |
158 | // put dummy numbers to check the monitoring | |
159 | ||
160 | fGlobalL0 = 1000; | |
161 | fGlobalClk = 10000; | |
162 | fGlobalHold = 100; | |
163 | fGlobalSpare = 1; | |
164 | ||
165 | fDarcL0R = 1000; | |
166 | fDarcL0U = 900; | |
167 | fDarcL0P = 800; | |
168 | fDarcL0S = 700; | |
169 | fDarcClk = 10000; | |
170 | fDarcHold = 100; | |
171 | ||
172 | for (Int_t i = 0; i < 6; i++) | |
173 | fGlobalScaler[i] = i; | |
174 | ||
175 | } | |
176 | ||
177 | //___________________________________________ | |
178 | void AliMUONDarcHeader::Clear(Option_t* ) | |
179 | { | |
180 | // Clear TClones arrays | |
181 | // instead of deleting | |
182 | // | |
183 | fRegHeaderArray->Clear("C"); | |
184 | ||
185 | } |