#include #include "TH1F.h" #include "TStyle.h" #include "TCanvas.h" #include "TLorentzVector.h" #include "TClonesArray.h" #include "TFile.h" #include "TTree.h" using namespace std; void massclass() { TFile *hfile = new TFile("unweighted.root","read"); TTree *LHEF=(TTree*)hfile->Get("LHEF"); LHEF->SetMakeClass(true); LHEF->SetBranchStatus("*",0); LHEF->SetBranchStatus("Particle.M",1); LHEF->SetBranchStatus("Event_size",1); Long64_t nentries = LHEF->GetEntries(); Double_t *Particle_M[8]; LHEF->SetBranchAddress("Particle.M",Particle_M); TH1F *invm = new TH1F("H_invmass","GeV",100,0,150); Double_t k; Int_t i=0; for (i=0; i<10000;i++) { LHEF->GetEntry(i); for (Int_t j=0; j<8 ;j++) { k=*(Particle_M[j]); cout<< Particle_M[j]<Fill(k); } cout<Draw(); }