1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
18 #include "AliMUONDspHeader.h"
19 #include "AliMUONBusStruct.h"
20 #include <Riostream.h>
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
30 /// \author Christian Finck
31 //-----------------------------------------------------------------------------
36 ClassImp(AliMUONDspHeader)
39 const Int_t AliMUONDspHeader::fgkHeaderLength = 10;
40 const UInt_t AliMUONDspHeader::fgkDefaultDataKey = 0xF000000F;
41 const UInt_t AliMUONDspHeader::fgkDefaultPaddingWord = 0xBEEFFACE;
43 //___________________________________________
44 AliMUONDspHeader::AliMUONDspHeader(TRootIOCtor* /*dummy*/)
64 //___________________________________________
65 AliMUONDspHeader::AliMUONDspHeader()
77 fBusPatchArray(new TClonesArray("AliMUONBusStruct",5))
85 //___________________________________________
86 AliMUONDspHeader::~AliMUONDspHeader()
91 fBusPatchArray->Delete();
92 delete fBusPatchArray;
95 //___________________________________________
96 AliMUONDspHeader::AliMUONDspHeader(const AliMUONDspHeader& 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))
114 for (Int_t index = 0; index < (event.fBusPatchArray)->GetEntriesFast(); index++) {
115 {new ((*fBusPatchArray)[fBusPatchArray->GetEntriesFast()])
116 AliMUONBusStruct(*(AliMUONBusStruct*)(event.fBusPatchArray)->At(index));}
118 // fBusPatchArray->SetOwner();
122 //___________________________________________
123 AliMUONDspHeader& AliMUONDspHeader::operator=(const AliMUONDspHeader& event)
126 /// assignemnt constructor
128 if (this == &event) return *this;
130 fDataKey = event.fDataKey;
131 fTotalLength = event.fTotalLength;
132 fLength = event.fLength;
133 fDspId = event.fDspId;
134 fBlkL1ATrigger = event.fBlkL1ATrigger;
135 fMiniEventId = event.fMiniEventId;
136 fL1ATrigger = event.fL1ATrigger;
137 fL1RTrigger = event.fL1RTrigger;
138 fPaddingWord = event.fPaddingWord;
139 fErrorWord = event.fErrorWord;
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));}
149 //___________________________________________
150 void AliMUONDspHeader::AddBusPatch(const AliMUONBusStruct& busPatch)
153 /// adding buspatch info
154 /// into TClonesArray
156 TClonesArray &eventArray = *fBusPatchArray;
157 new(eventArray[eventArray.GetEntriesFast()]) AliMUONBusStruct(busPatch);
159 //___________________________________________
160 void AliMUONDspHeader::Clear(Option_t* )
162 /// Clear TClones arrays
163 /// instead of deleting
165 fBusPatchArray->Clear("C");
169 //___________________________________________
170 void AliMUONDspHeader::Print(Option_t* /*opt*/) const
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;