Update rawdata format for trigger (Christian)
[u/mrichter/AliRoot.git] / MUON / AliMUONRegHeader.h
CommitLineData
32def6aa 1#ifndef ALIMUONREGHEADER_H
2#define ALIMUONREGHEADER_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 AliMUONRegHeader
10/// \brief MUON regional header for trigger
11///
12/// \author Christian Finck
13
14#include <TObject.h>
15#include <TClonesArray.h>
16
17class AliMUONLocalStruct;
18
19class AliMUONRegHeader : public TObject{
20
21public:
22 AliMUONRegHeader();
23 AliMUONRegHeader(const AliMUONRegHeader& event);
24 AliMUONRegHeader& operator=(const AliMUONRegHeader& event);
25
26 virtual ~AliMUONRegHeader();
27
00f56161 28 UInt_t GetDarcWord() const {return fDarcWord;}
32def6aa 29 UInt_t GetWord() const {return fWord;}
30 UInt_t GetInput(Int_t n) const {return fInput[n];}
31
32 //MBZ:3,serialNb:5,Version:8,Id:4,MBZ:4,Out:8
33 Char_t GetSerialNb() const {return (Char_t)(fWord >> 24) & 0x1F;}
34 Char_t GetVersion() const {return (Char_t)(fWord >> 16) & 0xFF;}
35 Char_t GetId() const {return (Char_t)(fWord >> 12) & 0x0F;}
36 Char_t GetOutput() const {return (Char_t)(fWord) & 0xFF;}
37
00f56161 38 void SetDarcWord(UInt_t w) {fDarcWord = w;}
32def6aa 39 void SetWord(UInt_t w) {fWord = w;}
40 void SetInput(UInt_t in, Int_t n) {fInput[n] = in;}
41
42 Int_t GetHeaderLength() const {return fgkHeaderLength;}
43 UInt_t GetEndOfReg() const {return fgkEndOfReg;}
44
45
00f56161 46 UInt_t* GetHeader() {return &fDarcWord;}
32def6aa 47
48 // scalar methods
49 UInt_t GetL0() const {return fL0;}
50 UInt_t GetClock() const {return fClk;}
51 const UInt_t* GetScaler() const {return fScaler;}
52 UInt_t GetHold() const {return fHold;}
53
54 UInt_t* GetScalers() {return &fL0;}
55
56 // get scaler length
57 Int_t GetScalerLength() const {return fgkScalerLength;}
58
59 // set random numbers to fill variable
60 void SetScalersNumbers();
61
62 // get TClonesArray
63 TClonesArray* GetLocalArray() const {return fLocalArray;}
64
65 // get entries
66 Int_t GetLocalEntries() const {return fLocalArray->GetEntriesFast();}
67
68 // get entry
69 AliMUONLocalStruct* GetLocalEntry(Int_t i) const {
70 return (AliMUONLocalStruct*)fLocalArray->At(i);}
71
72 // clear
73 void Clear(Option_t* opt);
74
75 private:
76
77 // regional header
00f56161 78 UInt_t fDarcWord; ///< darc word
79 UInt_t fWord; ///< first reg word
829425a5 80 UInt_t fInput[2]; ///< regional input
32def6aa 81
82 // regional card scalers
829425a5 83 UInt_t fL0; ///< regional L0
84 UInt_t fClk; ///< regional clock
85 UInt_t fScaler[8]; ///< regional ouput
86 UInt_t fHold; ///< regional hold (dead time)
32def6aa 87
829425a5 88 static const Int_t fgkScalerLength; ///< length of regional scaler in word
89 static const Int_t fgkHeaderLength; ///< header length in word
90 static const UInt_t fgkEndOfReg; ///< end of regional info word
32def6aa 91
829425a5 92 TClonesArray* fLocalArray; ///< array of local structure
32def6aa 93
94 ClassDef(AliMUONRegHeader,3)
95};
96#endif