Skip to content
Open
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 @@ -47,7 +47,7 @@ public class TrackCandListFinder {

private static final Logger LOGGER = Logger.getLogger(TrackCandListFinder.class.getName());

long startTime, startTime2 = 0;
long startTime;

/**
* the tracking status = HitBased or TimeBased
Expand Down Expand Up @@ -318,13 +318,11 @@ public List<Track> getTrackCandsAI(CrossList crossList, DCGeant4Factory DcDetect
*/
public List<Track> getTrackCands(CrossList crossList, DCGeant4Factory DcDetector, double TORSCALE, Swim dcSwim,
boolean donotapplyCuts) {
List<Track> cands = null;
if (Math.abs(TORSCALE) < 0.001) {
cands = this.findStraightTracks(crossList, DcDetector, TORSCALE, dcSwim);
return this.findStraightTracks(crossList, DcDetector, TORSCALE, dcSwim);
} else {
cands = this.findCurvedTracks(crossList, DcDetector, TORSCALE, dcSwim, donotapplyCuts);
return this.findCurvedTracks(crossList, DcDetector, TORSCALE, dcSwim, donotapplyCuts);
}
return cands;
}

/**
Expand Down Expand Up @@ -374,13 +372,10 @@ private void getStraightTrack(Track cand) {
FitPars2 = linefit.getFit();
}

double X0 = -99999;
double Y0 = -99999;

if (FitPars1 != null && FitPars2 != null) {

X0 = FitPars1.intercept();
Y0 = FitPars2.intercept();
double X0 = FitPars1.intercept();
double Y0 = FitPars2.intercept();
Point3D trkR1X = new Point3D(FitPars1.slope() * x[0] + FitPars1.intercept(),
FitPars2.slope() * x[0] + FitPars2.intercept(), x[0]);
Point3D trkR3X = new Point3D(FitPars1.slope() * x[2] + FitPars1.intercept(),
Expand Down Expand Up @@ -410,30 +405,6 @@ private void getStraightTrack(Track cand) {
}
}

/**
* @param x x coordinate in the lab frame
* @param y y coordinate in the lab frame
* @return the sector in the DC lab frame system corresponding to the (x,y)
* coordinates
*/
private int getSector(double x, double y) {
double phi = Math.toDegrees(FastMath.atan2(y, x));
double ang = phi + 30;
while (ang < 0) {
ang += 360;
}
int sector = 1 + (int) (ang / 60.);

if (sector == 7) {
sector = 6;
}

if ((sector < 1) || (sector > 6)) {
System.err.println("Track sector not found....");
}
return sector;
}

/**
* @param cand the track candidate
* @param traj the track trajectory
Expand Down Expand Up @@ -533,20 +504,6 @@ public void setTrackPars(Track cand,
return;
}

int LR = 0;
for (Cross crs : cand) {
Segment s1 = crs.get_Segment1();
Segment s2 = crs.get_Segment2();

for (FittedHit h : s1) {
LR += h._lr;
}
for (FittedHit h : s2) {
LR += h._lr;
}

}

double xOrFix = Vt[0];
double yOrFix = Vt[1];
double zOrFix = Vt[2];
Expand Down Expand Up @@ -951,10 +908,6 @@ private double calcCurvSign(Track cand) {

private List<Track> findStraightTracks(CrossList crossList, DCGeant4Factory DcDetector, double TORSCALE, Swim dcSwim) {

if(LOGGER.getLevel()==Level.FINEST) {
startTime2 = System.currentTimeMillis();
}

List<Track> cands = new ArrayList<>();
if (crossList.isEmpty()) {
return cands;
Expand Down Expand Up @@ -1046,11 +999,6 @@ private List<Track> findStraightTracks(CrossList crossList, DCGeant4Factory DcDe
private List<Track> findCurvedTracks(CrossList crossList, DCGeant4Factory DcDetector, double TORSCALE, Swim dcSwim,
boolean donotapplyCuts) {


if(LOGGER.getLevel()==Level.FINEST) {
startTime2 = System.currentTimeMillis();
}

List<Track> cands = new ArrayList<>();
if (crossList.isEmpty()) {
return cands;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -304,13 +304,8 @@ public void init(Track trkcand, double z0, KFitterDoca kf, int c) {

rk.SwimToZ(trkcand.get(0).get_Sector(), initSV, dcSwim, z0, bf);

if (initSV != null) {
this.trackTraj.put(0, initSV);

this.trackTraj.put(0, initSV);
} else {
kf.setFitFailed = true;
return;
}
//LOGGER.log(Level.FINEST, (0)+"] init "+this.trackTraj.get(0).x+","+this.trackTraj.get(0).y+","+
// this.trackTraj.get(0).z+","+this.trackTraj.get(0).tx+","+this.trackTraj.get(0).ty+" "+1/this.trackTraj.get(0).Q);
double err_sl1 = trkcand.get(0).get_Segment1().get_fittedCluster().get_clusterLineFitSlopeErr();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import Jama.*;
import org.jlab.rec.dc.Constants;

/**
* Describes a track pars in the DC.
* @author ziegler
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,8 @@ public void loadSurface(double targetPosition, double targetLength, DCGeant4Fact
Constants.getInstance().Z[11]= dcDetector.getWireMidpoint(0, 5, 0, 0).z;
Constants.getInstance().Z[12]= dcDetector.getWireMidpoint(0, 5, 5, 0).z;
//DcDetector.getWireMidpoint(this.get_Sector()-1, this.get_Superlayer()-1, this.get_Layer()-1, this.get_Wire()-1).z;

double d = 0;
Vector3D n,P;
Vector3D n;

for(int isector =0; isector<6; isector++) {

int sector = isector+1;
Expand Down
Loading