Classes for trigger raw data
[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///
12/// \author Christian Finck
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
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 GetHeaderLength() const {return fgkHeaderLength;}
45
46 UInt_t* GetHeader() {return &fWord;}
47 Int_t* GetGlobalInput() {return &fGlobalInput[0];}
48
49 // DARC get methods
50 UInt_t GetDarcL0R() const {return fDarcL0R;}
51 UInt_t GetDarcL0U() const {return fDarcL0U;}
52 UInt_t GetDarcL0P() const {return fDarcL0P;}
53 UInt_t GetDarcL0S() const {return fDarcL0S;}
54 UInt_t GetDarcClock() const {return fDarcClk;}
55 UInt_t GetDarcHold() const {return fDarcHold;}
56
57 // don't use setting methods but memcpy
58 UInt_t* GetGlobalScalers() {return &fGlobalL0;}
59 UInt_t* GetDarcScalers() {return &fDarcL0R;}
60
61 // global get methods
62 UInt_t GetGlobalL0() const {return fGlobalL0;}
63 UInt_t GetGlobalClock() const {return fGlobalClk;}
64 const UInt_t* GetGlobalScaler() const {return fGlobalScaler;}
65 UInt_t GetGlobalHold() const {return fGlobalHold;}
66 UInt_t GetGlobalSpare() const {return fGlobalSpare;}
67
68 Int_t GetGlobalScalerLength() const {return fgkGlobalScalerLength;}
69 Int_t GetDarcScalerLength() const {return fgkDarcScalerLength;}
70
71 UInt_t GetEndOfDarc() const {return fgkEndOfDarc;}
72 UInt_t GetEndOfGlobal() const {return fgkEndOfGlobal;}
73
74 // set random numbers to fill variable
75 void SetScalersNumbers();
76
77 // get TClonesArray
78 TClonesArray* GetRegHeaderArray() const {return fRegHeaderArray;}
79
80 // get entries
81 Int_t GetRegHeaderEntries() const {return fRegHeaderArray->GetEntriesFast();}
82
83 // get entry
84 AliMUONRegHeader* GetRegHeaderEntry(Int_t i) const {
85 return (AliMUONRegHeader*)fRegHeaderArray->At(i);}
86
87 // clear
88 void Clear(Option_t* opt);
89
90 private:
91
92 UInt_t fWord; // first word
93 Int_t fGlobalInput[4]; // global input
94 Int_t fGlobalOutput; // global ouput
95
96 static const Int_t fgkHeaderLength; // header length
97
98
99 // global card scalers
100 UInt_t fGlobalL0; // global L0
101 UInt_t fGlobalClk; // global clock
102 UInt_t fGlobalScaler[6]; // global ouput
103 UInt_t fGlobalHold; // global hold (dead time)
104 UInt_t fGlobalSpare; // global spare
105 static const Int_t fgkGlobalScalerLength; // length of global scaler in word
106
107 // DARC Scalers
108 UInt_t fDarcL0R; // DARC L0 received
109 UInt_t fDarcL0U; // DARC L0 used
110 UInt_t fDarcL0P; // DARC Physical L0
111 UInt_t fDarcL0S; // DARC Software (checking) L0
112 UInt_t fDarcClk; // DARC clock
113 UInt_t fDarcHold; // DARC hold (dead time)
114 static const Int_t fgkDarcScalerLength; // length of DARC scaler in word
115
116 static const UInt_t fgkEndOfDarc; // end of darc info word
117 static const UInt_t fgkEndOfGlobal; // end of global info word
118
119 TClonesArray* fRegHeaderArray; //container for regional header
120
121 ClassDef(AliMUONDarcHeader,1) // MUON DDL Trigger
122};
123#endif