bug fixed (Valerie)
[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
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
1839c0b1 49 UChar_t GetVersion() const {return (UChar_t)(fWord >> 13) & 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
32def6aa 64 void SetGlobalInput(Int_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
32def6aa 76 Int_t* GetGlobalInput() {return &fGlobalInput[0];}
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
122 // set random numbers to fill variable
123 void SetScalersNumbers();
124
71a2d3aa 125 /// get TClonesArray
32def6aa 126 TClonesArray* GetRegHeaderArray() const {return fRegHeaderArray;}
127
71a2d3aa 128 /// get entries
32def6aa 129 Int_t GetRegHeaderEntries() const {return fRegHeaderArray->GetEntriesFast();}
130
71a2d3aa 131 /// get entry
32def6aa 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
829425a5 140 UInt_t fWord; ///< first word
141 Int_t fGlobalInput[4]; ///< global input
142 Int_t fGlobalOutput; ///< global ouput
32def6aa 143
18d3ded7 144 static const Int_t fgkDarcHeaderLength; ///< darc header length
145 static const Int_t fgkGlobalHeaderLength; ///< global header length
32def6aa 146
147
148 // global card scalers
829425a5 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
32def6aa 155
156 // DARC Scalers
d622a0ec 157 UInt_t fDarcL0R; ///< DARC L0 received and used
883199be 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
829425a5 162 UInt_t fDarcClk; ///< DARC clock
163 UInt_t fDarcHold; ///< DARC hold (dead time)
d622a0ec 164 UInt_t fDarcSpare; ///< DARC Empty slot (for the moment)
165
829425a5 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
32def6aa 172
173 ClassDef(AliMUONDarcHeader,1) // MUON DDL Trigger
174};
175#endif