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