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::fgkHeaderLength = 8;
35 const Int_t AliMUONDarcHeader::fgkDarcScalerLength = 6;
36 const Int_t AliMUONDarcHeader::fgkGlobalScalerLength = 10;
38 const UInt_t AliMUONDarcHeader::fgkEndOfDarc = 0xDEADFACE;
39 const UInt_t AliMUONDarcHeader::fgkEndOfGlobal = 0xDEADBEEF;
41 //___________________________________________
42 AliMUONDarcHeader::AliMUONDarcHeader()
62 for (Int_t i = 0; i < 4; i++)
65 for (Int_t i = 0; i < 6; i++)
68 fRegHeaderArray = new TClonesArray("AliMUONRegHeader",8);
71 //___________________________________________
72 AliMUONDarcHeader::AliMUONDarcHeader(const AliMUONDarcHeader& event)
79 fGlobalOutput = event.fGlobalOutput;
80 fGlobalL0 = event.fGlobalL0;
81 fGlobalClk = event.fGlobalClk;
82 fGlobalHold = event.fGlobalHold;
83 fGlobalSpare = event.fGlobalSpare;
85 fDarcL0R = event.fDarcL0R;
86 fDarcL0U = event.fDarcL0U;
87 fDarcL0P = event.fDarcL0P;
88 fDarcL0S = event.fDarcL0S;
89 fDarcClk = event.fDarcClk;
90 fDarcHold = event.fDarcHold;
93 for (Int_t i = 0; i < 4; i++)
94 fGlobalInput[i] = event.fGlobalInput[i];
96 for (Int_t i = 0; i < 6; i++)
97 fGlobalScaler[i] = event.fGlobalScaler[i];
99 fRegHeaderArray = new TClonesArray("AliMUONRegHeader", 8);
100 for (Int_t index = 0; index < (event.fRegHeaderArray)->GetEntriesFast(); index++) {
101 new ((*fRegHeaderArray)[fRegHeaderArray->GetEntriesFast()])
102 AliMUONRegHeader(*(AliMUONRegHeader*)(event.fRegHeaderArray)->At(index));
106 //___________________________________________
107 AliMUONDarcHeader& AliMUONDarcHeader::operator=(const AliMUONDarcHeader& event)
110 // assignment operator
112 if (this == &event) return *this;
115 fGlobalOutput = event.fGlobalOutput;
116 fGlobalL0 = event.fGlobalL0;
117 fGlobalClk = event.fGlobalClk;
118 fGlobalHold = event.fGlobalHold;
119 fGlobalSpare = event.fGlobalSpare;
121 fDarcL0R = event.fDarcL0R;
122 fDarcL0U = event.fDarcL0U;
123 fDarcL0P = event.fDarcL0P;
124 fDarcL0S = event.fDarcL0S;
125 fDarcClk = event.fDarcClk;
126 fDarcHold = event.fDarcHold;
128 for (Int_t i = 0; i < 4; i++)
129 fGlobalInput[i] = event.fGlobalInput[i];
131 for (Int_t i = 0; i < 6; i++)
132 fGlobalScaler[i] = event.fGlobalScaler[i];
134 fRegHeaderArray = new TClonesArray("AliMUONRegHeader", 8);
135 for (Int_t index = 0; index < (event.fRegHeaderArray)->GetEntriesFast(); index++) {
136 new ((*fRegHeaderArray)[fRegHeaderArray->GetEntriesFast()])
137 AliMUONRegHeader(*(AliMUONRegHeader*)(event.fRegHeaderArray)->At(index));
143 //___________________________________________
144 AliMUONDarcHeader::~AliMUONDarcHeader()
149 fRegHeaderArray->Delete();
150 delete fRegHeaderArray;
153 //___________________________________________
154 void AliMUONDarcHeader::SetScalersNumbers()
156 // set numbers for scaler events for Darc header
157 // since this is provided by the experiment
158 // put dummy numbers to check the monitoring
172 for (Int_t i = 0; i < 6; i++)
173 fGlobalScaler[i] = i;
177 //___________________________________________
178 void AliMUONDarcHeader::Clear(Option_t* )
180 // Clear TClones arrays
181 // instead of deleting
183 fRegHeaderArray->Clear("C");