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