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 = 7;
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()
64 for (Int_t i = 0; i < 4; i++)
67 for (Int_t i = 0; i < 6; i++)
70 fRegHeaderArray = new TClonesArray("AliMUONRegHeader",8);
73 //___________________________________________
74 AliMUONDarcHeader::AliMUONDarcHeader(const AliMUONDarcHeader& event)
81 fGlobalOutput = event.fGlobalOutput;
82 fGlobalL0 = event.fGlobalL0;
83 fGlobalClk = event.fGlobalClk;
84 fGlobalHold = event.fGlobalHold;
85 fGlobalSpare = event.fGlobalSpare;
87 fDarcL0R = event.fDarcL0R;
88 fDarcL1P = event.fDarcL1P;
89 fDarcL1S = event.fDarcL1S;
90 fDarcL2A = event.fDarcL2A;
91 fDarcL2R = event.fDarcL2R;
92 fDarcClk = event.fDarcClk;
93 fDarcHold = event.fDarcHold;
96 for (Int_t i = 0; i < 4; i++)
97 fGlobalInput[i] = event.fGlobalInput[i];
99 for (Int_t i = 0; i < 6; i++)
100 fGlobalScaler[i] = event.fGlobalScaler[i];
102 fRegHeaderArray = new TClonesArray("AliMUONRegHeader", 8);
103 for (Int_t index = 0; index < (event.fRegHeaderArray)->GetEntriesFast(); index++) {
104 new ((*fRegHeaderArray)[fRegHeaderArray->GetEntriesFast()])
105 AliMUONRegHeader(*(AliMUONRegHeader*)(event.fRegHeaderArray)->At(index));
109 //___________________________________________
110 AliMUONDarcHeader& AliMUONDarcHeader::operator=(const AliMUONDarcHeader& event)
113 // assignment operator
115 if (this == &event) return *this;
118 fGlobalOutput = event.fGlobalOutput;
119 fGlobalL0 = event.fGlobalL0;
120 fGlobalClk = event.fGlobalClk;
121 fGlobalHold = event.fGlobalHold;
122 fGlobalSpare = event.fGlobalSpare;
124 fDarcL0R = event.fDarcL0R;
125 fDarcL1P = event.fDarcL1P;
126 fDarcL1S = event.fDarcL1S;
127 fDarcL2A = event.fDarcL2A;
128 fDarcL2R = event.fDarcL2R;
129 fDarcClk = event.fDarcClk;
130 fDarcHold = event.fDarcHold;
132 for (Int_t i = 0; i < 4; i++)
133 fGlobalInput[i] = event.fGlobalInput[i];
135 for (Int_t i = 0; i < 6; i++)
136 fGlobalScaler[i] = event.fGlobalScaler[i];
138 fRegHeaderArray = new TClonesArray("AliMUONRegHeader", 8);
139 for (Int_t index = 0; index < (event.fRegHeaderArray)->GetEntriesFast(); index++) {
140 new ((*fRegHeaderArray)[fRegHeaderArray->GetEntriesFast()])
141 AliMUONRegHeader(*(AliMUONRegHeader*)(event.fRegHeaderArray)->At(index));
147 //___________________________________________
148 AliMUONDarcHeader::~AliMUONDarcHeader()
153 fRegHeaderArray->Delete();
154 delete fRegHeaderArray;
157 //___________________________________________
158 void AliMUONDarcHeader::SetScalersNumbers()
160 // set numbers for scaler events for Darc header
161 // since this is provided by the experiment
162 // put dummy numbers to check the monitoring
177 for (Int_t i = 0; i < 6; i++)
178 fGlobalScaler[i] = i;
182 //___________________________________________
183 void AliMUONDarcHeader::Clear(Option_t* )
185 // Clear TClones arrays
186 // instead of deleting
188 fRegHeaderArray->Clear("C");