Added description for the new analysis macros
[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),
49 fErrorWord(0)
47c194a6 50{
51 //
52 //ctor
53 //
47c194a6 54
55 fBusPatchArray = new TClonesArray("AliMUONBusStruct",5);
56
57}
58
59//___________________________________________
60AliMUONDspHeader::~AliMUONDspHeader()
61{
62 //
63 // dtr
64 //
65 fBusPatchArray->Delete();
66 delete fBusPatchArray;
67}
68
69//___________________________________________
70AliMUONDspHeader::AliMUONDspHeader(const AliMUONDspHeader& event)
71 : TObject(event)
72{
73 //
74 // copy constructor
75 //
84ceeb06 76 fTotalLength = event.fTotalLength;
77 fLength = event.fLength;
78 fDspId = event.fDspId;
79 fBlkL1ATrigger = event.fBlkL1ATrigger;
80 fMiniEventId = event.fMiniEventId;
81 fL1ATrigger = event.fL1ATrigger;
82 fL1RTrigger = event.fL1RTrigger;
83 fPaddingWord = event.fPaddingWord;
84 fErrorWord = event.fErrorWord;
47c194a6 85
86 fBusPatchArray = new TClonesArray("AliMUONBusStruct", 5);
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
103 fTotalLength = event.fTotalLength;
104 fLength = event.fLength;
105 fDspId = event.fDspId;
84ceeb06 106 fBlkL1ATrigger = event.fBlkL1ATrigger;
107 fMiniEventId = event.fMiniEventId;
108 fL1ATrigger = event.fL1ATrigger;
109 fL1RTrigger = event.fL1RTrigger;
110 fPaddingWord = event.fPaddingWord;
111 fErrorWord = event.fErrorWord;
47c194a6 112
47c194a6 113
114 fBusPatchArray = new TClonesArray("AliMUONBusStruct", 5);
115 for (Int_t index = 0; index < (event.fBusPatchArray)->GetEntriesFast(); index++) {
116 {new ((*fBusPatchArray)[fBusPatchArray->GetEntriesFast()])
117 AliMUONBusStruct(*(AliMUONBusStruct*)(event.fBusPatchArray)->At(index));}
118 }
119 return *this;
120}
121//___________________________________________
122void AliMUONDspHeader::AddBusPatch(const AliMUONBusStruct& busPatch)
123{
124 //
125 // adding buspatch info
126 // into TClonesArray
127 //
128 TClonesArray &eventArray = *fBusPatchArray;
129 new(eventArray[eventArray.GetEntriesFast()]) AliMUONBusStruct(busPatch);
130}
131//___________________________________________
132void AliMUONDspHeader::Clear(Option_t* )
133{
134 // Clear TClones arrays
135 // instead of deleting
136 //
137 fBusPatchArray->Clear("C");
138
139}