source: trunk/MagicSoft/Simulation/Detector/include-MFadc/MFadc.hxx@ 397

Last change on this file since 397 was 397, checked in by blanch, 24 years ago
*** empty log message ***
File size: 3.3 KB
Line 
1#ifndef __MFadc__
2#define __MFadc__
3//
4// class MFadc
5//
6// implemented by Harald Kornmayer
7//
8// This is a class to simulate the FADC.
9// It assumes a special response of the PMT for one single Photo-electron.
10//
11//
12//
13#include <stream.h>
14#include <math.h>
15
16#include "TObject.h"
17#include "TRandom.h"
18
19#include "Mdefine.h"
20
21#include "MTriggerDefine.h"
22
23class MMcEvt ;
24
25//==========
26// MFadc
27//
28// The simulation of the Flash ADC system for the MAGIC teleskop is done with
29// this class.
30// So all methods concerning the FADC System should be done inside this
31// class.
32//
33// The Idea is to (in)put the data of the photo electrons into the class and
34// generate the response (output) of the FADC to that input. Response means
35// in this sense the ADC values of the different time slices for all pixels
36//
37// The pixelisation is done by the camera program of Jose Carlos.
38//
39// This class is closly connected to the MTrigger classs. So some of the
40// values defined in MTriggerDefine.h are also used by this class.
41//
42// But a lot of other stuff is defined here.
43//
44// --> Frist of all the WIDTH of the time slice of one FADC slice
45// this is 3.33333 nsec.
46//
47#define WIDTH_FADC_TIMESLICE (50./15.) // this means 3.33 nsec
48//
49// --> Second the number of slices to fill in MFADC. This must by
50// connected to the MTrigger class. The time of interest must be
51// equal in both classes.
52//
53#define SLICES_MFADC (TOTAL_TRIGGER_TIME / WIDTH_FADC_TIMESLICE)
54// --> The amount of ns before trigger that would be read from the ADC
55// in oder to show also the start of the pulse before the
56// the trigger time.
57//
58#define TIME_BEFORE_TRIGGER 10.
59// --> like the trigger the FADC value will also have a standard response
60// to one single Photo electron. This response is binned with smaller
61// bins. The WIDTH of that response function is done here.
62//
63#define SUBBINS 5.
64#define WIDTH_RESPONSE_MFADC (WIDTH_FADC_TIMESLICE / SUBBINS ) // 5 sub-bin in one FADC slice
65//
66// --> the number of Response slices
67//
68#define RESPONSE_SLICES_MFADC 45
69//
70//
71#define MFADC_RESPONSE_FWHM 5.0
72
73//
74//
75#define MFADC_RESPONSE_AMPLITUDE 4.0
76//
77//
78//
79//
80class MFadc {
81 private:
82 //
83 // then for all pixels the shape of all the analog signals
84 //
85 Bool_t used[CAMERA_PIXELS] ; // a boolean to indicated if the pixels is used in this event
86
87 Float_t sig[CAMERA_PIXELS][(Int_t) SLICES_MFADC] ; // the analog signal for pixels
88 UChar_t output[CAMERA_PIXELS][FADC_SLICES]; // the analog signal for pixels that is read after a trigger occurs.
89
90 //
91 // first the data for the response function
92 //
93 Float_t fwhm_resp ; // fwhm of the phe_response function
94 Float_t ampl_resp ; // amplitude of the phe_response function (in mV)
95 Float_t sing_resp[ RESPONSE_SLICES_MFADC ] ; // the shape of the phe_response function
96 //
97 // RandomGenerator for the Electonic Noise
98 //
99
100 TRandom *GenElec ;
101
102
103public:
104
105 MFadc() ;
106
107 void Reset() ;
108
109 void Fill( Int_t, Float_t, Float_t ) ;
110
111 void ElecNoise() ;
112
113 void Scan() ;
114
115 void Scan(Float_t time) ;
116
117 void TriggeredFadc(Float_t time);
118
119 void ShowSignal ( MMcEvt *McEvt , Float_t ) ;
120
121 Float_t GetFadcSignal(Int_t pixel, Int_t slice);
122} ;
123
124
125#endif
Note: See TracBrowser for help on using the repository browser.