]>
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 "AliMUONBlockHeader.h" | |
19 | #include "AliMUONDspHeader.h" | |
20 | ||
21 | #include <Riostream.h> | |
22 | ||
23 | //----------------------------------------------------------------------------- | |
24 | /// \class AliMUONBlockHeader | |
25 | /// Block structure for tracker raw data | |
26 | /// each DDL contains two blocks, | |
27 | /// each block contains at most 5 dsp structure. | |
28 | /// Beside the total length and length of the below data | |
29 | /// the header of the block contains the front end DSP id, trigger words and paddind word | |
30 | /// | |
31 | /// \author Christian Finck | |
32 | //----------------------------------------------------------------------------- | |
33 | ||
34 | /// \cond CLASSIMP | |
35 | ClassImp(AliMUONBlockHeader) | |
36 | /// \endcond | |
37 | ||
38 | const Int_t AliMUONBlockHeader::fgkHeaderLength = 8; | |
39 | const UInt_t AliMUONBlockHeader::fgkDefaultDataKey = 0xFC0000FC; | |
40 | const UInt_t AliMUONBlockHeader::fgkDdlDataKey = 0xD000000D; | |
41 | ||
42 | //___________________________________________ | |
43 | AliMUONBlockHeader::AliMUONBlockHeader(TRootIOCtor* /*dummy*/) | |
44 | : TObject(), | |
45 | fDataKey(0), | |
46 | fTotalLength(0), | |
47 | fLength(0), | |
48 | fDspId(0), | |
49 | fL0Trigger(0), | |
50 | fMiniEventId(0), | |
51 | fEventId1(0), | |
52 | fEventId2(0), | |
53 | fDspHeaderArray(0x0) | |
54 | { | |
55 | /// | |
56 | /// ctor | |
57 | /// | |
58 | ||
59 | } | |
60 | ||
61 | //___________________________________________ | |
62 | AliMUONBlockHeader::AliMUONBlockHeader() | |
63 | : TObject(), | |
64 | fDataKey(0), | |
65 | fTotalLength(0), | |
66 | fLength(0), | |
67 | fDspId(0), | |
68 | fL0Trigger(0), | |
69 | fMiniEventId(0), | |
70 | fEventId1(0), | |
71 | fEventId2(0), | |
72 | fDspHeaderArray(new TClonesArray("AliMUONDspHeader", 5)) | |
73 | ||
74 | { | |
75 | /// | |
76 | /// ctor | |
77 | /// | |
78 | ||
79 | } | |
80 | ||
81 | //___________________________________________ | |
82 | AliMUONBlockHeader::~AliMUONBlockHeader() | |
83 | { | |
84 | /// | |
85 | /// dtor | |
86 | /// | |
87 | fDspHeaderArray->Delete(); | |
88 | delete fDspHeaderArray; | |
89 | } | |
90 | ||
91 | //___________________________________________ | |
92 | AliMUONBlockHeader::AliMUONBlockHeader(const AliMUONBlockHeader& event) | |
93 | : TObject(event), | |
94 | fDataKey(event.fDataKey), | |
95 | fTotalLength(event.fTotalLength), | |
96 | fLength(event.fLength), | |
97 | fDspId(event.fDspId), | |
98 | fL0Trigger(event.fL0Trigger), | |
99 | fMiniEventId(event.fMiniEventId), | |
100 | fEventId1(event.fEventId1), | |
101 | fEventId2(event.fEventId2), | |
102 | fDspHeaderArray(new TClonesArray("AliMUONDspHeader", 5)) | |
103 | { | |
104 | /// | |
105 | /// copy ctor | |
106 | /// | |
107 | ||
108 | for (Int_t index = 0; index < (event.fDspHeaderArray)->GetEntriesFast(); index++) { | |
109 | {new ((*fDspHeaderArray)[fDspHeaderArray->GetEntriesFast()]) | |
110 | AliMUONDspHeader(*(AliMUONDspHeader*)(event.fDspHeaderArray)->At(index));} | |
111 | } | |
112 | // fDspHeaderArray->SetOwner(); | |
113 | } | |
114 | ||
115 | //___________________________________________ | |
116 | AliMUONBlockHeader& | |
117 | AliMUONBlockHeader::operator=(const AliMUONBlockHeader &event) | |
118 | { | |
119 | /// | |
120 | /// assignment operator | |
121 | /// | |
122 | if (this == &event) return *this; | |
123 | ||
124 | fDataKey = event.fDataKey; | |
125 | fTotalLength = event.fTotalLength; | |
126 | fLength = event.fLength; | |
127 | fDspId = event.fDspId; | |
128 | ||
129 | fL0Trigger = event.fL0Trigger; | |
130 | fMiniEventId = event.fMiniEventId; | |
131 | fEventId1 = event.fEventId1; | |
132 | fEventId2 = event.fEventId2; | |
133 | ||
134 | fDspHeaderArray = new TClonesArray("AliMUONDspHeader", 5); | |
135 | for (Int_t index = 0; index < (event.fDspHeaderArray)->GetEntriesFast(); index++) { | |
136 | new ((*fDspHeaderArray)[fDspHeaderArray->GetEntriesFast()]) | |
137 | AliMUONDspHeader(*(AliMUONDspHeader*)(event.fDspHeaderArray)->At(index)); | |
138 | } | |
139 | ||
140 | return *this; | |
141 | ||
142 | } | |
143 | //___________________________________________ | |
144 | void AliMUONBlockHeader::AddDspHeader(const AliMUONDspHeader& dspHeader) | |
145 | { | |
146 | /// | |
147 | /// adding the dsp structure | |
148 | /// into the TClonesArray | |
149 | /// | |
150 | TClonesArray &dspArray = *fDspHeaderArray; | |
151 | new(dspArray[dspArray.GetEntriesFast()]) AliMUONDspHeader(dspHeader); | |
152 | ||
153 | } | |
154 | //___________________________________________ | |
155 | void AliMUONBlockHeader::Clear(Option_t* ) | |
156 | { | |
157 | /// Clear TClones arrays | |
158 | /// instead of deleting | |
159 | /// | |
160 | fDspHeaderArray->Clear("C"); | |
161 | ||
162 | } | |
163 | ||
164 | //___________________________________________ | |
165 | void AliMUONBlockHeader::Print(Option_t* /*opt*/) const | |
166 | { | |
167 | /// print out | |
168 | ||
169 | cout << "CRT info" << endl; | |
170 | cout << "DataKey: " << fDataKey << endl; | |
171 | cout << "TotalLength: " << fTotalLength << endl; | |
172 | cout << "Length: " << fLength << endl; | |
173 | cout << "DspId: " << fDspId << endl; | |
174 | ||
175 | cout << "L0Trigger: " << fL0Trigger << endl; | |
176 | cout << "MiniEventId: " << fMiniEventId<< endl; | |
177 | cout << "EventId1: " << fEventId1 << endl; | |
178 | cout << "EventId2: " << fEventId2 << endl;; | |
179 | ||
180 | } |