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 | #if 0
|
---|
13 | #include <fstream>
|
---|
14 | #endif
|
---|
15 |
|
---|
16 | class MParList;
|
---|
17 | class MParameterD;
|
---|
18 | class MAnalogChannels;
|
---|
19 | class MRawEvtHeader;
|
---|
20 | class MRawRunHeader;
|
---|
21 | class MPedestalCam;
|
---|
22 |
|
---|
23 | class MSimTrigger : public MTask
|
---|
24 | {
|
---|
25 | private:
|
---|
26 | MAnalogChannels *fCamera; //! The analog input channels
|
---|
27 | MParameterD *fPulsePos; //! The intended pulse positon
|
---|
28 | MParameterD *fTrigger; //! The trigger position w.r.t. the analog channels
|
---|
29 | MRawRunHeader *fRunHeader; //! The run header storing infos about the digitization
|
---|
30 | MRawEvtHeader *fEvtHeader; //! The event header storing the trigger information
|
---|
31 | MPedestalCam *fElectronicNoise; //! Electronic noise (for baseline correction)
|
---|
32 | MPedestalCam *fGain; //! Gain of the pulses
|
---|
33 |
|
---|
34 | MLut fRouteAC; // Combinination map for the AC channels
|
---|
35 | MLut fCoincidenceMap; // channels for which digital coincidence is checked
|
---|
36 |
|
---|
37 | TString fNameRouteAC; // Name for the AC routing
|
---|
38 | TString fNameCoincidenceMap; // Name for the coincidence mape
|
---|
39 |
|
---|
40 | Float_t fDiscriminatorThreshold; // Discriminator threshold
|
---|
41 | Float_t fDigitalSignalLength; // Length of the output of the discriminator
|
---|
42 | Float_t fCoincidenceTime; // Minimum coincidence time (gate) [slices]
|
---|
43 |
|
---|
44 | Bool_t fShiftBaseline; // Shift the baseline back to 0 for the threshold (needs ElectronicNoise [MPedestalCam])
|
---|
45 | Bool_t fUngainSignal; // "Remove" the gain from the signal (needs Gain [MPedestalCam])
|
---|
46 | Bool_t fSimulateElectronics; // If the electronics is not simulated the trigger is set artificially to the first photon arrived
|
---|
47 |
|
---|
48 | Int_t fMinMultiplicity; // N out of M
|
---|
49 |
|
---|
50 | Int_t fCableDelay; // signal runtime on the clipping cable in slices, e.g. 105cm cable = 2*105cm
|
---|
51 | // (20cm/ns) = 10.5ns = 21slices @ 2GHz [slices]
|
---|
52 |
|
---|
53 | Float_t fCableDamping; // the signal is damped a bit when reflecting at the end of the cable and is inverted as well.
|
---|
54 | // Damping factor in [-1..0]. In short tests by Kai Schennetten it looked like -0.96.
|
---|
55 | #if 0
|
---|
56 | // debugging
|
---|
57 | std::ofstream patch_file;
|
---|
58 | std::ofstream clipped_file;
|
---|
59 | std::ofstream digital_file;
|
---|
60 | std::ofstream ratescan_file;
|
---|
61 | #endif
|
---|
62 |
|
---|
63 | // MSimTrigger
|
---|
64 | TObjArray *CalcCoincidence(const TObjArray &arr1, const TObjArray &arr2/*, Float_t gate=0*/) const;
|
---|
65 | TObjArray *CalcMinMultiplicity(const MArrayI &idx, const TObjArray &ttls, Int_t threshold) const;
|
---|
66 | TObjArray *CalcCoincidences(const MArrayI &idx, const TObjArray &ttls) const;
|
---|
67 | void SetTrigger(Double_t pos, Int_t idx);
|
---|
68 |
|
---|
69 | // MTask
|
---|
70 | Int_t PreProcess(MParList *pList);
|
---|
71 | Int_t Process();
|
---|
72 | Int_t PostProcess();
|
---|
73 |
|
---|
74 | // MParContainer
|
---|
75 | Int_t ReadEnv(const TEnv &env, TString prefix, Bool_t print);
|
---|
76 |
|
---|
77 | public:
|
---|
78 | MSimTrigger(const char *name=NULL, const char *title=NULL);
|
---|
79 |
|
---|
80 | void SetNameRouteAC(const char *name) { fNameRouteAC=name; }
|
---|
81 | void SetNameCoincidenceMap(const char *name) { fNameCoincidenceMap=name; }
|
---|
82 |
|
---|
83 | void SetDiscriminatorThreshold(Float_t th) { fDiscriminatorThreshold=th; }
|
---|
84 | void SetDigitalSignalLength(Float_t ln) { fDigitalSignalLength=ln; }
|
---|
85 | void SetCoincidenceTime(Float_t tm) { fCoincidenceTime=tm; }
|
---|
86 |
|
---|
87 | ClassDef(MSimTrigger, 0) // Task to simulate trigger electronics
|
---|
88 | };
|
---|
89 |
|
---|
90 | #endif
|
---|