]> git.uio.no Git - u/mrichter/AliRoot.git/blob - VZERO/AliVZEROTriggerData.h
Implementation of Trigger simulation (Raphael Tieulent)
[u/mrichter/AliRoot.git] / VZERO / AliVZEROTriggerData.h
1 #ifndef ALIVZEROTRIGGERDATA_H
2 #define ALIVZEROTRIGGERDATA_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights
4  * reserved. 
5  *
6  * See cxx source for full Copyright notice                               
7  */
8 #include "AliVZERODataFEE.h";
9
10 #include <TNamed.h>
11
12 class AliVZEROTriggerData : public TNamed {
13 public:
14         AliVZEROTriggerData();
15         AliVZEROTriggerData(Int_t nRun, UInt_t startTime, UInt_t endTime);
16         ~AliVZEROTriggerData();
17         AliVZEROTriggerData(const AliVZEROTriggerData &triggerData);
18         AliVZEROTriggerData& operator= (const AliVZEROTriggerData &triggerData);
19         
20         void FillData(AliVZERODataFEE * data);
21
22         // ----- Setters -----
23
24         void SetClk1Win1(UShort_t* clks);
25         void SetClk1Win1(UShort_t clk, Int_t board);
26         void SetClk2Win1(UShort_t* clks);
27         void SetClk2Win1(UShort_t clk, Int_t board);
28         
29         void SetClk1Win2(UShort_t* clks);
30         void SetClk1Win2(UShort_t clk, Int_t board);
31         void SetClk2Win2(UShort_t* clks);
32         void SetClk2Win2(UShort_t clk, Int_t board);
33         
34         void SetDelayClk1Win1(UShort_t* delays);
35         void SetDelayClk1Win1(UShort_t delay, Int_t board);
36         void SetDelayClk2Win1(UShort_t* delays);
37         void SetDelayClk2Win1(UShort_t delay, Int_t board);
38         
39         void SetDelayClk1Win2(UShort_t* delays);
40         void SetDelayClk1Win2(UShort_t delay, Int_t board);
41         void SetDelayClk2Win2(UShort_t* delays);
42         void SetDelayClk2Win2(UShort_t delay, Int_t board);
43         
44         void SetLatchWin1(UShort_t *latchs);
45         void SetLatchWin1(UShort_t latch, Int_t board);
46         void SetLatchWin2(UShort_t *latchs);
47         void SetLatchWin2(UShort_t latch, Int_t board);
48         
49         void SetResetWin1(UShort_t *resets);
50         void SetResetWin1(UShort_t reset, Int_t board);
51         void SetResetWin2(UShort_t *resets);
52         void SetResetWin2(UShort_t reset, Int_t board);
53         
54         void SetPedestalSubtraction(Bool_t *peds);
55         void SetPedestalSubtraction(Bool_t ped, Int_t board);
56         
57         void SetBBAThreshold(UShort_t th) {fBBAThreshold = th;};
58         void SetBBCThreshold(UShort_t th) {fBBCThreshold = th;};
59
60         void SetBGAThreshold(UShort_t th) {fBGAThreshold = th;};
61         void SetBGCThreshold(UShort_t th) {fBGCThreshold = th;};
62
63         void SetBBAForBGThreshold(UShort_t th) {fBBAForBGThreshold = th;};
64         void SetBBCForBGThreshold(UShort_t th) {fBBCForBGThreshold = th;};
65         
66         void SetCentralityV0AThrLow(UShort_t th) {fCentralityVOAThrLow = th;};
67         void SetCentralityV0AThrHigh(UShort_t th) {fCentralityVOAThrHigh = th;};
68         
69         void SetCentralityV0CThrLow(UShort_t th) {fCentralityVOCThrLow = th;};
70         void SetCentralityV0CThrHigh(UShort_t th) {fCentralityVOCThrHigh = th;};
71         
72         void SetMultV0AThrLow(UShort_t th) {fMultV0AThrLow = th;};
73         void SetMultV0AThrHigh(UShort_t th) {fMultV0AThrHigh = th;};
74         
75         void SetMultV0CThrLow(UShort_t th) {fMultV0CThrLow = th;};
76         void SetMultV0CThrHigh(UShort_t th) {fMultV0CThrHigh = th;};
77         
78         void SetTriggerSelected(UShort_t trigger, Int_t output);
79         
80         void SetEnableCharge(Bool_t val, Int_t board, Int_t channel);
81         void SetEnableTiming(Bool_t val, Int_t board, Int_t channel);
82         void SetDiscriThr(UShort_t val, Int_t board, Int_t channel);
83         void SetDelayHit(UShort_t val, Int_t board, Int_t channel);
84         void SetPedestal(UShort_t val, Int_t integrator, Int_t board, Int_t channel);
85         void SetPedestalCut(UShort_t val, Int_t integrator, Int_t board, Int_t channel);
86
87         
88         // ----- Getters -----
89         
90         UShort_t * GetClk1Win1() const {return (UShort_t*)fClk1Win1;};
91         UShort_t GetClk1Win1(Int_t board ) const {return (board<kNCIUBoards?fClk1Win1[board]:0);};
92         UShort_t * GetClk2Win1() const {return (UShort_t*)fClk2Win1;};
93         UShort_t GetClk2Win1(Int_t board ) const {return (board<kNCIUBoards?fClk2Win1[board]:0);};
94
95         UShort_t * GetClk1Win2() const {return (UShort_t*)fClk1Win2;};
96         UShort_t GetClk1Win2(Int_t board ) const {return (board<kNCIUBoards?fClk1Win2[board]:0);};
97         UShort_t * GetClk2Win2() const {return (UShort_t*)fClk2Win2;};
98         UShort_t GetClk2Win2(Int_t board ) const {return (board<kNCIUBoards?fClk2Win2[board]:0);};
99
100         UShort_t * GetDelayClk1Win1() const {return (UShort_t*)fDelayClk1Win1;};
101         UShort_t GetDelayClk1Win1(Int_t board ) const {return (board<kNCIUBoards?fDelayClk1Win1[board]:0);};
102         UShort_t * GetDelayClk2Win1() const {return (UShort_t*)fDelayClk2Win1;};
103         UShort_t GetDelayClk2Win1(Int_t board ) const {return (board<kNCIUBoards?fDelayClk2Win1[board]:0);};
104         
105         UShort_t * GetDelayClk1Win2() const {return (UShort_t*)fDelayClk1Win2;};
106         UShort_t GetDelayClk1Win2(Int_t board ) const {return (board<kNCIUBoards?fDelayClk1Win2[board]:0);};
107         UShort_t * GetDelayClk2Win2() const {return (UShort_t*)fDelayClk2Win2;};
108         UShort_t GetDelayClk2Win2(Int_t board ) const {return (board<kNCIUBoards?fDelayClk2Win2[board]:0);};
109         
110         UShort_t * GetLatchWin1() const {return (UShort_t*)fLatchWin1;};
111         UShort_t GetLatchWin1(Int_t board ) const  {return (board<kNCIUBoards?fLatchWin1[board]:0);};
112         UShort_t * GetLatchWin2() const {return (UShort_t*)fLatchWin2;};
113         UShort_t GetLatchWin2(Int_t board ) const  {return (board<kNCIUBoards?fLatchWin2[board]:0);};
114         
115         UShort_t * GetResetWin1() const {return (UShort_t*)fResetWin1;};
116         UShort_t GetResetWin1(Int_t board ) const  {return (board<kNCIUBoards?fResetWin1[board]:0);};
117         UShort_t * GetResetWin2() const {return (UShort_t*)fResetWin2;};
118         UShort_t GetResetWin2(Int_t board ) const  {return (board<kNCIUBoards?fResetWin2[board]:0);};
119         
120         Bool_t * GetPedestalSubtraction() const {return (Bool_t*) fPedestalSubtraction;};
121         Bool_t GetPedestalSubtraction(Int_t board ) const  {return (board<kNCIUBoards?fPedestalSubtraction[board]:0);};
122
123         UShort_t GetBBAThreshold() const {return fBBAThreshold;};
124         UShort_t GetBBCThreshold() const {return fBBCThreshold;};
125
126         UShort_t GetBGAThreshold() const {return fBGAThreshold;};
127         UShort_t GetBGCThreshold() const {return fBGCThreshold;};
128
129         UShort_t GetBBAForBGThreshold() const {return fBBAForBGThreshold;};
130         UShort_t GetBBCForBGThreshold() const {return fBBCForBGThreshold;};
131         
132         UShort_t GetCentralityV0AThrLow() const {return fCentralityVOAThrLow;};
133         UShort_t GetCentralityV0AThrHigh() const {return fCentralityVOAThrHigh;};
134         
135         UShort_t GetCentralityV0CThrLow() const {return fCentralityVOCThrLow;};
136         UShort_t GetCentralityV0CThrHigh() const {return fCentralityVOCThrHigh;};
137
138         UShort_t GetMultV0AThrLow() const {return fMultV0AThrLow;};
139         UShort_t GetMultV0AThrHigh() const {return fMultV0AThrHigh;};
140
141         UShort_t GetMultV0CThrLow() const {return fMultV0CThrLow;};
142         UShort_t GetMultV0CThrHigh() const {return fMultV0CThrHigh;};
143
144         UShort_t GetTriggerSelected(Int_t output) const {return (output<kNTriggerOutputs?fTriggerSelected[output]:0);};
145         
146         Bool_t GetEnableCharge(Int_t board, Int_t channel);
147         Bool_t GetEnableTiming(Int_t board, Int_t channel);
148         UShort_t GetDiscriThr(Int_t board, Int_t channel);
149         UShort_t GetDelayHit(Int_t board, Int_t channel);
150         UShort_t GetPedestal(Int_t integrator, Int_t board, Int_t channel);
151         UShort_t GetPedestalCut(Int_t integrator, Int_t board, Int_t channel);
152
153         enum {
154                 kNCIUBoards = AliVZERODataFEE::kNCIUBoards,
155                 kNAliases = AliVZERODataFEE::kNAliases,
156                 kNTriggerOutputs = 5,
157                 kNChannels = 8
158         };
159         
160 private:
161         
162         UShort_t fClk1Win1[kNCIUBoards]; //Profil of the Clock 1  of the Window 1 (BB window)
163         UShort_t fClk2Win1[kNCIUBoards]; //Profil of the Clock 2  of the Window 1 (BB window)
164         UShort_t fClk1Win2[kNCIUBoards]; //Profil of the Clock 1  of the Window 2 (BG window)
165         UShort_t fClk2Win2[kNCIUBoards]; //Profil of the Clock 2  of the Window 2 (BG window)
166         UShort_t fDelayClk1Win1[kNCIUBoards]; // Delays of the Clock 1  of the Window 1 (BB window)
167         UShort_t fDelayClk2Win1[kNCIUBoards]; // Delays of the Clock 2 of the Window 1 (BB window)
168         UShort_t fDelayClk1Win2[kNCIUBoards]; // Delays of the Clock 1  of the Window 2 (BG window)
169         UShort_t fDelayClk2Win2[kNCIUBoards]; // Delays of the Clock 2 of the Window 2 (BG window)
170         UShort_t fLatchWin1[kNCIUBoards]; //Profil of the Clock of the Latch signal of Window 1 (BB window)
171         UShort_t fLatchWin2[kNCIUBoards]; //Profil of the Clock of the Latch signal of Window 2 (BG window)
172         UShort_t fResetWin1[kNCIUBoards]; //Profil of the Clock of the Reset signal of Window 1 (BB window)
173         UShort_t fResetWin2[kNCIUBoards]; //Profil of the Clock of the Reset signal of Window 2 (BG window)
174         Bool_t   fPedestalSubtraction[kNCIUBoards]; // Flag to en(dis)able pedestal subtraction before centrality trigger calculation
175         UShort_t fBBAThreshold;  // Minimum bias Threshold in number of channel hit for V0A
176         UShort_t fBBCThreshold;  // Minimum bias Threshold in number of channel hit for V0C
177         UShort_t fBGAThreshold;  // Beam Gas Threshold in number of channel hit for V0A
178         UShort_t fBGCThreshold;  // Beam Gas Threshold in number of channel hit for V0C
179         UShort_t fBBAForBGThreshold;  // BBA threshold for Beam Gas triggers (i.e. BBA and BGC)
180         UShort_t fBBCForBGThreshold;  // BBC threshold for Beam Gas triggers (i.e. BBC and BGA)
181         UShort_t fCentralityVOAThrLow;  // Threshold used for centrality triggers (i.e. CTA1 and CTC1)
182         UShort_t fCentralityVOAThrHigh; // Threshold used for centrality triggers (i.e. CTA2 and CTC2)
183         UShort_t fCentralityVOCThrLow;  // Threshold used for centrality triggers (i.e. CTA1 and CTC1)
184         UShort_t fCentralityVOCThrHigh; // Threshold used for centrality triggers (i.e. CTA2 and CTC2)
185         UShort_t fMultV0AThrLow;  // Threshold used for multiplicity triggers (i.e. MTA and MTC)
186         UShort_t fMultV0AThrHigh; // Threshold used for multiplicity triggers (i.e. MTA and MTC)
187         UShort_t fMultV0CThrLow;  // Threshold used for multiplicity triggers (i.e. MTA and MTC)
188         UShort_t fMultV0CThrHigh; // Threshold used for multiplicity triggers (i.e. MTA and MTC)
189         UShort_t fTriggerSelected[kNTriggerOutputs]; // Triggers selected on the 5 outputs to CTP
190         Bool_t   fEnableCharge[kNCIUBoards][kNChannels]; // Flag to know is a channel is participating to the Charge triggers
191         Bool_t   fEnableTiming[kNCIUBoards][kNChannels]; // Flag to know is a channel is participating to the Timing triggers
192         UShort_t fDiscriThr[kNCIUBoards][kNChannels]; // Threshold of each discriminator
193         UShort_t fDelayHit[kNCIUBoards][kNChannels]; // Individual delays of each channel 
194         UShort_t fPedestalOdd[kNCIUBoards][kNChannels]; // Pedestals for the Odd integrators
195         UShort_t fPedestalEven[kNCIUBoards][kNChannels]; // Pedestals for the Even integrators
196         UShort_t fPedestalCutOdd[kNCIUBoards][kNChannels]; // Pedestals Cut for the Odd integrators
197         UShort_t fPedestalCutEven[kNCIUBoards][kNChannels]; // Pedestals Cut for the Even integrators
198
199         Int_t fRun;       // Run number
200         Int_t fStartTime; // Start time
201         Int_t fEndTime;   // End time
202         TString fAliasNames[kNAliases]; // aliases for DCS data
203         Bool_t fIsProcessed; // bool to know processing status
204         
205         Bool_t  IsClkValid(UShort_t clock);
206         void SetParameter(TString name, Float_t val);
207         
208         
209         ClassDef( AliVZEROTriggerData, 1 )  
210
211 };
212
213
214 #endif // ALIVZEROTRIGGERDATA_H