Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,9 @@
<ecalClusterCollectionName>EcalClustersCorr</ecalClusterCollectionName>
<trackCollectionNames>MatchedTracks GBLTracks</trackCollectionNames>
</driver>
<driver name="TrackDataDriver" type="org.hps.recon.tracking.TrackDataDriver" />
<driver name="TrackDataDriver" type="org.hps.recon.tracking.TrackDataDriver">
<layerNum>7</layerNum>
</driver>
<driver name="LCIOWriter" type="org.lcsim.util.loop.LCIODriver">
<outputFilePath>${outputFile}.slcio</outputFilePath>
</driver>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,9 @@
<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="TrackDataDriver" type="org.hps.recon.tracking.TrackDataDriver">
<layerNum>7</layerNum>
</driver>
<driver name="ReconParticleDriver" type="org.hps.recon.particle.HpsReconParticleDriver" >
<ecalClusterCollectionName>EcalClustersCorr</ecalClusterCollectionName>
<trackCollectionNames>MatchedTracks GBLTracks</trackCollectionNames>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ public final class TrackDataDriver extends Driver {
/** The extrapolation step size */
double stepSize = 5.0; // mm

/** The default number of layers */
int layerNum = 6;

/** Default constructor */
public TrackDataDriver() {
}
Expand All @@ -98,6 +101,15 @@ void setStepSize(double stepSize) {
this.stepSize = stepSize;
}

/**
* Set number of tracking layers. Default is 6 layers.
*
*/

public void setLayerNum(int layerNum) {
this.layerNum = layerNum;
}

/**
* Method called by the framework when a new {@link Detector} geometry is
* loaded. This method is called at the beginning of every run and
Expand Down Expand Up @@ -283,7 +295,7 @@ protected void process(EventHeader event) {

// Calculate the track isolation constants for each of the
// layers
Double[] isolations = TrackUtils.getIsolations(track, hitToStrips, hitToRotated);
Double[] isolations = TrackUtils.getIsolations(track, hitToStrips, hitToRotated,layerNum);
double qualityArray[] = new double[isolations.length];
for (int i = 0; i < isolations.length; i++) {
qualityArray[i] = isolations[i] == null ? -99999999.0 : isolations[i];
Expand Down
9 changes: 6 additions & 3 deletions tracking/src/main/java/org/hps/recon/tracking/TrackUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ public static double[] getParametersAtNewRefPoint(double[] newRefPoint, double[]
if (Math.abs( dphi ) > Math.PI)
throw new RuntimeException("dphi is large " + dphi + " from phi0 " + phi0
+ " and phinew " + phinew + " take care of the ambiguity!!??");
//System.out.println("dphi is large " + dphi + " from phi0 " + phi0 + " and phinew " + phinew + " take care of the ambiguity!!??");

// calculate new dca
double dcanew = dca + dx*sinphi - dy*cosphi + (dx*cosphi + dy*sinphi)*Math.tan( dphi/2. );
Expand Down Expand Up @@ -1286,8 +1287,8 @@ public static double getIsolation(TrackerHit strip, TrackerHit otherStrip, Relat
* @param hitToRotated
* @return isolations for all 12 strip layers
*/
public static Double[] getIsolations(Track trk, RelationalTable hitToStrips, RelationalTable hitToRotated) {
Double[] isolations = new Double[12];
public static Double[] getIsolations(Track trk, RelationalTable hitToStrips, RelationalTable hitToRotated, int layers) {
Double[] isolations = new Double[2*layers];
for (TrackerHit hit : trk.getTrackerHits()) {
Set<TrackerHit> htsList = hitToStrips.allFrom(hitToRotated.from(hit));
TrackerHit[] strips = new TrackerHit[2];
Expand All @@ -1298,7 +1299,9 @@ public static Double[] getIsolations(Track trk, RelationalTable hitToStrips, Rel
return isolations;
}


public static Double[] getIsolations(Track trk, RelationalTable hitToStrips, RelationalTable hitToRotated) {
return getIsolations(trk, hitToStrips, hitToRotated, 6);
}

/**
* Backward compatibility function for {@code extrapolateTrackUsingFieldMap}.
Expand Down