11package org .jlab .rec .atof .hit ;
22
33import org .jlab .rec .atof .constants .Parameters ;
4+ import org .jlab .rec .constants .CalibrationConstantsLoader ;
45
56/**
67 *
@@ -14,6 +15,8 @@ public class BarHit extends ATOFHit {
1415
1516 //A bar hit is the combination of a downstream and upstream hits
1617 private ATOFHit hitUp , hitDown ;
18+ //Effective velocity read from CCDB
19+ double vEff ;
1720
1821 public ATOFHit getHitUp () {
1922 return hitUp ;
@@ -36,7 +39,7 @@ public void setHitDown(ATOFHit hit_down) {
3639 *
3740 */
3841 public final void computeZ () {
39- this .setZ (Parameters . VEFF /2. * (hitUp .getTime () - hitDown .getTime ()));
42+ this .setZ (this . vEff /2. * (hitUp .getTime () - hitDown .getTime ()));
4043 }
4144
4245 /**
@@ -56,7 +59,7 @@ public final void computeTime() {
5659 time_at_sipm = this .hitUp .getTime ();
5760 distance_to_sipm = Parameters .LENGTH_ATOF /2. + this .getZ ();
5861 }
59- this .setTime (time_at_sipm - distance_to_sipm /Parameters . VEFF );
62+ this .setTime (time_at_sipm - distance_to_sipm /this . vEff );
6063 }
6164
6265 /**
@@ -88,6 +91,11 @@ public BarHit(ATOFHit hit_down, ATOFHit hit_up) {
8891 this .setComponent (10 );
8992 this .setX (hit_up .getX ());
9093 this .setY (hit_up .getY ());
94+
95+ //CCDB readout for the effective velocity
96+ int key = this .getSector ()*10000 + this .getLayer ()*1000 + this .getComponent ()*10 ;
97+ double [] vEffTable = CalibrationConstantsLoader .ATOF_EFFECTIVE_VELOCITY .get (key );
98+ this .vEff = vEffTable [0 ];
9199 this .computeZ ();
92100 this .computeTime ();
93101 this .computeEnergy ();
0 commit comments