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