Line data Source code
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 :
16 : /* $Id$ */
17 :
18 : #include "AliMUONDarcHeader.h"
19 : #include "AliMUONRegHeader.h"
20 :
21 : //-----------------------------------------------------------------------------
22 : /// \class AliMUONDarcHeader
23 : /// Darc structure for trigger raw data.
24 : /// Each DDL contains one Darc structure
25 : /// The structure includes the information of the Darc boards
26 : /// the Global board input and the global board output
27 : /// The structure containes the information of the 8 (at most)
28 : /// regional structures.
29 : ///
30 : /// \author Christian Finck
31 : //-----------------------------------------------------------------------------
32 :
33 : /// \cond CLASSIMP
34 18 : ClassImp(AliMUONDarcHeader)
35 : /// \endcond
36 :
37 : const Int_t AliMUONDarcHeader::fgkDarcHeaderLength = 1;
38 : const Int_t AliMUONDarcHeader::fgkGlobalHeaderLength = 5;
39 : const Int_t AliMUONDarcHeader::fgkDarcScalerLength = 8;
40 : const Int_t AliMUONDarcHeader::fgkGlobalScalerLength = 10;
41 :
42 : const UInt_t AliMUONDarcHeader::fgkEndOfDarc = 0xDEADFACE;
43 : const UInt_t AliMUONDarcHeader::fgkEndOfGlobal = 0xDEADBEEF;
44 : const UInt_t AliMUONDarcHeader::fgkDarcVadorhType = 4;
45 : const UInt_t AliMUONDarcHeader::fgkDarcDefaultType = 6;
46 :
47 : //___________________________________________
48 : AliMUONDarcHeader::AliMUONDarcHeader(TRootIOCtor* /*dummy*/)
49 0 : : TObject(),
50 0 : fWord(0),
51 0 : fGlobalOutput(0),
52 0 : fGlobalL0(0),
53 0 : fGlobalClk(0),
54 0 : fGlobalHold(0),
55 0 : fGlobalSpare(0),
56 0 : fDarcL0R(0),
57 0 : fDarcL1P(0),
58 0 : fDarcL1S(0),
59 0 : fDarcL2A(0),
60 0 : fDarcL2R(0),
61 0 : fDarcClk(0),
62 0 : fDarcHold(0),
63 0 : fDarcSpare(0),
64 0 : fRegHeaderArray(0x0)
65 0 : {
66 : /// ctor
67 0 : for (Int_t i = 0; i < 4; i++)
68 0 : fGlobalInput[i] = 0;
69 :
70 0 : for (Int_t i = 0; i < 6; i++)
71 0 : fGlobalScaler[i] = 0;
72 :
73 0 : }
74 :
75 : //___________________________________________
76 : AliMUONDarcHeader::AliMUONDarcHeader()
77 1 : : TObject(),
78 1 : fWord(0),
79 1 : fGlobalOutput(0),
80 :
81 1 : fGlobalL0(0),
82 1 : fGlobalClk(0),
83 1 : fGlobalHold(0),
84 1 : fGlobalSpare(0),
85 :
86 1 : fDarcL0R(0),
87 1 : fDarcL1P(0),
88 1 : fDarcL1S(0),
89 1 : fDarcL2A(0),
90 1 : fDarcL2R(0),
91 1 : fDarcClk(0),
92 1 : fDarcHold(0),
93 1 : fDarcSpare(0),
94 3 : fRegHeaderArray(new TClonesArray("AliMUONRegHeader",8))
95 :
96 :
97 5 : {
98 : /// ctor
99 :
100 10 : for (Int_t i = 0; i < 4; i++)
101 4 : fGlobalInput[i] = 0;
102 :
103 14 : for (Int_t i = 0; i < 6; i++)
104 6 : fGlobalScaler[i] = 0;
105 :
106 2 : }
107 :
108 : //___________________________________________
109 : AliMUONDarcHeader::AliMUONDarcHeader(const AliMUONDarcHeader& event)
110 0 : : TObject(event),
111 0 : fWord(event.fWord),
112 0 : fGlobalOutput(event.fGlobalOutput),
113 0 : fGlobalL0(event.fGlobalL0),
114 0 : fGlobalClk(event.fGlobalClk),
115 0 : fGlobalHold(event.fGlobalHold),
116 0 : fGlobalSpare(event.fGlobalSpare),
117 :
118 0 : fDarcL0R(event.fDarcL0R),
119 0 : fDarcL1P(event.fDarcL1P),
120 0 : fDarcL1S(event.fDarcL1S),
121 0 : fDarcL2A(event.fDarcL2A),
122 0 : fDarcL2R(event.fDarcL2R),
123 0 : fDarcClk(event.fDarcClk),
124 0 : fDarcHold(event.fDarcHold),
125 0 : fDarcSpare(event.fDarcSpare),
126 0 : fRegHeaderArray(new TClonesArray("AliMUONRegHeader", 8))
127 :
128 0 : {
129 : ///
130 : /// copy ctor
131 : ///
132 :
133 0 : for (Int_t i = 0; i < 4; i++)
134 0 : fGlobalInput[i] = event.fGlobalInput[i];
135 :
136 0 : for (Int_t i = 0; i < 6; i++)
137 0 : fGlobalScaler[i] = event.fGlobalScaler[i];
138 :
139 0 : for (Int_t index = 0; index < (event.fRegHeaderArray)->GetEntriesFast(); index++) {
140 0 : new ((*fRegHeaderArray)[fRegHeaderArray->GetEntriesFast()])
141 0 : AliMUONRegHeader(*(AliMUONRegHeader*)(event.fRegHeaderArray)->At(index));
142 : }
143 0 : }
144 :
145 : //___________________________________________
146 : AliMUONDarcHeader& AliMUONDarcHeader::operator=(const AliMUONDarcHeader& event)
147 : {
148 : ///
149 : /// assignment operator
150 : ///
151 0 : if (this == &event) return *this;
152 :
153 0 : fWord = event.fWord;
154 0 : fGlobalOutput = event.fGlobalOutput;
155 0 : fGlobalL0 = event.fGlobalL0;
156 0 : fGlobalClk = event.fGlobalClk;
157 0 : fGlobalHold = event.fGlobalHold;
158 0 : fGlobalSpare = event.fGlobalSpare;
159 :
160 0 : fDarcL0R = event.fDarcL0R;
161 0 : fDarcL1P = event.fDarcL1P;
162 0 : fDarcL1S = event.fDarcL1S;
163 0 : fDarcL2A = event.fDarcL2A;
164 0 : fDarcL2R = event.fDarcL2R;
165 0 : fDarcClk = event.fDarcClk;
166 0 : fDarcHold = event.fDarcHold;
167 0 : fDarcSpare = event.fDarcSpare;
168 :
169 0 : for (Int_t i = 0; i < 4; i++)
170 0 : fGlobalInput[i] = event.fGlobalInput[i];
171 :
172 0 : for (Int_t i = 0; i < 6; i++)
173 0 : fGlobalScaler[i] = event.fGlobalScaler[i];
174 :
175 0 : fRegHeaderArray = new TClonesArray("AliMUONRegHeader", 8);
176 0 : for (Int_t index = 0; index < (event.fRegHeaderArray)->GetEntriesFast(); index++) {
177 0 : new ((*fRegHeaderArray)[fRegHeaderArray->GetEntriesFast()])
178 0 : AliMUONRegHeader(*(AliMUONRegHeader*)(event.fRegHeaderArray)->At(index));
179 : }
180 :
181 0 : return *this;
182 0 : }
183 :
184 : //___________________________________________
185 : AliMUONDarcHeader::~AliMUONDarcHeader()
186 6 : {
187 : ///
188 : /// dtor
189 : ///
190 1 : fRegHeaderArray->Delete();
191 2 : delete fRegHeaderArray;
192 3 : }
193 :
194 : //___________________________________________
195 : void AliMUONDarcHeader::SetScalersNumbers()
196 : {
197 : /// set numbers for scaler events for Darc header
198 : /// since this is provided by the experiment
199 : /// put dummy numbers to check the monitoring
200 :
201 0 : fGlobalL0 = 1000;
202 0 : fGlobalClk = 10000;
203 0 : fGlobalHold = 100;
204 0 : fGlobalSpare = 1;
205 :
206 0 : fDarcL0R = 1000;
207 0 : fDarcL1P = 900;
208 0 : fDarcL1S = 800;
209 0 : fDarcL2A = 700;
210 0 : fDarcL2R = 700;
211 0 : fDarcClk = 10000;
212 0 : fDarcHold = 100;
213 0 : fDarcSpare = 0;
214 :
215 0 : for (Int_t i = 0; i < 6; i++)
216 0 : fGlobalScaler[i] = i;
217 :
218 0 : }
219 : //___________________________________________
220 : Bool_t AliMUONDarcHeader::GetEventType() const
221 : {
222 : /// return 1 for physics trigger
223 : /// return 0 for software trigger
224 : // 01 = trigger physics
225 : // 10 = trigger software "start of run"
226 : // 11 = trigger software "end of run"
227 : // 00 = other trigger software
228 :
229 0 : Bool_t b1 = (fWord >> 30) & 0x1;
230 0 : Bool_t b2 = !((fWord >> 31) & 0x1);
231 :
232 : //printf("%d\n", b1 & b2);
233 : //printf("%d %d\n", b2 , b1);
234 0 : return (b1 & b2);
235 : }
236 :
237 : //___________________________________________
238 : void AliMUONDarcHeader::Clear(Option_t* )
239 : {
240 : /// Clear TClones arrays
241 : /// instead of deleting
242 : ///
243 0 : fRegHeaderArray->Clear("C");
244 :
245 0 : }
|