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 "AliMUONBlockHeader.h"
19 #include "AliMUONDspHeader.h"
21 #include <Riostream.h>
23 //-----------------------------------------------------------------------------
24 /// \class AliMUONBlockHeader
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
31 /// \author Christian Finck
32 //-----------------------------------------------------------------------------
37 ClassImp(AliMUONBlockHeader)
40 const Int_t AliMUONBlockHeader::fgkHeaderLength = 8;
41 const UInt_t AliMUONBlockHeader::fgkDefaultDataKey = 0xFC0000FC;
42 const UInt_t AliMUONBlockHeader::fgkDdlDataKey = 0xD000000D;
44 //___________________________________________
45 AliMUONBlockHeader::AliMUONBlockHeader(TRootIOCtor* /*dummy*/)
63 //___________________________________________
64 AliMUONBlockHeader::AliMUONBlockHeader()
74 fDspHeaderArray(new TClonesArray("AliMUONDspHeader", 5))
83 //___________________________________________
84 AliMUONBlockHeader::~AliMUONBlockHeader()
89 fDspHeaderArray->Delete();
90 delete fDspHeaderArray;
93 //___________________________________________
94 AliMUONBlockHeader::AliMUONBlockHeader(const AliMUONBlockHeader& event)
96 fDataKey(event.fDataKey),
97 fTotalLength(event.fTotalLength),
98 fLength(event.fLength),
100 fL0Trigger(event.fL0Trigger),
101 fMiniEventId(event.fMiniEventId),
102 fEventId1(event.fEventId1),
103 fEventId2(event.fEventId2),
104 fDspHeaderArray(new TClonesArray("AliMUONDspHeader", 5))
110 for (Int_t index = 0; index < (event.fDspHeaderArray)->GetEntriesFast(); index++) {
111 {new ((*fDspHeaderArray)[fDspHeaderArray->GetEntriesFast()])
112 AliMUONDspHeader(*(AliMUONDspHeader*)(event.fDspHeaderArray)->At(index));}
114 // fDspHeaderArray->SetOwner();
117 //___________________________________________
119 AliMUONBlockHeader::operator=(const AliMUONBlockHeader &event)
122 /// assignment operator
124 if (this == &event) return *this;
126 fDataKey = event.fDataKey;
127 fTotalLength = event.fTotalLength;
128 fLength = event.fLength;
129 fDspId = event.fDspId;
131 fL0Trigger = event.fL0Trigger;
132 fMiniEventId = event.fMiniEventId;
133 fEventId1 = event.fEventId1;
134 fEventId2 = event.fEventId2;
136 fDspHeaderArray = new TClonesArray("AliMUONDspHeader", 5);
137 for (Int_t index = 0; index < (event.fDspHeaderArray)->GetEntriesFast(); index++) {
138 new ((*fDspHeaderArray)[fDspHeaderArray->GetEntriesFast()])
139 AliMUONDspHeader(*(AliMUONDspHeader*)(event.fDspHeaderArray)->At(index));
145 //___________________________________________
146 void AliMUONBlockHeader::AddDspHeader(const AliMUONDspHeader& dspHeader)
149 /// adding the dsp structure
150 /// into the TClonesArray
152 TClonesArray &dspArray = *fDspHeaderArray;
153 new(dspArray[dspArray.GetEntriesFast()]) AliMUONDspHeader(dspHeader);
156 //___________________________________________
157 void AliMUONBlockHeader::Clear(Option_t* )
159 /// Clear TClones arrays
160 /// instead of deleting
162 fDspHeaderArray->Clear("C");
166 //___________________________________________
167 void AliMUONBlockHeader::Print(Option_t* /*opt*/) const
171 cout << "CRT info" << endl;
172 cout << "DataKey: " << fDataKey << endl;
173 cout << "TotalLength: " << fTotalLength << endl;
174 cout << "Length: " << fLength << endl;
175 cout << "DspId: " << fDspId << endl;
177 cout << "L0Trigger: " << fL0Trigger << endl;
178 cout << "MiniEventId: " << fMiniEventId<< endl;
179 cout << "EventId1: " << fEventId1 << endl;
180 cout << "EventId2: " << fEventId2 << endl;;