Skip to content

Commit

Permalink
will work on this branch
Browse files Browse the repository at this point in the history
  • Loading branch information
Churamani Paudel committed Jan 22, 2025
1 parent 8368618 commit a803cc3
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

/**
*
* @author npilleux
* @authors npilleux, churaman
*/


Expand Down Expand Up @@ -82,6 +82,7 @@ public void setPath_length(double path_length) {

//Cluster coordinates and time are defined as the coordinates and time of the max energy hit
//Can be changed later

public final void computeClusterProperties() {
this.energy=0;
double max_energy = -1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@

/**
*
* @author npilleux
* @authors npilleux,churaman
*/

public class ClusterFinder {

private ArrayList<AtofCluster> clusters;
Expand All @@ -42,16 +43,10 @@ public void MakeClusters(HitFinder hitfinder) {
double sigma_Phi = 6.0; //angle opening of a layer. to be read from DB in the future
double sigma_Z = 6000;//to be read from DB in the future
double sigma_T = 1000;//timing resolution to be read from DB in the future

/*
double sigma_Phi = loadParameterFromDB("SIGMA_PHI");
double sigma_Z = loadParameterFromDB("SIGMA_Z");
double sigma_T = loadParameterFromDB("SIGMA_T");
*/

int sigma_module = 1; //hits are always within +-1 phi module of the most energetic
int sigma_component = 1;//hits are always within +-1 z component of the most energetic


//Looping through wedge hits first
for (int i_wedge = 0; i_wedge < wedge_hits.size(); i_wedge++) {
AtofHit this_wedge_hit = wedge_hits.get(i_wedge);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* computed from atof detector object using the geometry service Stores whether
* the hit is part of a cluster. Calculates time, energy based on TDC/ToT.
*
* @author npilleux
* @authors npilleux, churaman
*/
public class AtofHit {

Expand Down Expand Up @@ -285,6 +285,7 @@ public final int slc_to_xyz(Detector atof) {
* @param hit2match The AtofHit object to compare with the current instance.
* @return {@code true} if the hits match; {@code false} otherwise.
*/

public boolean matchBar(AtofHit hit2match) {
if (this.getSector() != hit2match.getSector()) {
return false; //System.out.print("Two hits in different sectors \n");
Expand Down Expand Up @@ -386,6 +387,7 @@ public AtofHit(int sector, int layer, int component, int order, int tdc, int tot
* TrackProjections.
*
*/

public final void matchTrack(TrackProjector track_projector) {
double sigma_phi = 0;
double sigma_z = 0;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
package org.jlab.rec.atof.hit;

import org.jlab.detector.calib.utils.DatabaseConstantProvider;
import org.jlab.geom.base.Detector;
import org.jlab.geom.detector.alert.ATOF.AlertTOFFactory;
Expand All @@ -15,8 +14,9 @@
* by the two hits upstream and downstream composing a full bar hit. z position,
* time and energy are defined from the up/down hits
*
* @author npilleux
* @authors npilleux,churaman
*/

public class BarHit extends AtofHit {

//A bar hit is the combination of a downstream and upstream hits
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

/**
*
* @author npilleux
* @authors npilleux,churaman
*/
public class HitFinder {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,12 @@ public void projectMCTracks(DataEvent event) {//, CalibrationConstantsLoader ccd
double pz = bank.getFloat("pz", i);

//Put everything in MM

x = x*10;
y = y*10;
z = z*10;
Units units = Units.MM;

Units units = Units.MM;

int q = 1; //need the charge sign from tracking

Expand All @@ -194,15 +196,18 @@ public void projectMCTracks(DataEvent event) {//, CalibrationConstantsLoader ccd
Helix helix = new Helix(x, y, z, px, py, pz, q, B, xb, yb, units);

//Intersection points with the middle of the bar or wedge
projection.set_BarIntersect(helix.getHelixPointAtR(Parameters.BAR_MIDDLE_RADIUS));

projection.set_BarIntersect(helix.getHelixPointAtR(Parameters.BAR_MIDDLE_RADIUS));
projection.set_WedgeIntersect(helix.getHelixPointAtR(Parameters.WEDGE_MIDDLE_RADIUS));

//Path length to the middle of the bar or wedge
projection.set_BarPathLength((float) Math.abs(helix.getLAtR(Parameters.BAR_INNER_RADIUS)));

projection.set_BarPathLength((float) Math.abs(helix.getLAtR(Parameters.BAR_INNER_RADIUS)));
projection.set_WedgePathLength((float) Math.abs(helix.getLAtR(Parameters.WEDGE_INNER_RADIUS)));

//Path length from the inner radius to the middle radius
projection.set_BarInPathLength((float) Math.abs(helix.getLAtR(Parameters.BAR_MIDDLE_RADIUS)) - projection.get_BarPathLength());

projection.set_BarInPathLength((float) Math.abs(helix.getLAtR(Parameters.BAR_MIDDLE_RADIUS)) - projection.get_BarPathLength());
projection.set_WedgeInPathLength((float) Math.abs(helix.getLAtR(Parameters.WEDGE_MIDDLE_RADIUS)) - projection.get_WedgePathLength());
Projections.add(projection);
fill_out_bank(outputBank, projection, i);
Expand Down Expand Up @@ -261,4 +266,4 @@ public static void main(String arg[]) {

System.out.print("Read " + event_number + " events");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

/**
*
* @author npilleux
* @authors npilleux,churaman
*/
public class RecoBankWriter {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/**
*
* @author npilleux
* @authors npilleux,churaman
*/
public class Parameters {

Expand Down

0 comments on commit a803cc3

Please sign in to comment.