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 **************************************************************************/
16 #include "AliMUONDarcHeader.h"
17 #include "AliMUONRegHeader.h"
20 /// Darc structure for trigger raw data.
21 /// Each DDL contains one Darc structure
22 /// The structure includes the information of the Darc boards
23 /// the Global board input and the global board output
24 /// The structure containes the information of the 8 (at most)
25 /// regional structures.
28 ClassImp(AliMUONDarcHeader)
30 const Int_t AliMUONDarcHeader::fgkHeaderLength = 8;
31 const Int_t AliMUONDarcHeader::fgkDarcScalerLength = 6;
32 const Int_t AliMUONDarcHeader::fgkGlobalScalerLength = 10;
34 const UInt_t AliMUONDarcHeader::fgkEndOfDarc = 0xDEADFACE;
35 const UInt_t AliMUONDarcHeader::fgkEndOfGlobal = 0xDEADBEEF;
38 //___________________________________________
39 AliMUONDarcHeader::AliMUONDarcHeader()
59 for (Int_t i = 0; i < 4; i++)
62 for (Int_t i = 0; i < 6; i++)
65 fRegHeaderArray = new TClonesArray("AliMUONRegHeader",8);
68 //___________________________________________
69 AliMUONDarcHeader::AliMUONDarcHeader(const AliMUONDarcHeader& event)
76 fGlobalOutput = event.fGlobalOutput;
77 fGlobalL0 = event.fGlobalL0;
78 fGlobalClk = event.fGlobalClk;
79 fGlobalHold = event.fGlobalHold;
80 fGlobalSpare = event.fGlobalSpare;
82 fDarcL0R = event.fDarcL0R;
83 fDarcL0U = event.fDarcL0U;
84 fDarcL0P = event.fDarcL0P;
85 fDarcL0S = event.fDarcL0S;
86 fDarcClk = event.fDarcClk;
87 fDarcHold = event.fDarcHold;
90 for (Int_t i = 0; i < 4; i++)
91 fGlobalInput[i] = event.fGlobalInput[i];
93 for (Int_t i = 0; i < 6; i++)
94 fGlobalScaler[i] = event.fGlobalScaler[i];
96 fRegHeaderArray = new TClonesArray("AliMUONRegHeader", 8);
97 for (Int_t index = 0; index < (event.fRegHeaderArray)->GetEntriesFast(); index++) {
98 new ((*fRegHeaderArray)[fRegHeaderArray->GetEntriesFast()])
99 AliMUONRegHeader(*(AliMUONRegHeader*)(event.fRegHeaderArray)->At(index));
103 //___________________________________________
104 AliMUONDarcHeader& AliMUONDarcHeader::operator=(const AliMUONDarcHeader& event)
107 // assignment operator
109 if (this == &event) return *this;
112 fGlobalOutput = event.fGlobalOutput;
113 fGlobalL0 = event.fGlobalL0;
114 fGlobalClk = event.fGlobalClk;
115 fGlobalHold = event.fGlobalHold;
116 fGlobalSpare = event.fGlobalSpare;
118 fDarcL0R = event.fDarcL0R;
119 fDarcL0U = event.fDarcL0U;
120 fDarcL0P = event.fDarcL0P;
121 fDarcL0S = event.fDarcL0S;
122 fDarcClk = event.fDarcClk;
123 fDarcHold = event.fDarcHold;
125 for (Int_t i = 0; i < 4; i++)
126 fGlobalInput[i] = event.fGlobalInput[i];
128 for (Int_t i = 0; i < 6; i++)
129 fGlobalScaler[i] = event.fGlobalScaler[i];
131 fRegHeaderArray = new TClonesArray("AliMUONRegHeader", 8);
132 for (Int_t index = 0; index < (event.fRegHeaderArray)->GetEntriesFast(); index++) {
133 new ((*fRegHeaderArray)[fRegHeaderArray->GetEntriesFast()])
134 AliMUONRegHeader(*(AliMUONRegHeader*)(event.fRegHeaderArray)->At(index));
140 //___________________________________________
141 AliMUONDarcHeader::~AliMUONDarcHeader()
146 fRegHeaderArray->Delete();
147 delete fRegHeaderArray;
150 //___________________________________________
151 void AliMUONDarcHeader::SetScalersNumbers()
153 // set numbers for scaler events for Darc header
154 // since this is provided by the experiment
155 // put dummy numbers to check the monitoring
169 for (Int_t i = 0; i < 6; i++)
170 fGlobalScaler[i] = i;
174 //___________________________________________
175 void AliMUONDarcHeader::Clear(Option_t* )
177 // Clear TClones arrays
178 // instead of deleting
180 fRegHeaderArray->Clear("C");