source: trunk/Mars/msimcamera/MSimTrigger.h@ 19713

Last change on this file since 19713 was 19695, checked in by tbretz, 5 years ago
Added an option to write the trigger channel intp the raw channels to sample the trigger channel instead of the raw channels.
File size: 3.6 KB
Line 
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
16class MParList;
17class MParameterD;
18class MAnalogChannels;
19class MRawEvtHeader;
20class MRawRunHeader;
21class MPedestalCam;
22
23class MSimTrigger : public MTask
24{
25private:
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
56 Bool_t fDebugTrigger; // Copy the sum signal back to the camera for debugging purpose
57
58#if 0
59 // debugging
60 std::ofstream patch_file;
61 std::ofstream clipped_file;
62 std::ofstream digital_file;
63 std::ofstream ratescan_file;
64#endif
65
66 // MSimTrigger
67 TObjArray *CalcCoincidence(const TObjArray &arr1, const TObjArray &arr2/*, Float_t gate=0*/) const;
68 TObjArray *CalcMinMultiplicity(const MArrayI &idx, const TObjArray &ttls, Int_t threshold) const;
69 TObjArray *CalcCoincidences(const MArrayI &idx, const TObjArray &ttls) const;
70 void SetTrigger(Double_t pos, Int_t idx);
71
72 // MTask
73 Int_t PreProcess(MParList *pList);
74 Int_t Process();
75 Int_t PostProcess();
76
77 // MParContainer
78 Int_t ReadEnv(const TEnv &env, TString prefix, Bool_t print);
79
80public:
81 MSimTrigger(const char *name=NULL, const char *title=NULL);
82
83 void SetNameRouteAC(const char *name) { fNameRouteAC=name; }
84 void SetNameCoincidenceMap(const char *name) { fNameCoincidenceMap=name; }
85
86 void SetDiscriminatorThreshold(Float_t th) { fDiscriminatorThreshold=th; }
87 void SetDigitalSignalLength(Float_t ln) { fDigitalSignalLength=ln; }
88 void SetCoincidenceTime(Float_t tm) { fCoincidenceTime=tm; }
89
90 ClassDef(MSimTrigger, 0) // Task to simulate trigger electronics
91};
92
93#endif
Note: See TracBrowser for help on using the repository browser.