void timediff( char src[200] ) { FILE *outf; outf=fopen("timeinf.txt","w"); TFile *pRootFile = new TFile(src); TTree *pTreeCoin = (TTree*)pRootFile->Get("Coincidences"); double time1; double time2; int eventID1; int nentries = (int) pTreeCoin -> GetEntries(); int nBug=0; pTreeCoin->SetBranchAddress("time1",&time1); pTreeCoin->SetBranchAddress("time2",&time2); pTreeCoin->SetBranchAddress("eventID1",&eventID1); for(int i=0 ; iGetEntry(i); fprintf(outf,"%1.12lf, %1.12lf\n",time1,time2); if( fabs(time1-time2)*1.0e12 > 100. ) nBug++; } printf("Total Coincidences event %d, coincidences events out of window %d\n", nentries, nBug); delete pTreeCoin; fclose(outf); }