]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONDspHeader.cxx
Decode new trigger board names
[u/mrichter/AliRoot.git] / MUON / AliMUONDspHeader.cxx
1 /**************************************************************************
2  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3  *                                                                        *
4  * Author: The ALICE Off-line Project.                                    *
5  * Contributors are mentioned in the code where appropriate.              *
6  *                                                                        *
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  **************************************************************************/
15  
16 #include "AliMUONDspHeader.h"
17 #include "AliMUONBusStruct.h"
18
19
20 /// 
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 
26 ///
27
28 ClassImp(AliMUONDspHeader)
29   
30   const Int_t AliMUONDspHeader::fgkHeaderLength = 8;
31
32 //___________________________________________
33 AliMUONDspHeader::AliMUONDspHeader()
34   :  TObject(),
35      fTotalLength(0),
36      fLength(0),
37      fDspId(0),
38      fEventWord(0)
39 {
40   //
41   //ctor
42   //
43   for (Int_t i = 0; i < 4; i++)
44     fTriggerWord[i] = 0;
45
46   fBusPatchArray  = new TClonesArray("AliMUONBusStruct",5);
47
48 }
49
50 //___________________________________________
51 AliMUONDspHeader::~AliMUONDspHeader()
52 {
53   //
54   // dtr
55   //
56   fBusPatchArray->Delete();
57   delete fBusPatchArray;
58 }
59
60 //___________________________________________
61 AliMUONDspHeader::AliMUONDspHeader(const AliMUONDspHeader& event)
62   :  TObject(event)
63 {
64   // 
65   // copy constructor
66   //
67   fTotalLength = event.fTotalLength;
68   fLength      = event.fLength;
69   fDspId       = event.fDspId;
70   fEventWord   = event.fEventWord;
71
72   //ctor
73   for (Int_t i = 0; i < 4; i++)
74     fTriggerWord[i] = event.fTriggerWord[i];
75
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));}
80   }
81   // fBusPatchArray->SetOwner();
82  
83 }
84
85 //___________________________________________
86 AliMUONDspHeader& AliMUONDspHeader::operator=(const AliMUONDspHeader& event)
87 {
88   //
89   // assignemnt constructor
90   //
91   if (this == &event) return *this;
92
93   fTotalLength = event.fTotalLength;
94   fLength      = event.fLength;
95   fDspId       = event.fDspId;
96   fEventWord   = event.fEventWord;
97
98   //ctor
99   for (Int_t i = 0; i < 4; i++)
100     fTriggerWord[i] = event.fTriggerWord[i];
101
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));}
106   }
107   return *this;
108 }
109 //___________________________________________
110 void AliMUONDspHeader::AddBusPatch(const AliMUONBusStruct& busPatch)
111 {
112   // 
113   // adding buspatch info
114   // into TClonesArray
115   //
116   TClonesArray &eventArray = *fBusPatchArray;
117   new(eventArray[eventArray.GetEntriesFast()]) AliMUONBusStruct(busPatch);
118 }
119 //___________________________________________
120 void AliMUONDspHeader::Clear(Option_t* )
121 {
122   // Clear TClones arrays
123   // instead of deleting
124   //
125   fBusPatchArray->Clear("C");
126  
127 }