]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONDspHeader.cxx
No more misaligned_geometry
[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 #include <Riostream.h>
21
22 /// \class AliMUONDspHeader
23 /// DSP structure for tracker raw data.
24 /// Each block contains at most 5 Dsp structures.
25 /// Beside the total length and length of the below data
26 /// the header of the Dsp contains the front end DSP id, trigger words
27 /// and event word (1 for nb of word is odd and 0 if not 
28 ///
29 /// \author Christian Finck
30
31 /// \cond CLASSIMP
32 ClassImp(AliMUONDspHeader)
33 /// \endcond
34   
35   const Int_t  AliMUONDspHeader::fgkHeaderLength = 10;
36   const UInt_t AliMUONDspHeader::fgkDefaultDataKey = 0xF000000F;
37   const UInt_t AliMUONDspHeader::fgkDefaultPaddingWord = 0xBEEFFACE;
38
39 //___________________________________________
40 AliMUONDspHeader::AliMUONDspHeader()
41   :  TObject(),
42      fDataKey(0),
43      fTotalLength(0),
44      fLength(0),
45      fDspId(0),
46      fBlkL1ATrigger(0),
47      fMiniEventId(0),
48      fL1ATrigger(0),
49      fL1RTrigger(0),
50      fPaddingWord(0),
51      fErrorWord(0),
52      fBusPatchArray(new TClonesArray("AliMUONBusStruct",5))
53 {
54   ///
55   ///ctor
56   ///
57
58 }
59
60 //___________________________________________
61 AliMUONDspHeader::~AliMUONDspHeader()
62 {
63   ///
64   /// dtr
65   ///
66   fBusPatchArray->Delete();
67   delete fBusPatchArray;
68 }
69
70 //___________________________________________
71 AliMUONDspHeader::AliMUONDspHeader(const AliMUONDspHeader& event)
72   :  TObject(event),
73      fDataKey(event.fDataKey),
74      fTotalLength(event.fTotalLength),
75      fLength(event.fLength),
76      fDspId(event.fDspId),
77      fBlkL1ATrigger(event.fBlkL1ATrigger),
78      fMiniEventId(event.fMiniEventId),
79      fL1ATrigger(event.fL1ATrigger),
80      fL1RTrigger(event.fL1RTrigger),
81      fPaddingWord(event.fPaddingWord),
82      fErrorWord(event.fErrorWord),
83      fBusPatchArray(new TClonesArray("AliMUONBusStruct", 5))
84 {
85   /// 
86   /// copy constructor
87   ///
88
89   for (Int_t index = 0; index < (event.fBusPatchArray)->GetEntriesFast(); index++) {
90     {new ((*fBusPatchArray)[fBusPatchArray->GetEntriesFast()]) 
91         AliMUONBusStruct(*(AliMUONBusStruct*)(event.fBusPatchArray)->At(index));}
92   }
93   // fBusPatchArray->SetOwner();
94  
95 }
96
97 //___________________________________________
98 AliMUONDspHeader& AliMUONDspHeader::operator=(const AliMUONDspHeader& event)
99 {
100   ///
101   /// assignemnt constructor
102   ///
103   if (this == &event) return *this;
104
105   fDataKey       = event.fDataKey;
106   fTotalLength   = event.fTotalLength;
107   fLength        = event.fLength;
108   fDspId         = event.fDspId;
109   fBlkL1ATrigger = event.fBlkL1ATrigger;
110   fMiniEventId   = event.fMiniEventId;
111   fL1ATrigger    = event.fL1ATrigger;
112   fL1RTrigger    = event.fL1RTrigger;
113   fPaddingWord   = event.fPaddingWord;
114   fErrorWord     = event.fErrorWord;
115
116
117   fBusPatchArray = new TClonesArray("AliMUONBusStruct", 5);
118   for (Int_t index = 0; index < (event.fBusPatchArray)->GetEntriesFast(); index++) {
119     {new ((*fBusPatchArray)[fBusPatchArray->GetEntriesFast()]) 
120         AliMUONBusStruct(*(AliMUONBusStruct*)(event.fBusPatchArray)->At(index));}
121   }
122   return *this;
123 }
124 //___________________________________________
125 void AliMUONDspHeader::AddBusPatch(const AliMUONBusStruct& busPatch)
126 {
127   /// 
128   /// adding buspatch info
129   /// into TClonesArray
130   ///
131   TClonesArray &eventArray = *fBusPatchArray;
132   new(eventArray[eventArray.GetEntriesFast()]) AliMUONBusStruct(busPatch);
133 }
134 //___________________________________________
135 void AliMUONDspHeader::Clear(Option_t* )
136 {
137   /// Clear TClones arrays
138   /// instead of deleting
139   ///
140   fBusPatchArray->Clear("C");
141  
142 }
143
144 //___________________________________________
145 void AliMUONDspHeader::Print(Option_t* /*opt*/) const
146 {
147   /// print out
148
149   cout << "FRT info"        << endl;
150   cout << "DataKey: "       << fDataKey << endl;
151   cout << "TotalLength: "   << fTotalLength << endl;
152   cout << "Length : "       << fLength << endl;
153   cout << "DspId: "         << fDspId << endl;
154   cout << "BlkL1ATrigger: " << fBlkL1ATrigger << endl;
155   cout << "MiniEventId: "   << fMiniEventId << endl;
156   cout << "L1ATrigger: "    << fL1ATrigger << endl;
157   cout << "L1RTrigger: "    << fL1RTrigger << endl;
158   cout << "PaddingWord: "   << fPaddingWord << endl;
159   cout << "ErrorWord: "     << fErrorWord << endl;
160
161 }