]>
Commit | Line | Data |
---|---|---|
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 | /* $Id$ */ | |
17 | ||
18 | #include <TClonesArray.h> | |
19 | ||
20 | #include "AliMUONRegHeader.h" | |
21 | #include "AliMUONLocalStruct.h" | |
22 | ||
23 | //----------------------------------------------------------------------------- | |
24 | /// \class AliMUONRegHeader | |
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 | /// | |
30 | /// \author Christian Finck | |
31 | //----------------------------------------------------------------------------- | |
32 | ||
33 | /// \cond CLASSIMP | |
34 | ClassImp(AliMUONRegHeader) | |
35 | /// \endcond | |
36 | ||
37 | const Int_t AliMUONRegHeader::fgkHeaderLength = 5; | |
38 | const Int_t AliMUONRegHeader::fgkScalerLength = 10; | |
39 | const UInt_t AliMUONRegHeader::fgkEndOfReg = 0xBEEFFACE; | |
40 | const UInt_t AliMUONRegHeader::fgkErrorWord = 0xCAFEDEAD; | |
41 | ||
42 | //___________________________________________ | |
43 | AliMUONRegHeader::AliMUONRegHeader() | |
44 | : TObject(), | |
45 | fDarcWord(0), | |
46 | fWord(0), | |
47 | fMask(0), | |
48 | fL0(0), | |
49 | fClk(0), | |
50 | fHold(0), | |
51 | fLocalArray(new TClonesArray("AliMUONLocalStruct",16)) | |
52 | { | |
53 | /// ctor | |
54 | ||
55 | fInput[0] = fInput[1] = 0; | |
56 | ||
57 | for (Int_t i = 0; i < 8; i++) | |
58 | fScaler[i] = 0; | |
59 | ||
60 | } | |
61 | ||
62 | //___________________________________________ | |
63 | AliMUONRegHeader::~AliMUONRegHeader() | |
64 | { | |
65 | /// dtor | |
66 | ||
67 | fLocalArray->Delete(); | |
68 | delete fLocalArray; | |
69 | } | |
70 | ||
71 | //___________________________________________ | |
72 | AliMUONRegHeader::AliMUONRegHeader(const AliMUONRegHeader& event) | |
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)) | |
81 | { | |
82 | /// | |
83 | /// copy ctor | |
84 | /// | |
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 | ||
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 | { | |
101 | /// | |
102 | /// assignment operator | |
103 | /// | |
104 | ||
105 | if (this == &event) return *this; | |
106 | ||
107 | fDarcWord = event.fDarcWord; | |
108 | fWord = event.fWord; | |
109 | fClk = event.fClk; | |
110 | fHold = event.fHold; | |
111 | fL0 = event.fL0; | |
112 | fMask = event.fMask; | |
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 | { | |
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 | |
135 | ||
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 | { | |
146 | /// Clear TClones arrays | |
147 | /// instead of deleting | |
148 | /// | |
149 | fLocalArray->Clear("C"); | |
150 | ||
151 | } |