- Adding check and flagging for HG present
[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
13985652 33/// \cond CLASSIMP
47c194a6 34ClassImp(AliMUONDspHeader)
13985652 35/// \endcond
47c194a6 36
84ceeb06 37 const Int_t AliMUONDspHeader::fgkHeaderLength = 10;
38 const UInt_t AliMUONDspHeader::fgkDefaultDataKey = 0xF000000F;
39 const UInt_t AliMUONDspHeader::fgkDefaultPaddingWord = 0xBEEFFACE;
47c194a6 40
41//___________________________________________
42AliMUONDspHeader::AliMUONDspHeader()
43 : TObject(),
84ceeb06 44 fDataKey(0),
47c194a6 45 fTotalLength(0),
46 fLength(0),
47 fDspId(0),
84ceeb06 48 fBlkL1ATrigger(0),
49 fMiniEventId(0),
50 fL1ATrigger(0),
51 fL1RTrigger(0),
52 fPaddingWord(0),
9f5dcca3 53 fErrorWord(0),
54 fBusPatchArray(new TClonesArray("AliMUONBusStruct",5))
47c194a6 55{
00e86732 56 ///
57 ///ctor
58 ///
47c194a6 59
47c194a6 60}
61
62//___________________________________________
63AliMUONDspHeader::~AliMUONDspHeader()
64{
00e86732 65 ///
66 /// dtr
67 ///
47c194a6 68 fBusPatchArray->Delete();
69 delete fBusPatchArray;
70}
71
72//___________________________________________
73AliMUONDspHeader::AliMUONDspHeader(const AliMUONDspHeader& event)
9f5dcca3 74 : TObject(event),
75 fDataKey(event.fDataKey),
76 fTotalLength(event.fTotalLength),
77 fLength(event.fLength),
78 fDspId(event.fDspId),
79 fBlkL1ATrigger(event.fBlkL1ATrigger),
80 fMiniEventId(event.fMiniEventId),
81 fL1ATrigger(event.fL1ATrigger),
82 fL1RTrigger(event.fL1RTrigger),
83 fPaddingWord(event.fPaddingWord),
84 fErrorWord(event.fErrorWord),
85 fBusPatchArray(new TClonesArray("AliMUONBusStruct", 5))
47c194a6 86{
00e86732 87 ///
88 /// copy constructor
89 ///
47c194a6 90
47c194a6 91 for (Int_t index = 0; index < (event.fBusPatchArray)->GetEntriesFast(); index++) {
92 {new ((*fBusPatchArray)[fBusPatchArray->GetEntriesFast()])
93 AliMUONBusStruct(*(AliMUONBusStruct*)(event.fBusPatchArray)->At(index));}
94 }
95 // fBusPatchArray->SetOwner();
96
97}
98
99//___________________________________________
100AliMUONDspHeader& AliMUONDspHeader::operator=(const AliMUONDspHeader& event)
101{
00e86732 102 ///
103 /// assignemnt constructor
104 ///
47c194a6 105 if (this == &event) return *this;
106
9f5dcca3 107 fDataKey = event.fDataKey;
108 fTotalLength = event.fTotalLength;
109 fLength = event.fLength;
110 fDspId = event.fDspId;
84ceeb06 111 fBlkL1ATrigger = event.fBlkL1ATrigger;
112 fMiniEventId = event.fMiniEventId;
113 fL1ATrigger = event.fL1ATrigger;
114 fL1RTrigger = event.fL1RTrigger;
115 fPaddingWord = event.fPaddingWord;
116 fErrorWord = event.fErrorWord;
47c194a6 117
47c194a6 118
119 fBusPatchArray = new TClonesArray("AliMUONBusStruct", 5);
120 for (Int_t index = 0; index < (event.fBusPatchArray)->GetEntriesFast(); index++) {
121 {new ((*fBusPatchArray)[fBusPatchArray->GetEntriesFast()])
122 AliMUONBusStruct(*(AliMUONBusStruct*)(event.fBusPatchArray)->At(index));}
123 }
124 return *this;
125}
126//___________________________________________
127void AliMUONDspHeader::AddBusPatch(const AliMUONBusStruct& busPatch)
128{
00e86732 129 ///
130 /// adding buspatch info
131 /// into TClonesArray
132 ///
47c194a6 133 TClonesArray &eventArray = *fBusPatchArray;
134 new(eventArray[eventArray.GetEntriesFast()]) AliMUONBusStruct(busPatch);
135}
136//___________________________________________
137void AliMUONDspHeader::Clear(Option_t* )
138{
00e86732 139 /// Clear TClones arrays
140 /// instead of deleting
141 ///
47c194a6 142 fBusPatchArray->Clear("C");
143
144}
1ed3c5c2 145
146//___________________________________________
147void AliMUONDspHeader::Print(Option_t* /*opt*/) const
148{
149 /// print out
150
151 cout << "FRT info" << endl;
152 cout << "DataKey: " << fDataKey << endl;
153 cout << "TotalLength: " << fTotalLength << endl;
154 cout << "Length : " << fLength << endl;
155 cout << "DspId: " << fDspId << endl;
156 cout << "BlkL1ATrigger: " << fBlkL1ATrigger << endl;
157 cout << "MiniEventId: " << fMiniEventId << endl;
158 cout << "L1ATrigger: " << fL1ATrigger << endl;
159 cout << "L1RTrigger: " << fL1RTrigger << endl;
160 cout << "PaddingWord: " << fPaddingWord << endl;
161 cout << "ErrorWord: " << fErrorWord << endl;
162
163}