Quasi-free pi+A scattering, including beam smearing


#include "PFermiNucleus.C"
#include "PCopyBeam.C"

void piA(void) {    
    //Uses PFermiNucleus.C & PCopyBeam
    //This class is here only for didactical reasons. It has no real physics content

    makeStaticData()->AddParticle(90, "A",  20.);
    makeStaticData()->AddParticle(91, "A'", 19.);
    
    makeStaticData()->AddParticle(90008, "pi+ + A", 21.);
    if (!makeStaticData()->IsParticleValid("pi+ + p")) {
	makeStaticData()->AddParticle(14008, "pi+ + p", 2.);
    }

    makeStaticData()->AddDecay(-1, "pi+ + A -> (pi+ + p) + A' (quasi-free)", 
			       "pi+ + A","pi+ + p,A'", 1.0);

    
    PFermiNucleus *pmodel = new PFermiNucleus(
			"nucleon_fermi@pi+ + A_to_pi+ + p_A'",
			"Quasi-free particle production", -1);
    
    pmodel->Add("q",   "parent");
    pmodel->Add("pi+", "grandparent", "beam");
    pmodel->Add("A",   "grandparent", "target");
    pmodel->Add("A'",  "daughter",    "spectator");
    pmodel->Add("q",   "daughter",    "composite"); 
    pmodel->Add("p",   "granddaughter", "participant");
    pmodel->Add("pi+", "granddaughter", "p2");

    makeDistributionManager()->Add(pmodel);
    makeDistributionManager()->Print("user");

    PParticle pi("pi+", 2.2); 	//projectil
    PParticle A("A");	        //target 
    PParticle A1("A'");	        //spectator fragment
    
    PParticle piA = pi + A;
    
    PParticle pi1("pi+");
    PParticle p2("p");
    PParticle pip = pi1 + p2;     //quasi-elastic scattering
    
    PParticle p3("p");
    PParticle pi4("pi+");          //outgoing products
   

    PParticle *s0[] = {&piA, &A1, &pip};
    PParticle *s1[] = {&pip, &p3, &pi4};

    PChannel *c0 = new PChannel(s0, 2);
    PChannel *c1 = new PChannel(s1, 2);
    PChannel *cc[] = {c0, c1};
    
    PReaction my_reaction(cc, "piA", 2, 1);
    
    //Use PCopyBeam macro to copy the original beam + target into the particle array....
    PCopyBeam *copy = new PCopyBeam();
    my_reaction.AddBulk(copy);
    //...could be useful sometimes
    //...this is dangerous if you use GEANT!
    
    makeDistributionManager()->Print("user");//The "Print()" statement is optional
    
    //Create my histograms:
    TH1F *histo2 = new TH1F ("histo2", "cos theta", 100, -1., 1.);

    //Create the container of the histogram list
    PProjector *m1 = new PProjector(); 
    //cos theta in piA rest frame
    //m1->AddHistogram(histo2,"p1=[p,1]; p1->Boost([pi+ + A]); _x=cos(p1->Theta())");
    m1->AddHistogram(histo2, "p1=[pi+ + p,1]; p1->Boost([pi+ + A]);_x=cos(p1->Theta())");
    m1->Print();

    my_reaction.AddBulk(m1);

    my_reaction.Print();

    my_reaction.Loop(1000);

    histo2->Draw();
}
 piA.C:1
 piA.C:2
 piA.C:3
 piA.C:4
 piA.C:5
 piA.C:6
 piA.C:7
 piA.C:8
 piA.C:9
 piA.C:10
 piA.C:11
 piA.C:12
 piA.C:13
 piA.C:14
 piA.C:15
 piA.C:16
 piA.C:17
 piA.C:18
 piA.C:19
 piA.C:20
 piA.C:21
 piA.C:22
 piA.C:23
 piA.C:24
 piA.C:25
 piA.C:26
 piA.C:27
 piA.C:28
 piA.C:29
 piA.C:30
 piA.C:31
 piA.C:32
 piA.C:33
 piA.C:34
 piA.C:35
 piA.C:36
 piA.C:37
 piA.C:38
 piA.C:39
 piA.C:40
 piA.C:41
 piA.C:42
 piA.C:43
 piA.C:44
 piA.C:45
 piA.C:46
 piA.C:47
 piA.C:48
 piA.C:49
 piA.C:50
 piA.C:51
 piA.C:52
 piA.C:53
 piA.C:54
 piA.C:55
 piA.C:56
 piA.C:57
 piA.C:58
 piA.C:59
 piA.C:60
 piA.C:61
 piA.C:62
 piA.C:63
 piA.C:64
 piA.C:65
 piA.C:66
 piA.C:67
 piA.C:68
 piA.C:69
 piA.C:70
 piA.C:71
 piA.C:72
 piA.C:73
 piA.C:74
 piA.C:75
 piA.C:76
 piA.C:77
 piA.C:78
 piA.C:79
 piA.C:80
 piA.C:81
 piA.C:82
 piA.C:83
 piA.C:84
 piA.C:85