Usage of weights/generators: another way of eta Dalitz simulation


{
    gROOT->Reset();
    
    //Disable old eta Dalitz model and enable it for weighting:
    makeDistributionManager()->GetDistribution("eta_dalitz")->EnableWeighting();
    
    //TF1 object representing the di-lepton statistics:
    TF1 *flat = new TF1("flat", "1", 0, 1);
    
    //The "PInclusiveModel" can be used as a generator:
    PInclusiveModel *dilepton_generator = 
	new PInclusiveModel("flat@eta_to_g_dilepton/generator", "Dilepton generator", -1);
    
    //The distribution template:
    dilepton_generator->Add("eta,parent");
    dilepton_generator->Add("g,daughter");
    dilepton_generator->Add("dilepton,daughter,primary");
    dilepton_generator->SetSampleFunction(flat);

    //Enable distribution as a generator
    dilepton_generator->EnableGenerator();
    
    makeDistributionManager()->Add(dilepton_generator);
    
    PReaction *r =new PReaction(3.13, "p", "p", "p p eta [dilepton [e+ e-] g]", 
				"eta_generator", 1, 0, 0, 0);
    
    r->Print();

    //100 dummy events to have a good starting point for the normalization:
    r->Preheating(100);
    r->loop(10000);
 
}

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