Line data Source code
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 "AliMUONDspHeader.h"
19 : #include "AliMUONBusStruct.h"
20 : #include <Riostream.h>
21 :
22 : //-----------------------------------------------------------------------------
23 : /// \class AliMUONDspHeader
24 : /// DSP structure for tracker raw data.
25 : /// Each block contains at most 5 Dsp structures.
26 : /// Beside the total length and length of the below data
27 : /// the header of the Dsp contains the front end DSP id, trigger words
28 : /// and event word (1 for nb of word is odd and 0 if not
29 : ///
30 : /// \author Christian Finck
31 : //-----------------------------------------------------------------------------
32 :
33 : using std::cout;
34 : using std::endl;
35 : /// \cond CLASSIMP
36 18 : ClassImp(AliMUONDspHeader)
37 : /// \endcond
38 :
39 : const Int_t AliMUONDspHeader::fgkHeaderLength = 10;
40 : const UInt_t AliMUONDspHeader::fgkDefaultDataKey = 0xF000000F;
41 : const UInt_t AliMUONDspHeader::fgkDefaultPaddingWord = 0xBEEFFACE;
42 :
43 : //___________________________________________
44 : AliMUONDspHeader::AliMUONDspHeader(TRootIOCtor* /*dummy*/)
45 0 : : TObject(),
46 0 : fDataKey(0),
47 0 : fTotalLength(0),
48 0 : fLength(0),
49 0 : fDspId(0),
50 0 : fBlkL1ATrigger(0),
51 0 : fMiniEventId(0),
52 0 : fL1ATrigger(0),
53 0 : fL1RTrigger(0),
54 0 : fPaddingWord(0),
55 0 : fErrorWord(0),
56 0 : fBusPatchArray(0x0)
57 0 : {
58 : ///
59 : ///ctor
60 : ///
61 :
62 0 : }
63 :
64 : //___________________________________________
65 : AliMUONDspHeader::AliMUONDspHeader()
66 1 : : TObject(),
67 1 : fDataKey(0),
68 1 : fTotalLength(0),
69 1 : fLength(0),
70 1 : fDspId(0),
71 1 : fBlkL1ATrigger(0),
72 1 : fMiniEventId(0),
73 1 : fL1ATrigger(0),
74 1 : fL1RTrigger(0),
75 1 : fPaddingWord(0),
76 1 : fErrorWord(0),
77 3 : fBusPatchArray(new TClonesArray("AliMUONBusStruct",5))
78 5 : {
79 : ///
80 : ///ctor
81 : ///
82 :
83 2 : }
84 :
85 : //___________________________________________
86 : AliMUONDspHeader::~AliMUONDspHeader()
87 6 : {
88 : ///
89 : /// dtr
90 : ///
91 1 : fBusPatchArray->Delete();
92 2 : delete fBusPatchArray;
93 3 : }
94 :
95 : //___________________________________________
96 : AliMUONDspHeader::AliMUONDspHeader(const AliMUONDspHeader& event)
97 0 : : TObject(event),
98 0 : fDataKey(event.fDataKey),
99 0 : fTotalLength(event.fTotalLength),
100 0 : fLength(event.fLength),
101 0 : fDspId(event.fDspId),
102 0 : fBlkL1ATrigger(event.fBlkL1ATrigger),
103 0 : fMiniEventId(event.fMiniEventId),
104 0 : fL1ATrigger(event.fL1ATrigger),
105 0 : fL1RTrigger(event.fL1RTrigger),
106 0 : fPaddingWord(event.fPaddingWord),
107 0 : fErrorWord(event.fErrorWord),
108 0 : fBusPatchArray(new TClonesArray("AliMUONBusStruct", 5))
109 0 : {
110 : ///
111 : /// copy constructor
112 : ///
113 :
114 0 : for (Int_t index = 0; index < (event.fBusPatchArray)->GetEntriesFast(); index++) {
115 0 : {new ((*fBusPatchArray)[fBusPatchArray->GetEntriesFast()])
116 0 : AliMUONBusStruct(*(AliMUONBusStruct*)(event.fBusPatchArray)->At(index));}
117 : }
118 : // fBusPatchArray->SetOwner();
119 :
120 0 : }
121 :
122 : //___________________________________________
123 : AliMUONDspHeader& AliMUONDspHeader::operator=(const AliMUONDspHeader& event)
124 : {
125 : ///
126 : /// assignemnt constructor
127 : ///
128 0 : if (this == &event) return *this;
129 :
130 0 : fDataKey = event.fDataKey;
131 0 : fTotalLength = event.fTotalLength;
132 0 : fLength = event.fLength;
133 0 : fDspId = event.fDspId;
134 0 : fBlkL1ATrigger = event.fBlkL1ATrigger;
135 0 : fMiniEventId = event.fMiniEventId;
136 0 : fL1ATrigger = event.fL1ATrigger;
137 0 : fL1RTrigger = event.fL1RTrigger;
138 0 : fPaddingWord = event.fPaddingWord;
139 0 : fErrorWord = event.fErrorWord;
140 :
141 :
142 0 : fBusPatchArray = new TClonesArray("AliMUONBusStruct", 5);
143 0 : for (Int_t index = 0; index < (event.fBusPatchArray)->GetEntriesFast(); index++) {
144 0 : {new ((*fBusPatchArray)[fBusPatchArray->GetEntriesFast()])
145 0 : AliMUONBusStruct(*(AliMUONBusStruct*)(event.fBusPatchArray)->At(index));}
146 : }
147 0 : return *this;
148 0 : }
149 : //___________________________________________
150 : void AliMUONDspHeader::AddBusPatch(const AliMUONBusStruct& busPatch)
151 : {
152 : ///
153 : /// adding buspatch info
154 : /// into TClonesArray
155 : ///
156 0 : TClonesArray &eventArray = *fBusPatchArray;
157 0 : new(eventArray[eventArray.GetEntriesFast()]) AliMUONBusStruct(busPatch);
158 0 : }
159 : //___________________________________________
160 : void AliMUONDspHeader::Clear(Option_t* )
161 : {
162 : /// Clear TClones arrays
163 : /// instead of deleting
164 : ///
165 0 : fBusPatchArray->Clear("C");
166 :
167 0 : }
168 :
169 : //___________________________________________
170 : void AliMUONDspHeader::Print(Option_t* /*opt*/) const
171 : {
172 : /// print out
173 :
174 0 : cout << "FRT info" << endl;
175 0 : cout << "DataKey: " << fDataKey << endl;
176 0 : cout << "TotalLength: " << fTotalLength << endl;
177 0 : cout << "Length : " << fLength << endl;
178 0 : cout << "DspId: " << fDspId << endl;
179 0 : cout << "BlkL1ATrigger: " << fBlkL1ATrigger << endl;
180 0 : cout << "MiniEventId: " << fMiniEventId << endl;
181 0 : cout << "L1ATrigger: " << fL1ATrigger << endl;
182 0 : cout << "L1RTrigger: " << fL1RTrigger << endl;
183 0 : cout << "PaddingWord: " << fPaddingWord << endl;
184 0 : cout << "ErrorWord: " << fErrorWord << endl;
185 :
186 0 : }
|