Analyze the eta Dalitz output file


{
    // This macro uses the output of 
    // * complete_eta.C
    // * parse_eta.C
    // * hello_world.C (can have an filter)

    TFile *f = new TFile("eta_dalitz.root");
    TTree *Reaction = (TTree*)gDirectory->Get("data");
    TClonesArray *evt=new TClonesArray("PParticle", 100);
    Reaction->SetBranchAddress("Particles", &evt);
    PParticle *ep, *em;

    TH1F *hf1= new TH1F("hf2", "Di-Lepton mass", 100, 0., 0.6);
    Int_t nentries = Reaction->GetEntries();
    if (nentries > 1000) 
	nentries = 1000; //limit number of events
    
    for (Int_t i=0; i<nentries; i++) {
	ep = NULL;
	em = NULL;
	Reaction->GetEntry(i);

	for (int j=0; j<evt->GetEntriesFast(); j++) {
	    PParticle *current = (PParticle*)evt->At(j);
	    //current->Print();
	    if (current->Is("e+")) ep = current;
	    if (current->Is("e-")) em = current;
	}
	
	if (ep && em) {
	    //particles found

	    //It is very important to parse the PParticle
	    //to a TLorentzVector, because the "+" operator
	    //is reserved for a reaction (i.e. a compound
	    //particle is created
	    
	    TLorentzVector dilepton =
		(*(TLorentzVector *) ep) + (*(TLorentzVector *) em);
	    hf1->Fill(dilepton.M());
	}
    }

    hf1->Draw();
}
 analyze_eta_dalitz.C:1
 analyze_eta_dalitz.C:2
 analyze_eta_dalitz.C:3
 analyze_eta_dalitz.C:4
 analyze_eta_dalitz.C:5
 analyze_eta_dalitz.C:6
 analyze_eta_dalitz.C:7
 analyze_eta_dalitz.C:8
 analyze_eta_dalitz.C:9
 analyze_eta_dalitz.C:10
 analyze_eta_dalitz.C:11
 analyze_eta_dalitz.C:12
 analyze_eta_dalitz.C:13
 analyze_eta_dalitz.C:14
 analyze_eta_dalitz.C:15
 analyze_eta_dalitz.C:16
 analyze_eta_dalitz.C:17
 analyze_eta_dalitz.C:18
 analyze_eta_dalitz.C:19
 analyze_eta_dalitz.C:20
 analyze_eta_dalitz.C:21
 analyze_eta_dalitz.C:22
 analyze_eta_dalitz.C:23
 analyze_eta_dalitz.C:24
 analyze_eta_dalitz.C:25
 analyze_eta_dalitz.C:26
 analyze_eta_dalitz.C:27
 analyze_eta_dalitz.C:28
 analyze_eta_dalitz.C:29
 analyze_eta_dalitz.C:30
 analyze_eta_dalitz.C:31
 analyze_eta_dalitz.C:32
 analyze_eta_dalitz.C:33
 analyze_eta_dalitz.C:34
 analyze_eta_dalitz.C:35
 analyze_eta_dalitz.C:36
 analyze_eta_dalitz.C:37
 analyze_eta_dalitz.C:38
 analyze_eta_dalitz.C:39
 analyze_eta_dalitz.C:40
 analyze_eta_dalitz.C:41
 analyze_eta_dalitz.C:42
 analyze_eta_dalitz.C:43
 analyze_eta_dalitz.C:44
 analyze_eta_dalitz.C:45
 analyze_eta_dalitz.C:46
 analyze_eta_dalitz.C:47