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