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 "AliMUONBlockHeader.h"
19 #include "AliMUONDspHeader.h"
22 /// Block structure for tracker raw data
23 /// each DDL contains two blocks,
24 /// each block contains at most 5 dsp structure.
25 /// Beside the total length and length of the below data
26 /// the header of the block contains the front end DSP id, trigger words and paddind word
30 ClassImp(AliMUONBlockHeader)
33 const Int_t AliMUONBlockHeader::fgkHeaderLength = 7;
35 //___________________________________________
36 AliMUONBlockHeader::AliMUONBlockHeader()
46 for (Int_t i = 0; i < 4; i++)
49 fDspHeaderArray = new TClonesArray("AliMUONDspHeader", 5);
53 //___________________________________________
54 AliMUONBlockHeader::~AliMUONBlockHeader()
59 fDspHeaderArray->Delete();
60 delete fDspHeaderArray;
63 //___________________________________________
64 AliMUONBlockHeader::AliMUONBlockHeader(const AliMUONBlockHeader& event)
70 fTotalLength = event.fTotalLength;
71 fLength = event.fLength;
72 fDspId = event.fDspId;
73 fPadding = event.fPadding;
75 for (Int_t i = 0; i < 4; i++)
76 fTriggerWord[i] = event.fTriggerWord[i];
78 fDspHeaderArray = new TClonesArray("AliMUONDspHeader", 5);
79 for (Int_t index = 0; index < (event.fDspHeaderArray)->GetEntriesFast(); index++) {
80 {new ((*fDspHeaderArray)[fDspHeaderArray->GetEntriesFast()])
81 AliMUONDspHeader(*(AliMUONDspHeader*)(event.fDspHeaderArray)->At(index));}
83 // fDspHeaderArray->SetOwner();
86 //___________________________________________
88 AliMUONBlockHeader::operator=(const AliMUONBlockHeader &event)
91 // assignment operator
93 if (this == &event) return *this;
95 fTotalLength = event.fTotalLength;
96 fLength = event.fLength;
97 fDspId = event.fDspId;
98 fPadding = event.fPadding;
101 for (Int_t i = 0; i < 4; i++)
102 fTriggerWord[i] = event.fTriggerWord[i];
105 fDspHeaderArray = new TClonesArray("AliMUONDspHeader", 5);
106 for (Int_t index = 0; index < (event.fDspHeaderArray)->GetEntriesFast(); index++) {
107 new ((*fDspHeaderArray)[fDspHeaderArray->GetEntriesFast()])
108 AliMUONDspHeader(*(AliMUONDspHeader*)(event.fDspHeaderArray)->At(index));
114 //___________________________________________
115 void AliMUONBlockHeader::AddDspHeader(const AliMUONDspHeader& dspHeader)
118 // adding the dsp structure
119 // into the TClonesArray
121 TClonesArray &dspArray = *fDspHeaderArray;
122 new(dspArray[dspArray.GetEntriesFast()]) AliMUONDspHeader(dspHeader);
125 //___________________________________________
126 void AliMUONBlockHeader::Clear(Option_t* )
128 // Clear TClones arrays
129 // instead of deleting
131 fDspHeaderArray->Clear("C");