Print

Print


Commit in lcsim/src/org/lcsim/recon/calorimetry on MAIN
CalorimeterLayerSelector.java+2-211.3 -> 1.4
Avoid modifying meta data when replacing collection

lcsim/src/org/lcsim/recon/calorimetry
CalorimeterLayerSelector.java 1.3 -> 1.4
diff -u -r1.3 -r1.4
--- CalorimeterLayerSelector.java	19 Jul 2012 22:30:34 -0000	1.3
+++ CalorimeterLayerSelector.java	20 Jul 2012 21:30:29 -0000	1.4
@@ -54,31 +54,12 @@
 		List<SimCalorimeterHit> hitsToKeep = new ArrayList<SimCalorimeterHit>();
 		
 		for (SimCalorimeterHit hit : caloHits) {
-			//System.out.println("Layer: "+ hit.getLayerNumber());
 			if (activeLayers.contains(hit.getLayerNumber())) {
-				//System.out.println("Layer: "+ hit.getLayerNumber());
 				hitsToKeep.add(hit);
 			}
 		}
 		
-		replaceCollection(event.getMetaData(caloHits), hitsToKeep, event);
+		caloHits.clear();
+		caloHits.addAll(hitsToKeep);
 	}
-	
-	/**
-	 * Adds a collection to an event using the meta data information from the
-	 * given collection and the entries from the given list.
-	 * @param collection the collection to take the meta data from
-	 * @param entries the list of entries to put into the event
-	 * @param event the event to put the collection
-	 */
-	protected void replaceCollection(LCMetaData collection, List entries, EventHeader event) {
-		event.remove(collection.getName());
-		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());
-		}
-	}
-	
 }
CVSspam 0.2.12


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