Pluto v6.3.0
Loading...
Searching...
No Matches
PAngularDistribution.h
Go to the documentation of this file.
1// Author: I. Froehlich
2// Written: 3.7.2006
3// Revised:
4
5#ifndef _PANGULARDISTRIBUTION_H_
6#define _PANGULARDISTRIBUTION_H_
7
8
9#include "TF1.h"
10#include "TF2.h"
11#include "TGraph.h"
12#include "TSpline.h"
13#include "PDistribution.h"
14#include "PKinematics.h"
15
16#define MAX_ANG_NUM 10
17
18
20
21 public:
23 PAngularDistribution(const Char_t *id, const Char_t *de);
24
25 PDistribution* Clone(const char *delme=NULL) const;
26
27 Bool_t Init(void);
28 Bool_t Prepare(void);
29 Bool_t Finalize(void);
30 Bool_t IsNotRejected(void);
31 Bool_t CheckAbort(void);
32 Bool_t SampleAngle(void);
33
34 void SetAngleFunction(TF1 *f) {angles1=f;};
35 void SetAngleFunction(TF2 *f) {angles2=f;};
36 void SetAngleFunction(TGraph *f, Bool_t useSpline=kFALSE,
37 Bool_t useSymmetry=kFALSE) {
38 anglesg = f;
39 spline = useSpline;
40 reflection_symmetry = useSymmetry;
41 if (spline) g_spline = new TSpline3("", f);
42 };
43
44 void SetAngleFunction(TH1 *f) {anglesh = f;};
45
46 void SetRotate(Bool_t t) {rotate = t;};
47 void NeverAbort(Bool_t t) {never_abort = t;}; //Avoid to re-sample the complete reaction chain
48 void ForceRejectionMethod(Bool_t t) {always_reject = t;};
49
50 void Print(const Option_t *delme=NULL) const; //Debug info
51
52 virtual Double_t Eval(Double_t x, Double_t y = 0, Double_t z = 0, Double_t t = 0) const;
53 virtual Double_t EvalPar(const Double_t *x, const Double_t *params);
54 //TF1 wrapper
55
56 virtual double SamplePolarAngle(double r = 0);
57 Bool_t direct_sampling_possible, direct_sampling_done; //Try to use direct sampling and not rejection
58
59 protected:
60
61 TF1 *angles1;
62 TF2 *angles2;
63 TH1 *anglesh;
64 TGraph *anglesg;
65 TSpline3 *g_spline;
77 Bool_t rotate;
79 Bool_t reflection_symmetry; //use symmetry around theta=90°
80 Bool_t spline;
81
83 ang_tmp; //for boosting and rotation
84 Bool_t Rotate(Int_t); //Do temporary boosting and rotation
85 Bool_t RotateBack(Int_t); //Do temporary boosting and rotation
86
87 Double_t q_value;
88
89 Double_t weight_max;
90
91 ClassDef(PAngularDistribution, 0) //Multi-purpose angular distributions
92
93};
94
95#endif
96
97
#define MAX_ANG_NUM
TFile * f
Definition analyze_g12C.C:8
Bool_t Prepare(void)
virtual double SamplePolarAngle(double r=0)
PAngularDistribution(const Char_t *id, const Char_t *de)
virtual Double_t Eval(Double_t x, Double_t y=0, Double_t z=0, Double_t t=0) const
PParticle * daughter[MAX_ANG_NUM]
Bool_t RotateBack(Int_t)
virtual Double_t EvalPar(const Double_t *x, const Double_t *params)
Bool_t IsNotRejected(void)
void SetAngleFunction(TGraph *f, Bool_t useSpline=kFALSE, Bool_t useSymmetry=kFALSE)
Bool_t Rotate(Int_t)
Bool_t SampleAngle(void)
Bool_t Finalize(void)
PDistribution * Clone(const char *delme=NULL) const
void Print(const Option_t *delme=NULL) const
Bool_t CheckAbort(void)
void ForceRejectionMethod(Bool_t t)
PReaction r(c,"eta_dalitz", 3, 0, 0, 0, 1)