Demo using the batch syntax to change the Dalitz plot eta -> 3pi


{

    makeDistributionManager()->Disable("eta_hadronic_decay");

    PDalitzDistribution *decay = 
	new PDalitzDistribution("my_hadronic_decay",
				"Eta matrix element for decay into charged pions");
    decay->Add("eta, parent");
    decay->Add("pi0, daughter, primary");
    decay->Add("pi+, daughter, s1");
    decay->Add("pi-, daughter, s2");
    //A "step function"
    //decay->AddEquation("_f = 1.; m = (_s1 + _primary)->M2() ; echo $m; if m > 0.12; _f = 0.2");
    decay->AddEquation("_f = 1.; m = (_s1 + _primary)->M2(); if m > 0.12; _f = 0.2");
    decay->SetMax(1);
    makeDistributionManager()->Add(decay);

    TFile *f   = new TFile("histo.root", "RECREATE");  //keep the histogram for the next macro
    TH2F  *hf1 = new TH2F("hf1", "", 100, 0.06, .2, 100, 0.06, .2);

    PReaction my_reaction("2.2", "p", "p", "p p eta [pi+ pi- pi0]", NULL, 1, 0, 0, 0);

    my_reaction.Do(hf1, "_x = ([pi-] + [pi0])->M2() ; _y = ([pi+] + [pi0])->M2()");
    my_reaction.Print();
    my_reaction.Loop(10000);
    hf1->Draw("box");

    //keep the histogram for the next macro:
    f->cd();
    hf1->Write();

}
 user_eta_3pi_decay.C:1
 user_eta_3pi_decay.C:2
 user_eta_3pi_decay.C:3
 user_eta_3pi_decay.C:4
 user_eta_3pi_decay.C:5
 user_eta_3pi_decay.C:6
 user_eta_3pi_decay.C:7
 user_eta_3pi_decay.C:8
 user_eta_3pi_decay.C:9
 user_eta_3pi_decay.C:10
 user_eta_3pi_decay.C:11
 user_eta_3pi_decay.C:12
 user_eta_3pi_decay.C:13
 user_eta_3pi_decay.C:14
 user_eta_3pi_decay.C:15
 user_eta_3pi_decay.C:16
 user_eta_3pi_decay.C:17
 user_eta_3pi_decay.C:18
 user_eta_3pi_decay.C:19
 user_eta_3pi_decay.C:20
 user_eta_3pi_decay.C:21
 user_eta_3pi_decay.C:22
 user_eta_3pi_decay.C:23
 user_eta_3pi_decay.C:24
 user_eta_3pi_decay.C:25
 user_eta_3pi_decay.C:26
 user_eta_3pi_decay.C:27
 user_eta_3pi_decay.C:28
 user_eta_3pi_decay.C:29
 user_eta_3pi_decay.C:30
 user_eta_3pi_decay.C:31
 user_eta_3pi_decay.C:32
 user_eta_3pi_decay.C:33
 user_eta_3pi_decay.C:34