Separating run-dependent mapping data from data, which are not
[u/mrichter/AliRoot.git] / MUON / AliMUONLocalStruct.h
CommitLineData
32def6aa 1#ifndef ALIMUONLOCALSTRUCT_H
2#define ALIMUONLOCALSTRUCT_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 AliMUONLocalStruct
69d7ac2e 10/// \brief Rawdata local card structure for trigger
32def6aa 11///
78649106 12// Author Christian Finck
32def6aa 13
14#include <TObject.h>
dfba12ee 15#include <TMath.h>
861275bb 16#include <TArrayS.h>
17
32def6aa 18
19class AliMUONLocalStruct : public TObject{
20
21public:
22 AliMUONLocalStruct();
23 AliMUONLocalStruct(const AliMUONLocalStruct& event);
24 AliMUONLocalStruct& operator=(const AliMUONLocalStruct& event);
25
26
71a2d3aa 27 virtual ~AliMUONLocalStruct();
32def6aa 28
29 // local board info
71a2d3aa 30 /// Return local data
32def6aa 31 UInt_t GetData(Int_t n) const {return fData[n];}
32
71a2d3aa 33 /// Return X2
32def6aa 34 UShort_t GetX2() const {return (fData[0] >> 16) & 0xFFFF;}
71a2d3aa 35 /// Return X1
32def6aa 36 UShort_t GetX1() const {return (fData[0]) & 0xFFFF;}
71a2d3aa 37 /// Return X4
32def6aa 38 UShort_t GetX4() const {return (fData[1] >> 16) & 0xFFFF;}
71a2d3aa 39 /// Return X3
32def6aa 40 UShort_t GetX3() const {return (fData[1]) & 0xFFFF;}
861275bb 41 /// return X pattern array
42 void GetXPattern(TArrayS& array) const;
43 /// return Y pattern array
44 void GetYPattern(TArrayS& array) const;
32def6aa 45
71a2d3aa 46 /// Return Y2
32def6aa 47 UShort_t GetY2() const {return (fData[2] >> 16) & 0xFFFF;}
71a2d3aa 48 /// Return Y1
32def6aa 49 UShort_t GetY1() const {return (fData[2]) & 0xFFFF;}
71a2d3aa 50 /// Return Y4
32def6aa 51 UShort_t GetY4() const {return (fData[3] >> 16) & 0xFFFF;}
71a2d3aa 52 /// Return Y3
32def6aa 53 UShort_t GetY3() const {return (fData[3]) & 0xFFFF;}
54
71a2d3aa 55 /// Return Id
1afc1008 56 UChar_t GetId() const {return fData[4] >> 19 & 0xF;}
71a2d3aa 57 /// Return Dec
1afc1008 58 UChar_t GetDec() const {return fData[4] >> 15 & 0xF;}
7c97cbb1 59 /// Return TrigY
c97418cb 60 Bool_t GetTrigY() const {return (fData[4] >> 14 & 0x1);}
71a2d3aa 61 /// Return TriggerY
c97418cb 62 Bool_t GetTriggerY() const {return !(GetTrigY() && GetYPos()==15);}
71a2d3aa 63 /// Return Upos
1afc1008 64 UChar_t GetYPos() const {return fData[4] >> 10 & 0xF;}
fa3fe02e 65 /// Get Sign of X deviation
c4860b34 66 UChar_t GetSXDev() const {return fData[4] >> 9 & 0x1;}
fa3fe02e 67 /// Get X deviation
c4860b34 68 UChar_t GetXDev() const {return fData[4] >> 5 & 0xF;}
71a2d3aa 69 /// Return TriggerX
c97418cb 70 Bool_t GetTriggerX() const {return !(GetSXDev() &&
71 !GetXDev() &&
72 GetXPos()==0);}
71a2d3aa 73 /// Return Xpos
1afc1008 74 UChar_t GetXPos() const {return fData[4] & 0x1F;}
32def6aa 75
71a2d3aa 76 /// Return LPT
32def6aa 77 Int_t GetLpt() const {return (GetDec() & 0x3);}
71a2d3aa 78 /// Return HPT
32def6aa 79 Int_t GetHpt() const {return (GetDec() >> 2) & 0x3;}
80
71a2d3aa 81 /// Set local data
32def6aa 82 void SetData(UInt_t d, Int_t n) {fData[n] = d;}
83
71a2d3aa 84 /// Return data
32def6aa 85 UInt_t* GetData() {return &fData[0];}
86
87 // Scaler methods
71a2d3aa 88 /// Return local L0
32def6aa 89 UInt_t GetL0() const {return fL0;}
71a2d3aa 90 /// Return local hold (dead time)
32def6aa 91 UInt_t GetHold() const {return fHold;}
71a2d3aa 92 /// Return local clock
32def6aa 93 UInt_t GetClock() const {return fClk;}
71a2d3aa 94 /// Return switch
2c85fbc9 95 UShort_t GetSwitch() const {return (fEOS >> 1) & 0x3FF;}
71a2d3aa 96 /// Return ComptXY
e445ce57 97 UChar_t GetComptXY() const {return fEOS & 1;}
32def6aa 98
71a2d3aa 99 /// Return XY1
dfba12ee 100 UShort_t GetXY1(Int_t n) const {return (n % 2 == 0) ?
101 (fScaler[TMath::Nint(Float_t(n/2))] & 0xFFFF) :
102 (fScaler[TMath::Nint(Float_t(n/2))] >> 16) & 0xFFFF;}
103
71a2d3aa 104 /// Return XY2
dfba12ee 105 UShort_t GetXY2(Int_t n) const {return (n % 2 == 0) ?
106 (fScaler[8 + TMath::Nint(Float_t(n/2))] & 0xFFFF) :
107 (fScaler[8 + TMath::Nint(Float_t(n/2))] >> 16) & 0xFFFF;}
108
71a2d3aa 109 /// Return XY3
dfba12ee 110 UShort_t GetXY3(Int_t n) const {return (n % 2 == 0) ?
111 (fScaler[8*2 + TMath::Nint(Float_t(n/2))] & 0xFFFF) :
112 (fScaler[8*2 + TMath::Nint(Float_t(n/2))] >> 16) & 0xFFFF;}
113
71a2d3aa 114 /// Return XY4
dfba12ee 115 UShort_t GetXY4(Int_t n) const {return (n % 2 == 0) ?
116 (fScaler[8*3 + TMath::Nint(Float_t(n/2))] & 0xFFFF) :
117 (fScaler[8*3 + TMath::Nint(Float_t(n/2))] >> 16) & 0xFFFF;}
32def6aa 118
71a2d3aa 119 /// Return scalers
32def6aa 120 UInt_t* GetScalers() {return &fL0;}
121
122 // get length
71a2d3aa 123 /// Return scaler length in word
32def6aa 124 Int_t GetScalerLength() const {return fgkScalerLength;}
71a2d3aa 125 /// Return local info length in word
32def6aa 126 Int_t GetLength() const {return fgkLength;}
71a2d3aa 127 /// Return end of local info word
32def6aa 128 UInt_t GetEndOfLocal() const {return fgkEndOfLocal;}
71a2d3aa 129 /// Return Word for "empty" slots
b2e46925 130 UInt_t GetDisableWord() const {return fgkDisableWord;}
32def6aa 131
71a2d3aa 132 // set random numbers to fill variable
32def6aa 133 void SetScalersNumbers();
134
135 private:
136
137 // local info
829425a5 138 UInt_t fData[5]; ///< local data
32def6aa 139
140 // local card scalers
829425a5 141 UInt_t fL0; ///< local L0
142 UInt_t fHold; ///< local hold (dead time)
143 UInt_t fClk; ///< local clock
32def6aa 144
829425a5 145 UInt_t fLPtNTrig; ///< local low Pt no trigger
146 UInt_t fHPtNTrig; ///< local high Pt no trigger
32def6aa 147
829425a5 148 UInt_t fLPtRTrig; ///< local low Pt right trigger
149 UInt_t fHPtRTrig; ///< local high Pt right trigger
32def6aa 150
829425a5 151 UInt_t fLPtLTrig; ///< local low Pt left trigger
152 UInt_t fHPtLTrig; ///< local high Pt left trigger
32def6aa 153
829425a5 154 UInt_t fLPtSTrig; ///< local low Pt straight trigger
155 UInt_t fHPtSTrig; ///< local high Pt straight trigger
32def6aa 156
829425a5 157 UInt_t fScaler[8*4]; ///< local data
158 UInt_t fEOS; ///< contains switches conf. & flag for reading X (0) or Y (1) in fScaler
159 UInt_t fReset; ///< reset signal
32def6aa 160
829425a5 161 static const Int_t fgkLength; ///< local info length in word
162 static const Int_t fgkScalerLength; ///< scaler length in word
163 static const UInt_t fgkEndOfLocal; ///< end of local info word
b6ab2009 164 static const UInt_t fgkDisableWord; ///< Word for "empty" slots
32def6aa 165
69d7ac2e 166 ClassDef(AliMUONLocalStruct,3) //Rawdata local card structure for trigger
32def6aa 167};
168#endif