source: trunk/MagicSoft/Simulation/Detector/include-MTrigger/MTrigger.hxx@ 370

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