PandaRoot
PndRadMapBoxMesh.h
Go to the documentation of this file.
1 //****************************************************************************
2 //* This file is part of PandaRoot. *
3 //* *
4 //* PandaRoot is distributed under the terms of the *
5 //* GNU General Public License (GPL) version 3, *
6 //* copied verbatim in the file "LICENSE". *
7 //* *
8 //* Copyright (C) 2006 - 2024 FAIR GmbH and copyright holders of PandaRoot *
9 //* The copyright holders are listed in the file "COPYRIGHTHOLDERS". *
10 //* The authors are listed in the file "AUTHORS". *
11 //****************************************************************************
12 
13 #ifndef __PNDRADMAPBOXMESH_HH__
14 #define __PNDRADMAPBOXMESH_HH__
15 #include <TH2D.h>
16 #include <TROOT.h>
17 #include <TFormula.h>
18 #include <TMatrixD.h>
19 #include <FairRadMapPoint.h>
20 #include <PndRadMapPlane.h>
21 #include <TDatabasePDG.h>
22 
23 enum quantity {
24  Edep = 1,
25  Dose = 2,
26  Fluence = 3,
27  SimpleFluence = 9, // -> 1/m^2
28  Flux = 5,
29  Kerma = 6,
30  EnergyFluence = 4, // not mplemented
31  Density = 7,
32  Mass = 8,
33  Twos = 10
34 };
35 //
36 
37 struct Corner {
38  TVector3 corner1;
39  TVector3 corner2;
40  TVector3 corner3;
41 };
42 
43 /* class PndRadMapPlane { */
44 /* public: */
45 /* PndRadMapPlane(TVector3 _corner1, */
46 /* TVector3 _corner2, */
47 /* TVector3 _corner3, */
48 /* double dist = 0); */
49 /* PndRadMapPlane(); */
50 /* TVector3 LineIntersection(TVector3 begline, */
51 /* TVector3 endline); */
52 /* void SetNormal(TVector3 n){normal = n;}; */
53 /* void SetDistance(double d){distance = d;}; */
54 /* TVector3 GetCorner(int i); */
55 /* TVector3 Corner1(){return corner1;}; */
56 /* TVector3 Corner2(){return corner2;}; */
57 /* TVector3 Corner3(){return corner3;}; */
58 /* double Distance(){return distance;}; */
59 /* TVector3 Normal(){return normal;}; */
60 /* private: */
61 /* TVector3 normal; */
62 /* TVector3 corner1; */
63 /* TVector3 corner2; */
64 /* TVector3 corner3; */
65 /* double distance; */
66 /* }; */
67 
69  public:
71  PndRadMapBoxMesh(PndRadMapBoxMesh &m); // copy cons
72  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);
73  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,
74  quantity Quantity = Edep);
76 
77  void SetFilter(const char *filter);
78  void SetQuantity(quantity Quantity = Edep);
79  void SetOrientation(orientation plane, Double_t rotate = 99999, axis Ax = Xx);
80  void SetOrientation(Double_t rotate = 99999, axis Ax = Xx);
81  void SetVerbosityLevel(int verbose = 0);
82  void Fill(FairRadMapPoint *p);
83  void Transform(Double_t X, Double_t Y, Double_t Z);
84  void Transform(Double_t X, Double_t Y, Double_t Z, Double_t &X0, Double_t &Y0, Double_t &Z0);
85  void Transform(TVector3 InV, TVector3 &OutV);
86 
87  void Scale(Double_t sca);
88  void Save(TFile *fout);
89  void Save();
90  TH2D *GetHisto();
91  PndRadMapPlane *GetPlane();
92  Double_t CalcFluence(FairRadMapPoint *p);
93 
94  protected:
95  bool IsInside(Double_t X, Double_t Y, Double_t Z);
96  bool IsInside(FairRadMapPoint *p);
97  bool IsInside();
98  void Fill(Int_t gBin, Double_t val);
99  void Fill(Double_t X, Double_t Y, Double_t Z, Double_t we = 1);
100  void makeHisto(const char *Orient, Double_t rotate, int Hbins, Double_t Hlow, Double_t Hhigh, int Vbins, Double_t Vlow, Double_t Vhigh,
101  Double_t dlow /*, Double_t dhigh --unused parameter */);
102 
103  TH2D *_MeshHisto;
104  TH2I *_StatHisto;
106  TString _Name;
107 
109  Double_t _rotate;
111  Double_t _volume;
113 
114  int _Xbins;
115  Double_t _Xlow, _Xhigh;
116  int _Ybins;
117  Double_t _Ylow, _Yhigh;
118  int _Zbins;
119  Double_t _Zlow, _Zhigh;
120 
121  Double_t _X, _Y, _Z;
122  Double_t _tX, _tY, _tZ; // back-shifted, back-rotated coordinate
123 
124  TFormula _filter;
125  int _verbose;
126 
128  TVector3 InterSection;
129 
130  private:
131  bool _isSurfaceQuantity;
132  TDatabasePDG *pdg;
133  TParticlePDG *pdgpart;
134 };
135 
136 void InvMatVecProd(TMatrixD mat, TVector3 vec, TVector3 &res);
137 
138 #endif
TVector3 corner3
orientation _orientation
TVector3 corner2
__m128 m
Definition: P4_F32vec4.h:38
PndRadMapPlane * _plane
quantity
axis
orientation
TVector3 corner1
TMatrixT< double > TMatrixD
Definition: PndLmdDim.h:64
debug
void InvMatVecProd(TMatrixD mat, TVector3 vec, TVector3 &res)