1 | // $Id: OpticsResponseBuilder.hh 2868 2011-03-23 06:15:13Z naumov $ |
---|
2 | // Author: ale 2005/01/19 |
---|
3 | |
---|
4 | /***************************************************************************** |
---|
5 | * ESAF: Euso Simulation and Analysis Framework * |
---|
6 | * * |
---|
7 | * Id: OpticsResponseBuilder * |
---|
8 | * Package: <packagename> * |
---|
9 | * Coordinator: <coordinator> * |
---|
10 | * * |
---|
11 | *****************************************************************************/ |
---|
12 | |
---|
13 | #ifndef __OPTICSRESPONSEBUILDER_HH__ |
---|
14 | #define __OPTICSRESPONSEBUILDER_HH__ |
---|
15 | |
---|
16 | #include "euso.hh" |
---|
17 | #include "EsafMsgSource.hh" |
---|
18 | |
---|
19 | #include <TString.h> |
---|
20 | #include <TVector3.h> |
---|
21 | |
---|
22 | class OpticalSystem; |
---|
23 | class IdealFocalSurface; |
---|
24 | class TH1F; |
---|
25 | class TH2F; |
---|
26 | class ParentPhoton; |
---|
27 | class EORSample; |
---|
28 | class EORHeader; |
---|
29 | class TClonesArray; |
---|
30 | class TFile; |
---|
31 | class TTree; |
---|
32 | |
---|
33 | //////////////////////////////////////////////////////////////////////////////// |
---|
34 | // // |
---|
35 | // OpticsResponseBuilder // |
---|
36 | // // |
---|
37 | // <brief class description> // |
---|
38 | // // |
---|
39 | //////////////////////////////////////////////////////////////////////////////// |
---|
40 | |
---|
41 | class OpticsResponseBuilder : public EsafMsgSource { |
---|
42 | public: |
---|
43 | OpticsResponseBuilder(); |
---|
44 | virtual ~OpticsResponseBuilder(); |
---|
45 | |
---|
46 | virtual void Clear(); |
---|
47 | |
---|
48 | inline void SetOpticalSystem( OpticalSystem* os) { fOpticalSystem = os; } |
---|
49 | inline void SetIdealFocalSurface( IdealFocalSurface* ifs ) { fIdealFocalSurface = ifs; } |
---|
50 | |
---|
51 | inline void SetDBName( const char* name ); |
---|
52 | void SetNrays( Int_t n ); |
---|
53 | inline void SetBins(Int_t k,Int_t n) { fBinsTheta = k; fBinsLambda = n;} |
---|
54 | |
---|
55 | inline void SetDiscRadius( Float_t r ) { fDiscRadius = r; } |
---|
56 | inline void SetEusoRadius( Float_t r ) { fEusoRadius = r; } |
---|
57 | inline void SetRmax( Float_t r ) { fRmax = r; } |
---|
58 | inline void SetTriggDiam( Float_t d ) { fTriggDiam = d; } |
---|
59 | |
---|
60 | inline OpticalSystem* GetOpticalSystem() const { return fOpticalSystem; } |
---|
61 | inline IdealFocalSurface* GetIdealFocalSurface() const { return fIdealFocalSurface; } |
---|
62 | |
---|
63 | inline const char *GetDBName() const { return fDBName.Data(); } |
---|
64 | inline Int_t GetNrays() const { return fNrays; } |
---|
65 | |
---|
66 | inline Float_t GetDiscRadius() const { return fDiscRadius; } |
---|
67 | inline Float_t GetEusoRadius() const { return fEusoRadius; } |
---|
68 | inline Float_t GetRmax() const { return fRmax; } |
---|
69 | inline Float_t GetTriggDiam() const { return fTriggDiam;} |
---|
70 | |
---|
71 | inline TH2F* GetPsf() { return fPsf; } |
---|
72 | inline TH2F* GetPsfZoom() { return fPsfZoom; } |
---|
73 | inline TH1F* GetPsfRProj() { return fPsfRProj; } |
---|
74 | void RandomPosOnLense(Double_t &x, Double_t &y, Double_t &z); |
---|
75 | |
---|
76 | void BuildEfficacyTables(); |
---|
77 | //protected: |
---|
78 | |
---|
79 | Bool_t ComputeEfficacy( Float_t th, Float_t ph, Float_t wl ); |
---|
80 | |
---|
81 | virtual void OpenDB(); |
---|
82 | virtual void CloseDB(); |
---|
83 | |
---|
84 | virtual void FillPsfHist(); |
---|
85 | |
---|
86 | private: |
---|
87 | |
---|
88 | TString fDBName; |
---|
89 | TFile* fDBFile; |
---|
90 | TTree* fDBTree; |
---|
91 | |
---|
92 | OpticalSystem* fOpticalSystem; // not own |
---|
93 | IdealFocalSurface* fIdealFocalSurface; // not own |
---|
94 | |
---|
95 | TH2F* fPsf; |
---|
96 | TH2F* fPsfZoom; |
---|
97 | TH1F* fPsfRProj; |
---|
98 | |
---|
99 | // event variables (needed?) |
---|
100 | Float_t fTotalEfficacy; |
---|
101 | Float_t fTriggEfficacy; |
---|
102 | |
---|
103 | Int_t fNrays; |
---|
104 | Float_t fThetaMin; |
---|
105 | Float_t fThetaMax; |
---|
106 | Float_t fLambdaMin; |
---|
107 | Float_t fLambdaMax; |
---|
108 | |
---|
109 | Int_t fBinsTheta; |
---|
110 | Int_t fBinsLambda; |
---|
111 | Int_t fPsfBins; |
---|
112 | Float_t fPsfZoomSide; |
---|
113 | TVector3 fCentroid; |
---|
114 | |
---|
115 | // parameters for light generation |
---|
116 | Float_t fDiscRadius; // entrance disc radius |
---|
117 | Float_t fEusoRadius; // detector radius |
---|
118 | Float_t fRmax; // maximum incident angle |
---|
119 | Float_t fTriggDiam; // bucket diameter for the trig |
---|
120 | // efficacy |
---|
121 | |
---|
122 | TClonesArray* fPoints; // intersections between photons |
---|
123 | // and focal surface |
---|
124 | ParentPhoton* fParent; |
---|
125 | EORSample* fSample; |
---|
126 | |
---|
127 | ClassDef(OpticsResponseBuilder,0) |
---|
128 | }; |
---|
129 | |
---|
130 | inline void OpticsResponseBuilder::SetDBName( const char* name ) { |
---|
131 | |
---|
132 | fDBName = name; |
---|
133 | |
---|
134 | if ( !fDBName.EndsWith(".root") ) |
---|
135 | fDBName.Append(".root"); |
---|
136 | } |
---|
137 | |
---|
138 | #endif /* __OPTICSRESPONSEBUILDER_HH__ */ |
---|
139 | |
---|