Pluto v6.3.0
Loading...
Searching...
No Matches
PFermiNucleus.C
Go to the documentation of this file.
1//TITLE <b>Quasi-free reactions:</b> A (dummy) model for fermi samping inside a nucleus
2
3//This class is here only for didactical reasons. It has no real physics content
4//See nucleus_fermi plugin for a real implementation
5
6//#include "../include/PChannelModel.h"
7
8//Class definition
9
11
12public:
13
15 PFermiNucleus(const Char_t *id, const Char_t *de, Int_t key);
16 PDistribution *Clone(const char *delme=NULL) const;
17 Bool_t Init(void);
18 Bool_t SampleMass(void);
19 Bool_t SampleMomentum(void);
20
21 private:
22
23 double SampleFermi(double &px, double &py, double &pz);
24 PParticle *beam;
25 PParticle *target;
26 PParticle *spectator;
27 PParticle *parent;
28 PParticle *p2, *participant;
29 PParticle *composite;
30
31 ClassDef(PFermiNucleus, 0) //
32};
33
35 //clone the object
36 return new PFermiNucleus((const PFermiNucleus &)* this);
37};
38
39PFermiNucleus::PFermiNucleus(const Char_t *id, const Char_t *de, Int_t key) : PChannelModel(id, de,key) {
40 //Constructor
41 beam = NULL;
42 target = NULL;
43 spectator = NULL;
44 parent = NULL;
45 participant = NULL;
46 p2 = NULL;
47 composite = NULL;
48} ;
49
50
51double PFermiNucleus::SampleFermi(double &px, double &py, double &pz) {
52 // dummy function
53
54 double p = 0.5; //150 MeV
55 //double p = 0.;
56 double theta = acos(1.-2.*PUtils::sampleFlat());
57 double phi = 2.*TMath::Pi()*PUtils::sampleFlat();
58 double sth=sin(theta);
59 px = p*cos(phi)*sth;
60 py = p*sin(phi)*sth;
61 pz = p*cos(theta);
62 return p;
63}
64
65Bool_t PFermiNucleus::Init(void) {
66
67 beam = GetParticle("beam");
68 target = GetParticle("target");
69 parent = GetParticle("parent");
70
71 if (!beam || !target) {
72 Warning("Init", "beam or target not found");
73 return kFALSE;
74 }
75
76 spectator = GetParticle("spectator");
77 participant = GetParticle("participant");
78 p2 = GetParticle("p2");
79
80 composite = GetParticle("composite");
81
82 return kTRUE;
83}
84
86
87 Double_t massS, eS, eP, ptot, px, py, pz, t=-1., mtarget;
88 while (t<0.) {
89 ptot = SampleFermi(px,py,pz); // Fermi momentum
90 massS = spectator->M(); // mass of spectator nucleon
91 eS = sqrt(ptot*ptot + massS*massS); // spectator total energy in deuteron c.m.
92 mtarget = target->M();
93 t = pow(mtarget-massS,2) - 2.*mtarget*(eS-massS); // off-shell mass**2 of participant
94 }
95
96 eP = sqrt(ptot*ptot + t); // participant total energy
97
98 participant->SetPxPyPzE(-px,-py,-pz,eP); // initialize participant nucleon
99 spectator->SetPxPyPzE(px,py,pz,eS); // initialize spectator nucleon
100
101// participant->Print();
102// spectator->Print();
103
104 participant->Boost(target->BoostVector());
105 spectator->Boost(target->BoostVector());
106
107 *p2 = *beam;
108
109 //go into parent frame
110 participant->Boost(-parent->BoostVector());
111 p2->Boost(-parent->BoostVector());
112 spectator->Boost(-parent->BoostVector());
113
114 composite->Reconstruct(); //reset mass after p1 and p2 have been setted
115
116 //boost scatter back to lab
117 participant->Boost(parent->BoostVector());
118 p2->Boost(parent->BoostVector());
119
120 spectator->SetW(parent->W()); // copy parent weight to spectator
121
122 return kTRUE;
123}
124
126 return kTRUE;
127}
128
129
131
132
ClassImp(PBeamLineSimulation) PBeamLineSimulation
double pz
double px
double py
PParticle * GetParticle(const Char_t *pflag=NULL)
virtual Double_t GetWeight(void)
Bool_t SampleMass(void)
PDistribution * Clone(const char *delme=NULL) const
Bool_t SampleMomentum(void)
PFermiNucleus(const Char_t *id, const Char_t *de, Int_t key)
Bool_t Init(void)
static Double_t sampleFlat()
Definition PUtils.h:121
PParticle * p
Definition dp_mult.C:24