]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONDarcHeader.cxx
Decode new trigger board names
[u/mrichter/AliRoot.git] / MUON / AliMUONDarcHeader.cxx
1 /**************************************************************************
2  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3  *                                                                        *
4  * Author: The ALICE Off-line Project.                                    *
5  * Contributors are mentioned in the code where appropriate.              *
6  *                                                                        *
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  **************************************************************************/
15  
16 #include "AliMUONDarcHeader.h"
17 #include "AliMUONRegHeader.h"
18
19 /// 
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.
26 ///
27
28 ClassImp(AliMUONDarcHeader)
29  
30  const Int_t AliMUONDarcHeader::fgkHeaderLength = 8;
31  const Int_t AliMUONDarcHeader::fgkDarcScalerLength   = 6;
32  const Int_t AliMUONDarcHeader::fgkGlobalScalerLength = 10;
33
34  const UInt_t AliMUONDarcHeader::fgkEndOfDarc   = 0xDEADFACE;
35  const UInt_t AliMUONDarcHeader::fgkEndOfGlobal = 0xDEADBEEF;
36
37
38 //___________________________________________
39 AliMUONDarcHeader::AliMUONDarcHeader()
40   :  TObject(),
41      fWord(0),
42      fGlobalOutput(0),
43
44      fGlobalL0(0), 
45      fGlobalClk(0),
46      fGlobalHold(0),      
47      fGlobalSpare(0),     
48
49      fDarcL0R(0),
50      fDarcL0U(0),
51      fDarcL0P(0),
52      fDarcL0S(0),
53      fDarcClk(0),
54      fDarcHold(0)
55 {
56   //
57   // ctor
58   //
59   for (Int_t i = 0; i < 4; i++)
60     fGlobalInput[i] = 0;
61
62   for (Int_t i = 0; i < 6; i++)
63     fGlobalScaler[i] = 0;
64
65   fRegHeaderArray = new TClonesArray("AliMUONRegHeader",8);
66 }
67
68 //___________________________________________
69 AliMUONDarcHeader::AliMUONDarcHeader(const AliMUONDarcHeader& event)
70   :  TObject(event)
71 {
72   //
73   // copy ctor
74   //
75   fWord         = event.fWord;
76   fGlobalOutput = event.fGlobalOutput;
77   fGlobalL0     = event.fGlobalL0;
78   fGlobalClk    = event.fGlobalClk;
79   fGlobalHold   = event.fGlobalHold;   
80   fGlobalSpare  = event.fGlobalSpare;
81
82   fDarcL0R  = event.fDarcL0R;
83   fDarcL0U  = event.fDarcL0U;
84   fDarcL0P  = event.fDarcL0P;
85   fDarcL0S  = event.fDarcL0S;
86   fDarcClk  = event.fDarcClk;
87   fDarcHold = event.fDarcHold;
88
89  
90  for (Int_t i = 0; i < 4; i++)
91     fGlobalInput[i] = event.fGlobalInput[i];
92
93   for (Int_t i = 0; i < 6; i++)
94     fGlobalScaler[i] = event.fGlobalScaler[i];
95
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));
100   }
101 }
102
103 //___________________________________________
104 AliMUONDarcHeader& AliMUONDarcHeader::operator=(const AliMUONDarcHeader& event)
105 {
106   // 
107   // assignment operator
108   //
109   if (this == &event) return *this;
110
111   fWord         = event.fWord;
112   fGlobalOutput = event.fGlobalOutput;
113   fGlobalL0     = event.fGlobalL0;
114   fGlobalClk    = event.fGlobalClk;
115   fGlobalHold   = event.fGlobalHold;   
116   fGlobalSpare  = event.fGlobalSpare;
117
118   fDarcL0R  = event.fDarcL0R;
119   fDarcL0U  = event.fDarcL0U;
120   fDarcL0P  = event.fDarcL0P;
121   fDarcL0S  = event.fDarcL0S;
122   fDarcClk  = event.fDarcClk;
123   fDarcHold = event.fDarcHold;
124
125   for (Int_t i = 0; i < 4; i++)
126     fGlobalInput[i] = event.fGlobalInput[i];
127
128   for (Int_t i = 0; i < 6; i++)
129     fGlobalScaler[i] = event.fGlobalScaler[i];
130
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));
135   }
136
137   return *this;
138 }
139
140 //___________________________________________
141 AliMUONDarcHeader::~AliMUONDarcHeader()
142 {
143   // 
144   // dtor
145   //
146   fRegHeaderArray->Delete();
147   delete fRegHeaderArray;
148 }
149
150 //___________________________________________
151 void AliMUONDarcHeader::SetScalersNumbers()
152 {
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
156   
157   fGlobalL0    = 1000;
158   fGlobalClk   = 10000;
159   fGlobalHold  = 100;    
160   fGlobalSpare = 1;    
161
162   fDarcL0R  = 1000;
163   fDarcL0U  = 900;
164   fDarcL0P  = 800;
165   fDarcL0S  = 700;
166   fDarcClk  = 10000;
167   fDarcHold = 100;
168
169    for (Int_t i = 0; i < 6; i++)
170     fGlobalScaler[i] = i;
171
172 }
173
174 //___________________________________________
175 void AliMUONDarcHeader::Clear(Option_t* )
176 {
177   // Clear TClones arrays
178   // instead of deleting
179   //
180   fRegHeaderArray->Clear("C");
181  
182 }