-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #231 from JeffersonLab/iss228
Add hit removal driver and recon steering file
- Loading branch information
Showing
2 changed files
with
235 additions
and
0 deletions.
There are no files selected for viewing
151 changes: 151 additions & 0 deletions
151
...les/src/main/resources/org/hps/steering/recon/EngineeringRun2015FullRecon_RemoveHit.lcsim
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,151 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<lcsim xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="http://www.lcsim.org/schemas/lcsim/1.0/lcsim.xsd"> | ||
<!-- | ||
@brief Steering file that will be used for pass 2 reconstruction of | ||
the 2015 Engineering Run data. | ||
@author <a href="mailto:[email protected]">Sho Uemura</a> | ||
@author <a href="mailto:[email protected]">Omar Moreno</a> | ||
--> | ||
<execute> | ||
<!--RF driver--> | ||
<driver name="RfFitter"/> | ||
|
||
<!-- Ecal reconstruction drivers --> | ||
<driver name="EcalRunningPedestal"/> | ||
<driver name="EcalRawConverter" /> | ||
<driver name="ReconClusterer" /> | ||
<driver name="CopyCluster" /> | ||
<!-- SVT reconstruction drivers --> | ||
<driver name="RawTrackerHitSensorSetup"/> | ||
<driver name="RemoveRawHits"/> | ||
<driver name="RawTrackerHitFitterDriver" /> | ||
<driver name="TrackerHitDriver"/> | ||
<driver name="HelicalTrackHitDriver"/> | ||
<!-- | ||
Will run track finding algorithm using layers 345 as a seed, | ||
layer 2 to confirm and layers 1 and 6 to extend. The collection | ||
name of the tracks found with this strategy will be "MatchedTracks". | ||
--> | ||
<driver name="TrackReconSeed345Conf2Extd16"/> | ||
<!-- | ||
Will run track finding algorithm using layers 456 as a seed, | ||
layer 3 to confirm and layers 2 and 1 to extend. The collection | ||
name of the tracks found with this strategy will be | ||
"Tracks_s456_c3_e21" | ||
--> | ||
<driver name="TrackReconSeed456Conf3Extd21"/> | ||
<!-- | ||
Will run track finding algorithm using layers 123 as a seed, | ||
layer 4 to confirm and layers 5 and 6 to extend. The collection | ||
name of the tracks found with this strategy will be | ||
"Tracks_s123_c4_e56" | ||
--> | ||
<driver name="TrackReconSeed123Conf4Extd56"/> | ||
<!-- | ||
Will run track finding algorithm using layers 123 as a seed, | ||
layer 5 to confirm and layers 4 and 6 to extend. The collection | ||
name of the tracks found with this strategy will be | ||
"Tracks_s123_c5_e46" | ||
--> | ||
<driver name="TrackReconSeed123Conf5Extd46"/> | ||
<!-- | ||
TrackDataDriver needs to be run before ReconParticleDriver so the | ||
ReconstructedParticle types are properly set. | ||
--> | ||
<driver name="MergeTrackCollections"/> | ||
<driver name="GBLRefitterDriver" /> | ||
<driver name="TrackDataDriver" /> | ||
<driver name="ReconParticleDriver" /> | ||
<driver name="LCIOWriter"/> | ||
<driver name="CleanupDriver"/> | ||
</execute> | ||
<drivers> | ||
|
||
<driver name="RfFitter" type="org.hps.evio.RfFitterDriver"/> | ||
|
||
<!-- Ecal reconstruction drivers --> | ||
<driver name="EcalRunningPedestal" type="org.hps.recon.ecal.EcalRunningPedestalDriver"> | ||
<logLevel>CONFIG</logLevel> | ||
</driver> | ||
<driver name="EcalRawConverter" type="org.hps.recon.ecal.EcalRawConverterDriver"> | ||
<ecalCollectionName>EcalCalHits</ecalCollectionName> | ||
</driver> | ||
<driver name="ReconClusterer" type="org.hps.recon.ecal.cluster.ReconClusterDriver"> | ||
<logLevel>WARNING</logLevel> | ||
<outputClusterCollectionName>EcalClusters</outputClusterCollectionName> | ||
</driver> | ||
<driver name="CopyCluster" type="org.hps.recon.ecal.cluster.CopyClusterCollectionDriver"> | ||
<inputCollectionName>EcalClusters</inputCollectionName> | ||
<outputCollectionName>EcalClustersCorr</outputCollectionName> | ||
</driver> | ||
|
||
<!-- SVT reconstruction drivers --> | ||
<driver name="RawTrackerHitSensorSetup" type="org.lcsim.recon.tracking.digitization.sisim.config.RawTrackerHitSensorSetup"> | ||
<readoutCollections>SVTRawTrackerHits</readoutCollections> | ||
</driver> | ||
<driver name="RemoveRawHits" type="org.hps.readout.svt.DropSVTHits"> | ||
<enableHitEfficiency>true</enableHitEfficiency> | ||
<enableHitEfficiencyDistribution>false</enableHitEfficiencyDistribution> | ||
<layer1HitEfficiency>0.95</layer1HitEfficiency> | ||
</driver> | ||
<driver name="RawTrackerHitFitterDriver" type="org.hps.recon.tracking.RawTrackerHitFitterDriver"> | ||
<fitAlgorithm>Pileup</fitAlgorithm> | ||
<useTimestamps>false</useTimestamps> | ||
<correctTimeOffset>true</correctTimeOffset> | ||
<correctT0Shift>true</correctT0Shift> | ||
<useTruthTime>false</useTruthTime> | ||
<subtractTOF>true</subtractTOF> | ||
<subtractTriggerTime>true</subtractTriggerTime> | ||
<correctChanT0>true</correctChanT0> | ||
<debug>false</debug> | ||
</driver> | ||
<driver name="TrackerHitDriver" type="org.hps.recon.tracking.DataTrackerHitDriver"> | ||
<neighborDeltaT>8.0</neighborDeltaT> | ||
</driver> | ||
<driver name="HelicalTrackHitDriver" type="org.hps.recon.tracking.HelicalTrackHitDriver"> | ||
<debug>false</debug> | ||
<clusterTimeCut>12.0</clusterTimeCut> | ||
<maxDt>16.0</maxDt> | ||
<clusterAmplitudeCut>400.0</clusterAmplitudeCut> | ||
</driver> | ||
<!-- SVT Track finding --> | ||
<driver name="TrackReconSeed345Conf2Extd16" type="org.hps.recon.tracking.TrackerReconDriver"> | ||
<trackCollectionName>Tracks_s345_c2_e16</trackCollectionName> | ||
<strategyResource>HPS_s345_c2_e16.xml</strategyResource> | ||
<debug>false</debug> | ||
<rmsTimeCut>8.0</rmsTimeCut> | ||
</driver> | ||
<driver name="TrackReconSeed456Conf3Extd21" type="org.hps.recon.tracking.TrackerReconDriver"> | ||
<trackCollectionName>Tracks_s456_c3_e21</trackCollectionName> | ||
<strategyResource>HPS_s456_c3_e21.xml</strategyResource> | ||
<debug>false</debug> | ||
<rmsTimeCut>8.0</rmsTimeCut> | ||
</driver> | ||
<driver name="TrackReconSeed123Conf4Extd56" type="org.hps.recon.tracking.TrackerReconDriver"> | ||
<trackCollectionName>Tracks_s123_c4_e56</trackCollectionName> | ||
<strategyResource>HPS_s123_c4_e56.xml</strategyResource> | ||
<debug>false</debug> | ||
<rmsTimeCut>8.0</rmsTimeCut> | ||
</driver> | ||
<driver name="TrackReconSeed123Conf5Extd46" type="org.hps.recon.tracking.TrackerReconDriver"> | ||
<trackCollectionName>Tracks_s123_c5_e46</trackCollectionName> | ||
<strategyResource>HPS_s123_c5_e46.xml</strategyResource> | ||
<debug>false</debug> | ||
<rmsTimeCut>8.0</rmsTimeCut> | ||
</driver> | ||
<driver name="MergeTrackCollections" type="org.hps.recon.tracking.MergeTrackCollections" /> | ||
<driver name="TrackDataDriver" type="org.hps.recon.tracking.TrackDataDriver" /> | ||
<driver name="ReconParticleDriver" type="org.hps.recon.particle.HpsReconParticleDriver" > | ||
<ecalClusterCollectionName>EcalClustersCorr</ecalClusterCollectionName> | ||
<trackCollectionNames>MatchedTracks GBLTracks</trackCollectionNames> | ||
</driver> | ||
<driver name="GBLRefitterDriver" type="org.hps.recon.tracking.gbl.GBLRefitterDriver"/> | ||
<driver name="LCIOWriter" type="org.lcsim.util.loop.LCIODriver"> | ||
<outputFilePath>${outputFile}.slcio</outputFilePath> | ||
</driver> | ||
<driver name="CleanupDriver" type="org.lcsim.recon.tracking.digitization.sisim.config.ReadoutCleanupDriver"/> | ||
<driver name="AidaSaveDriver" type="org.lcsim.job.AidaSaveDriver"> | ||
<outputFileName>${outputFile}.root</outputFileName> | ||
</driver> | ||
</drivers> | ||
</lcsim> |
84 changes: 84 additions & 0 deletions
84
tracking/src/main/java/org/hps/readout/svt/DropSVTHits.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 <[email protected]> | ||
*/ | ||
|
||
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<RawTrackerHit> rawHits = event.get(RawTrackerHit.class, rawTrackerHitCollectionName); | ||
List<RawTrackerHit> removedRawHits = new ArrayList<RawTrackerHit>(); | ||
|
||
Iterator<RawTrackerHit> 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; | ||
} | ||
} |