]> git.uio.no Git - u/mrichter/AliRoot.git/blame - MUON/AliMUONDarcHeader.cxx
Update scaler words (Christian)
[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;
883199be 36 const Int_t AliMUONDarcHeader::fgkDarcScalerLength = 7;
32def6aa 37 const Int_t AliMUONDarcHeader::fgkGlobalScalerLength = 10;
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),
59 fDarcHold(0)
60{
61 //
62 // ctor
63 //
64 for (Int_t i = 0; i < 4; i++)
65 fGlobalInput[i] = 0;
66
67 for (Int_t i = 0; i < 6; i++)
68 fGlobalScaler[i] = 0;
69
70 fRegHeaderArray = new TClonesArray("AliMUONRegHeader",8);
71}
72
73//___________________________________________
74AliMUONDarcHeader::AliMUONDarcHeader(const AliMUONDarcHeader& event)
75 : TObject(event)
76{
77 //
78 // copy ctor
79 //
80 fWord = event.fWord;
81 fGlobalOutput = event.fGlobalOutput;
82 fGlobalL0 = event.fGlobalL0;
83 fGlobalClk = event.fGlobalClk;
84 fGlobalHold = event.fGlobalHold;
85 fGlobalSpare = event.fGlobalSpare;
86
87 fDarcL0R = event.fDarcL0R;
883199be 88 fDarcL1P = event.fDarcL1P;
89 fDarcL1S = event.fDarcL1S;
90 fDarcL2A = event.fDarcL2A;
91 fDarcL2R = event.fDarcL2R;
32def6aa 92 fDarcClk = event.fDarcClk;
93 fDarcHold = event.fDarcHold;
94
95
96 for (Int_t i = 0; i < 4; i++)
97 fGlobalInput[i] = event.fGlobalInput[i];
98
99 for (Int_t i = 0; i < 6; i++)
100 fGlobalScaler[i] = event.fGlobalScaler[i];
101
102 fRegHeaderArray = new TClonesArray("AliMUONRegHeader", 8);
103 for (Int_t index = 0; index < (event.fRegHeaderArray)->GetEntriesFast(); index++) {
104 new ((*fRegHeaderArray)[fRegHeaderArray->GetEntriesFast()])
105 AliMUONRegHeader(*(AliMUONRegHeader*)(event.fRegHeaderArray)->At(index));
106 }
107}
108
109//___________________________________________
110AliMUONDarcHeader& AliMUONDarcHeader::operator=(const AliMUONDarcHeader& event)
111{
112 //
113 // assignment operator
114 //
115 if (this == &event) return *this;
116
117 fWord = event.fWord;
118 fGlobalOutput = event.fGlobalOutput;
119 fGlobalL0 = event.fGlobalL0;
120 fGlobalClk = event.fGlobalClk;
121 fGlobalHold = event.fGlobalHold;
122 fGlobalSpare = event.fGlobalSpare;
123
124 fDarcL0R = event.fDarcL0R;
883199be 125 fDarcL1P = event.fDarcL1P;
126 fDarcL1S = event.fDarcL1S;
127 fDarcL2A = event.fDarcL2A;
128 fDarcL2R = event.fDarcL2R;
32def6aa 129 fDarcClk = event.fDarcClk;
130 fDarcHold = event.fDarcHold;
131
132 for (Int_t i = 0; i < 4; i++)
133 fGlobalInput[i] = event.fGlobalInput[i];
134
135 for (Int_t i = 0; i < 6; i++)
136 fGlobalScaler[i] = event.fGlobalScaler[i];
137
138 fRegHeaderArray = new TClonesArray("AliMUONRegHeader", 8);
139 for (Int_t index = 0; index < (event.fRegHeaderArray)->GetEntriesFast(); index++) {
140 new ((*fRegHeaderArray)[fRegHeaderArray->GetEntriesFast()])
141 AliMUONRegHeader(*(AliMUONRegHeader*)(event.fRegHeaderArray)->At(index));
142 }
143
144 return *this;
145}
146
147//___________________________________________
148AliMUONDarcHeader::~AliMUONDarcHeader()
149{
150 //
151 // dtor
152 //
153 fRegHeaderArray->Delete();
154 delete fRegHeaderArray;
155}
156
157//___________________________________________
158void AliMUONDarcHeader::SetScalersNumbers()
159{
160 // set numbers for scaler events for Darc header
161 // since this is provided by the experiment
162 // put dummy numbers to check the monitoring
163
164 fGlobalL0 = 1000;
165 fGlobalClk = 10000;
166 fGlobalHold = 100;
167 fGlobalSpare = 1;
168
169 fDarcL0R = 1000;
883199be 170 fDarcL1P = 900;
171 fDarcL1S = 800;
172 fDarcL2A = 700;
173 fDarcL2R = 700;
32def6aa 174 fDarcClk = 10000;
175 fDarcHold = 100;
176
177 for (Int_t i = 0; i < 6; i++)
178 fGlobalScaler[i] = i;
179
180}
181
182//___________________________________________
183void AliMUONDarcHeader::Clear(Option_t* )
184{
185 // Clear TClones arrays
186 // instead of deleting
187 //
188 fRegHeaderArray->Clear("C");
189
190}