root> TFile *f = new TFile("zuu307.root") root> f->ls() TFile** zuu307.root TFile* zuu307.root KEY: TTree MUON;1 MUON root> Muon->MakeClass("DeltaEtaProducer") then make changes to DeltaEtaProducer.h and .c #define DeltaEtaProducer_cxx #include "DeltaEtaProducer.h" void DeltaEtaProducer::Loop() { // In a Root session, you can do: // Root > .L DeltaEtaProducer.C // Root > DeltaEtaProducer 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 // To read only selected branches, Insert statements like: // METHOD1: // fTree->SetBranchStatus("*",0); // disable all branches // fTree->SetBranchStatus("branchname",1); // activate branchname // METHOD2: replace line // fTree->GetEntry(i); // read all branches //by b_branchname->GetEntry(i); //read only this branch if (fTree == 0) return; Float_t deltaEta[50]; TBranch *deltaEtaB = fTree->Branch("deltaEtaB", &deltaEta, "deltaEta[Nmuonid]/F"); Int_t nentries = Int_t(fTree->GetEntries()); Int_t nbytes = 0, nb = 0; Float_t temp; for (Int_t i=0; iGetEntry(i); nbytes += nb; // the following lines are added to process DeltaEta between segment and MC for (Int_t j=0; jLoop(); }