Skip to content

Commit

Permalink
VPD start mode not working due to double definition of start_resoluti…
Browse files Browse the repository at this point in the history
…on var
  • Loading branch information
Daniel Torres Valladares committed Jan 30, 2024
1 parent 84f537b commit f246b90
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
4 changes: 2 additions & 2 deletions StRoot/StBTofCalibMaker/StBTofCalibMaker.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -2843,9 +2843,9 @@ float StBTofCalibMaker::tofCellResolution(const Int_t itray, const Int_t iModule
// mBTofRes::timeres_tof() reports in picoseconds
float stop_resolution = mBTofRes->timeres_tof(itray, module, cell)/1000.;

float start_resolution(0);
float start_resolution = 0.0;
if (mUseVpdStart)
double start_resolution = mVpdResConfig->singleTubeRes(mVPDHitPatternEast, mVPDHitPatternWest)/1000.;
start_resolution = mVpdResConfig->singleTGubeRes(mVPDHitPatternEast, mVPDHitPatternWest)/1000.;
else
start_resolution = mBTofRes->average_timeres_tof()/sqrt(mNTzero)/1000.;
resolution = sqrt(stop_resolution*stop_resolution + start_resolution*start_resolution);
Expand Down
13 changes: 7 additions & 6 deletions StRoot/StBTofUtil/StVpdSimConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ class StVpdSimConfig : public StMaker {
//! structure containing tube parameters
struct SingleTubeParams{
float singleTubeRes; //!< Resolution of a particular Vpd tube in ps
int tubeId; //!< Tube Id (number) [0,37] with west Vpd [0,18] and east Vpd [19,37]
int tubeStatusFlag; //!< Status flag for whether tube was active (1) or inactive (0)
int tubeTriggerFlag; //!< Status flag for whether tube was triggered on (1) or not (0)
int tubeId, //!< Tube Id (number) [0,37] with west Vpd [0,18] and east Vpd [19,37]
tubeStatusFlag, //!< Status flag for whether tube was active (1) or inactive (0)
tubeTriggerFlag; //!< Status flag for whether tube was triggered on (1) or not (0)
};

/**
Expand All @@ -42,8 +42,9 @@ class StVpdSimConfig : public StMaker {
* @return double vpd resolution.
*/
double singleTubeRes(UInt_t mVPDHitPatternEast, UInt_t mVPDHitPatternWest){
double vpdResSumSqr(0.), vpdresolution(0.);
int total_vpd_hits = 0; //Total number of vpd tubes used.
double vpdResSumSqr(0.),
vpdresolution(0.);
int total_vpd_hits = 0; //Total number of vpd tubes used.
for (int i=0; i<19; i++){
if (1 << i & mVPDHitPatternEast) {
vpdResSumSqr += (mSimParams[i].singleTubeRes)*(mSimParams[i].singleTubeRes);
Expand All @@ -54,7 +55,7 @@ class StVpdSimConfig : public StMaker {
total_vpd_hits += 1;
}
}
vpdresolution = sqrt(vpdResSumSqr/total_vpd_hits);
vpdresolution = sqrt(vpdResSumSqr)/total_vpd_hits;
return vpdresolution;
}

Expand Down

0 comments on commit f246b90

Please sign in to comment.