]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONDspHeader.cxx
Adding new classes (Laurent)
[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 /* $Id$ */
17  
18 #include "AliMUONDspHeader.h"
19 #include "AliMUONBusStruct.h"
20
21 /// \class AliMUONDspHeader
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 
27 ///
28 /// \author Christian Finck
29
30 /// \cond CLASSIMP
31 ClassImp(AliMUONDspHeader)
32 /// \endcond
33   
34   const Int_t  AliMUONDspHeader::fgkHeaderLength = 10;
35   const UInt_t AliMUONDspHeader::fgkDefaultDataKey = 0xF000000F;
36   const UInt_t AliMUONDspHeader::fgkDefaultPaddingWord = 0xBEEFFACE;
37
38 //___________________________________________
39 AliMUONDspHeader::AliMUONDspHeader()
40   :  TObject(),
41      fDataKey(0),
42      fTotalLength(0),
43      fLength(0),
44      fDspId(0),
45      fBlkL1ATrigger(0),
46      fMiniEventId(0),
47      fL1ATrigger(0),
48      fL1RTrigger(0),
49      fPaddingWord(0),
50      fErrorWord(0),
51      fBusPatchArray(new TClonesArray("AliMUONBusStruct",5))
52 {
53   ///
54   ///ctor
55   ///
56
57 }
58
59 //___________________________________________
60 AliMUONDspHeader::~AliMUONDspHeader()
61 {
62   ///
63   /// dtr
64   ///
65   fBusPatchArray->Delete();
66   delete fBusPatchArray;
67 }
68
69 //___________________________________________
70 AliMUONDspHeader::AliMUONDspHeader(const AliMUONDspHeader& event)
71   :  TObject(event),
72      fDataKey(event.fDataKey),
73      fTotalLength(event.fTotalLength),
74      fLength(event.fLength),
75      fDspId(event.fDspId),
76      fBlkL1ATrigger(event.fBlkL1ATrigger),
77      fMiniEventId(event.fMiniEventId),
78      fL1ATrigger(event.fL1ATrigger),
79      fL1RTrigger(event.fL1RTrigger),
80      fPaddingWord(event.fPaddingWord),
81      fErrorWord(event.fErrorWord),
82      fBusPatchArray(new TClonesArray("AliMUONBusStruct", 5))
83 {
84   /// 
85   /// copy constructor
86   ///
87
88   for (Int_t index = 0; index < (event.fBusPatchArray)->GetEntriesFast(); index++) {
89     {new ((*fBusPatchArray)[fBusPatchArray->GetEntriesFast()]) 
90         AliMUONBusStruct(*(AliMUONBusStruct*)(event.fBusPatchArray)->At(index));}
91   }
92   // fBusPatchArray->SetOwner();
93  
94 }
95
96 //___________________________________________
97 AliMUONDspHeader& AliMUONDspHeader::operator=(const AliMUONDspHeader& event)
98 {
99   ///
100   /// assignemnt constructor
101   ///
102   if (this == &event) return *this;
103
104   fDataKey       = event.fDataKey;
105   fTotalLength   = event.fTotalLength;
106   fLength        = event.fLength;
107   fDspId         = event.fDspId;
108   fBlkL1ATrigger = event.fBlkL1ATrigger;
109   fMiniEventId   = event.fMiniEventId;
110   fL1ATrigger    = event.fL1ATrigger;
111   fL1RTrigger    = event.fL1RTrigger;
112   fPaddingWord   = event.fPaddingWord;
113   fErrorWord     = event.fErrorWord;
114
115
116   fBusPatchArray = new TClonesArray("AliMUONBusStruct", 5);
117   for (Int_t index = 0; index < (event.fBusPatchArray)->GetEntriesFast(); index++) {
118     {new ((*fBusPatchArray)[fBusPatchArray->GetEntriesFast()]) 
119         AliMUONBusStruct(*(AliMUONBusStruct*)(event.fBusPatchArray)->At(index));}
120   }
121   return *this;
122 }
123 //___________________________________________
124 void AliMUONDspHeader::AddBusPatch(const AliMUONBusStruct& busPatch)
125 {
126   /// 
127   /// adding buspatch info
128   /// into TClonesArray
129   ///
130   TClonesArray &eventArray = *fBusPatchArray;
131   new(eventArray[eventArray.GetEntriesFast()]) AliMUONBusStruct(busPatch);
132 }
133 //___________________________________________
134 void AliMUONDspHeader::Clear(Option_t* )
135 {
136   /// Clear TClones arrays
137   /// instead of deleting
138   ///
139   fBusPatchArray->Clear("C");
140  
141 }