Make the Scan method public
[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
23379754 54 fInput[0] = fInput[1] = 0;
55
56 for (Int_t i = 0; i < 8; i++)
57 fScaler[i] = 0;
ce350193 58}
59
60//___________________________________________
32def6aa 61AliMUONRegHeader::AliMUONRegHeader()
62 : TObject(),
00f56161 63 fDarcWord(0),
32def6aa 64 fWord(0),
bebe0279 65 fMask(0),
66 fL0(0),
32def6aa 67 fClk(0),
9f5dcca3 68 fHold(0),
69 fLocalArray(new TClonesArray("AliMUONLocalStruct",16))
32def6aa 70{
00e86732 71 /// ctor
72
32def6aa 73 fInput[0] = fInput[1] = 0;
74
75 for (Int_t i = 0; i < 8; i++)
76 fScaler[i] = 0;
77
32def6aa 78}
79
80//___________________________________________
81AliMUONRegHeader::~AliMUONRegHeader()
82{
00e86732 83 /// dtor
84
32def6aa 85 fLocalArray->Delete();
86 delete fLocalArray;
87}
88
89//___________________________________________
90AliMUONRegHeader::AliMUONRegHeader(const AliMUONRegHeader& event)
9f5dcca3 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))
32def6aa 99{
00e86732 100 ///
101 /// copy ctor
102 ///
32def6aa 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
32def6aa 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{
00e86732 119 ///
120 /// assignment operator
121 ///
32def6aa 122
123 if (this == &event) return *this;
124
00f56161 125 fDarcWord = event.fDarcWord;
126 fWord = event.fWord;
00f56161 127 fClk = event.fClk;
128 fHold = event.fHold;
bebe0279 129 fL0 = event.fL0;
130 fMask = event.fMask;
32def6aa 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{
00e86732 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
32def6aa 153
32def6aa 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{
00e86732 164 /// Clear TClones arrays
165 /// instead of deleting
166 ///
32def6aa 167 fLocalArray->Clear("C");
168
169}