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