]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONBlockHeader.cxx
commented logging message
[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 #include <Riostream.h>
22
23 /// \class AliMUONBlockHeader
24 /// Block structure for tracker raw data
25 /// each DDL contains two blocks,
26 /// each block contains at most 5 dsp structure.
27 /// Beside the total length and length of the below data
28 /// the header of the block contains the front end DSP id, trigger words and paddind word
29 ///
30 /// \author Christian Finck
31
32 /// \cond CLASSIMP
33 ClassImp(AliMUONBlockHeader)
34 /// \endcond
35
36 const Int_t  AliMUONBlockHeader::fgkHeaderLength = 8;
37 const UInt_t AliMUONBlockHeader::fgkDefaultDataKey = 0xFC0000FC;
38 //___________________________________________
39 AliMUONBlockHeader::AliMUONBlockHeader()
40   :  TObject(),
41      fDataKey(0),
42      fTotalLength(0),
43      fLength(0),
44      fDspId(0),
45      fL0Trigger(0),
46      fMiniEventId(0),
47      fEventId1(0),
48      fEventId2(0),
49      fDspHeaderArray(new TClonesArray("AliMUONDspHeader", 5))
50
51 {
52   ///
53   /// ctor
54   ///
55
56 }
57
58 //___________________________________________
59 AliMUONBlockHeader::~AliMUONBlockHeader()
60 {
61   /// 
62   /// dtor
63   ///
64   fDspHeaderArray->Delete();
65   delete fDspHeaderArray;
66 }
67
68 //___________________________________________
69 AliMUONBlockHeader::AliMUONBlockHeader(const AliMUONBlockHeader& event)
70   :  TObject(event),
71      fDataKey(event.fDataKey),
72      fTotalLength(event.fTotalLength),
73      fLength(event.fLength),
74      fDspId(event.fDspId),
75      fL0Trigger(event.fL0Trigger),
76      fMiniEventId(event.fMiniEventId),
77      fEventId1(event.fEventId1),
78      fEventId2(event.fEventId2),
79      fDspHeaderArray(new TClonesArray("AliMUONDspHeader", 5))
80 {
81   ///
82   /// copy ctor
83   ///
84
85   for (Int_t index = 0; index < (event.fDspHeaderArray)->GetEntriesFast(); index++) {
86     {new ((*fDspHeaderArray)[fDspHeaderArray->GetEntriesFast()]) 
87         AliMUONDspHeader(*(AliMUONDspHeader*)(event.fDspHeaderArray)->At(index));}
88   }
89   //  fDspHeaderArray->SetOwner();
90 }
91
92 //___________________________________________
93 AliMUONBlockHeader&
94 AliMUONBlockHeader::operator=(const AliMUONBlockHeader &event)
95 {
96   /// 
97   /// assignment operator
98   ///
99   if (this == &event) return *this;
100
101   fDataKey     = event.fDataKey;
102   fTotalLength = event.fTotalLength;
103   fLength      = event.fLength;
104   fDspId       = event.fDspId;
105  
106   fL0Trigger   = event.fL0Trigger;
107   fMiniEventId = event.fMiniEventId;
108   fEventId1    = event.fEventId1;
109   fEventId2    = event.fEventId2;
110
111   fDspHeaderArray = new TClonesArray("AliMUONDspHeader", 5);
112   for (Int_t index = 0; index < (event.fDspHeaderArray)->GetEntriesFast(); index++) {
113     new ((*fDspHeaderArray)[fDspHeaderArray->GetEntriesFast()]) 
114         AliMUONDspHeader(*(AliMUONDspHeader*)(event.fDspHeaderArray)->At(index));
115   }
116
117   return *this;
118
119 }
120 //___________________________________________
121 void AliMUONBlockHeader::AddDspHeader(const AliMUONDspHeader& dspHeader)
122
123   /// 
124   /// adding the dsp structure
125   /// into the TClonesArray
126   ///
127   TClonesArray &dspArray = *fDspHeaderArray;
128   new(dspArray[dspArray.GetEntriesFast()]) AliMUONDspHeader(dspHeader);
129
130 }
131 //___________________________________________
132 void AliMUONBlockHeader::Clear(Option_t* )
133 {
134   /// Clear TClones arrays
135   /// instead of deleting
136   ///
137   fDspHeaderArray->Clear("C");
138  
139 }
140
141 //___________________________________________
142 void AliMUONBlockHeader::Print(Option_t* /*opt*/) const
143 {
144   /// print out
145
146   cout << "CRT info"        << endl;
147   cout << "DataKey: "       << fDataKey << endl;
148   cout << "TotalLength: "   << fTotalLength << endl;
149   cout << "Length: "        << fLength << endl;
150   cout << "DspId: "         << fDspId << endl;
151  
152   cout << "L0Trigger: "     << fL0Trigger << endl;
153   cout << "MiniEventId: "   << fMiniEventId<< endl; 
154   cout << "EventId1: "      << fEventId1 << endl;
155   cout << "EventId2: "      << fEventId2 << endl;;
156
157 }