]>
Commit | Line | Data |
---|---|---|
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 | 35 | ClassImp(AliMUONBlockHeader) |
13985652 | 36 | /// \endcond |
47c194a6 | 37 | |
84ceeb06 | 38 | const Int_t AliMUONBlockHeader::fgkHeaderLength = 8; |
39 | const UInt_t AliMUONBlockHeader::fgkDefaultDataKey = 0xFC0000FC; | |
47c194a6 | 40 | //___________________________________________ |
41 | AliMUONBlockHeader::AliMUONBlockHeader() | |
42 | : TObject(), | |
84ceeb06 | 43 | fDataKey(0), |
47c194a6 | 44 | fTotalLength(0), |
45 | fLength(0), | |
46 | fDspId(0), | |
84ceeb06 | 47 | fL0Trigger(0), |
48 | fMiniEventId(0), | |
49 | fEventId1(0), | |
9f5dcca3 | 50 | fEventId2(0), |
51 | fDspHeaderArray(new TClonesArray("AliMUONDspHeader", 5)) | |
52 | ||
47c194a6 | 53 | { |
00e86732 | 54 | /// |
55 | /// ctor | |
56 | /// | |
47c194a6 | 57 | |
47c194a6 | 58 | } |
59 | ||
60 | //___________________________________________ | |
61 | AliMUONBlockHeader::~AliMUONBlockHeader() | |
62 | { | |
00e86732 | 63 | /// |
64 | /// dtor | |
65 | /// | |
47c194a6 | 66 | fDspHeaderArray->Delete(); |
67 | delete fDspHeaderArray; | |
68 | } | |
69 | ||
70 | //___________________________________________ | |
71 | AliMUONBlockHeader::AliMUONBlockHeader(const AliMUONBlockHeader& event) | |
9f5dcca3 | 72 | : TObject(event), |
73 | fDataKey(event.fDataKey), | |
74 | fTotalLength(event.fTotalLength), | |
75 | fLength(event.fLength), | |
76 | fDspId(event.fDspId), | |
77 | fL0Trigger(event.fL0Trigger), | |
78 | fMiniEventId(event.fMiniEventId), | |
79 | fEventId1(event.fEventId1), | |
80 | fEventId2(event.fEventId2), | |
81 | fDspHeaderArray(new TClonesArray("AliMUONDspHeader", 5)) | |
47c194a6 | 82 | { |
00e86732 | 83 | /// |
84 | /// copy ctor | |
85 | /// | |
84ceeb06 | 86 | |
47c194a6 | 87 | for (Int_t index = 0; index < (event.fDspHeaderArray)->GetEntriesFast(); index++) { |
88 | {new ((*fDspHeaderArray)[fDspHeaderArray->GetEntriesFast()]) | |
89 | AliMUONDspHeader(*(AliMUONDspHeader*)(event.fDspHeaderArray)->At(index));} | |
90 | } | |
91 | // fDspHeaderArray->SetOwner(); | |
92 | } | |
93 | ||
94 | //___________________________________________ | |
95 | AliMUONBlockHeader& | |
96 | AliMUONBlockHeader::operator=(const AliMUONBlockHeader &event) | |
97 | { | |
00e86732 | 98 | /// |
99 | /// assignment operator | |
100 | /// | |
47c194a6 | 101 | if (this == &event) return *this; |
102 | ||
1ed3c5c2 | 103 | fDataKey = event.fDataKey; |
47c194a6 | 104 | fTotalLength = event.fTotalLength; |
105 | fLength = event.fLength; | |
106 | fDspId = event.fDspId; | |
84ceeb06 | 107 | |
108 | fL0Trigger = event.fL0Trigger; | |
109 | fMiniEventId = event.fMiniEventId; | |
110 | fEventId1 = event.fEventId1; | |
111 | fEventId2 = event.fEventId2; | |
47c194a6 | 112 | |
113 | fDspHeaderArray = new TClonesArray("AliMUONDspHeader", 5); | |
114 | for (Int_t index = 0; index < (event.fDspHeaderArray)->GetEntriesFast(); index++) { | |
115 | new ((*fDspHeaderArray)[fDspHeaderArray->GetEntriesFast()]) | |
116 | AliMUONDspHeader(*(AliMUONDspHeader*)(event.fDspHeaderArray)->At(index)); | |
117 | } | |
118 | ||
119 | return *this; | |
120 | ||
121 | } | |
122 | //___________________________________________ | |
123 | void AliMUONBlockHeader::AddDspHeader(const AliMUONDspHeader& dspHeader) | |
124 | { | |
00e86732 | 125 | /// |
126 | /// adding the dsp structure | |
127 | /// into the TClonesArray | |
128 | /// | |
47c194a6 | 129 | TClonesArray &dspArray = *fDspHeaderArray; |
130 | new(dspArray[dspArray.GetEntriesFast()]) AliMUONDspHeader(dspHeader); | |
131 | ||
132 | } | |
133 | //___________________________________________ | |
134 | void AliMUONBlockHeader::Clear(Option_t* ) | |
135 | { | |
00e86732 | 136 | /// Clear TClones arrays |
137 | /// instead of deleting | |
138 | /// | |
47c194a6 | 139 | fDspHeaderArray->Clear("C"); |
140 | ||
141 | } | |
1ed3c5c2 | 142 | |
143 | //___________________________________________ | |
144 | void AliMUONBlockHeader::Print(Option_t* /*opt*/) const | |
145 | { | |
146 | /// print out | |
147 | ||
148 | cout << "CRT info" << endl; | |
149 | cout << "DataKey: " << fDataKey << endl; | |
150 | cout << "TotalLength: " << fTotalLength << endl; | |
151 | cout << "Length: " << fLength << endl; | |
152 | cout << "DspId: " << fDspId << endl; | |
153 | ||
154 | cout << "L0Trigger: " << fL0Trigger << endl; | |
155 | cout << "MiniEventId: " << fMiniEventId<< endl; | |
156 | cout << "EventId1: " << fEventId1 << endl; | |
157 | cout << "EventId2: " << fEventId2 << endl;; | |
158 | ||
159 | } |