From a32adfc63c2aea8e7da8f43d4838108495abe4a2 Mon Sep 17 00:00:00 2001 From: Matthew Solt Date: Tue, 31 Oct 2017 11:54:41 -0700 Subject: [PATCH 1/2] adding hit removal driver and recon steering file --- ...ngineeringRun2015FullRecon_RemoveHit.lcsim | 151 ++++++++++++++++++ .../java/org/hps/readout/svt/DropSVTHits.java | 84 ++++++++++ 2 files changed, 235 insertions(+) create mode 100644 steering-files/src/main/resources/org/hps/steering/recon/EngineeringRun2015FullRecon_RemoveHit.lcsim create mode 100644 tracking/src/main/java/org/hps/readout/svt/DropSVTHits.java diff --git a/steering-files/src/main/resources/org/hps/steering/recon/EngineeringRun2015FullRecon_RemoveHit.lcsim b/steering-files/src/main/resources/org/hps/steering/recon/EngineeringRun2015FullRecon_RemoveHit.lcsim new file mode 100644 index 0000000000..d36a1858ff --- /dev/null +++ b/steering-files/src/main/resources/org/hps/steering/recon/EngineeringRun2015FullRecon_RemoveHit.lcsim @@ -0,0 +1,151 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + CONFIG + + + EcalCalHits + + + WARNING + EcalClusters + + + EcalClusters + EcalClustersCorr + + + + + SVTRawTrackerHits + + + true + false + 0.975 + + + Pileup + false + true + true + false + true + true + true + false + + + 8.0 + + + false + 12.0 + 16.0 + 400.0 + + + + Tracks_s345_c2_e16 + HPS_s345_c2_e16.xml + false + 8.0 + + + Tracks_s456_c3_e21 + HPS_s456_c3_e21.xml + false + 8.0 + + + Tracks_s123_c4_e56 + HPS_s123_c4_e56.xml + false + 8.0 + + + Tracks_s123_c5_e46 + HPS_s123_c5_e46.xml + false + 8.0 + + + + + EcalClustersCorr + MatchedTracks GBLTracks + + + + ${outputFile}.slcio + + + + ${outputFile}.root + + + diff --git a/tracking/src/main/java/org/hps/readout/svt/DropSVTHits.java b/tracking/src/main/java/org/hps/readout/svt/DropSVTHits.java new file mode 100644 index 0000000000..b3a91a7ef7 --- /dev/null +++ b/tracking/src/main/java/org/hps/readout/svt/DropSVTHits.java @@ -0,0 +1,84 @@ +package org.hps.readout.svt; + +import org.lcsim.detector.tracker.silicon.HpsSiSensor; +import org.lcsim.event.EventHeader; +import org.lcsim.event.RawTrackerHit; +import org.lcsim.lcio.LCIOConstants; +import org.lcsim.util.Driver; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +/** + * Removes raw tracker hits based on SVT Inefficiencies. + * + * @author Matt Solt + */ + +public class DropSVTHits extends Driver { + + //Hit Efficiencies + private boolean enableHitEfficiency = false; + private boolean enableHitEfficiencyDistribution = false; + private double layer1HitEfficiency = 1.0; + + //Collection Names + private String removedOutputCollection = "SVTRawTrackerHitsRemoved"; + private String rawTrackerHitCollectionName = "SVTRawTrackerHits"; + + public void setEnableHitEfficiency(boolean enableHitEfficiency) { + this.enableHitEfficiency = enableHitEfficiency; + } + + public void setEnableHitEfficiencyDistribution(boolean enableHitEfficiencyDistribution) { + this.enableHitEfficiencyDistribution = enableHitEfficiencyDistribution; + } + + public void setLayer1HitEfficiency(double layer1HitEfficiency) { + this.layer1HitEfficiency = layer1HitEfficiency; + } + + public void process(EventHeader event) { + + List rawHits = event.get(RawTrackerHit.class, rawTrackerHitCollectionName); + List removedRawHits = new ArrayList(); + + Iterator iter = rawHits.iterator(); + while (iter.hasNext()) { + RawTrackerHit hit = iter.next(); + if(!KeepHit(hit,enableHitEfficiencyDistribution,layer1HitEfficiency) && enableHitEfficiency){ + removedRawHits.add(hit); + iter.remove(); + } + } + + int flags = 1 << LCIOConstants.TRAWBIT_ID1; + event.put(removedOutputCollection, removedRawHits, RawTrackerHit.class, flags); + } + + private boolean KeepHit(RawTrackerHit hit, boolean enableHitEfficiencyDistribution, double layer1HitEfficiency) { + boolean keepHit = true; + HpsSiSensor sensor = (HpsSiSensor) hit.getDetectorElement(); + int layer = sensor.getLayerNumber(); + double random = Math.random(); + if(!enableHitEfficiencyDistribution){ + if (random > layer1HitEfficiency && (layer == 1 || layer == 2)){ + keepHit = false; + } + return keepHit; + } + else{ + double eff = computeEfficiency(hit,sensor); + if(random > eff){ + keepHit = false; + } + return keepHit; + } + } + + private double computeEfficiency(RawTrackerHit hit, HpsSiSensor sensor){ + double eff = 1.0; + return eff; + } +} From 20c3094a85799ee519f72aa08c507ae270f37264 Mon Sep 17 00:00:00 2001 From: Matthew Solt Date: Tue, 31 Oct 2017 14:10:28 -0700 Subject: [PATCH 2/2] change the hit efficiency in L1 --- .../steering/recon/EngineeringRun2015FullRecon_RemoveHit.lcsim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/steering-files/src/main/resources/org/hps/steering/recon/EngineeringRun2015FullRecon_RemoveHit.lcsim b/steering-files/src/main/resources/org/hps/steering/recon/EngineeringRun2015FullRecon_RemoveHit.lcsim index d36a1858ff..c2e49979c9 100644 --- a/steering-files/src/main/resources/org/hps/steering/recon/EngineeringRun2015FullRecon_RemoveHit.lcsim +++ b/steering-files/src/main/resources/org/hps/steering/recon/EngineeringRun2015FullRecon_RemoveHit.lcsim @@ -86,7 +86,7 @@ true false - 0.975 + 0.95 Pileup