Pluto v6.3.0
Loading...
Searching...
No Matches
PAdaptiveMeshN.h
Go to the documentation of this file.
1// Author: I. Froehlich
2// Written: 1.02.2008
3// Revised:
4
5#ifndef _PADAPTIVEMESHN_H_
6#define _PADAPTIVEMESHN_H_
7
8#define MAX_SUBMESH_N 20
9#define MAX_DIMENSIONS 4
10
11#include "TObject.h"
12#include "PChannelModel.h"
13
14class PAdaptiveMeshN : public TObject {
15
16 private:
17
18 Double_t y_max; //upper value in each hyper-cube
19 Double_t area_size; //volume of the hyper-cube(es)
20 Double_t x_max[MAX_DIMENSIONS], x_min[MAX_DIMENSIONS]; //width of the hypercubes
21 Int_t sub_size[MAX_DIMENSIONS]; //sub-size in each dimension of the parent hypercube
22 Int_t total_sub_size; //total number of sub-meshs
23 Int_t is_divided;
24 Int_t layer; //layer of the hypercube. The innermost has 0
25
26 PAdaptiveMeshN *sub_tree; //for each dimension pointer to the subtree
27 Double_t *sub_area; //for each dimension volume size
28
29 Int_t num_dimensions; //number of dimensions of the hyper-cube
30 Int_t variable_dimensions; //number of dimensions to be sampled
31 PChannelModel *model; //Model to be sampled
32 Double_t array[MAX_DIMENSIONS]; //storage array for GetWeight()
33
34 void ReCalc(void); //re-calculate all volumes
35 void FixArray(void); //set the fixed array contributions
36
37 UInt_t pattern;
38 Int_t mcpoints;
39 Double_t threshold_diff;
40 Double_t threshold_abs;
41
42 PAdaptiveMeshN *GetRandomBin(Double_t f_random);
43
44 public:
45
46 //constructor
47 //pattern sets the variables to be sampled in the GetWeight method in PChannelModel
48 PAdaptiveMeshN(UInt_t my_pattern, Int_t my_max_dimensions,
49 PChannelModel *my_model, Double_t my_y_max);
51 void SetDefaults(UInt_t my_pattern, Int_t my_max_dimensions,
52 PChannelModel *my_model, Double_t my_y_max);
53 void ReCalcYMax(void);
55
56 void SetRange (Int_t dimension, Double_t my_x_min, Double_t my_x_max) {
57 x_min[dimension] = my_x_min;
58 x_max[dimension] = my_x_max;
59 };
60
61 Bool_t GetRandom();
62
63 Double_t GetArea() {return area_size;};
64
65 Double_t GetArrayValue(Int_t dimension) {
66 if (dimension > num_dimensions) {
67 Warning("GetArrayValue", "dimension>num_dimensions");
68 return 0;
69 }
70 return array[dimension];
71 };
72
73 Double_t GetXMax(Int_t dimension) {
74 // method should be fast. I do not make any test here!
75 return x_max[dimension];
76 };
77
78 Double_t GetXMin(Int_t dimension) {
79 // method should be fast. I do not make any test here!
80 return x_min[dimension];
81 };
82
83 Double_t GetYMax() {
84 return y_max;
85 };
86
87 void SetYMax(Double_t d) {y_max = d;};
88
89 void SetMCPoints(Int_t n) {mcpoints = n;};
90
91 void SetThreshold(Double_t diff, Double_t abs) {
92 threshold_diff = diff;
93 threshold_abs = abs;
94 };
95
96 void Divide(Int_t num, Int_t my_layer);
97
98 //void Draw(const Option_t *delme=NULL);
99
100 void PrintMesh(void);
101
102 ClassDef(PAdaptiveMeshN, 0) // Envelope with adaptable size of the bins (N dimensions)
103};
104
105#endif
#define MAX_DIMENSIONS
PParticle * d
void SetRange(Int_t dimension, Double_t my_x_min, Double_t my_x_max)
Double_t GetArea()
Double_t GetXMax(Int_t dimension)
void SetThreshold(Double_t diff, Double_t abs)
Double_t GetYMax()
Double_t GetArrayValue(Int_t dimension)
void SetMCPoints(Int_t n)
PAdaptiveMeshN(UInt_t my_pattern, Int_t my_max_dimensions, PChannelModel *my_model, Double_t my_y_max)
void ReCalcYMax(void)
Bool_t GetRandom()
void Divide(Int_t num, Int_t my_layer)
void SetYMax(Double_t d)
Double_t GetXMin(Int_t dimension)
void SetDefaults(UInt_t my_pattern, Int_t my_max_dimensions, PChannelModel *my_model, Double_t my_y_max)
void PrintMesh(void)
Int_t n
Definition etap+omeg.C:21