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 **************************************************************************/
16 #include "AliMUONDspHeader.h"
17 #include "AliMUONBusStruct.h"
21 /// DSP structure for tracker raw data.
22 /// Each block contains at most 5 Dsp structures.
23 /// Beside the total length and length of the below data
24 /// the header of the Dsp contains the front end DSP id, trigger words
25 /// and event word (1 for nb of word is odd and 0 if not
28 ClassImp(AliMUONDspHeader)
30 const Int_t AliMUONDspHeader::fgkHeaderLength = 8;
32 //___________________________________________
33 AliMUONDspHeader::AliMUONDspHeader()
43 for (Int_t i = 0; i < 4; i++)
46 fBusPatchArray = new TClonesArray("AliMUONBusStruct",5);
50 //___________________________________________
51 AliMUONDspHeader::~AliMUONDspHeader()
56 fBusPatchArray->Delete();
57 delete fBusPatchArray;
60 //___________________________________________
61 AliMUONDspHeader::AliMUONDspHeader(const AliMUONDspHeader& event)
67 fTotalLength = event.fTotalLength;
68 fLength = event.fLength;
69 fDspId = event.fDspId;
70 fEventWord = event.fEventWord;
73 for (Int_t i = 0; i < 4; i++)
74 fTriggerWord[i] = event.fTriggerWord[i];
76 fBusPatchArray = new TClonesArray("AliMUONBusStruct", 5);
77 for (Int_t index = 0; index < (event.fBusPatchArray)->GetEntriesFast(); index++) {
78 {new ((*fBusPatchArray)[fBusPatchArray->GetEntriesFast()])
79 AliMUONBusStruct(*(AliMUONBusStruct*)(event.fBusPatchArray)->At(index));}
81 // fBusPatchArray->SetOwner();
85 //___________________________________________
86 AliMUONDspHeader& AliMUONDspHeader::operator=(const AliMUONDspHeader& event)
89 // assignemnt constructor
91 if (this == &event) return *this;
93 fTotalLength = event.fTotalLength;
94 fLength = event.fLength;
95 fDspId = event.fDspId;
96 fEventWord = event.fEventWord;
99 for (Int_t i = 0; i < 4; i++)
100 fTriggerWord[i] = event.fTriggerWord[i];
102 fBusPatchArray = new TClonesArray("AliMUONBusStruct", 5);
103 for (Int_t index = 0; index < (event.fBusPatchArray)->GetEntriesFast(); index++) {
104 {new ((*fBusPatchArray)[fBusPatchArray->GetEntriesFast()])
105 AliMUONBusStruct(*(AliMUONBusStruct*)(event.fBusPatchArray)->At(index));}
109 //___________________________________________
110 void AliMUONDspHeader::AddBusPatch(const AliMUONBusStruct& busPatch)
113 // adding buspatch info
116 TClonesArray &eventArray = *fBusPatchArray;
117 new(eventArray[eventArray.GetEntriesFast()]) AliMUONBusStruct(busPatch);
119 //___________________________________________
120 void AliMUONDspHeader::Clear(Option_t* )
122 // Clear TClones arrays
123 // instead of deleting
125 fBusPatchArray->Clear("C");