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"
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.
31 ClassImp(AliMUONDarcHeader)
34 const Int_t AliMUONDarcHeader::fgkDarcHeaderLength = 1;
35 const Int_t AliMUONDarcHeader::fgkGlobalHeaderLength = 5;
36 const Int_t AliMUONDarcHeader::fgkDarcScalerLength = 6;
37 const Int_t AliMUONDarcHeader::fgkGlobalScalerLength = 10;
39 const UInt_t AliMUONDarcHeader::fgkEndOfDarc = 0xDEADFACE;
40 const UInt_t AliMUONDarcHeader::fgkEndOfGlobal = 0xDEADBEEF;
42 //___________________________________________
43 AliMUONDarcHeader::AliMUONDarcHeader()
63 for (Int_t i = 0; i < 4; i++)
66 for (Int_t i = 0; i < 6; i++)
69 fRegHeaderArray = new TClonesArray("AliMUONRegHeader",8);
72 //___________________________________________
73 AliMUONDarcHeader::AliMUONDarcHeader(const AliMUONDarcHeader& event)
80 fGlobalOutput = event.fGlobalOutput;
81 fGlobalL0 = event.fGlobalL0;
82 fGlobalClk = event.fGlobalClk;
83 fGlobalHold = event.fGlobalHold;
84 fGlobalSpare = event.fGlobalSpare;
86 fDarcL0R = event.fDarcL0R;
87 fDarcL0U = event.fDarcL0U;
88 fDarcL0P = event.fDarcL0P;
89 fDarcL0S = event.fDarcL0S;
90 fDarcClk = event.fDarcClk;
91 fDarcHold = event.fDarcHold;
94 for (Int_t i = 0; i < 4; i++)
95 fGlobalInput[i] = event.fGlobalInput[i];
97 for (Int_t i = 0; i < 6; i++)
98 fGlobalScaler[i] = event.fGlobalScaler[i];
100 fRegHeaderArray = new TClonesArray("AliMUONRegHeader", 8);
101 for (Int_t index = 0; index < (event.fRegHeaderArray)->GetEntriesFast(); index++) {
102 new ((*fRegHeaderArray)[fRegHeaderArray->GetEntriesFast()])
103 AliMUONRegHeader(*(AliMUONRegHeader*)(event.fRegHeaderArray)->At(index));
107 //___________________________________________
108 AliMUONDarcHeader& AliMUONDarcHeader::operator=(const AliMUONDarcHeader& event)
111 // assignment operator
113 if (this == &event) return *this;
116 fGlobalOutput = event.fGlobalOutput;
117 fGlobalL0 = event.fGlobalL0;
118 fGlobalClk = event.fGlobalClk;
119 fGlobalHold = event.fGlobalHold;
120 fGlobalSpare = event.fGlobalSpare;
122 fDarcL0R = event.fDarcL0R;
123 fDarcL0U = event.fDarcL0U;
124 fDarcL0P = event.fDarcL0P;
125 fDarcL0S = event.fDarcL0S;
126 fDarcClk = event.fDarcClk;
127 fDarcHold = event.fDarcHold;
129 for (Int_t i = 0; i < 4; i++)
130 fGlobalInput[i] = event.fGlobalInput[i];
132 for (Int_t i = 0; i < 6; i++)
133 fGlobalScaler[i] = event.fGlobalScaler[i];
135 fRegHeaderArray = new TClonesArray("AliMUONRegHeader", 8);
136 for (Int_t index = 0; index < (event.fRegHeaderArray)->GetEntriesFast(); index++) {
137 new ((*fRegHeaderArray)[fRegHeaderArray->GetEntriesFast()])
138 AliMUONRegHeader(*(AliMUONRegHeader*)(event.fRegHeaderArray)->At(index));
144 //___________________________________________
145 AliMUONDarcHeader::~AliMUONDarcHeader()
150 fRegHeaderArray->Delete();
151 delete fRegHeaderArray;
154 //___________________________________________
155 void AliMUONDarcHeader::SetScalersNumbers()
157 // set numbers for scaler events for Darc header
158 // since this is provided by the experiment
159 // put dummy numbers to check the monitoring
173 for (Int_t i = 0; i < 6; i++)
174 fGlobalScaler[i] = i;
178 //___________________________________________
179 void AliMUONDarcHeader::Clear(Option_t* )
181 // Clear TClones arrays
182 // instead of deleting
184 fRegHeaderArray->Clear("C");