]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONRegHeader.cxx
Removing warnings (Andrea)
[u/mrichter/AliRoot.git] / MUON / AliMUONRegHeader.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 #include <TClonesArray.h>
18
19 #include "AliMUONRegHeader.h"
20 #include "AliMUONLocalStruct.h"
21
22 //-----------------------------------------------------------------------------
23 /// \class AliMUONRegHeader
24 /// Regional structure for trigger raw data.
25 /// Each Reg structure contains 16 (at most) local card structure.
26 /// The structure includes the information of the Reg. boards and
27 /// regional inputs
28 /// 
29 /// \author Christian Finck
30 //-----------------------------------------------------------------------------
31
32 /// \cond CLASSIMP
33 ClassImp(AliMUONRegHeader)
34 /// \endcond
35  
36  const Int_t  AliMUONRegHeader::fgkHeaderLength = 5;
37  const Int_t  AliMUONRegHeader::fgkScalerLength = 10;
38  const UInt_t AliMUONRegHeader::fgkEndOfReg     = 0xBEEFFACE;
39  const UInt_t AliMUONRegHeader::fgkErrorWord    = 0xCAFEDEAD;
40
41 //___________________________________________
42 AliMUONRegHeader::AliMUONRegHeader()
43   :  TObject(),
44      fDarcWord(0),
45      fWord(0),
46      fMask(0),
47      fL0(0),
48      fClk(0),
49      fHold(0),
50      fLocalArray(new TClonesArray("AliMUONLocalStruct",16))
51 {
52   /// ctor
53  
54   fInput[0] = fInput[1] = 0;
55
56   for (Int_t i = 0; i < 8; i++)
57     fScaler[i] = 0;
58
59 }
60
61 //___________________________________________
62 AliMUONRegHeader::~AliMUONRegHeader()
63 {
64   /// dtor
65  
66   fLocalArray->Delete();
67   delete fLocalArray;
68 }
69
70 //___________________________________________
71 AliMUONRegHeader::AliMUONRegHeader(const AliMUONRegHeader& event)
72   :  TObject(event),
73      fDarcWord(event.fDarcWord),
74      fWord(event.fWord),
75      fMask(event.fMask),
76      fL0(event.fL0),
77      fClk(event.fClk),
78      fHold(event.fHold),
79      fLocalArray(new TClonesArray("AliMUONLocalStruct", 16))
80 {
81   ///
82   /// copy ctor
83   ///
84
85   fInput[0] = event.fInput[0];
86   fInput[1] = event.fInput[1];
87
88   for (Int_t i = 0; i < 8; i++)
89     fScaler[i] = event.fScaler[i];
90
91   for (Int_t index = 0; index < (event.fLocalArray)->GetEntriesFast(); index++) {
92     {new ((*fLocalArray)[fLocalArray->GetEntriesFast()]) 
93         AliMUONLocalStruct(*(AliMUONLocalStruct*)(event.fLocalArray)->At(index));}
94   }
95 }
96
97 //___________________________________________
98 AliMUONRegHeader& AliMUONRegHeader::operator=(const AliMUONRegHeader& event)
99 {
100   /// 
101   /// assignment operator
102   ///
103
104   if (this == &event) return *this;
105
106   fDarcWord = event.fDarcWord;
107   fWord     = event.fWord;
108   fClk      = event.fClk;
109   fHold     = event.fHold;
110   fL0       = event.fL0;
111   fMask     = event.fMask;
112
113   fInput[0] = event.fInput[0];
114   fInput[1] = event.fInput[1];
115
116   for (Int_t i = 0; i < 8; i++)
117     fScaler[i] = event.fScaler[i];
118
119   fLocalArray = new TClonesArray("AliMUONLocalStruct", 16);
120   for (Int_t index = 0; index < (event.fLocalArray)->GetEntriesFast(); index++) {
121     {new ((*fLocalArray)[fLocalArray->GetEntriesFast()]) 
122         AliMUONLocalStruct(*(AliMUONLocalStruct*)(event.fLocalArray)->At(index));}
123   }
124
125   return *this;
126 }
127
128 //___________________________________________
129 void AliMUONRegHeader::SetScalersNumbers()
130 {
131   /// set numbers for scaler events for Regional header
132   /// since this is provided by the experiment
133   /// put dummy numbers to check the monitoring
134   
135   fClk  = 10000;
136   fHold = 100; 
137   
138   for (Int_t i = 0; i < 8; i++)
139     fScaler[i] = i;  
140 }
141
142 //___________________________________________
143 void AliMUONRegHeader::Clear(Option_t* )
144 {
145   /// Clear TClones arrays
146   /// instead of deleting
147   ///
148   fLocalArray->Clear("C");
149  
150 }