source: branches/MarsISDCBranchBasedOn17887/msimcamera/MSimTrigger.h@ 19929

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