1 #ifndef ALIVZEROTRIGGERSIMULATOR_H
\r
2 #define ALIVZEROTRIGGERSIMULATOR_H
\r
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights
\r
6 * See cxx source for full Copyright notice
\r
9 // Class AliVZEROTriggerSimulator
\r
10 // ------------------------------
\r
11 // Simulate the VZERO Trigger response
\r
12 // Use FEE parameters stored in Database
\r
13 // Can work on real data or in simulation
\r
16 #include <TObject.h>
\r
18 #include "AliVZEROTriggerData.h"
\r
20 class AliVZEROLogicalSignal;
\r
24 class AliVZEROTriggerSimulator : public TObject {
\r
26 AliVZEROTriggerSimulator();
\r
27 AliVZEROTriggerSimulator(TTree * digitsTree, TClonesArray* digits);
\r
28 ~AliVZEROTriggerSimulator();
\r
30 AliVZEROTriggerData * GetTriggerData() const {return fTriggerData;};
\r
32 Bool_t GetBBAandBBC() const {return (fTriggerWord & 0x1);};
\r
33 Bool_t GetBBAorBBC() const {return (fTriggerWord>>1 & 0x1);};
\r
34 Bool_t GetBGAandBBC() const {return (fTriggerWord>>2 & 0x1);};
\r
35 Bool_t GetBGA() const {return (fTriggerWord>>3 & 0x1);};
\r
36 Bool_t GetBGCandBBA() const {return (fTriggerWord>>4 & 0x1);};
\r
37 Bool_t GetBGC() const {return (fTriggerWord>>5 & 0x1);};
\r
38 Bool_t GetCTA1andCTC1() const {return (fTriggerWord>>6 & 0x1);};
\r
39 Bool_t GetCTA1orCTC1() const {return (fTriggerWord>>7 & 0x1);};
\r
40 Bool_t GetCTA2andCTC2() const {return (fTriggerWord>>8 & 0x1);};
\r
41 Bool_t GetCTA2orCTC2() const {return (fTriggerWord>>9 & 0x1);};
\r
42 Bool_t GetMTAandMTC() const {return (fTriggerWord>>10 & 0x1);};
\r
43 Bool_t GetMTAorMTC() const {return (fTriggerWord>>11 & 0x1);};
\r
44 Bool_t GetBBA() const {return (fTriggerWord>>12 & 0x1);};
\r
45 Bool_t GetBBC() const {return (fTriggerWord>>13 & 0x1);};
\r
46 Bool_t GetBGAorBGC() const {return (fTriggerWord>>14 & 0x1);};
\r
47 Bool_t GetBeamGas() const {return (fTriggerWord>>15 & 0x1);};
\r
49 void SetBBAandBBC() { (fTriggerWord += 0x1);};
\r
50 void SetBBAorBBC() { (fTriggerWord += 0x1<<1);};
\r
51 void SetBGAandBBC() { (fTriggerWord += 0x1<<2);};
\r
52 void SetBGA() { (fTriggerWord += 0x1<<3);};
\r
53 void SetBGCandBBA() { (fTriggerWord += 0x1<<4);};
\r
54 void SetBGC() { (fTriggerWord += 0x1<<5);};
\r
55 void SetCTA1andCTC1() { (fTriggerWord += 0x1<<6);};
\r
56 void SetCTA1orCTC1() { (fTriggerWord += 0x1<<7);};
\r
57 void SetCTA2andCTC2() { (fTriggerWord += 0x1<<8);};
\r
58 void SetCTA2orCTC2() { (fTriggerWord += 0x1<<9);};
\r
59 void SetMTAandMTC() { (fTriggerWord += 0x1<<10);};
\r
60 void SetMTAorMTC() { (fTriggerWord += 0x1<<11);};
\r
61 void SetBBA() { (fTriggerWord += 0x1<<12);};
\r
62 void SetBBC() { (fTriggerWord += 0x1<<13);};
\r
63 void SetBGAorBGC() { (fTriggerWord += 0x1<<14);};
\r
64 void SetBeamGas() { (fTriggerWord += 0x1<<15);};
\r
67 virtual void Print(Option_t* /* opt */) const;
\r
71 AliVZEROTriggerSimulator(const AliVZEROTriggerSimulator &/*triggerSim*/);
\r
72 AliVZEROTriggerSimulator& operator= (const AliVZEROTriggerSimulator & /*triggerSim*/);
\r
73 AliVZEROTriggerData * LoadTriggerData() const ;
\r
74 void LoadClockOffset();
\r
75 void GenerateBBWindows();
\r
76 void GenerateBGWindows();
\r
77 Bool_t AreGatesOpen() const;
\r
80 AliVZEROLogicalSignal * fBBGate[AliVZEROTriggerData::kNCIUBoards]; // BB Observation window
\r
81 AliVZEROLogicalSignal * fBBLatch[AliVZEROTriggerData::kNCIUBoards]; // BB Latch window
\r
82 AliVZEROLogicalSignal * fBBReset[AliVZEROTriggerData::kNCIUBoards]; // BB Reset Window
\r
84 AliVZEROLogicalSignal * fBGGate[AliVZEROTriggerData::kNCIUBoards]; // BG Observation window
\r
85 AliVZEROLogicalSignal * fBGLatch[AliVZEROTriggerData::kNCIUBoards]; // BG Latch Window
\r
86 AliVZEROLogicalSignal * fBGReset[AliVZEROTriggerData::kNCIUBoards]; // BG Reset Window
\r
88 AliVZEROTriggerData *fTriggerData; // Object holding the trigger configuration parameters
\r
89 Float_t fClockOffset[AliVZEROTriggerData::kNCIUBoards]; // TDC clock offset including roll-over, trig count and L0->L1 delay
\r
91 TTree* fDigitsTree; //Pointer to VZERO digit tree
\r
92 TClonesArray* fDigits; //Pointer to VZERO digit array
\r
94 Bool_t fBBFlags[64]; // Individual BB Flags
\r
95 Bool_t fBGFlags[64]; // Individual BG Flags
\r
96 Float_t fCharges[64]; // Individual Charge
\r
98 UShort_t fTriggerWord; // Word holding the 16 triggers return by the FEE
\r
100 ClassDef( AliVZEROTriggerSimulator, 3 )
\r
105 #endif // ALIVZEROTRIGGERSIMULATOR_H
\r