#define zgam_0jet_DBS_cxx #include "zgam_0jet_DBS.h" #include #include #include #include "iostream.h" void zgam_0jet_DBS::Loop() { // In a ROOT session, you can do: // Root > .L zgam_0jet_DBS.C // Root > zgam_0jet_DBS t // Root > t.GetEntry(12); // Fill t data members with entry number 12 // Root > t.Show(); // Show values of entry 12 // Root > t.Show(16); // Read and show values of entry 16 // Root > t.Loop(); // Loop on all entries // // This is the loop skeleton where: // jentry is the global entry number in the chain // ientry is the entry number in the current Tree // Note that the argument to GetEntry must be: // jentry for TChain::GetEntry // ientry for TTree::GetEntry and TBranch::GetEntry // // To read only selected branches, Insert statements like: // METHOD1: // fChain->SetBranchStatus("*",0); // disable all branches // fChain->SetBranchStatus("branchname",1); // activate branchname // METHOD2: replace line // fChain->GetEntry(jentry); //read all branches //by b_branchname->GetEntry(ientry); //read only this branch if (fChain == 0) return; //cout<<"tree no"<GetTreeNumber()<SetWeight(0.5,"global"); cout<<"weight="<GetWeight()<GetEntriesFast(); Long64_t nbytes = 0, nb = 0; for (Long64_t jentry=0; jentry>hist_genZdaughterpt"); rootfile->cd(); //hist_genphotonpt->Draw(); hist_genphotonpt->Write(); hist_genphotoneta->Write(); hist_genZbosonpt->Write(); hist_genZbosoneta->Write(); hist_genZdaughterpt->Write(); hist_genZdaughtereta->Write(); rootfile->Write(); //reset the weights to 1 w1=1; w2=1; w3=1; w4=1; w5=1; w6=1; w7=1; w8=1; w9=1; /*tree = (TTree*)f1->Get("myEvent"); tree->SetWeight(w1,"global"); tree->AutoSave(); cout<<"w1 = "<Close(); tree = (TTree*)f2->Get("myEvent"); tree->SetWeight(w1,"global"); tree->AutoSave(); cout<<"w1 = "<Close(); tree = (TTree*)f3->Get("myEvent"); tree->SetWeight(w2,"global"); tree->AutoSave(); cout<<"w2 = "<Close(); tree = (TTree*)f4->Get("myEvent"); tree->SetWeight(w2,"global"); tree->AutoSave(); cout<<"w2 = "<Close(); tree = (TTree*)f5->Get("myEvent"); tree->SetWeight(w3,"global"); tree->AutoSave(); cout<<"w3 = "<Close(); tree = (TTree*)f6->Get("myEvent"); tree->SetWeight(w3,"global"); tree->AutoSave(); cout<<"w3 = "<Close(); tree = (TTree*)f7->Get("myEvent"); tree->SetWeight(w4,"global"); tree->AutoSave(); cout<<"w4 = "<Close(); tree = (TTree*)f8->Get("myEvent"); tree->SetWeight(w4,"global"); tree->AutoSave(); cout<<"w4 = "<Close(); tree = (TTree*)f9->Get("myEvent"); tree->SetWeight(w5,"global"); tree->AutoSave(); cout<<"w5 = "<Close(); tree = (TTree*)f10->Get("myEvent"); tree->SetWeight(w5,"global"); tree->AutoSave(); cout<<"w5 = "<Close(); tree = (TTree*)f11->Get("myEvent"); tree->SetWeight(w6,"global"); tree->AutoSave(); cout<<"w6 = "<Close(); tree = (TTree*)f12->Get("myEvent"); tree->SetWeight(w6,"global"); tree->AutoSave(); cout<<"w6 = "<Close(); tree = (TTree*)f13->Get("myEvent"); tree->SetWeight(w7,"global"); tree->AutoSave(); cout<<"w7 = "<Close(); tree = (TTree*)f14->Get("myEvent"); tree->SetWeight(w7,"global"); tree->AutoSave(); cout<<"w7 = "<Close(); tree = (TTree*)f15->Get("myEvent"); tree->SetWeight(w8,"global"); tree->AutoSave(); cout<<"w8 = "<Close(); tree = (TTree*)f16->Get("myEvent"); tree->SetWeight(w8,"global"); tree->AutoSave(); cout<<"w8 = "<Close(); tree = (TTree*)f17->Get("myEvent"); tree->SetWeight(w9,"global"); tree->AutoSave(); cout<<"w9 = "<Close(); tree = (TTree*)f18->Get("myEvent"); tree->SetWeight(w9,"global"); tree->AutoSave(); cout<<"w9 = "<Close(); */ rootfile->Close(); //hist_genZdaughterpt->Draw(); }