source: trunk/MagicSoft/include-Classes/MMcFormat/MMcTrigHeader.hxx@ 5827

Last change on this file since 5827 was 5410, checked in by moralejo, 20 years ago
*** empty log message ***
File size: 3.3 KB
Line 
1#ifndef __MMcTrigHeader__
2#define __MMcTrigHeader__
3
4#ifndef MARS_MParContainer
5#include "MParContainer.h"
6#endif
7
8#include "MTriggerDefine.h"
9#include "Mdefine.h"
10
11//
12// Version 4
13// Added data members fGainFluctuations and fNoiseGainFluctuations
14//
15
16class MMcTrigHeader : public MParContainer{
17 private:
18
19 Short_t fTopology ; // Topology of the trigger
20 // 0 = N-1 neighbours of one pixel
21 // 1 = N neighbours
22 // 2 = N closed pack
23 Short_t fMultiplicity ; // Pixel multiplicity of trigger configuration
24 Float_t fThreshold[CAMERA_PIXELS] ; // Threshold for trigger
25 UInt_t fTrigPattern[2]; // Used to inddentify with
26 // RawEvt::Trigger Pattern identification
27 Float_t fTrigShape ; // a number that indicate the shape type of
28 // the signal
29 // = 0 --> a gaussian
30 Float_t fAmplTrig ; // the amplitude of the trigger in mV
31 Float_t fFwhmTrig ; // the width of the signal in nsec
32 Float_t fOverlapingTime;// Minimum coincidence time
33 Float_t fGateLeng; // the length of the digital signal if analog
34 // signal is above threshold
35 Float_t fElecNoiseTrig; // The width of the gaussian noise is that times
36 // the amplitude of the single phe response
37 // for the trigger
38
39 Bool_t fGainFluctuations;
40 // kTRUE if PMT gain fluctuations were simulated for the signal
41 // (=> default in camera simulation)
42
43 Bool_t fNoiseGainFluctuations;
44 // kTRUE if PMT gain fluctuations were simulated for the NSB noise
45 // (=> default in StarResponse program)
46
47
48 public:
49 MMcTrigHeader() ;
50
51 ~MMcTrigHeader();
52
53 void Print(Option_t *opt=NULL) const;
54
55 void SetTopology(Short_t nTop) {
56 fTopology=nTop;
57 }
58
59 void SetMultiplicity(Short_t nMul) {
60 fMultiplicity=nMul;
61 }
62
63 void SetThreshold(Float_t fthr[]){
64 int i;
65 for(i=0;i<CAMERA_PIXELS;i++){
66 fThreshold[i]=fthr[i];
67 }
68 }
69
70 void SetTrigPattern (UInt_t upi, UInt_t loi){
71
72 if (upi==loi==0) {
73 fTrigPattern[0]= (UInt_t) fThreshold[0];
74 fTrigPattern[1]= (UInt_t) (100*fMultiplicity+fTopology);
75 }
76 else {
77 fTrigPattern[0]=upi;
78 fTrigPattern[1]=loi;
79 }
80 }
81
82 void SetShape(Float_t shape){
83 fTrigShape=shape;
84 }
85
86 void SetAmplitud(Float_t amp){
87 fAmplTrig=amp;
88 }
89
90 void SetFwhm(Float_t fwhm){
91 fFwhmTrig=fwhm;
92 }
93
94 void SetOverlap(Float_t overlap){
95 fOverlapingTime=overlap;
96 }
97
98 void SetGate(Float_t gate){
99 fGateLeng=gate;
100 }
101
102 void SetElecNoise( Float_t elecnoise){
103 fElecNoiseTrig = elecnoise;
104 }
105
106 void SetGainFluctuations(Bool_t x) { fGainFluctuations = x; }
107 void SetNoiseGainFluctuations(Bool_t x) { fNoiseGainFluctuations = x; }
108
109 Short_t GetMultiplicity() { return fMultiplicity; }
110
111 Float_t GetMeanThreshold()
112 {
113 int i;
114 Float_t sum = 0., trigpix = 0.;
115 for(i=0;i<CAMERA_PIXELS;i++)
116 {
117 if (fThreshold[i] < 1.e6 && fThreshold[i] > 0.)
118 {
119 sum += fThreshold[i];
120 trigpix += 1.;
121 }
122 }
123
124 return (sum / trigpix);
125 }
126
127
128 ClassDef(MMcTrigHeader, 4) //Stores Montecarlo Information which describes the used trigger
129
130};
131
132#endif
Note: See TracBrowser for help on using the repository browser.