Fixes for #86059: Install data when ALICE_ROOT does not point to source (Christian)
[u/mrichter/AliRoot.git] / MUON / AliMUONBlockHeader.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 "AliMUONBlockHeader.h"
19#include "AliMUONDspHeader.h"
20
1ed3c5c2 21#include <Riostream.h>
22
3d1463c8 23//-----------------------------------------------------------------------------
00e86732 24/// \class AliMUONBlockHeader
47c194a6 25/// Block structure for tracker raw data
26/// each DDL contains two blocks,
27/// each block contains at most 5 dsp structure.
28/// Beside the total length and length of the below data
29/// the header of the block contains the front end DSP id, trigger words and paddind word
30///
00e86732 31/// \author Christian Finck
3d1463c8 32//-----------------------------------------------------------------------------
47c194a6 33
13985652 34/// \cond CLASSIMP
47c194a6 35ClassImp(AliMUONBlockHeader)
13985652 36/// \endcond
47c194a6 37
1c66abf3 38const Int_t AliMUONBlockHeader::fgkHeaderLength = 8;
84ceeb06 39const UInt_t AliMUONBlockHeader::fgkDefaultDataKey = 0xFC0000FC;
1c66abf3 40const UInt_t AliMUONBlockHeader::fgkDdlDataKey = 0xD000000D;
ce350193 41
42//___________________________________________
43AliMUONBlockHeader::AliMUONBlockHeader(TRootIOCtor* /*dummy*/)
44: TObject(),
45fDataKey(0),
46fTotalLength(0),
47fLength(0),
48fDspId(0),
49fL0Trigger(0),
50fMiniEventId(0),
51fEventId1(0),
52fEventId2(0),
53fDspHeaderArray(0x0)
54{
55 ///
56 /// ctor
57 ///
58
59}
60
47c194a6 61//___________________________________________
62AliMUONBlockHeader::AliMUONBlockHeader()
63 : TObject(),
84ceeb06 64 fDataKey(0),
47c194a6 65 fTotalLength(0),
66 fLength(0),
67 fDspId(0),
84ceeb06 68 fL0Trigger(0),
69 fMiniEventId(0),
70 fEventId1(0),
9f5dcca3 71 fEventId2(0),
72 fDspHeaderArray(new TClonesArray("AliMUONDspHeader", 5))
73
47c194a6 74{
00e86732 75 ///
76 /// ctor
77 ///
47c194a6 78
47c194a6 79}
80
81//___________________________________________
82AliMUONBlockHeader::~AliMUONBlockHeader()
83{
00e86732 84 ///
85 /// dtor
86 ///
47c194a6 87 fDspHeaderArray->Delete();
88 delete fDspHeaderArray;
89}
90
91//___________________________________________
92AliMUONBlockHeader::AliMUONBlockHeader(const AliMUONBlockHeader& event)
9f5dcca3 93 : TObject(event),
94 fDataKey(event.fDataKey),
95 fTotalLength(event.fTotalLength),
96 fLength(event.fLength),
97 fDspId(event.fDspId),
98 fL0Trigger(event.fL0Trigger),
99 fMiniEventId(event.fMiniEventId),
100 fEventId1(event.fEventId1),
101 fEventId2(event.fEventId2),
102 fDspHeaderArray(new TClonesArray("AliMUONDspHeader", 5))
47c194a6 103{
00e86732 104 ///
105 /// copy ctor
106 ///
84ceeb06 107
47c194a6 108 for (Int_t index = 0; index < (event.fDspHeaderArray)->GetEntriesFast(); index++) {
109 {new ((*fDspHeaderArray)[fDspHeaderArray->GetEntriesFast()])
110 AliMUONDspHeader(*(AliMUONDspHeader*)(event.fDspHeaderArray)->At(index));}
111 }
112 // fDspHeaderArray->SetOwner();
113}
114
115//___________________________________________
116AliMUONBlockHeader&
117AliMUONBlockHeader::operator=(const AliMUONBlockHeader &event)
118{
00e86732 119 ///
120 /// assignment operator
121 ///
47c194a6 122 if (this == &event) return *this;
123
1ed3c5c2 124 fDataKey = event.fDataKey;
47c194a6 125 fTotalLength = event.fTotalLength;
126 fLength = event.fLength;
127 fDspId = event.fDspId;
84ceeb06 128
129 fL0Trigger = event.fL0Trigger;
130 fMiniEventId = event.fMiniEventId;
131 fEventId1 = event.fEventId1;
132 fEventId2 = event.fEventId2;
47c194a6 133
134 fDspHeaderArray = new TClonesArray("AliMUONDspHeader", 5);
135 for (Int_t index = 0; index < (event.fDspHeaderArray)->GetEntriesFast(); index++) {
136 new ((*fDspHeaderArray)[fDspHeaderArray->GetEntriesFast()])
137 AliMUONDspHeader(*(AliMUONDspHeader*)(event.fDspHeaderArray)->At(index));
138 }
139
140 return *this;
141
142}
143//___________________________________________
144void AliMUONBlockHeader::AddDspHeader(const AliMUONDspHeader& dspHeader)
145{
00e86732 146 ///
147 /// adding the dsp structure
148 /// into the TClonesArray
149 ///
47c194a6 150 TClonesArray &dspArray = *fDspHeaderArray;
151 new(dspArray[dspArray.GetEntriesFast()]) AliMUONDspHeader(dspHeader);
152
153}
154//___________________________________________
155void AliMUONBlockHeader::Clear(Option_t* )
156{
00e86732 157 /// Clear TClones arrays
158 /// instead of deleting
159 ///
47c194a6 160 fDspHeaderArray->Clear("C");
161
162}
1ed3c5c2 163
164//___________________________________________
165void AliMUONBlockHeader::Print(Option_t* /*opt*/) const
166{
167 /// print out
168
169 cout << "CRT info" << endl;
170 cout << "DataKey: " << fDataKey << endl;
171 cout << "TotalLength: " << fTotalLength << endl;
172 cout << "Length: " << fLength << endl;
173 cout << "DspId: " << fDspId << endl;
174
175 cout << "L0Trigger: " << fL0Trigger << endl;
176 cout << "MiniEventId: " << fMiniEventId<< endl;
177 cout << "EventId1: " << fEventId1 << endl;
178 cout << "EventId2: " << fEventId2 << endl;;
179
180}