1 | #ifndef __MTrigger__
|
---|
2 | #define __MTrigger__
|
---|
3 |
|
---|
4 | // class MTrigger
|
---|
5 | //
|
---|
6 | // implemented by Harald Kornmayer
|
---|
7 | //
|
---|
8 | // This is a class to simulate the trigger.
|
---|
9 | // It assumes a special response of the PMT for one single Photo-electron.
|
---|
10 | //
|
---|
11 | //
|
---|
12 | //
|
---|
13 | #include <iostream.h>
|
---|
14 | #include <math.h>
|
---|
15 |
|
---|
16 | #include "TROOT.h"
|
---|
17 | #include "TObject.h"
|
---|
18 | #include "TRandom.h"
|
---|
19 | #include "TH1.h"
|
---|
20 |
|
---|
21 | #include "Mdefine.h"
|
---|
22 | #include "MMcEvt.h"
|
---|
23 |
|
---|
24 | #include "MTriggerDefine.h"
|
---|
25 |
|
---|
26 |
|
---|
27 | //==========
|
---|
28 | // MTrigger
|
---|
29 | //
|
---|
30 | // The simulation of the Trigger for MonteCarlo Events is using this
|
---|
31 | // class. So all methods concerning the trigger should be done inside this
|
---|
32 | // class.
|
---|
33 | //
|
---|
34 | // For a better understanding of the behavior of the trigger is here small
|
---|
35 | // abstract of the trigger. This may change in the future.
|
---|
36 | //
|
---|
37 | //
|
---|
38 | // We now from the camera program (This is the surrounding of the class
|
---|
39 | // MTrigger.) that one photo electron leaves at time t the photo cathode
|
---|
40 | // of the pixel number iPix).
|
---|
41 | //
|
---|
42 | // At the end of the PMT, the preamp, the optical fiber transmission we
|
---|
43 | // get a signal of a given shape. After some discussion with Eckart the
|
---|
44 | // standard response function looks like this :
|
---|
45 | //
|
---|
46 | // It is a gaussian Signal with a given FWHM.
|
---|
47 | //
|
---|
48 | // So whenever a photo electron leaves the photo cathod, on has to add
|
---|
49 | // the standard response function to the analog signal of the pixel.
|
---|
50 | //
|
---|
51 | // Each pixel of the camera has such an summed-up analog signal. It may
|
---|
52 | // look like this picture:
|
---|
53 | //
|
---|
54 | //
|
---|
55 | // This is the input of the discriminator for the pixels. The output of
|
---|
56 | // the discriminator is a digital signal. The response of the diskriminator
|
---|
57 | // is not fixed at the moment. There are discussion about this topic.
|
---|
58 | //
|
---|
59 | // At the moment the response is very simple. Whenever the analog signal
|
---|
60 | // is crossing a defined threshold from below to above, a digital signal
|
---|
61 | // with a given length is created.
|
---|
62 | //
|
---|
63 | // No one can start with the simulation of different trigger levels.
|
---|
64 | //
|
---|
65 | // The TriggerLevelZero is a very easy one. It is just looking if there
|
---|
66 | // are more then N digital signals at level ON (=1). If this is the case,
|
---|
67 | // a TriggerLevelZero signal is created.
|
---|
68 | //
|
---|
69 | // The TriggerLevelOne is not implemented now. This will be a kind of next
|
---|
70 | // neighbour condition (i.e. four neigbouring analog signals at the same
|
---|
71 | // time, but this requests at least four digital signals at level ON, what
|
---|
72 | // is equivalent with a TriggerLevelZero.
|
---|
73 | //
|
---|
74 | //
|
---|
75 | class MTrigger {
|
---|
76 |
|
---|
77 | private:
|
---|
78 | //
|
---|
79 | // then for all pixels the shape of all the analog signals
|
---|
80 | //
|
---|
81 | Bool_t used [TRIGGER_PIXELS] ; // a boolean to indicated if the pixels is used in this event
|
---|
82 | Int_t nphot[TRIGGER_PIXELS]; // count the photo electrons per pixel (NSB phe are not counted)
|
---|
83 |
|
---|
84 | Float_t *a_sig[TRIGGER_PIXELS] ; // the analog signal for pixels
|
---|
85 |
|
---|
86 | Float_t baseline[TRIGGER_PIXELS] ; // for the baseline shift
|
---|
87 |
|
---|
88 | //
|
---|
89 | // then for all pixels the shape of the digital signal
|
---|
90 | //
|
---|
91 | Bool_t dknt [TRIGGER_PIXELS] ; // a boolean to indicated if the pixels has passed the diskrminator
|
---|
92 | Float_t *d_sig[TRIGGER_PIXELS] ; // the digital signal for all pixels
|
---|
93 |
|
---|
94 | //
|
---|
95 | // and the sum of all digital signals
|
---|
96 | //
|
---|
97 | Float_t sum_d_sig[TRIGGER_TIME_SLICES] ;
|
---|
98 |
|
---|
99 |
|
---|
100 | //
|
---|
101 | // first the data for the response function
|
---|
102 | //
|
---|
103 | Float_t fwhm_resp ; // fwhm of the phe_response function
|
---|
104 | Float_t ampl_resp ; // amplitude of the phe_response function (in mV)
|
---|
105 | Float_t sing_resp[ RESPONSE_SLICES ] ; // the shape of the phe_response function
|
---|
106 |
|
---|
107 | TH1F *histPmt ;
|
---|
108 | Float_t histMean ; // Mean value of the distribution of Rasmik (stored in histPmt)
|
---|
109 | TRandom *GenElec ; // RandomGenerator for the Electronic Noise
|
---|
110 |
|
---|
111 | //
|
---|
112 | // some values for the trigger settings
|
---|
113 | //
|
---|
114 |
|
---|
115 | Float_t chan_thres ; // the threshold (in mV) for each individuel pixels
|
---|
116 | Float_t gate_leng ; // the length of the digital signal if analog signal is above threshold
|
---|
117 |
|
---|
118 | Float_t trigger_multi ; // Number of Pixels requested for a Trigger
|
---|
119 |
|
---|
120 | //
|
---|
121 | // The lookup table for the next neighbours
|
---|
122 | //
|
---|
123 |
|
---|
124 | Int_t NN[TRIGGER_PIXELS][6] ;
|
---|
125 |
|
---|
126 | //
|
---|
127 | // some information about the different TriggerLevels in each Event
|
---|
128 | //
|
---|
129 |
|
---|
130 | Int_t nZero ; // how many ZeroLevel Trigger in one Event
|
---|
131 | Int_t SlicesZero[5] ; // Times Slices at which the ZeroLevel Triggers occur
|
---|
132 |
|
---|
133 | Int_t nFirst ; // how many FirstLevel Trigger in one Event
|
---|
134 | Int_t SlicesFirst[5] ; // Times Slices at which the FirstLevel Triggers occur
|
---|
135 |
|
---|
136 | Int_t nSecond ; // how many SecondLevel Trigger in one Event
|
---|
137 | Int_t SlicesSecond[5] ; // Times Slices at which the SecondLevel Triggers occur
|
---|
138 |
|
---|
139 |
|
---|
140 | public:
|
---|
141 |
|
---|
142 | MTrigger() ;
|
---|
143 |
|
---|
144 | ~MTrigger() ;
|
---|
145 |
|
---|
146 | void Reset() ;
|
---|
147 |
|
---|
148 | Float_t Fill( Int_t, Float_t ) ;
|
---|
149 |
|
---|
150 | Float_t FillNSB( Int_t, Float_t ) ;
|
---|
151 |
|
---|
152 | void ElecNoise() ;
|
---|
153 |
|
---|
154 | Int_t Diskriminate() ;
|
---|
155 |
|
---|
156 | Int_t FirstLevel() ;
|
---|
157 |
|
---|
158 | Bool_t PassNextNeighbour( Bool_t m[] ) ;
|
---|
159 |
|
---|
160 | void ShowSignal (MMcEvt *McEvt) ;
|
---|
161 |
|
---|
162 | Float_t GetFirstLevelTime( Int_t il ) ;
|
---|
163 |
|
---|
164 | } ;
|
---|
165 |
|
---|
166 | #endif
|
---|
167 |
|
---|