Pluto v6.3.0
Loading...
Searching...
No Matches
PFermiMomentumGA.cc
Go to the documentation of this file.
1/**************************************************
2** This class is licensed under LGPL **
3** - free for personal and commercional use - **
4** **
5** --------------------------------------- **
6** Quasi-free scattering in the g+A scattering **
7** --------------------------------------- **
8** **
9** Author: L. Witthauer & M. Dieterle 2009 **
10** Version 1.0 **
11** **
12**************************************************/
13
14#include "PFermiMomentumGA.h"
15#include "PDynamicData.h"
16
21
22
23PFermiMomentumGA::PFermiMomentumGA(const Char_t *id, const Char_t *de, Int_t key) :
24 PChannelModel(id, de, key) {
25
26 fermi_model = NULL;
27 beam = NULL;
28 target = NULL;
29 spectator = NULL;
30 parent = NULL;
31 participant = NULL;
32 p2 = NULL;
33 composite = NULL;
35}
36
38 return new PFermiMomentumGA((const PFermiMomentumGA &)* this);
39};
40
41
42//-----------------------------------------------------------------------------------
44
45 beam = GetParticle("beam");
46 target = GetParticle("target");
47 parent = GetParticle("parent");
48
49 if (!beam || !target) {
50 Warning("Init", "<%s> beam or target not found", GetIdentifier());
51 return kFALSE;
52 }
53
54 spectator = GetParticle("spectator");
55 participant = GetParticle("participant");
56 p2 = GetParticle("p2");
57
58 composite = GetParticle("composite");
59
60 return kTRUE;
61}
62
63
64//------- Choose arbitrary fermi momentum according to distributions in PFermiDistribution ------
65
66Double_t PFermiMomentumGA::GetRandomFermiMomentum(Double_t &px, Double_t &py, Double_t &pz) {
67
68 //BUGBUG: What about the cross section
69 if (!fermi_model) {
70 //Read secondary fermi model
71 //This can only happen in Init, so after the freeze-out of the user
73
74 Int_t id1 = parent_id/1000;
75 Int_t id2 = parent_id%1000;
76 if (id1 > 600) {
77 fermi_model = makeDynamicData()->
78 GetParticleSecondaryModel(makeStaticData()->GetParticleName(id1), "fermi");
79 } else if (id2 > 600) {
80 fermi_model = makeDynamicData()->
81 GetParticleSecondaryModel(makeStaticData()->GetParticleName(id2), "fermi");
82 } else if (makeStaticData()->GetParticleBaryon(id1)
83 > makeStaticData()->GetParticleBaryon(id2)) {
84 fermi_model = makeDynamicData()->
85 GetParticleSecondaryModel(makeStaticData()->GetParticleName(id1), "fermi");
86 } else if (makeStaticData()->GetParticleBaryon(id2)
87 > makeStaticData()->GetParticleBaryon(id1)) {
88 fermi_model = makeDynamicData()->
89 GetParticleSecondaryModel(makeStaticData()->GetParticleName(id2), "fermi");
90 }
91
92 if (!fermi_model) {
93 Error("GetRandomFermiMomentum", "No fermi model found");
94 return 0.;
95 }
96 }
97
98 Double_t p = (fermi_model->GetRandom());
99 Double_t theta = acos(1.-2.*PUtils::sampleFlat());
100 Double_t phi = 2.*TMath::Pi()*PUtils::sampleFlat();
101 Double_t sth = sin(theta);
102
103 px = p*cos(phi)*sth;
104 py = p*sin(phi)*sth;
105 pz = p*cos(theta);
106
107 return p;
108}
109
111
112 Double_t massS, eS, eP, ptot, px, py, pz, t=-1., mAi;
113
114 parent->Reconstruct();
115
116 while (t < 0.) {
117 ptot = GetRandomFermiMomentum(px,py,pz); // Fermi momentum
118 massS = spectator->M(); // mass of spectator fragment
119 eS = sqrt(ptot*ptot + massS*massS); // spectator total energy in nucleus c.m.
120 mAi = target->M();
121 t = pow(mAi-massS,2) - 2.*mAi*(eS-massS); // off-shell mass**2 of participant
122 }
123
124 eP = sqrt(ptot*ptot + t); // participant total energy
125
126 participant->SetPxPyPzE(-px,-py,-pz,eP); // initialize participant
127 spectator->SetPxPyPzE(px,py,pz,eS); // initialize spectator fragment
128
129 participant->Boost(target->BoostVector());
130 spectator->Boost(target->BoostVector());
131
132 *p2 = *beam;
133
134 //go into parent frame
135 participant->Boost(-parent->BoostVector());
136 p2->Boost(-parent->BoostVector());
137 spectator->Boost(-parent->BoostVector());
138
139 composite->Reconstruct();
140
141 //boost scatter back to lab
142 participant->Boost(parent->BoostVector());
143 p2->Boost(parent->BoostVector());
144
145 spectator->SetW(parent->W()); // copy parent weight to spectator fragment
146
147 return kTRUE;
148}
149
151 return kTRUE;
152}
153
154
PDynamicData * makeDynamicData()
ClassImp(PFermiMomentumGA) PFermiMomentumGA
PStaticData * makeStaticData()
double pz
double px
double py
const Char_t * GetIdentifier(void)
PParticle * GetParticle(const Char_t *pflag=NULL)
UInt_t relative_warning
Bool_t SampleMass(void)
Bool_t SampleMomentum(void)
Double_t GetRandomFermiMomentum(Double_t &px, Double_t &py, Double_t &pz)
PDistribution * Clone(const char *delme=NULL) const
int GetDecayParentByKey(const int &)
static Double_t sampleFlat()
Definition PUtils.h:121
PParticle * p
Definition dp_mult.C:24