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