Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

430 atof reconstruction #436

Draft
wants to merge 19 commits into
base: development
Choose a base branch
from
Draft
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
100 changes: 100 additions & 0 deletions etc/bankdefs/hipo4/alert.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,105 @@
[
{
"name": "AHDC::Projections",
"group": 23000,
"item": 31,
"info": "Track Projections to ATOF",
"entries": [
{
"name": "x_at_bar",
"type": "F",
"info": "x position at atof bar (middle surface) in mm"
}, {
"name": "y_at_bar",
"type": "F",
"info": "y position at atof bar (middle surface) in mm"
}, {
"name": "z_at_bar",
"type": "F",
"info": "z position at atof bar (middle surface) in mm"
},{
"name": "L_at_bar",
"type": "F",
"info": "path length at atof bar (inner surface) in mm"
},{
"name": "L_in_bar",
"type": "F",
"info": "path length inside atof bar in mm"
},{
"name": "x_at_wedge",
"type": "F",
"info": "x position at atof wedge (middle surface) in mm"
}, {
"name": "y_at_wedge",
"type": "F",
"info": "y position at atof wedge (middle surface) in mm"
}, {
"name": "z_at_wedge",
"type": "F",
"info": "z position at atof wedge (middle surface) in mm"
},{
"name": "L_at_wedge",
"type": "F",
"info": "path length at atof wedge (inner surface) in mm"
},{
"name": "L_in_wedge",
"type": "F",
"info": "path length inside atof wedge in mm"
}
]
},{
"name": "ATOF::hits",
"group": 22500,
"item": 21,
"info": "Hits in ATOF",
"entries": [
{
"name": "id",
"type": "S",
"info": "hit id"
}, {
"name": "sector",
"type": "I",
"info": "atof sector"
}, {
"name": "layer",
"type": "I",
"info": "atof layer"
},{
"name": "component",
"type": "I",
"info": "atof component"
},{
"name": "time",
"type": "F",
"info": "time in ns"
},{
"name": "x",
"type": "F",
"info": "x position in mm"
}, {
"name": "y",
"type": "F",
"info": "y position in mm"
}, {
"name": "z",
"type": "F",
"info": "z position in mm"
},{
"name": "energy",
"type": "F",
"info": "deposited energy in MeV"
},{
"name": "inlength",
"type": "F",
"info": "path length inside the detector (from entrance to hit) in mm"
},{
"name": "pathlength",
"type": "F",
"info": "path length to the hit in mm"
}
]
},{
"name": "AHDC::Hits",
"group": 23000,
"item": 23,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
package org.jlab.rec.atof.cluster;

import java.util.ArrayList;
import org.jlab.rec.atof.hit.AtofHit;
import org.jlab.rec.atof.hit.BarHit;

/**
*
* @author npilleux
*/
public class AtofCluster {

ArrayList<BarHit> bar_hits;
ArrayList<AtofHit> wedge_hits;
double x,y,z,time,energy;
double path_length;

public ArrayList<BarHit> getBarHits() {
return bar_hits;
}

public void setBarHits(ArrayList<BarHit> bar_hits) {
this.bar_hits = bar_hits;
}

public ArrayList<AtofHit> getWedgeHits() {
return wedge_hits;
}

public void setWedgeHits(ArrayList<AtofHit> wedge_hits) {
this.wedge_hits = wedge_hits;
}

public double getX() {
return x;
}

public void setX(double x) {
this.x = x;
}

public double getY() {
return y;
}

public void setY(double y) {
this.y = y;
}

public double getZ() {
return z;
}

public void setZ(double z) {
this.z = z;
}

public double getTime() {
return time;
}

public void setTime(double time) {
this.time = time;
}

public double getEnergy() {
return energy;
}

public void setEnergy(double energy) {
this.energy = energy;
}

public double getPath_length() {
return path_length;
}

public void setPath_length(double path_length) {
this.path_length = 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;
AtofHit max_energy_hit = new AtofHit();
BarHit max_energy_barhit = new BarHit();

for(int i_wedge = 0; i_wedge<this.wedge_hits.size(); i_wedge++)
{
AtofHit this_wedge_hit = this.wedge_hits.get(i_wedge);
double this_energy = this_wedge_hit.getEnergy();
this.energy+=this_energy;
if(this_energy>max_energy){max_energy_hit = this_wedge_hit; max_energy = this_energy;}
}

for(int i_bar = 0; i_bar<this.bar_hits.size(); i_bar++)
{
BarHit this_bar_hit = this.bar_hits.get(i_bar);
double this_energy = this_bar_hit.getEnergy();
this.energy+=this_energy;
if(this_energy>max_energy){max_energy_barhit = this_bar_hit; max_energy = this_energy;}
}

if(max_energy_hit.getEnergy() > max_energy_barhit.getEnergy())
{
this.time = max_energy_hit.getTime();
this.x = max_energy_hit.getX();
this.y = max_energy_hit.getY();
this.z = max_energy_hit.getZ();
this.path_length = max_energy_hit.getPath_length();
}
else
{
this.time = max_energy_barhit.getTime();
this.x = max_energy_barhit.getX();
this.y = max_energy_barhit.getY();
this.z = max_energy_barhit.getZ();
this.path_length = max_energy_barhit.getPath_length();
}

}

public double getPhi()
{
return Math.atan2(this.y, this.x);
}

public AtofCluster(ArrayList<BarHit> bar_hits, ArrayList<AtofHit> wedge_hits)
{
this.bar_hits = bar_hits;
this.wedge_hits = wedge_hits;
this.computeClusterProperties();
}

/**
* @param args the command line arguments
*/
public static void main(String[] args) {
}

}
Loading
Loading