PandaRoot
PndRadMapBoxMesh.h
Go to the documentation of this file.
1 #ifndef __PNDRADMAPBOXMESH_HH__
2 #define __PNDRADMAPBOXMESH_HH__
3 #include <TH2D.h>
4 #include <TROOT.h>
5 #include <TFormula.h>
6 #include <TMatrixD.h>
7 #include <FairRadMapPoint.h>
8 #include <PndRadMapPlane.h>
9 #include <TDatabasePDG.h>
10 
11 enum quantity {
12  Edep = 1,
13  Dose = 2,
14  Fluence = 3,
15  SimpleFluence = 9, // -> 1/m^2
16  Flux = 5,
17  Kerma = 6,
18  EnergyFluence = 4, // not mplemented
19  Density = 7,
20  Mass = 8,
21  Twos = 10
22 };
23 //
24 
25 struct Corner {
26  TVector3 corner1;
27  TVector3 corner2;
28  TVector3 corner3;
29 };
30 
31 /* class PndRadMapPlane { */
32 /* public: */
33 /* PndRadMapPlane(TVector3 _corner1, */
34 /* TVector3 _corner2, */
35 /* TVector3 _corner3, */
36 /* double dist = 0); */
37 /* PndRadMapPlane(); */
38 /* TVector3 LineIntersection(TVector3 begline, */
39 /* TVector3 endline); */
40 /* void SetNormal(TVector3 n){normal = n;}; */
41 /* void SetDistance(double d){distance = d;}; */
42 /* TVector3 GetCorner(int i); */
43 /* TVector3 Corner1(){return corner1;}; */
44 /* TVector3 Corner2(){return corner2;}; */
45 /* TVector3 Corner3(){return corner3;}; */
46 /* double Distance(){return distance;}; */
47 /* TVector3 Normal(){return normal;}; */
48 /* private: */
49 /* TVector3 normal; */
50 /* TVector3 corner1; */
51 /* TVector3 corner2; */
52 /* TVector3 corner3; */
53 /* double distance; */
54 /* }; */
55 
57  public:
59  PndRadMapBoxMesh(PndRadMapBoxMesh &m); // copy cons
60  PndRadMapBoxMesh(const char *Name, int Xbins, Double_t Xlow, Double_t Xhigh, int Ybins, Double_t Ylow, Double_t Yhigh, int Zbins, Double_t Zlow, Double_t Zhigh);
61  PndRadMapBoxMesh(const char *name, int xbins, Double_t xlow, Double_t xhigh, int ybins, Double_t ylow, Double_t yhigh, Double_t zlow, Double_t zhigh, orientation plane = ZX,
62  quantity Quantity = Edep);
64 
65  void SetFilter(const char *filter);
66  void SetQuantity(quantity Quantity = Edep);
67  void SetOrientation(orientation plane, Double_t rotate = 99999, axis Ax = Xx);
68  void SetOrientation(Double_t rotate = 99999, axis Ax = Xx);
69  void SetVerbosityLevel(int verbose = 0);
70  void Fill(FairRadMapPoint *p);
71  void Transform(Double_t X, Double_t Y, Double_t Z);
72  void Transform(Double_t X, Double_t Y, Double_t Z, Double_t &X0, Double_t &Y0, Double_t &Z0);
73  void Transform(TVector3 InV, TVector3 &OutV);
74 
75  void Scale(Double_t sca);
76  void Save(TFile *fout);
77  void Save();
78  TH2D *GetHisto();
79  PndRadMapPlane *GetPlane();
80  Double_t CalcFluence(FairRadMapPoint *p);
81 
82  protected:
83  bool IsInside(Double_t X, Double_t Y, Double_t Z);
84  bool IsInside(FairRadMapPoint *p);
85  bool IsInside();
86  void Fill(Int_t gBin, Double_t val);
87  void Fill(Double_t X, Double_t Y, Double_t Z, Double_t we = 1);
88  void makeHisto(const char *Orient, Double_t rotate, int Hbins, Double_t Hlow, Double_t Hhigh, int Vbins, Double_t Vlow, Double_t Vhigh,
89  Double_t dlow /*, Double_t dhigh --unused parameter */);
90 
91  TH2D *_MeshHisto;
92  TH2I *_StatHisto;
93  TH2D *_EnergyHisto;
94  TString _Name;
95 
97  Double_t _rotate;
99  Double_t _volume;
101 
102  int _Xbins;
103  Double_t _Xlow, _Xhigh;
104  int _Ybins;
105  Double_t _Ylow, _Yhigh;
106  int _Zbins;
107  Double_t _Zlow, _Zhigh;
108 
109  Double_t _X, _Y, _Z;
110  Double_t _tX, _tY, _tZ; // back-shifted, back-rotated coordinate
111 
112  TFormula _filter;
113  int _verbose;
114 
116  TVector3 InterSection;
117 
118  private:
119  bool _isSurfaceQuantity;
120  TDatabasePDG *pdg;
121  TParticlePDG *pdgpart;
122 };
123 
124 void InvMatVecProd(TMatrixD mat, TVector3 vec, TVector3 &res);
125 
126 #endif
TVector3 corner3
orientation _orientation
TVector3 corner2
__m128 m
Definition: P4_F32vec4.h:26
PndRadMapPlane * _plane
quantity
axis
Definition: PndRadMapPlane.h:9
orientation
TVector3 corner1
TMatrixT< double > TMatrixD
Definition: PndLmdDim.h:52
debug
void InvMatVecProd(TMatrixD mat, TVector3 vec, TVector3 &res)