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 "AliMUONBlockHeader.h"
17 #include "AliMUONDspHeader.h"
21 /// Block structure for tracker raw data
22 /// each DDL contains two blocks,
23 /// each block contains at most 5 dsp structure.
24 /// Beside the total length and length of the below data
25 /// the header of the block contains the front end DSP id, trigger words and paddind word
28 ClassImp(AliMUONBlockHeader)
30 const Int_t AliMUONBlockHeader::fgkHeaderLength = 7;
32 //___________________________________________
33 AliMUONBlockHeader::AliMUONBlockHeader()
43 for (Int_t i = 0; i < 4; i++)
46 fDspHeaderArray = new TClonesArray("AliMUONDspHeader", 5);
50 //___________________________________________
51 AliMUONBlockHeader::~AliMUONBlockHeader()
56 fDspHeaderArray->Delete();
57 delete fDspHeaderArray;
60 //___________________________________________
61 AliMUONBlockHeader::AliMUONBlockHeader(const AliMUONBlockHeader& event)
67 fTotalLength = event.fTotalLength;
68 fLength = event.fLength;
69 fDspId = event.fDspId;
70 fPadding = event.fPadding;
72 for (Int_t i = 0; i < 4; i++)
73 fTriggerWord[i] = event.fTriggerWord[i];
75 fDspHeaderArray = new TClonesArray("AliMUONDspHeader", 5);
76 for (Int_t index = 0; index < (event.fDspHeaderArray)->GetEntriesFast(); index++) {
77 {new ((*fDspHeaderArray)[fDspHeaderArray->GetEntriesFast()])
78 AliMUONDspHeader(*(AliMUONDspHeader*)(event.fDspHeaderArray)->At(index));}
80 // fDspHeaderArray->SetOwner();
83 //___________________________________________
85 AliMUONBlockHeader::operator=(const AliMUONBlockHeader &event)
88 // assignment operator
90 if (this == &event) return *this;
92 fTotalLength = event.fTotalLength;
93 fLength = event.fLength;
94 fDspId = event.fDspId;
95 fPadding = event.fPadding;
98 for (Int_t i = 0; i < 4; i++)
99 fTriggerWord[i] = event.fTriggerWord[i];
102 fDspHeaderArray = new TClonesArray("AliMUONDspHeader", 5);
103 for (Int_t index = 0; index < (event.fDspHeaderArray)->GetEntriesFast(); index++) {
104 new ((*fDspHeaderArray)[fDspHeaderArray->GetEntriesFast()])
105 AliMUONDspHeader(*(AliMUONDspHeader*)(event.fDspHeaderArray)->At(index));
111 //___________________________________________
112 void AliMUONBlockHeader::AddDspHeader(const AliMUONDspHeader& dspHeader)
115 // adding the dsp structure
116 // into the TClonesArray
118 TClonesArray &dspArray = *fDspHeaderArray;
119 new(dspArray[dspArray.GetEntriesFast()]) AliMUONDspHeader(dspHeader);
122 //___________________________________________
123 void AliMUONBlockHeader::Clear(Option_t* )
125 // Clear TClones arrays
126 // instead of deleting
128 fDspHeaderArray->Clear("C");