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