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