1 | #ifndef MARS_MSimTrigger
|
---|
2 | #define MARS_MSimTrigger
|
---|
3 |
|
---|
4 | #ifndef MARS_MTask
|
---|
5 | #include "MTask.h"
|
---|
6 | #endif
|
---|
7 |
|
---|
8 | #ifndef MARS_MLut
|
---|
9 | #include "MLut.h"
|
---|
10 | #endif
|
---|
11 |
|
---|
12 | class MParList;
|
---|
13 | class MParameterD;
|
---|
14 | class MAnalogChannels;
|
---|
15 | class MRawEvtHeader;
|
---|
16 | class MRawRunHeader;
|
---|
17 | class MPedestalCam;
|
---|
18 |
|
---|
19 | class MSimTrigger : public MTask
|
---|
20 | {
|
---|
21 | private:
|
---|
22 | MAnalogChannels *fCamera; //! The analog input channels
|
---|
23 | MParameterD *fPulsePos; //! The intended pulse positon
|
---|
24 | MParameterD *fTrigger; //! The trigger position w.r.t. the analog channels
|
---|
25 | MRawRunHeader *fRunHeader; //! The run header storing infos about the digitization
|
---|
26 | MRawEvtHeader *fEvtHeader; //! The event header storing the trigger information
|
---|
27 | MPedestalCam *fElectronicNoise; //! Electronic noise (for baseline correction)
|
---|
28 | MPedestalCam *fGain; //! Gain of the pulses
|
---|
29 |
|
---|
30 | MLut fRouteAC; // Combinination map for the AC channels
|
---|
31 | MLut fCoincidenceMap; // channels for which digital coincidence is checked
|
---|
32 |
|
---|
33 | TString fNameRouteAC; // Name for the AC routing
|
---|
34 | TString fNameCoincidenceMap; // Name for the coincidence mape
|
---|
35 |
|
---|
36 | Float_t fDiscriminatorThreshold; // Discriminator threshold
|
---|
37 | Float_t fDigitalSignalLength; // Length of the output of the discriminator
|
---|
38 | Float_t fCoincidenceTime; // Minimum coincidence time (gate)
|
---|
39 |
|
---|
40 | Bool_t fShiftBaseline; // Shift the baseline back to 0 for the threshold (needs ElectronicNoise [MPedestalCam])
|
---|
41 | Bool_t fUngainSignal; // "Remove" the gain from the signal (needs Gain [MPedestalCam])
|
---|
42 | Bool_t fSimulateElectronics; // If the electronics is not simulated the trigger is set artificially to the first photon arrived
|
---|
43 |
|
---|
44 | Int_t fMinMultiplicity; // N out of M
|
---|
45 |
|
---|
46 | // MSimTrigger
|
---|
47 | TObjArray *CalcCoincidence(const TObjArray &arr1, const TObjArray &arr2/*, Float_t gate=0*/) const;
|
---|
48 | TObjArray *CalcMinMultiplicity(const MArrayI &idx, const TObjArray &ttls, Int_t threshold) const;
|
---|
49 | TObjArray *CalcCoincidences(const MArrayI &idx, const TObjArray &ttls) const;
|
---|
50 | void SetTrigger(Double_t pos);
|
---|
51 |
|
---|
52 | // MTask
|
---|
53 | Int_t PreProcess(MParList *pList);
|
---|
54 | Int_t Process();
|
---|
55 |
|
---|
56 | // MParContainer
|
---|
57 | Int_t ReadEnv(const TEnv &env, TString prefix, Bool_t print);
|
---|
58 |
|
---|
59 | public:
|
---|
60 | MSimTrigger(const char *name=NULL, const char *title=NULL);
|
---|
61 |
|
---|
62 | void SetNameRouteAC(const char *name) { fNameRouteAC=name; }
|
---|
63 | void SetNameCoincidenceMap(const char *name) { fNameCoincidenceMap=name; }
|
---|
64 |
|
---|
65 | void SetDiscriminatorThreshold(Float_t th) { fDiscriminatorThreshold=th; }
|
---|
66 | void SetDigitalSignalLength(Float_t ln) { fDigitalSignalLength=ln; }
|
---|
67 | void SetCoincidenceTime(Float_t tm) { fCoincidenceTime=tm; }
|
---|
68 |
|
---|
69 | ClassDef(MSimTrigger, 0) // Task to simulate trigger electronics
|
---|
70 | };
|
---|
71 |
|
---|
72 | #endif
|
---|