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