]>
Commit | Line | Data |
---|---|---|
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$ */ |
17 | ||
32def6aa | 18 | #include "AliMUONRegHeader.h" |
19 | #include "AliMUONLocalStruct.h" | |
20 | ||
32def6aa | 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 | ||
13985652 | 28 | /// \cond CLASSIMP |
32def6aa | 29 | ClassImp(AliMUONRegHeader) |
13985652 | 30 | /// \endcond |
32def6aa | 31 | |
d622a0ec | 32 | const Int_t AliMUONRegHeader::fgkHeaderLength = 5; |
33 | const Int_t AliMUONRegHeader::fgkScalerLength = 10; | |
32def6aa | 34 | const UInt_t AliMUONRegHeader::fgkEndOfReg = 0xBEEFFACE; |
35 | ||
36 | //___________________________________________ | |
37 | AliMUONRegHeader::AliMUONRegHeader() | |
38 | : TObject(), | |
00f56161 | 39 | fDarcWord(0), |
32def6aa | 40 | fWord(0), |
d622a0ec | 41 | fL0Mask(0), |
32def6aa | 42 | fClk(0), |
43 | fHold(0) | |
44 | ||
45 | { | |
46 | // | |
47 | // ctor | |
48 | // | |
49 | fInput[0] = fInput[1] = 0; | |
50 | ||
51 | for (Int_t i = 0; i < 8; i++) | |
52 | fScaler[i] = 0; | |
53 | ||
54 | fLocalArray = new TClonesArray("AliMUONLocalStruct",16); | |
55 | ||
56 | } | |
57 | ||
58 | //___________________________________________ | |
59 | AliMUONRegHeader::~AliMUONRegHeader() | |
60 | { | |
61 | // | |
62 | // dtor | |
63 | // | |
64 | fLocalArray->Delete(); | |
65 | delete fLocalArray; | |
66 | } | |
67 | ||
68 | //___________________________________________ | |
69 | AliMUONRegHeader::AliMUONRegHeader(const AliMUONRegHeader& event) | |
70 | : TObject(event) | |
71 | { | |
72 | // | |
73 | // copy ctor | |
74 | // | |
00f56161 | 75 | fDarcWord = event.fDarcWord; |
76 | fWord = event.fWord; | |
00f56161 | 77 | fClk = event.fClk; |
78 | fHold = event.fHold; | |
d622a0ec | 79 | fL0Mask = event.fL0Mask; |
32def6aa | 80 | |
81 | fInput[0] = event.fInput[0]; | |
82 | fInput[1] = event.fInput[1]; | |
83 | ||
84 | for (Int_t i = 0; i < 8; i++) | |
85 | fScaler[i] = event.fScaler[i]; | |
86 | ||
87 | fLocalArray = new TClonesArray("AliMUONLocalStruct", 16); | |
88 | for (Int_t index = 0; index < (event.fLocalArray)->GetEntriesFast(); index++) { | |
89 | {new ((*fLocalArray)[fLocalArray->GetEntriesFast()]) | |
90 | AliMUONLocalStruct(*(AliMUONLocalStruct*)(event.fLocalArray)->At(index));} | |
91 | } | |
92 | } | |
93 | ||
94 | //___________________________________________ | |
95 | AliMUONRegHeader& AliMUONRegHeader::operator=(const AliMUONRegHeader& event) | |
96 | { | |
97 | // | |
98 | // assignment operator | |
99 | // | |
100 | ||
101 | if (this == &event) return *this; | |
102 | ||
00f56161 | 103 | fDarcWord = event.fDarcWord; |
104 | fWord = event.fWord; | |
00f56161 | 105 | fClk = event.fClk; |
106 | fHold = event.fHold; | |
d622a0ec | 107 | fL0Mask = event.fL0Mask; |
32def6aa | 108 | |
109 | fInput[0] = event.fInput[0]; | |
110 | fInput[1] = event.fInput[1]; | |
111 | ||
112 | for (Int_t i = 0; i < 8; i++) | |
113 | fScaler[i] = event.fScaler[i]; | |
114 | ||
115 | fLocalArray = new TClonesArray("AliMUONLocalStruct", 16); | |
116 | for (Int_t index = 0; index < (event.fLocalArray)->GetEntriesFast(); index++) { | |
117 | {new ((*fLocalArray)[fLocalArray->GetEntriesFast()]) | |
118 | AliMUONLocalStruct(*(AliMUONLocalStruct*)(event.fLocalArray)->At(index));} | |
119 | } | |
120 | ||
121 | return *this; | |
122 | } | |
123 | ||
124 | //___________________________________________ | |
125 | void AliMUONRegHeader::SetScalersNumbers() | |
126 | { | |
127 | // set numbers for scaler events for Regional header | |
128 | // since this is provided by the experiment | |
129 | // put dummy numbers to check the monitoring | |
130 | ||
32def6aa | 131 | fClk = 10000; |
132 | fHold = 100; | |
133 | ||
134 | for (Int_t i = 0; i < 8; i++) | |
135 | fScaler[i] = i; | |
136 | } | |
137 | ||
138 | //___________________________________________ | |
139 | void AliMUONRegHeader::Clear(Option_t* ) | |
140 | { | |
141 | // Clear TClones arrays | |
142 | // instead of deleting | |
143 | // | |
144 | fLocalArray->Clear("C"); | |
145 | ||
146 | } |