]> git.uio.no Git - u/mrichter/AliRoot.git/blame_incremental - MUON/AliMUONDarcHeader.h
bug fixed (Valerie)
[u/mrichter/AliRoot.git] / MUON / AliMUONDarcHeader.h
... / ...
CommitLineData
1#ifndef ALIMUONDARCHEADER_H
2#define ALIMUONDARCHEADER_H
3/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5
6/*$Id$*/
7
8/// \ingroup raw
9/// \class AliMUONDarcHeader
10/// \brief MUON Darc header for Trigger
11///
12// Author Christian Finck
13
14#include <TObject.h>
15#include <TClonesArray.h>
16
17class AliMUONRegHeader;
18
19class AliMUONDarcHeader : public TObject {
20
21public:
22 AliMUONDarcHeader();
23 AliMUONDarcHeader(const AliMUONDarcHeader& event);
24 AliMUONDarcHeader& operator=(const AliMUONDarcHeader& event);
25
26 virtual ~AliMUONDarcHeader();
27
28
29 /// Return first word
30 UInt_t GetWord() const {return fWord;}
31 /// Return global input
32 Int_t GetGlobalInput(Int_t n) const {return fGlobalInput[n];}
33 /// Return global output
34 UChar_t GetGlobalOutput() const {return (fGlobalOutput & 0xFF);}
35 /// Return global config
36 UShort_t GetGlobalConfig() const {return ((fGlobalOutput >> 16) & 0xFFFF);}
37
38 //MBZ:1, phys trig:1, type:3, ,SerialNb:4,Version:8,VME trig:1,
39 //GlobalFlag:1, CTP trig:1, DAQ:1, Reg pattern:8;
40
41 /// Return event type
42 //Bool_t GetEventType() const {return (fWord & 0x40000000);}
43 Bool_t GetEventType() const;
44 /// Return Darc type
45 UChar_t GetDarcType() const {return (UChar_t)(fWord >> 24) & 0x7;}
46 /// Return serial number
47 UChar_t GetSerialNb() const {return (UChar_t)(fWord >> 20) & 0xF;}
48 /// Return version
49 UChar_t GetVersion() const {return (UChar_t)(fWord >> 13) & 0xFF;}
50 /// Return VME trig
51 Bool_t GetVMETrig() const {return (fWord & 0x800);}
52 /// Return global flag
53 Bool_t GetGlobalFlag() const {return (fWord & 0x400);}
54 /// Return CPT trigger
55 Bool_t GetCTPTrig() const {return (fWord & 0x200);}
56 /// Return DAQ flag
57 Bool_t GetDAQFlag() const {return (fWord & 0x100);}
58 /// Return reg pattern
59 UChar_t GetRegPattern() const {return (UChar_t)(fWord & 0xFF);}
60
61 /// Set first word
62 void SetWord(UInt_t w) {fWord = w;}
63 /// Set global input
64 void SetGlobalInput(Int_t in, Int_t n) {fGlobalInput[n] = in;}
65 /// Set global output
66 void SetGlobalOutput(Int_t out) {fGlobalOutput = out;}
67
68 /// Return darc header length
69 Int_t GetDarcHeaderLength() const {return fgkDarcHeaderLength;}
70 /// Return global header length
71 Int_t GetGlobalHeaderLength() const {return fgkGlobalHeaderLength;}
72
73 /// Return header
74 UInt_t* GetHeader() {return &fWord;}
75 /// Return global input
76 Int_t* GetGlobalInput() {return &fGlobalInput[0];}
77
78 // DARC get methods
79 /// Return DARC L0 received and used
80 UInt_t GetDarcL0R() const {return fDarcL0R;}
81 /// Return DARC L1 physics
82 UInt_t GetDarcL1P() const {return fDarcL1P;}
83 /// Return DARC L1 software
84 UInt_t GetDarcL1S() const {return fDarcL1S;}
85 /// Return DARC L2 accept
86 UInt_t GetDarcL2A() const {return fDarcL2A;}
87 /// Return DARC L2 reject
88 UInt_t GetDarcL2R() const {return fDarcL2R;}
89 /// Return DARC clock
90 UInt_t GetDarcClock() const {return fDarcClk;}
91 /// Return DARC hold (dead time)
92 UInt_t GetDarcHold() const {return fDarcHold;}
93
94 // don't use setting methods but memcpy
95 /// Return global L0
96 UInt_t* GetGlobalScalers() {return &fGlobalL0;}
97 /// Return DARC L0 received and used
98 UInt_t* GetDarcScalers() {return &fDarcL0R;}
99
100 // global get methods
101 /// Return global L0
102 UInt_t GetGlobalL0() const {return fGlobalL0;}
103 /// Return global clock
104 UInt_t GetGlobalClock() const {return fGlobalClk;}
105 /// Return global scaler
106 const UInt_t* GetGlobalScaler() const {return fGlobalScaler;}
107 /// Return global hold (dead time)
108 UInt_t GetGlobalHold() const {return fGlobalHold;}
109 /// Return global spare
110 UInt_t GetGlobalSpare() const {return fGlobalSpare;}
111
112 /// Return length of global scaler in word
113 Int_t GetGlobalScalerLength() const {return fgkGlobalScalerLength;}
114 /// Return length of DARC scaler in word
115 Int_t GetDarcScalerLength() const {return fgkDarcScalerLength;}
116
117 /// Return end of darc info word
118 UInt_t GetEndOfDarc() const {return fgkEndOfDarc;}
119 /// Return end of global info word
120 UInt_t GetEndOfGlobal() const {return fgkEndOfGlobal;}
121
122 // set random numbers to fill variable
123 void SetScalersNumbers();
124
125 /// get TClonesArray
126 TClonesArray* GetRegHeaderArray() const {return fRegHeaderArray;}
127
128 /// get entries
129 Int_t GetRegHeaderEntries() const {return fRegHeaderArray->GetEntriesFast();}
130
131 /// get entry
132 AliMUONRegHeader* GetRegHeaderEntry(Int_t i) const {
133 return (AliMUONRegHeader*)fRegHeaderArray->At(i);}
134
135 // clear
136 void Clear(Option_t* opt);
137
138 private:
139
140 UInt_t fWord; ///< first word
141 Int_t fGlobalInput[4]; ///< global input
142 Int_t fGlobalOutput; ///< global ouput
143
144 static const Int_t fgkDarcHeaderLength; ///< darc header length
145 static const Int_t fgkGlobalHeaderLength; ///< global header length
146
147
148 // global card scalers
149 UInt_t fGlobalL0; ///< global L0
150 UInt_t fGlobalClk; ///< global clock
151 UInt_t fGlobalScaler[6]; ///< global ouput
152 UInt_t fGlobalHold; ///< global hold (dead time)
153 UInt_t fGlobalSpare; ///< global spare
154 static const Int_t fgkGlobalScalerLength; ///< length of global scaler in word
155
156 // DARC Scalers
157 UInt_t fDarcL0R; ///< DARC L0 received and used
158 UInt_t fDarcL1P; ///< DARC L1 physics
159 UInt_t fDarcL1S; ///< DARC L1 software
160 UInt_t fDarcL2A; ///< DARC L2 accept
161 UInt_t fDarcL2R; ///< DARC L2 reject
162 UInt_t fDarcClk; ///< DARC clock
163 UInt_t fDarcHold; ///< DARC hold (dead time)
164 UInt_t fDarcSpare; ///< DARC Empty slot (for the moment)
165
166 static const Int_t fgkDarcScalerLength; ///< length of DARC scaler in word
167
168 static const UInt_t fgkEndOfDarc; ///< end of darc info word
169 static const UInt_t fgkEndOfGlobal; ///< end of global info word
170
171 TClonesArray* fRegHeaderArray; ///< container for regional header
172
173 ClassDef(AliMUONDarcHeader,1) // MUON DDL Trigger
174};
175#endif