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 /// \class AliMUONBlockHeader
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
30 /// \author Christian Finck
33 ClassImp(AliMUONBlockHeader)
36 const Int_t AliMUONBlockHeader::fgkHeaderLength = 8;
37 const UInt_t AliMUONBlockHeader::fgkDefaultDataKey = 0xFC0000FC;
38 //___________________________________________
39 AliMUONBlockHeader::AliMUONBlockHeader()
49 fDspHeaderArray(new TClonesArray("AliMUONDspHeader", 5))
58 //___________________________________________
59 AliMUONBlockHeader::~AliMUONBlockHeader()
64 fDspHeaderArray->Delete();
65 delete fDspHeaderArray;
68 //___________________________________________
69 AliMUONBlockHeader::AliMUONBlockHeader(const AliMUONBlockHeader& event)
71 fDataKey(event.fDataKey),
72 fTotalLength(event.fTotalLength),
73 fLength(event.fLength),
75 fL0Trigger(event.fL0Trigger),
76 fMiniEventId(event.fMiniEventId),
77 fEventId1(event.fEventId1),
78 fEventId2(event.fEventId2),
79 fDspHeaderArray(new TClonesArray("AliMUONDspHeader", 5))
85 for (Int_t index = 0; index < (event.fDspHeaderArray)->GetEntriesFast(); index++) {
86 {new ((*fDspHeaderArray)[fDspHeaderArray->GetEntriesFast()])
87 AliMUONDspHeader(*(AliMUONDspHeader*)(event.fDspHeaderArray)->At(index));}
89 // fDspHeaderArray->SetOwner();
92 //___________________________________________
94 AliMUONBlockHeader::operator=(const AliMUONBlockHeader &event)
97 /// assignment operator
99 if (this == &event) return *this;
101 fDataKey = event.fDataKey;
102 fTotalLength = event.fTotalLength;
103 fLength = event.fLength;
104 fDspId = event.fDspId;
106 fL0Trigger = event.fL0Trigger;
107 fMiniEventId = event.fMiniEventId;
108 fEventId1 = event.fEventId1;
109 fEventId2 = event.fEventId2;
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));
120 //___________________________________________
121 void AliMUONBlockHeader::AddDspHeader(const AliMUONDspHeader& dspHeader)
124 /// adding the dsp structure
125 /// into the TClonesArray
127 TClonesArray &dspArray = *fDspHeaderArray;
128 new(dspArray[dspArray.GetEntriesFast()]) AliMUONDspHeader(dspHeader);
131 //___________________________________________
132 void AliMUONBlockHeader::Clear(Option_t* )
134 /// Clear TClones arrays
135 /// instead of deleting
137 fDspHeaderArray->Clear("C");
141 //___________________________________________
142 void AliMUONBlockHeader::Print(Option_t* /*opt*/) const
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;
152 cout << "L0Trigger: " << fL0Trigger << endl;
153 cout << "MiniEventId: " << fMiniEventId<< endl;
154 cout << "EventId1: " << fEventId1 << endl;
155 cout << "EventId2: " << fEventId2 << endl;;