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