]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONDarcHeader.h
Add comments for Doxygen
[u/mrichter/AliRoot.git] / MUON / AliMUONDarcHeader.h
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
17 class AliMUONRegHeader;
18
19 class AliMUONDarcHeader : public TObject {
20  
21 public:
22    AliMUONDarcHeader();
23    AliMUONDarcHeader(const AliMUONDarcHeader& event);
24    AliMUONDarcHeader& operator=(const AliMUONDarcHeader& event);
25
26    virtual ~AliMUONDarcHeader();
27
28
29             /// Return first word
30    UInt_t   GetWord()               const {return fWord;}
31             /// Return global input
32    Int_t    GetGlobalInput(Int_t n) const {return fGlobalInput[n];}
33             /// Return global output
34    UChar_t  GetGlobalOutput()       const {return (fGlobalOutput & 0xFF);}
35             /// Return global config  
36    UShort_t GetGlobalConfig()       const {return ((fGlobalOutput >> 16) & 0xFFFF);}
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
41             /// Return event type
42    Bool_t  GetEventType()  const {return (fWord &  0x40000000);}
43             /// Return Darc type
44    UChar_t GetDarcType()   const {return (UChar_t)(fWord >> 27) &  0x7;}
45             /// Return serial number
46    UChar_t GetSerialNb()   const {return (UChar_t)(fWord >> 23) &  0xF;}
47             /// Return version
48    UChar_t GetVersion()    const {return (UChar_t)(fWord >> 15) &  0xFF;}
49             /// Return VME trig
50    Bool_t  GetVMETrig()    const {return (fWord &  0x800);}
51             /// Return global flag
52    Bool_t  GetGlobalFlag() const {return (fWord &  0x400);}
53             /// Return CPT trigger
54    Bool_t  GetCTPTrig()    const {return (fWord &  0x200);}
55             /// Return DAQ flag
56    Bool_t  GetDAQFlag()    const {return (fWord &  0x100);}
57             /// Return reg pattern
58    UChar_t GetRegPattern() const {return (UChar_t)(fWord &  0xFF);}
59
60            /// Set first word
61    void    SetWord(UInt_t w) {fWord = w;}
62            /// Set global input
63    void    SetGlobalInput(Int_t in, Int_t n) {fGlobalInput[n] = in;}
64            /// Set global output
65    void    SetGlobalOutput(Int_t out) {fGlobalOutput = out;}
66
67             /// Return darc header length
68    Int_t   GetDarcHeaderLength()   const {return fgkDarcHeaderLength;}
69             /// Return global header length
70    Int_t   GetGlobalHeaderLength() const {return fgkGlobalHeaderLength;}
71
72             /// Return header
73    UInt_t* GetHeader() {return &fWord;}
74             /// Return global input
75    Int_t*  GetGlobalInput()    {return &fGlobalInput[0];}
76
77   // DARC get methods
78             /// Return DARC L0 received and used
79    UInt_t  GetDarcL0R()     const {return fDarcL0R;}
80             /// Return DARC L1 physics
81    UInt_t  GetDarcL1P()     const {return fDarcL1P;}
82             /// Return DARC L1 software
83    UInt_t  GetDarcL1S()     const {return fDarcL1S;}
84             /// Return DARC L2 accept
85    UInt_t  GetDarcL2A()     const {return fDarcL2A;}
86             /// Return DARC L2 reject
87    UInt_t  GetDarcL2R()     const {return fDarcL2R;}
88             /// Return DARC clock
89    UInt_t  GetDarcClock()   const {return fDarcClk;}
90             /// Return DARC hold (dead time)
91    UInt_t  GetDarcHold()    const {return fDarcHold;}
92    
93    // don't use setting methods but memcpy
94             /// Return global L0
95    UInt_t* GetGlobalScalers()  {return &fGlobalL0;}
96             /// Return DARC L0 received and used
97    UInt_t* GetDarcScalers()    {return &fDarcL0R;} 
98
99    // global get methods
100             /// Return global L0
101    UInt_t  GetGlobalL0()      const {return fGlobalL0;}
102             /// Return global clock
103    UInt_t  GetGlobalClock()   const {return fGlobalClk;}
104             /// Return global scaler
105    const UInt_t* GetGlobalScaler()  const {return fGlobalScaler;}
106             /// Return global hold (dead time)
107    UInt_t  GetGlobalHold()    const {return fGlobalHold;}
108             /// Return global spare
109    UInt_t  GetGlobalSpare()   const {return fGlobalSpare;}
110
111             /// Return length of global scaler in word
112    Int_t GetGlobalScalerLength() const {return fgkGlobalScalerLength;}
113             /// Return length of DARC scaler in word
114    Int_t GetDarcScalerLength()   const {return fgkDarcScalerLength;} 
115
116             /// Return end of darc info word
117    UInt_t GetEndOfDarc()     const {return fgkEndOfDarc;} 
118             /// Return end of global info word
119    UInt_t GetEndOfGlobal()   const {return fgkEndOfGlobal;} 
120
121    // set random numbers to fill variable
122    void SetScalersNumbers();
123
124    /// get TClonesArray
125    TClonesArray*  GetRegHeaderArray()  const {return fRegHeaderArray;}
126
127    /// get entries
128    Int_t GetRegHeaderEntries()  const {return fRegHeaderArray->GetEntriesFast();}
129
130    /// get entry
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
139    UInt_t    fWord;              ///< first word
140    Int_t     fGlobalInput[4];    ///< global input
141    Int_t     fGlobalOutput;      ///< global ouput
142
143    static const Int_t fgkDarcHeaderLength;   ///< darc header length
144    static const Int_t fgkGlobalHeaderLength; ///< global header length
145
146
147  // global card scalers   
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
154
155    // DARC Scalers
156    UInt_t     fDarcL0R;       ///< DARC L0 received and used
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
161    UInt_t     fDarcClk;       ///< DARC clock
162    UInt_t     fDarcHold;      ///< DARC hold (dead time)
163    UInt_t     fDarcSpare;     ///< DARC Empty slot (for the moment)
164
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
171
172    ClassDef(AliMUONDarcHeader,1)  // MUON DDL Trigger
173 };
174 #endif