]> git.uio.no Git - u/mrichter/AliRoot.git/blame - MUON/AliMUONDarcHeader.cxx
Update of the class ESDMuonFilter. New marcros for creating AOD with muon information...
[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
3d1463c8 21//-----------------------------------------------------------------------------
00e86732 22/// \class AliMUONDarcHeader
32def6aa 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///
00e86732 30/// \author Christian Finck
3d1463c8 31//-----------------------------------------------------------------------------
32def6aa 32
13985652 33/// \cond CLASSIMP
32def6aa 34ClassImp(AliMUONDarcHeader)
13985652 35/// \endcond
36
18d3ded7 37 const Int_t AliMUONDarcHeader::fgkDarcHeaderLength = 1;
38 const Int_t AliMUONDarcHeader::fgkGlobalHeaderLength = 5;
d622a0ec 39 const Int_t AliMUONDarcHeader::fgkDarcScalerLength = 8;
40 const Int_t AliMUONDarcHeader::fgkGlobalScalerLength = 10;
32def6aa 41
42 const UInt_t AliMUONDarcHeader::fgkEndOfDarc = 0xDEADFACE;
43 const UInt_t AliMUONDarcHeader::fgkEndOfGlobal = 0xDEADBEEF;
9d14fb2e 44 const UInt_t AliMUONDarcHeader::fgkDarcVadorhType = 4;
45 const UInt_t AliMUONDarcHeader::fgkDarcDefaultType = 6;
32def6aa 46
32def6aa 47//___________________________________________
48AliMUONDarcHeader::AliMUONDarcHeader()
49 : TObject(),
50 fWord(0),
51 fGlobalOutput(0),
52
53 fGlobalL0(0),
54 fGlobalClk(0),
55 fGlobalHold(0),
56 fGlobalSpare(0),
57
58 fDarcL0R(0),
883199be 59 fDarcL1P(0),
60 fDarcL1S(0),
61 fDarcL2A(0),
62 fDarcL2R(0),
32def6aa 63 fDarcClk(0),
d622a0ec 64 fDarcHold(0),
9f5dcca3 65 fDarcSpare(0),
66 fRegHeaderArray(new TClonesArray("AliMUONRegHeader",8))
67
d622a0ec 68
32def6aa 69{
00e86732 70 /// ctor
71
32def6aa 72 for (Int_t i = 0; i < 4; i++)
73 fGlobalInput[i] = 0;
74
75 for (Int_t i = 0; i < 6; i++)
76 fGlobalScaler[i] = 0;
77
32def6aa 78}
79
80//___________________________________________
81AliMUONDarcHeader::AliMUONDarcHeader(const AliMUONDarcHeader& event)
9f5dcca3 82 : TObject(event),
83 fWord(event.fWord),
84 fGlobalOutput(event.fGlobalOutput),
85 fGlobalL0(event.fGlobalL0),
86 fGlobalClk(event.fGlobalClk),
87 fGlobalHold(event.fGlobalHold),
88 fGlobalSpare(event.fGlobalSpare),
89
90 fDarcL0R(event.fDarcL0R),
91 fDarcL1P(event.fDarcL1P),
92 fDarcL1S(event.fDarcL1S),
93 fDarcL2A(event.fDarcL2A),
94 fDarcL2R(event.fDarcL2R),
95 fDarcClk(event.fDarcClk),
96 fDarcHold(event.fDarcHold),
97 fDarcSpare(event.fDarcSpare),
98 fRegHeaderArray(new TClonesArray("AliMUONRegHeader", 8))
99
32def6aa 100{
00e86732 101 ///
102 /// copy ctor
103 ///
32def6aa 104
105 for (Int_t i = 0; i < 4; i++)
106 fGlobalInput[i] = event.fGlobalInput[i];
107
108 for (Int_t i = 0; i < 6; i++)
109 fGlobalScaler[i] = event.fGlobalScaler[i];
110
32def6aa 111 for (Int_t index = 0; index < (event.fRegHeaderArray)->GetEntriesFast(); index++) {
112 new ((*fRegHeaderArray)[fRegHeaderArray->GetEntriesFast()])
113 AliMUONRegHeader(*(AliMUONRegHeader*)(event.fRegHeaderArray)->At(index));
114 }
115}
116
117//___________________________________________
118AliMUONDarcHeader& AliMUONDarcHeader::operator=(const AliMUONDarcHeader& event)
119{
00e86732 120 ///
121 /// assignment operator
122 ///
32def6aa 123 if (this == &event) return *this;
124
125 fWord = event.fWord;
126 fGlobalOutput = event.fGlobalOutput;
127 fGlobalL0 = event.fGlobalL0;
128 fGlobalClk = event.fGlobalClk;
129 fGlobalHold = event.fGlobalHold;
130 fGlobalSpare = event.fGlobalSpare;
131
d622a0ec 132 fDarcL0R = event.fDarcL0R;
133 fDarcL1P = event.fDarcL1P;
134 fDarcL1S = event.fDarcL1S;
135 fDarcL2A = event.fDarcL2A;
136 fDarcL2R = event.fDarcL2R;
137 fDarcClk = event.fDarcClk;
138 fDarcHold = event.fDarcHold;
139 fDarcSpare = event.fDarcSpare;
32def6aa 140
141 for (Int_t i = 0; i < 4; i++)
142 fGlobalInput[i] = event.fGlobalInput[i];
143
144 for (Int_t i = 0; i < 6; i++)
145 fGlobalScaler[i] = event.fGlobalScaler[i];
146
147 fRegHeaderArray = new TClonesArray("AliMUONRegHeader", 8);
148 for (Int_t index = 0; index < (event.fRegHeaderArray)->GetEntriesFast(); index++) {
149 new ((*fRegHeaderArray)[fRegHeaderArray->GetEntriesFast()])
150 AliMUONRegHeader(*(AliMUONRegHeader*)(event.fRegHeaderArray)->At(index));
151 }
152
153 return *this;
154}
155
156//___________________________________________
157AliMUONDarcHeader::~AliMUONDarcHeader()
158{
00e86732 159 ///
160 /// dtor
161 ///
32def6aa 162 fRegHeaderArray->Delete();
163 delete fRegHeaderArray;
164}
165
166//___________________________________________
167void AliMUONDarcHeader::SetScalersNumbers()
168{
00e86732 169 /// set numbers for scaler events for Darc header
170 /// since this is provided by the experiment
171 /// put dummy numbers to check the monitoring
32def6aa 172
173 fGlobalL0 = 1000;
174 fGlobalClk = 10000;
175 fGlobalHold = 100;
176 fGlobalSpare = 1;
177
d622a0ec 178 fDarcL0R = 1000;
179 fDarcL1P = 900;
180 fDarcL1S = 800;
181 fDarcL2A = 700;
182 fDarcL2R = 700;
183 fDarcClk = 10000;
184 fDarcHold = 100;
185 fDarcSpare = 0;
32def6aa 186
187 for (Int_t i = 0; i < 6; i++)
188 fGlobalScaler[i] = i;
189
190}
eeb99566 191//___________________________________________
192Bool_t AliMUONDarcHeader::GetEventType() const
193{
194 /// return 1 for physics trigger
195 /// return 0 for software trigger
196 // 01 = trigger physics
197 // 10 = trigger software "start of run"
198 // 11 = trigger software "end of run"
199 // 00 = other trigger software
200
201 Bool_t b1 = (fWord >> 30) & 0x1;
202 Bool_t b2 = !((fWord >> 31) & 0x1);
203
204 //printf("%d\n", b1 & b2);
205 //printf("%d %d\n", b2 , b1);
206 return (b1 & b2);
207}
32def6aa 208
209//___________________________________________
210void AliMUONDarcHeader::Clear(Option_t* )
211{
00e86732 212 /// Clear TClones arrays
213 /// instead of deleting
214 ///
32def6aa 215 fRegHeaderArray->Clear("C");
216
217}