#define teb_cxx #include "teb.h" #include #include #include #include void teb::Loop() { // In a ROOT session, you can do: // root> .L teb.C // root> teb 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 //define Histo TH2F *myMatrix = new TH2F("myMatrix", "", 15000, 0, 15000, 41, 0, 41); TH2F *mat41vs41 = new TH2F("mat41vs41", "", 300, 0, 300, 300, 0, 300); if (fChain == 0) return; Long64_t nentries = fChain->GetEntriesFast(); Long64_t nbytes = 0, nb = 0; for (Long64_t jentry=0; jentry<100;jentry++) { Long64_t ientry = LoadTree(jentry); if (ientry < 0) break; nb = fChain->GetEntry(jentry); nbytes += nb; b_xtals_crystalNum->GetEntry(jentry); b_xtals_crystalID->GetEntry(jentry); b_xtals_cc->GetEntry(jentry); b_xtals_intpts->GetEntry(jentry); //Fill Histo /* for (Int_t j=0; j<41; j++){ myMatrix->Fill( xtals_cc[xtals_crystalID[j]], xtals_crystalID[j]); } */ //cout << xtals_crystalID[0] <<" "<< xtals_cc[0] << endl; //41vs41 for (Int_t j=0; jFill( xtals_crystalID[j], xtals_crystalNum[j]); } // if (Cut(ientry) < 0) continue; //cout << xtals_crystalID[2] << endl; //cout << xtals_quadNum[2] << endl; //cout << xtals_crystalNum[0] << endl; /* cout << xtals_; for(Int_t j=0; jWrite(); mat41vs41->Write(); f.Close(); }