source: trunk/MagicSoft/include-Classes/MMcFormat/MMcFadcHeader.cxx@ 7436

Last change on this file since 7436 was 7436, checked in by tbretz, 19 years ago
*** empty log message ***
File size: 4.0 KB
Line 
1/* ======================================================================== *\
2!
3! *
4! * This file is part of MARS, the MAGIC Analysis and Reconstruction
5! * Software. It is distributed to you in the hope that it can be a useful
6! * and timesaving tool in analysing Data of imaging Cerenkov telescopes.
7! * It is distributed WITHOUT ANY WARRANTY.
8! *
9! * Permission to use, copy, modify and distribute this software and its
10! * documentation for any purpose is hereby granted without fee,
11! * provided that the above copyright notice appear in all copies and
12! * that both that copyright notice and this permission notice appear
13! * in supporting documentation. It is provided "as is" without express
14! * or implied warranty.
15! *
16!
17!
18! Author(s): Unknown
19!
20! Copyright: MAGIC Software Development, 2000-2005
21!
22!
23\* ======================================================================== */
24
25//////////////////////////////////////////////////////////////////////////////
26//
27// MMcFadcHeader
28//
29// This class contains the MonteCarlo information
30// of the FADC simulation for the current run.
31// The information is saved only once, whatever the
32// number of events is
33//
34// NOTE : meaning of fAmplFadc, fAmplFadcOuter changed in camera 0.7,
35// 30/03/2004: before it was amplitude of (gaussian) pulse, now is
36// integral of pulse (which may be gaussian or not).
37//
38// In camera 0.7, the meaning of fPedesSigmaHigh, fPedesSigmaLow changed:
39// before it was the rms of the single FADC slice. Now we calculate the
40// RMS of the distribution of the sum of 14 FADC slices. The value we set
41// as fPedesSigmaHigh/Low is that RMS divided by sqrt(14). It can be seen
42// that the fluctuations of the integrated pedestal, when adding n slices
43// to obtain the pixel signal, with n>~6, is more or less well
44// approximated by sqrt(n)*RMS(sum_14)slices)/sqrt(14).
45//
46// Version 5:
47// Added member fGainFluctuations
48//
49// Version 6:
50// Added member fNoiseGainFluctuations
51//
52// Version 7:
53// Derived class from MCamEvent
54//
55//////////////////////////////////////////////////////////////////////////////
56#include "MMcFadcHeader.hxx"
57
58#include <iostream>
59
60ClassImp(MMcFadcHeader);
61
62using namespace std;
63
64MMcFadcHeader::MMcFadcHeader(const char *name, const char *title) {
65 //
66 // default constructor
67
68 fName = name ? name : "MMcFadcHeader";
69 fTitle = title ? title : "Fadc Header Information from Monte Carlo";
70
71 // set all values to zero
72
73 Int_t i;
74
75 fFadcShape=0.0;
76 fAmplFadc=MFADC_RESPONSE_INTEGRAL;
77 fFwhmFadc=MFADC_RESPONSE_FWHM;
78 fAmplFadcOuter=MFADC_RESPONSE_INTEGRAL;
79 fFwhmFadcOuter=MFADC_RESPONSE_FWHM;
80
81 for(i=0;i<MFADC_CHANNELS;i++){
82 fPedesMean[i]= 0.0 ;
83 fPedesSigmaHigh[i]=-1.0 ;
84 fPedesSigmaLow[i]=-1.0 ;
85 fElecNoise[i]=-1.0 ;
86 fDigitalNoise[i]=-1.0 ;
87 }
88}
89
90void MMcFadcHeader::Print(Option_t *Option) const {
91 //
92 // print out the data member on screen
93 //
94 cout << endl;
95 cout << "Monte Carlo Fadc output:" << endl;
96 cout << " Shape type of the signal: " << fFadcShape << endl;
97 cout << " FADC integral for sphe [counts*ns]: " << fAmplFadc << endl;
98 cout << " Width of the signal in nsec: " << fFwhmFadc << endl;
99 cout << " Outer FADC integral for sphe [counts*ns]: " << fAmplFadcOuter
100 << endl;
101 cout << " Width of the signal in nsec for outer: " << fFwhmFadcOuter
102 << endl;
103 cout << " Pedestals and ElecNoise in fadc counts: " << endl;
104 for (int i=0;i<MFADC_CHANNELS;i++){
105 cout << " Pixel "<<i<<": "<<fPedesMean[i]<<" "<<fElecNoise[i]<<endl;
106 }
107 cout << endl ;
108}
109
110Bool_t MMcFadcHeader::GetPixelContent(Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type) const
111{
112 if ((UInt_t)idx>=GetNumPixel())
113 return kFALSE;
114
115 switch (type)
116 {
117 case 0:
118 val = fPedesMean[idx];
119 break;
120 case 1:
121 val = fPedesSigmaHigh[idx];
122 break;
123 case 2:
124 val = fPedesSigmaLow[idx];
125 break;
126 case 3:
127 val = fElecNoise[idx];
128 break;
129 case 4:
130 val = fDigitalNoise[idx];
131 break;
132 default:
133 return kFALSE;
134 }
135 return kTRUE;
136}
Note: See TracBrowser for help on using the repository browser.