]> git.uio.no Git - u/mrichter/AliRoot.git/blame - MUON/AliMUONRegHeader.cxx
Updated to use the new CTP framework (Christian)
[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
16#include "AliMUONRegHeader.h"
17#include "AliMUONLocalStruct.h"
18
19
20
21///
22/// Regional structure for trigger raw data.
23/// Each Reg structure contains 16 (at most) local card structure.
24/// The structure includes the information of the Reg. boards and
25/// regional inputs
26///
27
28ClassImp(AliMUONRegHeader)
29
30 const Int_t AliMUONRegHeader::fgkHeaderLength = 3;
31 const Int_t AliMUONRegHeader::fgkScalerLength = 8;
32 const UInt_t AliMUONRegHeader::fgkEndOfReg = 0xBEEFFACE;
33
34//___________________________________________
35AliMUONRegHeader::AliMUONRegHeader()
36 : TObject(),
37 fWord(0),
38 fL0(0),
39 fClk(0),
40 fHold(0)
41
42{
43 //
44 // ctor
45 //
46 fInput[0] = fInput[1] = 0;
47
48 for (Int_t i = 0; i < 8; i++)
49 fScaler[i] = 0;
50
51 fLocalArray = new TClonesArray("AliMUONLocalStruct",16);
52
53}
54
55//___________________________________________
56AliMUONRegHeader::~AliMUONRegHeader()
57{
58 //
59 // dtor
60 //
61 fLocalArray->Delete();
62 delete fLocalArray;
63}
64
65//___________________________________________
66AliMUONRegHeader::AliMUONRegHeader(const AliMUONRegHeader& event)
67 : TObject(event)
68{
69 //
70 // copy ctor
71 //
72 fWord = event.fWord;
73 fL0 = event.fL0;
74 fClk = event.fClk;
75 fHold = event.fHold;
76
77 fInput[0] = event.fInput[0];
78 fInput[1] = event.fInput[1];
79
80 for (Int_t i = 0; i < 8; i++)
81 fScaler[i] = event.fScaler[i];
82
83 fLocalArray = new TClonesArray("AliMUONLocalStruct", 16);
84 for (Int_t index = 0; index < (event.fLocalArray)->GetEntriesFast(); index++) {
85 {new ((*fLocalArray)[fLocalArray->GetEntriesFast()])
86 AliMUONLocalStruct(*(AliMUONLocalStruct*)(event.fLocalArray)->At(index));}
87 }
88}
89
90//___________________________________________
91AliMUONRegHeader& AliMUONRegHeader::operator=(const AliMUONRegHeader& event)
92{
93 //
94 // assignment operator
95 //
96
97 if (this == &event) return *this;
98
99 fWord = event.fWord;
100 fL0 = event.fL0;
101 fClk = event.fClk;
102 fHold = event.fHold;
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 fLocalArray = new TClonesArray("AliMUONLocalStruct", 16);
111 for (Int_t index = 0; index < (event.fLocalArray)->GetEntriesFast(); index++) {
112 {new ((*fLocalArray)[fLocalArray->GetEntriesFast()])
113 AliMUONLocalStruct(*(AliMUONLocalStruct*)(event.fLocalArray)->At(index));}
114 }
115
116 return *this;
117}
118
119//___________________________________________
120void AliMUONRegHeader::SetScalersNumbers()
121{
122 // set numbers for scaler events for Regional header
123 // since this is provided by the experiment
124 // put dummy numbers to check the monitoring
125
126 fL0 = 1000;
127 fClk = 10000;
128 fHold = 100;
129
130 for (Int_t i = 0; i < 8; i++)
131 fScaler[i] = i;
132}
133
134//___________________________________________
135void AliMUONRegHeader::Clear(Option_t* )
136{
137 // Clear TClones arrays
138 // instead of deleting
139 //
140 fLocalArray->Clear("C");
141
142}