]> git.uio.no Git - u/mrichter/AliRoot.git/blame_incremental - MUON/AliMUONRegHeader.cxx
code cleanup: renaming functions; adding prototype code for later development; no...
[u/mrichter/AliRoot.git] / MUON / AliMUONRegHeader.cxx
... / ...
CommitLineData
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/* $Id$ */
17
18#include <TClonesArray.h>
19
20#include "AliMUONRegHeader.h"
21#include "AliMUONLocalStruct.h"
22
23//-----------------------------------------------------------------------------
24/// \class AliMUONRegHeader
25/// Regional structure for trigger raw data.
26/// Each Reg structure contains 16 (at most) local card structure.
27/// The structure includes the information of the Reg. boards and
28/// regional inputs
29///
30/// \author Christian Finck
31//-----------------------------------------------------------------------------
32
33/// \cond CLASSIMP
34ClassImp(AliMUONRegHeader)
35/// \endcond
36
37 const Int_t AliMUONRegHeader::fgkHeaderLength = 5;
38 const Int_t AliMUONRegHeader::fgkScalerLength = 10;
39 const UInt_t AliMUONRegHeader::fgkEndOfReg = 0xBEEFFACE;
40 const UInt_t AliMUONRegHeader::fgkErrorWord = 0xCAFEDEAD;
41
42//___________________________________________
43AliMUONRegHeader::AliMUONRegHeader(TRootIOCtor* /*dummy*/)
44: TObject(),
45fDarcWord(0),
46fWord(0),
47fMask(0),
48fL0(0),
49fClk(0),
50fHold(0),
51fLocalArray(0x0)
52{
53 /// ctor
54 fInput[0] = fInput[1] = 0;
55
56 for (Int_t i = 0; i < 8; i++)
57 fScaler[i] = 0;
58}
59
60//___________________________________________
61AliMUONRegHeader::AliMUONRegHeader()
62 : TObject(),
63 fDarcWord(0),
64 fWord(0),
65 fMask(0),
66 fL0(0),
67 fClk(0),
68 fHold(0),
69 fLocalArray(new TClonesArray("AliMUONLocalStruct",16))
70{
71 /// ctor
72
73 fInput[0] = fInput[1] = 0;
74
75 for (Int_t i = 0; i < 8; i++)
76 fScaler[i] = 0;
77
78}
79
80//___________________________________________
81AliMUONRegHeader::~AliMUONRegHeader()
82{
83 /// dtor
84
85 fLocalArray->Delete();
86 delete fLocalArray;
87}
88
89//___________________________________________
90AliMUONRegHeader::AliMUONRegHeader(const AliMUONRegHeader& event)
91 : TObject(event),
92 fDarcWord(event.fDarcWord),
93 fWord(event.fWord),
94 fMask(event.fMask),
95 fL0(event.fL0),
96 fClk(event.fClk),
97 fHold(event.fHold),
98 fLocalArray(new TClonesArray("AliMUONLocalStruct", 16))
99{
100 ///
101 /// copy ctor
102 ///
103
104 fInput[0] = event.fInput[0];
105 fInput[1] = event.fInput[1];
106
107 for (Int_t i = 0; i < 8; i++)
108 fScaler[i] = event.fScaler[i];
109
110 for (Int_t index = 0; index < (event.fLocalArray)->GetEntriesFast(); index++) {
111 {new ((*fLocalArray)[fLocalArray->GetEntriesFast()])
112 AliMUONLocalStruct(*(AliMUONLocalStruct*)(event.fLocalArray)->At(index));}
113 }
114}
115
116//___________________________________________
117AliMUONRegHeader& AliMUONRegHeader::operator=(const AliMUONRegHeader& event)
118{
119 ///
120 /// assignment operator
121 ///
122
123 if (this == &event) return *this;
124
125 fDarcWord = event.fDarcWord;
126 fWord = event.fWord;
127 fClk = event.fClk;
128 fHold = event.fHold;
129 fL0 = event.fL0;
130 fMask = event.fMask;
131
132 fInput[0] = event.fInput[0];
133 fInput[1] = event.fInput[1];
134
135 for (Int_t i = 0; i < 8; i++)
136 fScaler[i] = event.fScaler[i];
137
138 fLocalArray = new TClonesArray("AliMUONLocalStruct", 16);
139 for (Int_t index = 0; index < (event.fLocalArray)->GetEntriesFast(); index++) {
140 {new ((*fLocalArray)[fLocalArray->GetEntriesFast()])
141 AliMUONLocalStruct(*(AliMUONLocalStruct*)(event.fLocalArray)->At(index));}
142 }
143
144 return *this;
145}
146
147//___________________________________________
148void AliMUONRegHeader::SetScalersNumbers()
149{
150 /// set numbers for scaler events for Regional header
151 /// since this is provided by the experiment
152 /// put dummy numbers to check the monitoring
153
154 fClk = 10000;
155 fHold = 100;
156
157 for (Int_t i = 0; i < 8; i++)
158 fScaler[i] = i;
159}
160
161//___________________________________________
162void AliMUONRegHeader::Clear(Option_t* )
163{
164 /// Clear TClones arrays
165 /// instead of deleting
166 ///
167 fLocalArray->Clear("C");
168
169}