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