All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
BcEnergyDensity.h
Go to the documentation of this file.
1 // BcEnergyDensity class by A.Sapronov (sapronov@cern.ch)
2 // 18/07/2008
3 
4 #ifndef BcEnergyDensity_h
5 #define BcEnergyDensity_h 1
6 
7 #include "TROOT.h"
8 
9 #include <vector>
10 
11 using namespace std;
12 
14 {
15 public:
16  BcEnergyDensity(const char* inputfilename){
17  Init(inputfilename);
18  }
20  Destroy();
21  };
22 
23  // returns energy density in cell at given coordinates
24  // layers start from 1, backward direction - negative layer number
25  // radius is in mm, phi in radians,
26  // pEnDens - where the energy density will be written to (in GeV/mm2)
27  // pEnDensError - its statistical error
28  Bool_t GetEnergyDensity(const Int_t& rLayer, const Double_t& rRadius,
29  const Double_t& rPhi, Double_t* pEnDens,
30  Double_t* pEnDensError) const;
31 
32 private:
33  static const int msSize = 3;
34  typedef struct {
35  Int_t Id[msSize];
36  Double_t R;
37  Double_t Phi;
38  Double_t EnDens;
39  Double_t EnDensErr;
40  } CellType;
41 
42  typedef struct {
43  Double_t Val; // value
44  Double_t Lb; // lower bound
45  Double_t Ub; // upper bound
46  } ValErrType;
47 
48  vector<CellType*> mCellStorage;
49 
51  Double_t mRingDeltaR;
52  Double_t mRMin;
53  Double_t mRMax;
54  Double_t mPhiMin;
55  vector<Int_t> mNumbersOfSegments;
56  vector<Double_t> mSegmentDeltaPhi;
57 
58 private:
59  void Init(const char* inputfilename);
60  void Destroy();
61  Int_t GetCellNumber(const Int_t& rLayer, const Double_t& rRadius,
62  const Double_t& rPhi) const;
63 
64  Bool_t MakeInterpolation ( const Double_t& rX, const vector<Double_t>& rXData,
65  const vector<ValErrType>& rYData,
66  ValErrType* pResult) const;
67 
68 };
69 
70 
71 #endif
vector< CellType * > mCellStorage
BcEnergyDensity(const char *inputfilename)
vector< Int_t > mNumbersOfSegments
Double_t mRingDeltaR
vector< Double_t > mSegmentDeltaPhi