]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONDarcHeader.h
Update scaler words (Christian)
[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    UInt_t  GetWord()               const {return fWord;}
30    Int_t   GetGlobalInput(Int_t n) const {return fGlobalInput[n];}
31    Int_t   GetGlobalOutput()       const {return fGlobalOutput;}
32
33    //DarcId:4,SerialNb:4,Version:8,EventType:4,GlobalFlag:4,MBZ:8;
34    Char_t  GetDarcId()     const {return (Char_t)(fWord >> 28) &  0xF;}
35    Char_t  GetSerialNb()   const {return (Char_t)(fWord >> 24) &  0xF;}
36    Char_t  GetVersion()    const {return (Char_t)(fWord >> 16) &  0xFF;}
37    Char_t  GetEventType()  const {return (Char_t)(fWord >> 12) &  0xF;}
38    Char_t  GetGlobalFlag() const {return (Char_t)(fWord >>  8) &  0xF;}
39
40    void    SetWord(UInt_t w) {fWord = w;}
41    void    SetGlobalInput(Int_t in, Int_t n) {fGlobalInput[n] = in;}
42    void    SetGlobalOutput(Int_t out) {fGlobalOutput = out;}
43
44    Int_t   GetDarcHeaderLength()   const {return fgkDarcHeaderLength;}
45    Int_t   GetGlobalHeaderLength() const {return fgkGlobalHeaderLength;}
46
47    UInt_t* GetHeader() {return &fWord;}
48    Int_t*  GetGlobalInput()    {return &fGlobalInput[0];}
49
50   // DARC get methods
51    UInt_t  GetDarcL0R()     const {return fDarcL0R;}
52    UInt_t  GetDarcL1P()     const {return fDarcL1P;}
53    UInt_t  GetDarcL1S()     const {return fDarcL1S;}
54    UInt_t  GetDarcL2A()     const {return fDarcL2A;}
55    UInt_t  GetDarcL2R()     const {return fDarcL2R;}
56    UInt_t  GetDarcClock()   const {return fDarcClk;}
57    UInt_t  GetDarcHold()    const {return fDarcHold;}
58    
59    // don't use setting methods but memcpy
60    UInt_t* GetGlobalScalers()  {return &fGlobalL0;}
61    UInt_t* GetDarcScalers()    {return &fDarcL0R;} 
62
63    // global get methods
64    UInt_t  GetGlobalL0()      const {return fGlobalL0;}
65    UInt_t  GetGlobalClock()   const {return fGlobalClk;}
66    const UInt_t* GetGlobalScaler()  const {return fGlobalScaler;}
67    UInt_t  GetGlobalHold()    const {return fGlobalHold;}
68    UInt_t  GetGlobalSpare()   const {return fGlobalSpare;}
69
70    Int_t GetGlobalScalerLength() const {return fgkGlobalScalerLength;}
71    Int_t GetDarcScalerLength()   const {return fgkDarcScalerLength;} 
72
73    UInt_t GetEndOfDarc()     const {return fgkEndOfDarc;} 
74    UInt_t GetEndOfGlobal()   const {return fgkEndOfGlobal;} 
75
76    // set random numbers to fill variable
77    void SetScalersNumbers();
78
79   // get TClonesArray
80    TClonesArray*  GetRegHeaderArray()  const {return fRegHeaderArray;}
81
82    // get entries
83    Int_t GetRegHeaderEntries()  const {return fRegHeaderArray->GetEntriesFast();}
84
85    // get entry
86    AliMUONRegHeader* GetRegHeaderEntry(Int_t i) const  {
87      return (AliMUONRegHeader*)fRegHeaderArray->At(i);}
88
89    // clear
90    void Clear(Option_t* opt);
91
92  private:
93
94    UInt_t    fWord;              ///< first word
95    Int_t     fGlobalInput[4];    ///< global input
96    Int_t     fGlobalOutput;      ///< global ouput
97
98    static const Int_t fgkDarcHeaderLength;   ///< darc header length
99    static const Int_t fgkGlobalHeaderLength; ///< global header length
100
101
102  // global card scalers   
103    UInt_t     fGlobalL0;         ///< global L0
104    UInt_t     fGlobalClk;        ///< global clock
105    UInt_t     fGlobalScaler[6];  ///< global ouput
106    UInt_t     fGlobalHold;       ///< global hold (dead time)
107    UInt_t     fGlobalSpare;      ///< global spare
108    static const Int_t      fgkGlobalScalerLength;  ///< length of global scaler in word
109
110    // DARC Scalers
111    UInt_t     fDarcL0R;       ///< DARC L0 received
112    UInt_t     fDarcL1P;       ///< DARC L1 physics
113    UInt_t     fDarcL1S;       ///< DARC L1 software
114    UInt_t     fDarcL2A;       ///< DARC L2 accept
115    UInt_t     fDarcL2R;       ///< DARC L2 reject
116    UInt_t     fDarcClk;       ///< DARC clock
117    UInt_t     fDarcHold;      ///< DARC hold (dead time)
118    static const Int_t      fgkDarcScalerLength;  ///< length of DARC scaler in word
119
120    static const UInt_t     fgkEndOfDarc;         ///< end of darc info word
121    static const UInt_t     fgkEndOfGlobal;       ///< end of global info word
122
123    TClonesArray* fRegHeaderArray; ///< container for regional header
124
125    ClassDef(AliMUONDarcHeader,1)  // MUON DDL Trigger
126 };
127 #endif