source: trunk/MagicSoft/Simulation/Detector/StarResponse/MStarLight.hxx@ 18307

Last change on this file since 18307 was 5408, checked in by moralejo, 20 years ago
*** empty log message ***
File size: 3.5 KB
Line 
1#include "MFadcDefine.h"
2#include "MTriggerDefine.h"
3
4#ifndef __MStarLight__
5#define __MStarLight__
6//
7// class MStarLight
8//
9//
10#include "TROOT.h"
11#include "TH1.h"
12#include "TFile.h"
13#include <iostream>
14#include <fstream>
15#include "stdlib.h"
16#include "TRandom2.h"
17
18//
19// Version 1004:
20// Added data member fGainFluctuations, which indicates whether PMT
21// gain fluctuations have been simulated or not in producing the noise
22// database. A.M. 16/11/2004
23
24#define VERSIONSR 1004.0
25
26#define TIMERANGE 10000 // ns
27
28class MStarLight {
29
30 private:
31
32 Float_t fBrightness; // the brightness of the star in phe/nsec
33
34 Float_t fTimeRange; // the time range of the trigger response
35
36 Int_t fBinsTrig; // Number of Bins in the trigger database
37 Int_t fTrigShape; // a number that indicate the shape type of
38 // the signal
39 // = 0 --> a gaussian
40 Float_t fAmplTrig; // the amplitude of the trigger in mV
41 Float_t fFwhmTrig; // the width of the signal in nsec
42
43 Int_t fBinsFadc; // Number of Bins in the FADC database
44 Int_t fFadcShape; // a number that indicate the shape type of
45 // the signal
46 // = 0 --> a gaussian
47 Float_t fIntegFadc; // the integral of the single phe response
48 // in the FADC (in FADC counts)
49 Float_t fFwhmFadc; // the width of the signal in nsec
50
51 Float_t *fTrig; // Trigger branch "history" for 10000 nanoseconds
52 Float_t *fTrigResp; // the shape of the response for trigger
53 Float_t *fFadc; // FADC "history" for 10000 nanoseconds
54 Float_t *fFadcResp; // the shape of the response for FADC
55
56 Float_t fFadcSlicesPerNanosec; // Number of FADC slices per ns
57 // (may be < 1 if FADC is faster than 1 GHz)
58
59 Int_t fResponseSlicesFadc;
60
61 Int_t fGainFluctuations; // Is 0 if PMT gain fluctuations have been
62 // disabled in the input card. By default it is 1
63
64 public:
65
66 MStarLight(Float_t fadc_slices_per_ns = 0.,
67 Int_t response_slices_fadc = 0);
68
69 void Reset();
70
71 void SetBrightness(Float_t in);
72 void SetAmplTrig(Float_t in);
73 void SetFwhmTrig(Float_t in);
74 void SetShapeFadc(Int_t in) {fFadcShape=in;}
75 void SetIntegFadc(Float_t in);
76 void SetFwhmFadc(Float_t in);
77 void SetFadcSlicesPerNanosec(Float_t in);
78 void SetGainFluctuations(Int_t in) { fGainFluctuations = in; }
79
80 Float_t GetBrightness();
81 Float_t GetAmplTrig();
82 Float_t GetFwhmTrig();
83 Int_t GetShapeFadc() {return fFadcShape;}
84 Float_t GetIntegFadc();
85 Float_t GetFwhmFadc();
86 Int_t GetBinsTrig() {return fBinsTrig;}
87 Int_t GetBinsFadc() {return fBinsFadc;}
88 Float_t GetTimeRange() {return fTimeRange;}
89 Float_t GetFadcSlicesPerNanosec() {return fFadcSlicesPerNanosec;}
90 Int_t GetGainFluctuations() const {return fGainFluctuations;}
91
92 void SetTrigResponse(Float_t *in);
93 void SetFadcResponse(Float_t *in);
94
95 void FillResponse(Float_t ampl, Float_t time);
96
97 void ElecNoise ( Float_t noiseTrig = 0.3 , Float_t noiseFadc = .5 );
98
99 Float_t GetTrig (Int_t i);
100 Float_t GetFadc (Int_t i);
101
102 Float_t* GetTrigPointer (Int_t i) { return &(fTrig[i]); }
103 Float_t* GetFadcPointer (Int_t i) { return &(fFadc[i]); }
104
105 void StoreHisto (char *filename );
106
107 void WriteBinary (char *filename );
108
109 void ReadBinary (char *filename );
110
111};
112
113#endif
Note: See TracBrowser for help on using the repository browser.