1 | // ESAF : Euso Simulation and Analysis Framework |
---|
2 | // $Id: ERunParameters.hh 2800 2008-02-11 14:16:18Z naumov $ |
---|
3 | // M. Pallavicini, A. Thea created Sep, 19 2003 |
---|
4 | |
---|
5 | #ifndef __ERUNPARAMETERS_HH_ |
---|
6 | #define __ERUNPARAMETERS_HH_ |
---|
7 | |
---|
8 | #include <TObject.h> |
---|
9 | #include <TClonesArray.h> |
---|
10 | #include <TVector3.h> |
---|
11 | #include <TArrayF.h> |
---|
12 | |
---|
13 | #include "ERunParsFiller.hh" |
---|
14 | #include "EPmtData.hh" |
---|
15 | #include "EPmtGeo.hh" |
---|
16 | #include "EAnglePixelMap.hh" |
---|
17 | #include "ETriggPars.hh" |
---|
18 | #include "Etypes.hh" |
---|
19 | #include <TMath.h> |
---|
20 | |
---|
21 | enum ESquareCorner { kTopLeftCorner = 0, |
---|
22 | kTopRightCorner = 1, |
---|
23 | kBottomRightCorner = 2, |
---|
24 | kBottomLeftCorner = 3 |
---|
25 | }; |
---|
26 | |
---|
27 | using namespace TMath; |
---|
28 | |
---|
29 | // ERunParameters: container of the Detector configuration |
---|
30 | class ERunParameters : public TObject { |
---|
31 | public: |
---|
32 | ERunParameters(); |
---|
33 | ERunParameters( const ERunParameters& ); |
---|
34 | |
---|
35 | virtual ~ERunParameters(); |
---|
36 | |
---|
37 | // inline static ERunParameters* GetCurrent() { return fgCurrent; } |
---|
38 | // inline static void SetCurrent(ERunParameters *rp) { fgCurrent=rp; } |
---|
39 | // set current instance |
---|
40 | |
---|
41 | virtual void Copy( TObject& ) const ; |
---|
42 | virtual void Clear( Option_t* ="" ); |
---|
43 | |
---|
44 | inline const TClonesArray* GetPmts() const { return fPmts; } |
---|
45 | inline const EPmtData& GetPmtData() const { return fPmtData; } |
---|
46 | inline const EAnglePixelMap& GetPixelMap() const { return fAnglePixelMap; } |
---|
47 | |
---|
48 | Float_t GetNightGlowRate(Int_t feid) const; |
---|
49 | inline Float_t GetMinNightGlowRate() const { return MinElement(fChipNightGlowRates.GetSize(),fChipNightGlowRates.GetArray()); } |
---|
50 | inline Float_t GetMaxNightGlowRate() const { return MaxElement(fChipNightGlowRates.GetSize(),fChipNightGlowRates.GetArray()); } |
---|
51 | Float_t GetNightGlowRateByUId(Int_t uid) const; |
---|
52 | inline Int_t GetNumPmts() const { return fNumPmts; } |
---|
53 | const EPmtGeo* GetPmtGeo(Int_t id) const; |
---|
54 | const EPmtGeo* GetPmtGeoByUId(Int_t uid) const; |
---|
55 | Int_t ElementaryCell( Int_t uid ) const; |
---|
56 | Int_t FrontEndChip( Int_t uid ) const; |
---|
57 | inline void Fill( ERunParsFiller& f) { f.Fill( this ); } |
---|
58 | Bool_t IsInsidePixel(Int_t uid, const TVector2&) const; |
---|
59 | inline Bool_t IsValidPmt( Int_t id ) const; |
---|
60 | Int_t MacroCell( Int_t uid ) const; |
---|
61 | TVector3 PixelCenter( Int_t uid) const; |
---|
62 | TVector3 PixelCorner( Int_t uid, Int_t corner ) const; |
---|
63 | Int_t Pmt( Int_t uid ) const; |
---|
64 | TVector3 PmtCorner( Int_t pmtid, Int_t corner ) const; |
---|
65 | |
---|
66 | const ETriggPars* GetTriggPars( const char* name ) const; |
---|
67 | const ETriggPars* GetTriggPars( ETriggerTypeIdentifier id ) const; |
---|
68 | |
---|
69 | void DrawFocalSurface(); |
---|
70 | private: |
---|
71 | |
---|
72 | Int_t fNumPmts; // number of photomultipliers |
---|
73 | |
---|
74 | TClonesArray* fPmts; //-> description of the pmts |
---|
75 | |
---|
76 | TArrayF fChipNightGlowRates; // FE nightglow rates in p.e./microsec per pixel |
---|
77 | |
---|
78 | EPmtData fPmtData; // common parameters of the pmts |
---|
79 | EAnglePixelMap fAnglePixelMap; // map angle pixel |
---|
80 | TList* fTriggPars; |
---|
81 | |
---|
82 | ClassDef(ERunParameters,2) |
---|
83 | |
---|
84 | ERunParsVisitable() |
---|
85 | }; |
---|
86 | |
---|
87 | inline Bool_t ERunParameters::IsValidPmt( Int_t id ) const{ |
---|
88 | return (id > 0 && id <= fNumPmts); |
---|
89 | } |
---|
90 | #endif |
---|