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