Skip to content

Commit

Permalink
Merge pull request #426 from JeffersonLab/ftSolenoid
Browse files Browse the repository at this point in the history
FT vertex angle bug fix: correct sign of formula and constants from CCDB
  • Loading branch information
baltzell authored Dec 1, 2019
2 parents 63eb662 + 36a0962 commit 60124df
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
22 changes: 11 additions & 11 deletions reconstruction/ft/src/main/java/org/jlab/rec/ft/FTEBEngine.java
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public static void main(String arg[]){
en.init();
// String input = "/Users/devita/Work/clas12/simulations/tests/detectors/clas12/ft/elec_nofield_header.evio";
// EvioSource reader = new EvioSource();
String input = "/Users/devita/Work/clas12/simulations/clas12Tags/4.3.1/out.hipo";
String input = "/Users/devita/out.hipo";
// String input = "/Users/devita/out_gemc_10.hipo";
HipoDataSource reader = new HipoDataSource();
reader.open(input);
Expand All @@ -142,12 +142,12 @@ public static void main(String arg[]){
H1F h2 = new H1F("Energy Resolution", 100, -1, 1);
h2.setOptStat(Integer.parseInt("1111"));
h2.setTitleX("Energy Resolution(GeV)");
H1F h3 = new H1F("Theta Resolution", 100, -2, 2);
h3.setOptStat(Integer.parseInt("1111"));
h3.setTitleX("Theta Resolution(deg)");
H1F h4 = new H1F("Phi Resolution", 100, -10, 10);
h4.setOptStat(Integer.parseInt("1111"));
h4.setTitleX("Phi Resolution(deg)");
H2F h3 = new H2F("Theta Resolution", 100, 0, 5, 100, -2, 2);
h3.setTitleX("Energy (GeV)");
h3.setTitleY("Theta Resolution(deg)");
H2F h4 = new H2F("Phi Resolution", 100, 0, 5, 100, -10, 10);
h4.setTitleX("Energy (GeV)");
h4.setTitleY("Phi Resolution(deg)");
H1F h5 = new H1F("Time Resolution", 100, -2, 2);
h5.setOptStat(Integer.parseInt("1111"));
h5.setTitleX("Time Resolution(ns)");
Expand Down Expand Up @@ -183,8 +183,8 @@ public static void main(String arg[]){
h1.fill(bank.getDouble("Energy", i));
h2.fill(bank.getDouble("Energy", i) - gen.getParticle("[11]").vector().p());
Vector3D part = new Vector3D(bank.getDouble("Cx", i), bank.getDouble("Cy", i), bank.getDouble("Cz", i));
h3.fill(Math.toDegrees(part.theta() - gen.getParticle("[11]").theta()));
h4.fill(Math.toDegrees(part.phi() - gen.getParticle("[11]").phi()));
h3.fill(gen.getParticle("[11]").vector().p(),Math.toDegrees(part.theta() - gen.getParticle("[11]").theta()));
h4.fill(gen.getParticle("[11]").vector().p(),Math.toDegrees(part.phi() - gen.getParticle("[11]").phi()));
h5.fill(bank.getDouble("Time", i));
h6.fill(bank.getDouble("Energy", i), bank.getDouble("Energy", i) - gen.getParticle("[11]").vector().p());
}
Expand All @@ -200,8 +200,8 @@ public static void main(String arg[]){
h1.fill(bank.getFloat("energy", i));
h2.fill(bank.getFloat("energy", i) - gen.getGeneratedParticle(0).vector().p());
Vector3D part = new Vector3D(bank.getFloat("cx", i), bank.getFloat("cy", i), bank.getFloat("cz", i));
h3.fill(Math.toDegrees(part.theta() - gen.getGeneratedParticle(0).theta()));
h4.fill(Math.toDegrees(part.phi() - gen.getGeneratedParticle(0).phi()));
h3.fill(gen.getGeneratedParticle(0).vector().p(),Math.toDegrees(part.theta() - gen.getGeneratedParticle(0).theta()));
h4.fill(gen.getGeneratedParticle(0).vector().p(),Math.toDegrees(part.phi() - gen.getGeneratedParticle(0).phi()));
h5.fill(bank.getFloat("time", i) - 124.25);
h6.fill(bank.getFloat("cx", i) * FTCALConstantsLoader.CRYS_ZPOS, bank.getFloat("cy", i) * FTCALConstantsLoader.CRYS_ZPOS, bank.getFloat("energy", i) - gen.getGeneratedParticle(0).vector().p());
h7.fill(bank.getFloat("cx", i) * FTCALConstantsLoader.CRYS_ZPOS, bank.getFloat("cy", i) * FTCALConstantsLoader.CRYS_ZPOS);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ public void setDirection(IndexedTable thetaTable, IndexedTable phiTable) {
if(this._Charge==-1) {
double energy = this._Energy;
double thetaCorr = Math.exp(thetaTable.getDoubleValue("thetacorr0", 1,1,0)+thetaTable.getDoubleValue("thetacorr1", 1,1,0)*energy)+
Math.exp(thetaTable.getDoubleValue("thetacorr1", 1,1,0)+thetaTable.getDoubleValue("thetacorr3", 1,1,0)*energy);
thetaCorr = Math.toRadians(thetaCorr * this._field);
Math.exp(thetaTable.getDoubleValue("thetacorr2", 1,1,0)+thetaTable.getDoubleValue("thetacorr3", 1,1,0)*energy);
thetaCorr = Math.toRadians(thetaCorr * Math.abs(this._field));
double phiCorr = Math.exp(phiTable.getDoubleValue("phicorr0", 1,1,0)+phiTable.getDoubleValue("phicorr1", 1,1,0)*energy)+
Math.exp(phiTable.getDoubleValue("phicorr2", 1,1,0)+phiTable.getDoubleValue("phicorr3", 1,1,0)*energy)+
Math.exp(phiTable.getDoubleValue("phicorr4", 1,1,0)+phiTable.getDoubleValue("phicorr5", 1,1,0)*energy);
Expand Down

0 comments on commit 60124df

Please sign in to comment.