Pluto v6.3.0
Loading...
Searching...
No Matches
user_mass.C
Go to the documentation of this file.
1//TITLE Play with the mass shape of a dummy resonance
2
4
5double f_my_function(double *x, double * par) {
6 Double_t mass = x[0];
7
8 //this is a dummy box:
9 if ((mass < 1.2) || (mass > 1.5)) return 0;
10
11 //add a smooth trailing edge - if wanted
12 //(if not return a 1)
14 return width;
15}
16
17void user_mass(void) {
18
19 //Add a user-defined particle with mass = 1.25 GeV
20 pid_resonance = makeStaticData()->AddParticle(-1, "MyResonance", 1.25);
21 //Set the width (important to enable the m1-decay model for the production)
22 makeStaticData()->SetParticleTotalWidth("MyResonance", 0.25);
23 //It must be a hadron:
24 makeStaticData()->SetParticleBaryon("MyResonance", 1);
25
26 //Add some user-defined decays:
27 decay_index = makeStaticData()->AddDecay("MyResonance --> p + pi-", "MyResonance",
28 "p,pi-", .5 );
29 makeStaticData()->AddDecay("MyResonance --> n + pi0", "MyResonance",
30 "n,pi0", .5 );
31 makeStaticData()->AddDecay("MyResonance --> n + pi0 + pi0", "MyResonance",
32 "n,pi0,pi0", 1 );
33 //N.B.: Branching ratios are re-normalized
34
35 listParticle("MyResonance"); //List the data base content
36
37 //Add a user-defined mass distribution:
38 PMassSampling *model = new PMassSampling("mymodel@MyResonance", "My model", -1);
39 model->SetSamplingFunction(new TF1("mass_function",f_my_function,0.,10.,1));
41
42 //Create the reaction and a control histogram
43 TH1F *histo = new TH1F("histo", "MyResonance mass", 100, 1., 1.6);
44 PReaction r("1.25", "p", "p", "p MyResonance [p pi-]");
45 //(Try what happens if you increase the beam energy!)
46 r.Do(histo, "_x = [MyResonance]->M()");
47 r.Print();
48 r.Loop(10000);
49
50 histo->Draw();
51}
PDistributionManager * makeDistributionManager()
PDynamicData * makeDynamicData()
PStaticData * makeStaticData()
void listParticle(int id=-1)
PParticle * par[11]
int Add(PDistribution *dist)
Double_t GetDecayPartialWidth(Double_t mass, Int_t didx)
void SetSamplingFunction(TF1 *f)
int AddDecay(int didx, const char *name, const char *parent, const char *daughters, double br)
void SetParticleTotalWidth(Int_t id, Float_t wid)
void SetParticleBaryon(const char *id, Int_t num=1)
int AddParticle(int pid, const char *name, double mass)
PReaction r(c,"eta_dalitz", 3, 0, 0, 0, 1)
double f_my_function(double *x, double *par)
Double_t mass
TH1F * histo
Int_t decay_index
Definition user_mass.C:3
void user_mass(void)
Definition user_mass.C:17
Int_t pid_resonance
Definition user_mass.C:3
double f_my_function(double *x, double *par)
Definition user_mass.C:5