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 /// \class AliMUONDspHeader
23 /// DSP structure for tracker raw data.
24 /// Each block contains at most 5 Dsp structures.
25 /// Beside the total length and length of the below data
26 /// the header of the Dsp contains the front end DSP id, trigger words
27 /// and event word (1 for nb of word is odd and 0 if not
29 /// \author Christian Finck
32 ClassImp(AliMUONDspHeader)
35 const Int_t AliMUONDspHeader::fgkHeaderLength = 10;
36 const UInt_t AliMUONDspHeader::fgkDefaultDataKey = 0xF000000F;
37 const UInt_t AliMUONDspHeader::fgkDefaultPaddingWord = 0xBEEFFACE;
39 //___________________________________________
40 AliMUONDspHeader::AliMUONDspHeader()
52 fBusPatchArray(new TClonesArray("AliMUONBusStruct",5))
60 //___________________________________________
61 AliMUONDspHeader::~AliMUONDspHeader()
66 fBusPatchArray->Delete();
67 delete fBusPatchArray;
70 //___________________________________________
71 AliMUONDspHeader::AliMUONDspHeader(const AliMUONDspHeader& event)
73 fDataKey(event.fDataKey),
74 fTotalLength(event.fTotalLength),
75 fLength(event.fLength),
77 fBlkL1ATrigger(event.fBlkL1ATrigger),
78 fMiniEventId(event.fMiniEventId),
79 fL1ATrigger(event.fL1ATrigger),
80 fL1RTrigger(event.fL1RTrigger),
81 fPaddingWord(event.fPaddingWord),
82 fErrorWord(event.fErrorWord),
83 fBusPatchArray(new TClonesArray("AliMUONBusStruct", 5))
89 for (Int_t index = 0; index < (event.fBusPatchArray)->GetEntriesFast(); index++) {
90 {new ((*fBusPatchArray)[fBusPatchArray->GetEntriesFast()])
91 AliMUONBusStruct(*(AliMUONBusStruct*)(event.fBusPatchArray)->At(index));}
93 // fBusPatchArray->SetOwner();
97 //___________________________________________
98 AliMUONDspHeader& AliMUONDspHeader::operator=(const AliMUONDspHeader& event)
101 /// assignemnt constructor
103 if (this == &event) return *this;
105 fDataKey = event.fDataKey;
106 fTotalLength = event.fTotalLength;
107 fLength = event.fLength;
108 fDspId = event.fDspId;
109 fBlkL1ATrigger = event.fBlkL1ATrigger;
110 fMiniEventId = event.fMiniEventId;
111 fL1ATrigger = event.fL1ATrigger;
112 fL1RTrigger = event.fL1RTrigger;
113 fPaddingWord = event.fPaddingWord;
114 fErrorWord = event.fErrorWord;
117 fBusPatchArray = new TClonesArray("AliMUONBusStruct", 5);
118 for (Int_t index = 0; index < (event.fBusPatchArray)->GetEntriesFast(); index++) {
119 {new ((*fBusPatchArray)[fBusPatchArray->GetEntriesFast()])
120 AliMUONBusStruct(*(AliMUONBusStruct*)(event.fBusPatchArray)->At(index));}
124 //___________________________________________
125 void AliMUONDspHeader::AddBusPatch(const AliMUONBusStruct& busPatch)
128 /// adding buspatch info
129 /// into TClonesArray
131 TClonesArray &eventArray = *fBusPatchArray;
132 new(eventArray[eventArray.GetEntriesFast()]) AliMUONBusStruct(busPatch);
134 //___________________________________________
135 void AliMUONDspHeader::Clear(Option_t* )
137 /// Clear TClones arrays
138 /// instead of deleting
140 fBusPatchArray->Clear("C");
144 //___________________________________________
145 void AliMUONDspHeader::Print(Option_t* /*opt*/) const
149 cout << "FRT info" << endl;
150 cout << "DataKey: " << fDataKey << endl;
151 cout << "TotalLength: " << fTotalLength << endl;
152 cout << "Length : " << fLength << endl;
153 cout << "DspId: " << fDspId << endl;
154 cout << "BlkL1ATrigger: " << fBlkL1ATrigger << endl;
155 cout << "MiniEventId: " << fMiniEventId << endl;
156 cout << "L1ATrigger: " << fL1ATrigger << endl;
157 cout << "L1RTrigger: " << fL1RTrigger << endl;
158 cout << "PaddingWord: " << fPaddingWord << endl;
159 cout << "ErrorWord: " << fErrorWord << endl;