コード例 #1
0
ファイル: EnergyLossCorr.java プロジェクト: ggilfoyl/tracking
  public void doCorrection(Track trkcand, Geometry geo) {

    double B = bstSwim.Bfield(Points[0][0] / 10, Points[0][0] / 10, Points[0][0] / 10).z();
    double ELossMax = 600; // 600Mev
    double stepSize = 0.001; // 1 MeV
    int nbins = (int) ELossMax;

    double pt0 = trkcand.get_Pt() + ELossMax * stepSize; // Assumes the max ELoss is 600 MeV

    double pt = pt0;
    double curv =
        (Constants.LIGHTVEL * Math.abs(B)) * Math.signum(this.OrigTrack.get_curvature()) / pt;

    for (int j = 0; j < nbins; j++) {
      if (Math.abs(this.OrigTrack.get_curvature()) < Math.abs(curv)) {
        double correctedCurv =
            (Constants.LIGHTVEL * Math.abs(B))
                * Math.signum(this.OrigTrack.get_curvature())
                / (pt + stepSize);
        trkcand.get_Helix().set_curvature(correctedCurv);
        trkcand.set_HelicalTrack(trkcand.get_Helix());
        return;
      }
      pt = pt0 - j * stepSize;

      double aveCurv = 0;
      for (int k = 0; k < trkcand.size(); k++) {
        aveCurv += doEnergyLossCorrection(k, pt);
      }
      aveCurv /= trkcand.size();
      curv = aveCurv;
    }
  }
コード例 #2
0
ファイル: EnergyLossCorr.java プロジェクト: ggilfoyl/tracking
  private void init(Track trkcand) {

    Points = new double[trkcand.size()][3];
    // CorrPoints 	= new double[trkcand.size()][3] ;

    cosEntAnglesPlanes = new double[trkcand.size()];

    Track trkcandcopy = new Track();
    trkcandcopy.addAll(trkcand);
    trkcandcopy.set_HelicalTrack(trkcand.get_Helix());
    trkcandcopy.set_Helix(trkcand.get_Helix());

    this.set_UpdatedTrack(trkcandcopy);

    for (int m = 0; m < trkcand.size(); m++) {

      Points[m][0] = trkcand.get(m).get_Point().x();
      Points[m][1] = trkcand.get(m).get_Point().y();
      Points[m][2] = trkcand.get(m).get_Point().z();

      double x =
          trkcand
              .get_Helix()
              .getPointAtRadius(
                  Math.sqrt(Points[m][0] * Points[m][0] + Points[m][1] * Points[m][1]))
              .x();
      double ux =
          trkcand
              .get_Helix()
              .getTrackDirectionAtRadius(
                  Math.sqrt(Points[m][0] * Points[m][0] + Points[m][1] * Points[m][1]))
              .x();
      double y =
          trkcand
              .get_Helix()
              .getPointAtRadius(
                  Math.sqrt(Points[m][0] * Points[m][0] + Points[m][1] * Points[m][1]))
              .y();
      double uy =
          trkcand
              .get_Helix()
              .getTrackDirectionAtRadius(
                  Math.sqrt(Points[m][0] * Points[m][0] + Points[m][1] * Points[m][1]))
              .y();
      double z =
          trkcand
              .get_Helix()
              .getPointAtRadius(
                  Math.sqrt(Points[m][0] * Points[m][0] + Points[m][1] * Points[m][1]))
              .z();
      double uz =
          trkcand
              .get_Helix()
              .getTrackDirectionAtRadius(
                  Math.sqrt(Points[m][0] * Points[m][0] + Points[m][1] * Points[m][1]))
              .z();

      double cosEntranceAngle =
          Math.abs((x * ux + y * uy + z * uz) / Math.sqrt(x * x + y * y + z * z));
      cosEntAnglesPlanes[m] = cosEntranceAngle;
    }
  }