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