FairRoot/PandaRoot
PndPhiPhi.C
Go to the documentation of this file.
1 // macro for the PndJRGen event generator
2 // modified by A.Galoyan
3 
4 {
5  // load shared libraries
6  gROOT->Reset();
7  gSystem->Load("libPhysics.so");
8  gSystem->Load("libEG.so");
9  gSystem->Load("lib/libPndJRGen.so");
10 
11 
12 //gRandom.SetSeed(123456);
13 
14 // create a new particle that only decays to K+ K-
15 
16 if (!(TDatabasePDG::Instance())->GetParticle(997))
17  (TDatabasePDG::Instance())->AddParticle("phi -> K- K+","Title", 1.01940e+00 ,0, 4.43000e-03,0,"Unknown",997);
18 Int_t array[3]={-321,321};
19 ((TDatabasePDG::Instance())->GetParticle(997))-> AddDecayChannel(1, 1.0, 2, array);
20 
21 
22 //
23 // create a new particle for the beam and target
24 //
25 if (!(TDatabasePDG::Instance())->GetParticle(999))
26  (TDatabasePDG::Instance())->AddParticle("BeamTarget","Title",4.0,0,4.0,0,"Unknown",999);
27 
28 
29 Int_t array[2]={997,997};
30 ((TDatabasePDG::Instance())->GetParticle(999))-> AddDecayChannel(1, 1.0, 2, array);
31 
32 TLorentzVector Vertex, Beam, Target, s;
33 
34 // use a beam momentum of 4.0 GeV/c in the example below
35 
36 Beam. SetXYZM(0.,0.,4.0,((TDatabasePDG::Instance()) -> GetParticle(-2212)) -> Mass());
37 Target.SetXYZM(0.,0.,0.,((TDatabasePDG::Instance()) -> GetParticle( 2212)) -> Mass());
38 s = Beam+Target;
39 
40  cout << s.M() << endl;
41 
42 // mean location of the target
43 //Vertex.SetXYZT(0,0,0,0); // zero by default
44 
45 // smearing of the primary vertex (Gauss with the above mean, and this sigma)
46 //TVector3 VtxRes(.1,.1,.2); // what target smearing do you want???
47 TVector3 VtxRes(0,0,0); // what target smearing do you want???
48 
49 TParticle BeamTarget(999,1,0,0,0,0,s,Vertex);
50 
51 PndReaction reaction( BeamTarget, VtxRes, "PhiPhi.root" );
52 
53  reaction.Loop(10001);
54 
55 }
PndReaction reaction(BeamTarget, VtxRes,"Gen_2K02Pi0.root")
TLorentzVector s
Definition: Pnd2DStar.C:50
TFile * Target
Definition: hadd.C:35
TLorentzVector Vertex
Definition: Pnd2DStar.C:50
TParticle BeamTarget(999, 1, 0, 0, 0, 0, s, Vertex)
Beam SetXYZM(0., 0., 8,((TDatabasePDG::Instance()) -> GetParticle(-2212)) -> Mass())
TLorentzVector Beam
Definition: Pnd2DStar.C:50
TVector3 VtxRes(.1,.1,.2)