Record changes.
[u/mrichter/AliRoot.git] / MUON / AliMUONDspHeader.cxx
CommitLineData
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 "AliMUONDspHeader.h"
19#include "AliMUONBusStruct.h"
20
47c194a6 21///
22/// DSP structure for tracker raw data.
23/// Each block contains at most 5 Dsp structures.
24/// Beside the total length and length of the below data
25/// the header of the Dsp contains the front end DSP id, trigger words
26/// and event word (1 for nb of word is odd and 0 if not
27///
28
13985652 29/// \cond CLASSIMP
47c194a6 30ClassImp(AliMUONDspHeader)
13985652 31/// \endcond
47c194a6 32
84ceeb06 33 const Int_t AliMUONDspHeader::fgkHeaderLength = 10;
34 const UInt_t AliMUONDspHeader::fgkDefaultDataKey = 0xF000000F;
35 const UInt_t AliMUONDspHeader::fgkDefaultPaddingWord = 0xBEEFFACE;
47c194a6 36
37//___________________________________________
38AliMUONDspHeader::AliMUONDspHeader()
39 : TObject(),
84ceeb06 40 fDataKey(0),
47c194a6 41 fTotalLength(0),
42 fLength(0),
43 fDspId(0),
84ceeb06 44 fBlkL1ATrigger(0),
45 fMiniEventId(0),
46 fL1ATrigger(0),
47 fL1RTrigger(0),
48 fPaddingWord(0),
9f5dcca3 49 fErrorWord(0),
50 fBusPatchArray(new TClonesArray("AliMUONBusStruct",5))
47c194a6 51{
52 //
53 //ctor
54 //
47c194a6 55
47c194a6 56}
57
58//___________________________________________
59AliMUONDspHeader::~AliMUONDspHeader()
60{
61 //
62 // dtr
63 //
64 fBusPatchArray->Delete();
65 delete fBusPatchArray;
66}
67
68//___________________________________________
69AliMUONDspHeader::AliMUONDspHeader(const AliMUONDspHeader& event)
9f5dcca3 70 : TObject(event),
71 fDataKey(event.fDataKey),
72 fTotalLength(event.fTotalLength),
73 fLength(event.fLength),
74 fDspId(event.fDspId),
75 fBlkL1ATrigger(event.fBlkL1ATrigger),
76 fMiniEventId(event.fMiniEventId),
77 fL1ATrigger(event.fL1ATrigger),
78 fL1RTrigger(event.fL1RTrigger),
79 fPaddingWord(event.fPaddingWord),
80 fErrorWord(event.fErrorWord),
81 fBusPatchArray(new TClonesArray("AliMUONBusStruct", 5))
47c194a6 82{
83 //
84 // copy constructor
85 //
47c194a6 86
47c194a6 87 for (Int_t index = 0; index < (event.fBusPatchArray)->GetEntriesFast(); index++) {
88 {new ((*fBusPatchArray)[fBusPatchArray->GetEntriesFast()])
89 AliMUONBusStruct(*(AliMUONBusStruct*)(event.fBusPatchArray)->At(index));}
90 }
91 // fBusPatchArray->SetOwner();
92
93}
94
95//___________________________________________
96AliMUONDspHeader& AliMUONDspHeader::operator=(const AliMUONDspHeader& event)
97{
98 //
99 // assignemnt constructor
100 //
101 if (this == &event) return *this;
102
9f5dcca3 103 fDataKey = event.fDataKey;
104 fTotalLength = event.fTotalLength;
105 fLength = event.fLength;
106 fDspId = event.fDspId;
84ceeb06 107 fBlkL1ATrigger = event.fBlkL1ATrigger;
108 fMiniEventId = event.fMiniEventId;
109 fL1ATrigger = event.fL1ATrigger;
110 fL1RTrigger = event.fL1RTrigger;
111 fPaddingWord = event.fPaddingWord;
112 fErrorWord = event.fErrorWord;
47c194a6 113
47c194a6 114
115 fBusPatchArray = new TClonesArray("AliMUONBusStruct", 5);
116 for (Int_t index = 0; index < (event.fBusPatchArray)->GetEntriesFast(); index++) {
117 {new ((*fBusPatchArray)[fBusPatchArray->GetEntriesFast()])
118 AliMUONBusStruct(*(AliMUONBusStruct*)(event.fBusPatchArray)->At(index));}
119 }
120 return *this;
121}
122//___________________________________________
123void AliMUONDspHeader::AddBusPatch(const AliMUONBusStruct& busPatch)
124{
125 //
126 // adding buspatch info
127 // into TClonesArray
128 //
129 TClonesArray &eventArray = *fBusPatchArray;
130 new(eventArray[eventArray.GetEntriesFast()]) AliMUONBusStruct(busPatch);
131}
132//___________________________________________
133void AliMUONDspHeader::Clear(Option_t* )
134{
135 // Clear TClones arrays
136 // instead of deleting
137 //
138 fBusPatchArray->Clear("C");
139
140}