Stephen Levy levys@hep.uchicago.edu April 10, 2006 #---------------------- This code snippet assumes that you have a pointer to an uber object that has been correctly initialized in the event. The following files must be included #include #include Declare the following std::map before looping over events: std::map < int, std::set > evtmap; And then in the loop over the events add: // --- check for duplicate events in data int run = uber->header.run; int event = uber->header.event; bool unique = (evtmap[run].insert(event)).second; if (!unique) { std::cout << "ERROR: duplicate event for run/event " << run << "/" << event << std::endl; continue; } which will print out an error warning and skip over the duplicate events.