]>
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), | |
45 | fEventId2(0) | |
47c194a6 | 46 | { |
47 | // | |
48 | // ctor | |
49 | // | |
47c194a6 | 50 | |
51 | fDspHeaderArray = new TClonesArray("AliMUONDspHeader", 5); | |
52 | ||
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) | |
67 | : TObject(event) | |
68 | { | |
69 | // | |
70 | // copy ctor | |
71 | // | |
84ceeb06 | 72 | |
73 | fDataKey = event.fDataKey; | |
47c194a6 | 74 | fTotalLength = event.fTotalLength; |
75 | fLength = event.fLength; | |
76 | fDspId = event.fDspId; | |
84ceeb06 | 77 | fL0Trigger = event.fL0Trigger; |
78 | fMiniEventId = event.fMiniEventId; | |
79 | fEventId1 = event.fEventId1; | |
80 | fEventId2 = event.fEventId2; | |
47c194a6 | 81 | |
82 | fDspHeaderArray = new TClonesArray("AliMUONDspHeader", 5); | |
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 | { | |
94 | // | |
95 | // assignment operator | |
96 | // | |
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 | { | |
120 | // | |
121 | // adding the dsp structure | |
122 | // into the TClonesArray | |
123 | // | |
124 | TClonesArray &dspArray = *fDspHeaderArray; | |
125 | new(dspArray[dspArray.GetEntriesFast()]) AliMUONDspHeader(dspHeader); | |
126 | ||
127 | } | |
128 | //___________________________________________ | |
129 | void AliMUONBlockHeader::Clear(Option_t* ) | |
130 | { | |
131 | // Clear TClones arrays | |
132 | // instead of deleting | |
133 | // | |
134 | fDspHeaderArray->Clear("C"); | |
135 | ||
136 | } |