1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
18 #include "AliMUONDspHeader.h"
19 #include "AliMUONBusStruct.h"
21 /// \class AliMUONDspHeader
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
28 /// \author Christian Finck
31 ClassImp(AliMUONDspHeader)
34 const Int_t AliMUONDspHeader::fgkHeaderLength = 10;
35 const UInt_t AliMUONDspHeader::fgkDefaultDataKey = 0xF000000F;
36 const UInt_t AliMUONDspHeader::fgkDefaultPaddingWord = 0xBEEFFACE;
38 //___________________________________________
39 AliMUONDspHeader::AliMUONDspHeader()
51 fBusPatchArray(new TClonesArray("AliMUONBusStruct",5))
59 //___________________________________________
60 AliMUONDspHeader::~AliMUONDspHeader()
65 fBusPatchArray->Delete();
66 delete fBusPatchArray;
69 //___________________________________________
70 AliMUONDspHeader::AliMUONDspHeader(const AliMUONDspHeader& event)
72 fDataKey(event.fDataKey),
73 fTotalLength(event.fTotalLength),
74 fLength(event.fLength),
76 fBlkL1ATrigger(event.fBlkL1ATrigger),
77 fMiniEventId(event.fMiniEventId),
78 fL1ATrigger(event.fL1ATrigger),
79 fL1RTrigger(event.fL1RTrigger),
80 fPaddingWord(event.fPaddingWord),
81 fErrorWord(event.fErrorWord),
82 fBusPatchArray(new TClonesArray("AliMUONBusStruct", 5))
88 for (Int_t index = 0; index < (event.fBusPatchArray)->GetEntriesFast(); index++) {
89 {new ((*fBusPatchArray)[fBusPatchArray->GetEntriesFast()])
90 AliMUONBusStruct(*(AliMUONBusStruct*)(event.fBusPatchArray)->At(index));}
92 // fBusPatchArray->SetOwner();
96 //___________________________________________
97 AliMUONDspHeader& AliMUONDspHeader::operator=(const AliMUONDspHeader& event)
100 /// assignemnt constructor
102 if (this == &event) return *this;
104 fDataKey = event.fDataKey;
105 fTotalLength = event.fTotalLength;
106 fLength = event.fLength;
107 fDspId = event.fDspId;
108 fBlkL1ATrigger = event.fBlkL1ATrigger;
109 fMiniEventId = event.fMiniEventId;
110 fL1ATrigger = event.fL1ATrigger;
111 fL1RTrigger = event.fL1RTrigger;
112 fPaddingWord = event.fPaddingWord;
113 fErrorWord = event.fErrorWord;
116 fBusPatchArray = new TClonesArray("AliMUONBusStruct", 5);
117 for (Int_t index = 0; index < (event.fBusPatchArray)->GetEntriesFast(); index++) {
118 {new ((*fBusPatchArray)[fBusPatchArray->GetEntriesFast()])
119 AliMUONBusStruct(*(AliMUONBusStruct*)(event.fBusPatchArray)->At(index));}
123 //___________________________________________
124 void AliMUONDspHeader::AddBusPatch(const AliMUONBusStruct& busPatch)
127 /// adding buspatch info
128 /// into TClonesArray
130 TClonesArray &eventArray = *fBusPatchArray;
131 new(eventArray[eventArray.GetEntriesFast()]) AliMUONBusStruct(busPatch);
133 //___________________________________________
134 void AliMUONDspHeader::Clear(Option_t* )
136 /// Clear TClones arrays
137 /// instead of deleting
139 fBusPatchArray->Clear("C");