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