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