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 /// \class AliMUONDarcHeader
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.
29 /// \author Christian Finck
32 ClassImp(AliMUONDarcHeader)
35 const Int_t AliMUONDarcHeader::fgkDarcHeaderLength = 1;
36 const Int_t AliMUONDarcHeader::fgkGlobalHeaderLength = 5;
37 const Int_t AliMUONDarcHeader::fgkDarcScalerLength = 8;
38 const Int_t AliMUONDarcHeader::fgkGlobalScalerLength = 10;
40 const UInt_t AliMUONDarcHeader::fgkEndOfDarc = 0xDEADFACE;
41 const UInt_t AliMUONDarcHeader::fgkEndOfGlobal = 0xDEADBEEF;
43 //___________________________________________
44 AliMUONDarcHeader::AliMUONDarcHeader()
62 fRegHeaderArray(new TClonesArray("AliMUONRegHeader",8))
68 for (Int_t i = 0; i < 4; i++)
71 for (Int_t i = 0; i < 6; i++)
76 //___________________________________________
77 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 fDarcL1P(event.fDarcL1P),
88 fDarcL1S(event.fDarcL1S),
89 fDarcL2A(event.fDarcL2A),
90 fDarcL2R(event.fDarcL2R),
91 fDarcClk(event.fDarcClk),
92 fDarcHold(event.fDarcHold),
93 fDarcSpare(event.fDarcSpare),
94 fRegHeaderArray(new TClonesArray("AliMUONRegHeader", 8))
101 for (Int_t i = 0; i < 4; i++)
102 fGlobalInput[i] = event.fGlobalInput[i];
104 for (Int_t i = 0; i < 6; i++)
105 fGlobalScaler[i] = event.fGlobalScaler[i];
107 for (Int_t index = 0; index < (event.fRegHeaderArray)->GetEntriesFast(); index++) {
108 new ((*fRegHeaderArray)[fRegHeaderArray->GetEntriesFast()])
109 AliMUONRegHeader(*(AliMUONRegHeader*)(event.fRegHeaderArray)->At(index));
113 //___________________________________________
114 AliMUONDarcHeader& AliMUONDarcHeader::operator=(const AliMUONDarcHeader& event)
117 /// assignment operator
119 if (this == &event) return *this;
122 fGlobalOutput = event.fGlobalOutput;
123 fGlobalL0 = event.fGlobalL0;
124 fGlobalClk = event.fGlobalClk;
125 fGlobalHold = event.fGlobalHold;
126 fGlobalSpare = event.fGlobalSpare;
128 fDarcL0R = event.fDarcL0R;
129 fDarcL1P = event.fDarcL1P;
130 fDarcL1S = event.fDarcL1S;
131 fDarcL2A = event.fDarcL2A;
132 fDarcL2R = event.fDarcL2R;
133 fDarcClk = event.fDarcClk;
134 fDarcHold = event.fDarcHold;
135 fDarcSpare = event.fDarcSpare;
137 for (Int_t i = 0; i < 4; i++)
138 fGlobalInput[i] = event.fGlobalInput[i];
140 for (Int_t i = 0; i < 6; i++)
141 fGlobalScaler[i] = event.fGlobalScaler[i];
143 fRegHeaderArray = new TClonesArray("AliMUONRegHeader", 8);
144 for (Int_t index = 0; index < (event.fRegHeaderArray)->GetEntriesFast(); index++) {
145 new ((*fRegHeaderArray)[fRegHeaderArray->GetEntriesFast()])
146 AliMUONRegHeader(*(AliMUONRegHeader*)(event.fRegHeaderArray)->At(index));
152 //___________________________________________
153 AliMUONDarcHeader::~AliMUONDarcHeader()
158 fRegHeaderArray->Delete();
159 delete fRegHeaderArray;
162 //___________________________________________
163 void AliMUONDarcHeader::SetScalersNumbers()
165 /// set numbers for scaler events for Darc header
166 /// since this is provided by the experiment
167 /// put dummy numbers to check the monitoring
183 for (Int_t i = 0; i < 6; i++)
184 fGlobalScaler[i] = i;
188 //___________________________________________
189 void AliMUONDarcHeader::Clear(Option_t* )
191 /// Clear TClones arrays
192 /// instead of deleting
194 fRegHeaderArray->Clear("C");