source: JEM-EUSO/esaf_cc_at_lal/packages/simulation/detector/electronics/include/SimpleDetector.hh @ 114

Last change on this file since 114 was 114, checked in by moretto, 11 years ago

actual version of ESAF at CCin2p3

File size: 7.8 KB
Line 
1// $Id: SimpleDetector.hh 2845 2010-02-25 05:43:43Z fenu $
2// Author: Sylvain Moreggia   2006/03/16
3
4/*****************************************************************************
5 * ESAF: Euso Simulation and Analysis Framework                              *
6 *                                                                           *
7 *  Id: SimpleDetector                                                           *
8 *  Package: electronics                                                   *
9 *  Coordinator: Marco.Pallavicini                                               *
10 *                                                                           *
11 *****************************************************************************/
12
13#ifndef __SIMPLEDETECTOR_HH__
14#define __SIMPLEDETECTOR_HH__
15
16#include "euso.hh"
17#include "Detector.hh"
18#include "EarthVector.hh"
19
20////////////////////////////////////////////////////////////////////////////////
21//                                                                            //
22// SimpleDetector                                                                 //
23//                                                                            // 
24// <brief class description>                                                  // 
25//                                                                            // 
26////////////////////////////////////////////////////////////////////////////////
27
28class PhotoElectron;
29class Photon;
30
31
32class SimpleDetector :  public Detector,  public EsafConfigurable, public EsafMsgSource {
33public:
34   
35    // ctor
36    SimpleDetector();
37   
38    // dtor
39    virtual ~SimpleDetector();
40
41    // do the complete simulation of one event
42    virtual Telemetry* Get( PhotonsOnPupil* );
43
44    // get ready for next event
45    virtual void Reset();
46
47    // initialization
48    void InitDetector();
49
50    // apply optics effect
51    Int_t ApplyOpticsFilter(const Photon& ph) const;
52   
53    // Create PhotoElectrons using Detection Quantum Efficiency (= Collection eff. * Quantum eff.)
54    Int_t ApplyDQE(const Photon& ph) const;
55   
56    // interpolation functions according to wl
57    Double_t InterpolateBG3(Double_t) const;
58    Double_t InterpolateQE(Double_t) const;
59   
60    // orders pe- chronologically
61    // then find the time of first GTU and ranges them in the map using GTU info
62    // find starting position of shower point (taken at fFirstGTUTime)
63    // set pixel ID as well
64    void SpaceTimePEinfos(const vector<PhotoElectron*>&);
65   
66    // find pe- pixel
67    // - using sqrt(x*x + y*y) value in the MES Z=0 plane
68    // - i,j in [0..n-1]  (i<-->row    j<-->column)
69    // - pixeldID = N --> i,j coordinates found back using N / n = i  and  N % n = j
70    // Check if position is in the FoV, return kFALSE if not
71    Bool_t FindPixelID(const EarthVector&,UInt_t&) const;
72   
73    // get pixel 2D position in the Mes Z=0 plane
74    // return kTRUE if pixel is in the FoV, kFALSE otherwise
75    Bool_t Pos2D_Z0plane(UInt_t,EarthVector&) const;
76   
77    // get lateral distance² to the track of given pixel
78    //Bool_t LateralDist2ToTrack(UInt_t, UInt_t&) const;   // disabled so far
79       
80    // add background around showerpoint pixels (no more around the whole showertrack !!)
81    // For every pe-, set the spatial shift w.r.t. shower point
82    // returns nb of bgnd pe-
83    Int_t AddBackground();
84   
85    // add background around direct fluorescence pixels at a given GTU
86    // needed for very inclined track, i.e. when total nb of bgnd pe- of previous method becomes huge
87    // For every pe-, set the spatial shift w.r.t. shower point
88    // returns nb of bgnd pe-
89    //Int_t AddMinimizedBackground();  // disabled so far
90   
91    // kind of trigger simulation
92    // Tag pe- according to the SNR per pixel per GTU : if (S + B) >= (<B> + 3*sigmaB), pixel/GTU considered as triggered
93    // returns nb of triggered pe-
94    Int_t ApplyTrigger();
95   
96    // calculate mean background per pixel per GTU (Nadir incidence)
97    Double_t MeanBgndPerPixelPerGTU(Double_t);
98   
99    // getters
100    UInt_t GetNbPhotoElectrons() const {return fPhotoElectrons.size();}
101   
102    // physically release the memory allocated by the arrays of this object
103    virtual Bool_t ClearMemory() {return kTRUE;}
104
105
106    EsafConfigClass(Electronics,SimpleDetector)
107   
108private:
109    // configs
110    Double_t fReducedSurf;                                      // factor of reduction of collecting surface
111    Bool_t fTriggEff;                                           // true : fraction of light correctly focused (in 5mm bucket, optical aberration, red book)
112    Double_t fBG3filter[400];                                   // tabulated value for BG3 filter
113    Double_t fPMQE[51];                                         // tabulated values for PM Quantum Efficiency
114    Double_t fGTUlength;                                        // GTU length
115    Double_t fPixelSideLength;                                  // pixel side length projected on the MES plane Z=0
116    Double_t fFirstPixelX;                                      // pixel high left corner X-position projected on the MES plane Z=0
117    Double_t fFirstPixelY;                                      // pixel high left corner Y-position projected on the MES plane Z=0
118    UInt_t fNbPixelOnSide;                                      // nb of pixels on a side of the square FS
119    Double_t fMeanBgnd;                                         // value in ph-on-pupil/m2/ns/sr
120    Double_t fSNRtrigg;                                         // nb of background sigma considered for SNR treatment
121    UInt_t fNpersTrigg;                                         // persistency = nb of GTU with adjacents hitted pixels
122    string fBgndWl;                                             // RedBook (within 300-400nm) or Extended (extrapolation within 200-600nm)
123    string fBgndMode;                                           // standard (added all along track, all GTU), minimized (around fluo pixel only, at one GTU)
124    string fBG3type;                                            // BG3 (long tail above 400nm), or BG3_coated (RedBook config, sharp cut above 400nm)
125    UInt_t fNbMaxLateralPixels;                                 // define maximum area around track to be considered in the simulation
126    UInt_t fMaxLateralDist2;                                    // = fNbMaxLateralPixels * fNbMaxLateralPixels
127    Bool_t fCloudStatus;                                        // false : photon absorbed by cloud are kept for simu
128   
129    // event data
130    map<UInt_t, vector<PhotoElectron*>* > fPhotoElectrons;      // list of photoelectrons, stored per GTU (index=0 <--> GTUnb=0)
131    Bool_t fEvIsTriggered;                                      // tells if event is triggered
132    UInt_t fNbGTUs;                                             // nb of GTUs containing pe- (GTU id within [0,fNbGTUs-1])
133    Int_t fNbSignalPE;                                         // nb of pe- coming from signal photons
134    Double_t fFirstGTUTime;                                     // time of first GTU (raising time)
135    Double_t fFirstPETime;                                      // time of first pe-
136    Double_t fLastPETime;                                       // time of last pe-
137    EarthVector fStartPosShowPt;                                // MES 3D position of shower point at fFirstGTUTime
138    EarthVector fEndPosShowPt;                                  // MES 3D position of shower point at end of track (earth impact or Fov bounds)
139    EarthVector fDirShowPt;                                     // shower track 3D direction in MES
140    UInt_t fStartPixelID;                                       // define first corner of covered rectangular area (bgnd generation)
141    UInt_t fEndPixelID;                                         // define second corner of covered rectangular area (bgnd generation)
142
143    ClassDef(SimpleDetector,0)
144};
145
146#endif  /* __SIMPLEDETECTOR_HH__ */
147
Note: See TracBrowser for help on using the repository browser.