#define read_ntuple_cxx #include "read_ntuple.h" #include #include #include #include void read_ntuple::Loop() { // In a ROOT session, you can do: // Root > .L read_ntuple.C // Root > read_ntuple 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; ofstream of; of.open("ccbar_d_mu.oscar"); Long64_t nentries = fChain->GetEntriesFast(); Int_t nbytes = 0, nb = 0; of<<"# OSC1999A"<D->mu"<GetEntry(jentry); nbytes += nb; pt = sqrt(px_mu*px_mu+py_mu*py_mu); theta = atan(pt/fabs(pz_mu)); if (theta>max_ang || thetamax_ang || theta400.) { zvtx = tr->Gaus(0.,220.); } //vz_mu = vz_mu + zvtx*1e13; // add diamond to z of<<"0 1"<