1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
18 #include "AliMUONDarcHeader.h"
19 #include "AliMUONRegHeader.h"
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.
30 /// \author Christian Finck
31 //-----------------------------------------------------------------------------
34 ClassImp(AliMUONDarcHeader)
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;
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;
47 //___________________________________________
48 AliMUONDarcHeader::AliMUONDarcHeader()
66 fRegHeaderArray(new TClonesArray("AliMUONRegHeader",8))
72 for (Int_t i = 0; i < 4; i++)
75 for (Int_t i = 0; i < 6; i++)
80 //___________________________________________
81 AliMUONDarcHeader::AliMUONDarcHeader(const AliMUONDarcHeader& event)
84 fGlobalOutput(event.fGlobalOutput),
85 fGlobalL0(event.fGlobalL0),
86 fGlobalClk(event.fGlobalClk),
87 fGlobalHold(event.fGlobalHold),
88 fGlobalSpare(event.fGlobalSpare),
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))
105 for (Int_t i = 0; i < 4; i++)
106 fGlobalInput[i] = event.fGlobalInput[i];
108 for (Int_t i = 0; i < 6; i++)
109 fGlobalScaler[i] = event.fGlobalScaler[i];
111 for (Int_t index = 0; index < (event.fRegHeaderArray)->GetEntriesFast(); index++) {
112 new ((*fRegHeaderArray)[fRegHeaderArray->GetEntriesFast()])
113 AliMUONRegHeader(*(AliMUONRegHeader*)(event.fRegHeaderArray)->At(index));
117 //___________________________________________
118 AliMUONDarcHeader& AliMUONDarcHeader::operator=(const AliMUONDarcHeader& event)
121 /// assignment operator
123 if (this == &event) return *this;
126 fGlobalOutput = event.fGlobalOutput;
127 fGlobalL0 = event.fGlobalL0;
128 fGlobalClk = event.fGlobalClk;
129 fGlobalHold = event.fGlobalHold;
130 fGlobalSpare = event.fGlobalSpare;
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;
141 for (Int_t i = 0; i < 4; i++)
142 fGlobalInput[i] = event.fGlobalInput[i];
144 for (Int_t i = 0; i < 6; i++)
145 fGlobalScaler[i] = event.fGlobalScaler[i];
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));
156 //___________________________________________
157 AliMUONDarcHeader::~AliMUONDarcHeader()
162 fRegHeaderArray->Delete();
163 delete fRegHeaderArray;
166 //___________________________________________
167 void AliMUONDarcHeader::SetScalersNumbers()
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
187 for (Int_t i = 0; i < 6; i++)
188 fGlobalScaler[i] = i;
191 //___________________________________________
192 Bool_t AliMUONDarcHeader::GetEventType() const
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
201 Bool_t b1 = (fWord >> 30) & 0x1;
202 Bool_t b2 = !((fWord >> 31) & 0x1);
204 //printf("%d\n", b1 & b2);
205 //printf("%d %d\n", b2 , b1);
209 //___________________________________________
210 void AliMUONDarcHeader::Clear(Option_t* )
212 /// Clear TClones arrays
213 /// instead of deleting
215 fRegHeaderArray->Clear("C");