Commit in lcsim/src/org/lcsim/util on MAIN | |||
OverlayDriver.java | +11 | -9 | 1.15 -> 1.16 |
Changed the logic of replacing collections to avoid modifying collection meta data
diff -u -r1.15 -r1.16 --- OverlayDriver.java 20 Jul 2012 17:56:14 -0000 1.15 +++ OverlayDriver.java 20 Jul 2012 18:34:44 -0000 1.16 @@ -432,15 +432,17 @@
* @param entries the list of entries to put into the event * @param event the event to put the collection */
- protected void putCollection(LCMetaData collection, List entries, EventHeader event) { - String[] readout = collection.getStringParameters().get(BaseLCSimEvent.READOUT_NAME); - if (readout != null) { - event.put(collection.getName(), entries, collection.getType(), collection.getFlags(), readout[0]); - } else { - event.put(collection.getName(), entries, collection.getType(), collection.getFlags());
+ protected void putCollection(LCMetaData collection, List entries,EventHeader event) { + if (this.getHistogramLevel() > HLEVEL_NORMAL) System.out.println("Putting collection " + collection.getName() + " with " + entries.size() + " entries into event."); + try { + List oldEntries = (List) event.get(collection.getName()); + if (entries != oldEntries) { + oldEntries.clear(); + oldEntries.addAll(entries); + } + } catch (IllegalArgumentException e) { + System.err.println(e.getMessage());
}
-// ((BaseLCSimEvent) event).put(collection.getName(), entries, collection.getType(), collection.getFlags(), collection.getIntegerParameters(), collection.getFloatParameters(), collection.getStringParameters()); - if (this.getHistogramLevel() > HLEVEL_NORMAL) System.out.println("Putting collection "+collection.getName()+" into event.");
} /**
@@ -456,7 +458,7 @@
List movedCollection = this.moveCollectionToTime(collection, time); if (movedCollection != null) { // replace the original collection
- event.remove(collection.getName());
+ //event.remove(collection.getName());
this.putCollection(collection, movedCollection, event); } }
Use REPLY-ALL to reply to list
To unsubscribe from the LCD-CVS list, click the following link:
https://listserv.slac.stanford.edu/cgi-bin/wa?SUBED1=LCD-CVS&A=1