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"
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
30 ClassImp(AliMUONDspHeader)
33 const Int_t AliMUONDspHeader::fgkHeaderLength = 8;
35 //___________________________________________
36 AliMUONDspHeader::AliMUONDspHeader()
46 for (Int_t i = 0; i < 4; i++)
49 fBusPatchArray = new TClonesArray("AliMUONBusStruct",5);
53 //___________________________________________
54 AliMUONDspHeader::~AliMUONDspHeader()
59 fBusPatchArray->Delete();
60 delete fBusPatchArray;
63 //___________________________________________
64 AliMUONDspHeader::AliMUONDspHeader(const AliMUONDspHeader& event)
70 fTotalLength = event.fTotalLength;
71 fLength = event.fLength;
72 fDspId = event.fDspId;
73 fEventWord = event.fEventWord;
76 for (Int_t i = 0; i < 4; i++)
77 fTriggerWord[i] = event.fTriggerWord[i];
79 fBusPatchArray = new TClonesArray("AliMUONBusStruct", 5);
80 for (Int_t index = 0; index < (event.fBusPatchArray)->GetEntriesFast(); index++) {
81 {new ((*fBusPatchArray)[fBusPatchArray->GetEntriesFast()])
82 AliMUONBusStruct(*(AliMUONBusStruct*)(event.fBusPatchArray)->At(index));}
84 // fBusPatchArray->SetOwner();
88 //___________________________________________
89 AliMUONDspHeader& AliMUONDspHeader::operator=(const AliMUONDspHeader& event)
92 // assignemnt constructor
94 if (this == &event) return *this;
96 fTotalLength = event.fTotalLength;
97 fLength = event.fLength;
98 fDspId = event.fDspId;
99 fEventWord = event.fEventWord;
102 for (Int_t i = 0; i < 4; i++)
103 fTriggerWord[i] = event.fTriggerWord[i];
105 fBusPatchArray = new TClonesArray("AliMUONBusStruct", 5);
106 for (Int_t index = 0; index < (event.fBusPatchArray)->GetEntriesFast(); index++) {
107 {new ((*fBusPatchArray)[fBusPatchArray->GetEntriesFast()])
108 AliMUONBusStruct(*(AliMUONBusStruct*)(event.fBusPatchArray)->At(index));}
112 //___________________________________________
113 void AliMUONDspHeader::AddBusPatch(const AliMUONBusStruct& busPatch)
116 // adding buspatch info
119 TClonesArray &eventArray = *fBusPatchArray;
120 new(eventArray[eventArray.GetEntriesFast()]) AliMUONBusStruct(busPatch);
122 //___________________________________________
123 void AliMUONDspHeader::Clear(Option_t* )
125 // Clear TClones arrays
126 // instead of deleting
128 fBusPatchArray->Clear("C");