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