Line data Source code
1 : #ifndef ALIADTRIGGERSIMULATOR_H
2 : #define ALIADTRIGGERSIMULATOR_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 : //
9 : // Class AliADTriggerSimulator
10 : // ------------------------------
11 : // Simulate the AD Trigger response
12 : // Use FEE parameters stored in Database
13 : // Can work on real data or in simulation
14 : //
15 :
16 : #include <TObject.h>
17 : #include "AliADConst.h"
18 :
19 : class AliADLogicalSignal;
20 : class AliADCalibData;
21 : class TTree;
22 : class TClonesArray;
23 :
24 : class AliADTriggerSimulator : public TObject {
25 : public:
26 : AliADTriggerSimulator();
27 : AliADTriggerSimulator(TTree * digitsTree, TClonesArray* digits);
28 : ~AliADTriggerSimulator();
29 :
30 0 : AliADCalibData * GetCalibData() const {return fCalibData;};
31 :
32 0 : Bool_t GetBBAandBBC() const {return (fTriggerWord & 0x1);};
33 0 : Bool_t GetBBAorBBC() const {return (fTriggerWord>>1 & 0x1);};
34 0 : Bool_t GetBGAandBBC() const {return (fTriggerWord>>2 & 0x1);};
35 0 : Bool_t GetBGA() const {return (fTriggerWord>>3 & 0x1);};
36 0 : Bool_t GetBGCandBBA() const {return (fTriggerWord>>4 & 0x1);};
37 0 : Bool_t GetBGC() const {return (fTriggerWord>>5 & 0x1);};
38 0 : Bool_t GetCTA1andCTC1() const {return (fTriggerWord>>6 & 0x1);};
39 0 : Bool_t GetCTA1orCTC1() const {return (fTriggerWord>>7 & 0x1);};
40 0 : Bool_t GetCTA2andCTC2() const {return (fTriggerWord>>8 & 0x1);};
41 0 : Bool_t GetCTA2orCTC2() const {return (fTriggerWord>>9 & 0x1);};
42 0 : Bool_t GetMTAandMTC() const {return (fTriggerWord>>10 & 0x1);};
43 0 : Bool_t GetMTAorMTC() const {return (fTriggerWord>>11 & 0x1);};
44 0 : Bool_t GetBBA() const {return (fTriggerWord>>12 & 0x1);};
45 0 : Bool_t GetBBC() const {return (fTriggerWord>>13 & 0x1);};
46 0 : Bool_t GetBGAorBGC() const {return (fTriggerWord>>14 & 0x1);};
47 0 : Bool_t GetBeamGas() const {return (fTriggerWord>>15 & 0x1);};
48 :
49 0 : void SetBBAandBBC() { (fTriggerWord += 0x1);};
50 0 : void SetBBAorBBC() { (fTriggerWord += 0x1<<1);};
51 0 : void SetBGAandBBC() { (fTriggerWord += 0x1<<2);};
52 0 : void SetBGA() { (fTriggerWord += 0x1<<3);};
53 0 : void SetBGCandBBA() { (fTriggerWord += 0x1<<4);};
54 0 : void SetBGC() { (fTriggerWord += 0x1<<5);};
55 0 : void SetCTA1andCTC1() { (fTriggerWord += 0x1<<6);};
56 0 : void SetCTA1orCTC1() { (fTriggerWord += 0x1<<7);};
57 0 : void SetCTA2andCTC2() { (fTriggerWord += 0x1<<8);};
58 0 : void SetCTA2orCTC2() { (fTriggerWord += 0x1<<9);};
59 0 : void SetMTAandMTC() { (fTriggerWord += 0x1<<10);};
60 0 : void SetMTAorMTC() { (fTriggerWord += 0x1<<11);};
61 0 : void SetBBA() { (fTriggerWord += 0x1<<12);};
62 0 : void SetBBC() { (fTriggerWord += 0x1<<13);};
63 0 : void SetBGAorBGC() { (fTriggerWord += 0x1<<14);};
64 0 : void SetBeamGas() { (fTriggerWord += 0x1<<15);};
65 :
66 : void Run();
67 : void FillFlags(Bool_t *bbFlag, Bool_t *bgFlag, Float_t time[16]);
68 : virtual void Print(Option_t* /* opt */) const;
69 :
70 : private:
71 : // Private methods
72 : AliADTriggerSimulator(const AliADTriggerSimulator &/*triggerSim*/);
73 : AliADTriggerSimulator& operator= (const AliADTriggerSimulator & /*triggerSim*/);
74 : AliADCalibData * LoadCalibData() const ;
75 : void LoadClockOffset();
76 : void GenerateBBWindows();
77 : void GenerateBGWindows();
78 : void GenerateBCMask();
79 : Bool_t AreGatesOpen() const;
80 :
81 : // Members
82 : AliADLogicalSignal * fBBGate[kNCIUBoards]; // BB Observation window
83 : AliADLogicalSignal * fBGGate[kNCIUBoards]; // BG Observation window
84 : AliADLogicalSignal * fBCMask[kNCIUBoards]; // BC Mask
85 :
86 : AliADCalibData *fCalibData; // Object holding the trigger configuration parameters
87 : Float_t fWindowOffset[kNCIUBoards]; // TDC clock offset including roll-over, trig count and L0->L1 delay
88 :
89 : TTree* fDigitsTree; //Pointer to AD digit tree
90 : TClonesArray* fDigits; //Pointer to AD digit array
91 :
92 : Float_t fTime[16];
93 : Bool_t fBBFlags[16]; // Individual BB Flags
94 : Bool_t fBGFlags[16]; // Individual BG Flags
95 : Float_t fCharges[16]; // Individual Charge
96 :
97 : UShort_t fTriggerWord; // Word holding the 16 triggers return by the FEE
98 :
99 12 : ClassDef( AliADTriggerSimulator, 4 )
100 :
101 : };
102 :
103 :
104 : #endif // ALIADTRIGGERSIMULATOR_H
105 :
106 :
|