#include #include #include #include "TFile.h" #include"TLorentzVector.h" #include"TChain.h" #include"TString.h" #include"TMath.h" #include "TTree.h" using namespace std; void simple_code(){ gROOT->ProcessLine(".L loader.C+"); TFile f("stopFlatNtuples_1.root"); TTree *t = (TTree*)f.Get("stopTreeMaker/AUX"); std::vector *muonsLVec =0; int nMuons_CUT=0, nElectrons_CUT=0, nJets_CUT=0; double ht=0, mht=0, met=0, metphi=0, dPhi0_CUT=0,dPhi1_CUT=0, dPhi2_CUT=0; t->SetBranchAddress("muonsLVec", &muonsLVec); t->SetBranchAddress("nMuons_CUT", &nMuons_CUT); t->SetBranchAddress("nElectrons_CUT", &nElectrons_CUT); t->SetBranchAddress("nJets_CUT", &nJets_CUT); t->SetBranchAddress("ht", &ht); t->SetBranchAddress("mht", &mht); t->SetBranchAddress("met", &met); t->SetBranchAddress("metphi", &metphi); t->SetBranchAddress("dPhi0_CUT", &dPhi0_CUT); t->SetBranchAddress("dPhi1_CUT", &dPhi1_CUT); t->SetBranchAddress("dPhi2_CUT", &dPhi2_CUT); //vector *genmupt, *genmueta, *genmuphi; int hadtauflag,nmuon,nelectron,njets; double hT, mhT, meT, meTphi, dphi0, dphi1, dphi2; TFile *f1 = new TFile("hadtausimple.root", "RECREATE"); TTree *nt = new TTree("Hadtausimple","Hadtausimple info"); nt->Branch("hadtauflag",&hadtauflag,"hadtauflag/I"); nt->Branch("nmuon", &nmuon, "nmuon/I"); nt->Branch("nelectron", &nelectron, "nelectron/I"); nt->Branch("njets", &njets, "njets/I"); nt->Branch("hT", &hT, "hT/D"); nt->Branch("mhT", &mhT, "mhT/D"); nt->Branch("meT", &meT, "meT/D"); nt->Branch("meTphi", &meTphi, "meTphi/D"); nt->Branch("dphi0", &dphi0, "dphi0/D"); nt->Branch("dphi1", &dphi1, "dphi1/D"); nt->Branch("dphi2", &dphi2, "dphi2/D"); //int genmu=0, accmu=0; Int_t nentries = (Int_t)t->GetEntries(); for(Int_t i=0; iGetEntry(i); // genmupt->clear(); // genmueta->clear(); // genmuphi->clear(); nt->Fill(); } nt->Write(); cout<<"nentries "<