Commit in hps-java/src/main/java/org/lcsim/hps/users/omoreno on MAIN | |||
SimpleSvtTrigger.java | +23 | -7 | 1.1 -> 1.2 |
Allow a user to specify which SimTrackerHit collection to trigger on
diff -u -r1.1 -r1.2 --- SimpleSvtTrigger.java 9 Nov 2012 01:44:11 -0000 1.1 +++ SimpleSvtTrigger.java 19 Nov 2012 22:21:16 -0000 1.2 @@ -27,32 +27,43 @@
boolean debug = false;
+ // Collection Names + String simTrackerHitCollectionName = "TrackerHits"; + +
//--- Setters ---// //---------------// /**
- * Enable/disable debug
+ * Enable/disable debug.
*/ public void setDebug(boolean debug){ this.debug = debug; } /**
- * Set the number of SVT Layers
+ * Set the number of SVT Layers.
*/ public void setNumberOfSvtLayers(int numberOfSvtLayers){ this.numberOfSvtLayers = numberOfSvtLayers; } /**
- * Set the number of SVT Layers that an MC particle should hit
+ * Set the number of SVT Layers that an MC particle should hit.
*/ public void setNumberOfSvtLayersHit(int numberOfSvtLayersHit){ this.numberOfSvtLayersHit = numberOfSvtLayersHit; }
+ + /** + * Set the SimTrackerHit collection name. + */ + public void setSimTrackerHitCollectionName(String simTrackerHitCollectionName){ + this.simTrackerHitCollectionName = simTrackerHitCollectionName; + }
/**
- * Dflt Ctor
+ * Dflt Ctor.
*/ public SimpleSvtTrigger(){ }
@@ -73,9 +84,14 @@
eventNumber++; // If the event doesn't contain SimTrackerHits; skip the event
- if(!event.hasCollection(SimTrackerHit.class, "TrackerHits")) return; - List<SimTrackerHit> simHits = event.get(SimTrackerHit.class, "TrackerHits"); -
+ if(!event.hasCollection(SimTrackerHit.class, simTrackerHitCollectionName)){ + this.printDebug("The event does not contain the collection " + simTrackerHitCollectionName); + return; + } + List<SimTrackerHit> simHits = event.get(SimTrackerHit.class, simTrackerHitCollectionName); + this.printDebug("The collection " + simTrackerHitCollectionName + " contains " + simHits.size() + " SimTrackerHits"); + this.printDebug("The total number of SimTrackerHit collections " + event.get(SimTrackerHit.class).size()); +
// Get the MC Particles associated with the SimTrackerHits List<MCParticle> mcParticles = event.getMCParticles(); if(debug){
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