Added description for the new analysis macros
[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),
60 fDarcSpare(0)
61
32def6aa 62{
63 //
64 // ctor
65 //
66 for (Int_t i = 0; i < 4; i++)
67 fGlobalInput[i] = 0;
68
69 for (Int_t i = 0; i < 6; i++)
70 fGlobalScaler[i] = 0;
71
72 fRegHeaderArray = new TClonesArray("AliMUONRegHeader",8);
73}
74
75//___________________________________________
76AliMUONDarcHeader::AliMUONDarcHeader(const AliMUONDarcHeader& event)
77 : TObject(event)
78{
79 //
80 // copy ctor
81 //
82 fWord = event.fWord;
83 fGlobalOutput = event.fGlobalOutput;
84 fGlobalL0 = event.fGlobalL0;
85 fGlobalClk = event.fGlobalClk;
86 fGlobalHold = event.fGlobalHold;
87 fGlobalSpare = event.fGlobalSpare;
88
d622a0ec 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;
32def6aa 97
98
99 for (Int_t i = 0; i < 4; i++)
100 fGlobalInput[i] = event.fGlobalInput[i];
101
102 for (Int_t i = 0; i < 6; i++)
103 fGlobalScaler[i] = event.fGlobalScaler[i];
104
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));
109 }
110}
111
112//___________________________________________
113AliMUONDarcHeader& AliMUONDarcHeader::operator=(const AliMUONDarcHeader& event)
114{
115 //
116 // assignment operator
117 //
118 if (this == &event) return *this;
119
120 fWord = event.fWord;
121 fGlobalOutput = event.fGlobalOutput;
122 fGlobalL0 = event.fGlobalL0;
123 fGlobalClk = event.fGlobalClk;
124 fGlobalHold = event.fGlobalHold;
125 fGlobalSpare = event.fGlobalSpare;
126
d622a0ec 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;
32def6aa 135
136 for (Int_t i = 0; i < 4; i++)
137 fGlobalInput[i] = event.fGlobalInput[i];
138
139 for (Int_t i = 0; i < 6; i++)
140 fGlobalScaler[i] = event.fGlobalScaler[i];
141
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));
146 }
147
148 return *this;
149}
150
151//___________________________________________
152AliMUONDarcHeader::~AliMUONDarcHeader()
153{
154 //
155 // dtor
156 //
157 fRegHeaderArray->Delete();
158 delete fRegHeaderArray;
159}
160
161//___________________________________________
162void AliMUONDarcHeader::SetScalersNumbers()
163{
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
167
168 fGlobalL0 = 1000;
169 fGlobalClk = 10000;
170 fGlobalHold = 100;
171 fGlobalSpare = 1;
172
d622a0ec 173 fDarcL0R = 1000;
174 fDarcL1P = 900;
175 fDarcL1S = 800;
176 fDarcL2A = 700;
177 fDarcL2R = 700;
178 fDarcClk = 10000;
179 fDarcHold = 100;
180 fDarcSpare = 0;
32def6aa 181
182 for (Int_t i = 0; i < 6; i++)
183 fGlobalScaler[i] = i;
184
185}
186
187//___________________________________________
188void AliMUONDarcHeader::Clear(Option_t* )
189{
190 // Clear TClones arrays
191 // instead of deleting
192 //
193 fRegHeaderArray->Clear("C");
194
195}