Adding PiKP-only histograms and eliminating a number of switches where histograms...
[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//___________________________________________
ce350193 42AliMUONDspHeader::AliMUONDspHeader(TRootIOCtor* /*dummy*/)
43: TObject(),
44fDataKey(0),
45fTotalLength(0),
46fLength(0),
47fDspId(0),
48fBlkL1ATrigger(0),
49fMiniEventId(0),
50fL1ATrigger(0),
51fL1RTrigger(0),
52fPaddingWord(0),
53fErrorWord(0),
54fBusPatchArray(0x0)
55{
56 ///
57 ///ctor
58 ///
59
60}
61
62//___________________________________________
47c194a6 63AliMUONDspHeader::AliMUONDspHeader()
64 : TObject(),
84ceeb06 65 fDataKey(0),
47c194a6 66 fTotalLength(0),
67 fLength(0),
68 fDspId(0),
84ceeb06 69 fBlkL1ATrigger(0),
70 fMiniEventId(0),
71 fL1ATrigger(0),
72 fL1RTrigger(0),
73 fPaddingWord(0),
9f5dcca3 74 fErrorWord(0),
75 fBusPatchArray(new TClonesArray("AliMUONBusStruct",5))
47c194a6 76{
00e86732 77 ///
78 ///ctor
79 ///
47c194a6 80
47c194a6 81}
82
83//___________________________________________
84AliMUONDspHeader::~AliMUONDspHeader()
85{
00e86732 86 ///
87 /// dtr
88 ///
47c194a6 89 fBusPatchArray->Delete();
90 delete fBusPatchArray;
91}
92
93//___________________________________________
94AliMUONDspHeader::AliMUONDspHeader(const AliMUONDspHeader& event)
9f5dcca3 95 : TObject(event),
96 fDataKey(event.fDataKey),
97 fTotalLength(event.fTotalLength),
98 fLength(event.fLength),
99 fDspId(event.fDspId),
100 fBlkL1ATrigger(event.fBlkL1ATrigger),
101 fMiniEventId(event.fMiniEventId),
102 fL1ATrigger(event.fL1ATrigger),
103 fL1RTrigger(event.fL1RTrigger),
104 fPaddingWord(event.fPaddingWord),
105 fErrorWord(event.fErrorWord),
106 fBusPatchArray(new TClonesArray("AliMUONBusStruct", 5))
47c194a6 107{
00e86732 108 ///
109 /// copy constructor
110 ///
47c194a6 111
47c194a6 112 for (Int_t index = 0; index < (event.fBusPatchArray)->GetEntriesFast(); index++) {
113 {new ((*fBusPatchArray)[fBusPatchArray->GetEntriesFast()])
114 AliMUONBusStruct(*(AliMUONBusStruct*)(event.fBusPatchArray)->At(index));}
115 }
116 // fBusPatchArray->SetOwner();
117
118}
119
120//___________________________________________
121AliMUONDspHeader& AliMUONDspHeader::operator=(const AliMUONDspHeader& event)
122{
00e86732 123 ///
124 /// assignemnt constructor
125 ///
47c194a6 126 if (this == &event) return *this;
127
9f5dcca3 128 fDataKey = event.fDataKey;
129 fTotalLength = event.fTotalLength;
130 fLength = event.fLength;
131 fDspId = event.fDspId;
84ceeb06 132 fBlkL1ATrigger = event.fBlkL1ATrigger;
133 fMiniEventId = event.fMiniEventId;
134 fL1ATrigger = event.fL1ATrigger;
135 fL1RTrigger = event.fL1RTrigger;
136 fPaddingWord = event.fPaddingWord;
137 fErrorWord = event.fErrorWord;
47c194a6 138
47c194a6 139
140 fBusPatchArray = new TClonesArray("AliMUONBusStruct", 5);
141 for (Int_t index = 0; index < (event.fBusPatchArray)->GetEntriesFast(); index++) {
142 {new ((*fBusPatchArray)[fBusPatchArray->GetEntriesFast()])
143 AliMUONBusStruct(*(AliMUONBusStruct*)(event.fBusPatchArray)->At(index));}
144 }
145 return *this;
146}
147//___________________________________________
148void AliMUONDspHeader::AddBusPatch(const AliMUONBusStruct& busPatch)
149{
00e86732 150 ///
151 /// adding buspatch info
152 /// into TClonesArray
153 ///
47c194a6 154 TClonesArray &eventArray = *fBusPatchArray;
155 new(eventArray[eventArray.GetEntriesFast()]) AliMUONBusStruct(busPatch);
156}
157//___________________________________________
158void AliMUONDspHeader::Clear(Option_t* )
159{
00e86732 160 /// Clear TClones arrays
161 /// instead of deleting
162 ///
47c194a6 163 fBusPatchArray->Clear("C");
164
165}
1ed3c5c2 166
167//___________________________________________
168void AliMUONDspHeader::Print(Option_t* /*opt*/) const
169{
170 /// print out
171
172 cout << "FRT info" << endl;
173 cout << "DataKey: " << fDataKey << endl;
174 cout << "TotalLength: " << fTotalLength << endl;
175 cout << "Length : " << fLength << endl;
176 cout << "DspId: " << fDspId << endl;
177 cout << "BlkL1ATrigger: " << fBlkL1ATrigger << endl;
178 cout << "MiniEventId: " << fMiniEventId << endl;
179 cout << "L1ATrigger: " << fL1ATrigger << endl;
180 cout << "L1RTrigger: " << fL1RTrigger << endl;
181 cout << "PaddingWord: " << fPaddingWord << endl;
182 cout << "ErrorWord: " << fErrorWord << endl;
183
184}