From 2e60a9d2fd09be29f0e0b4bab389522814cd9bef Mon Sep 17 00:00:00 2001 From: Daniel Torres Valladares <81983942+DanielTorres98@users.noreply.github.com> Date: Tue, 26 Mar 2024 20:38:23 -0500 Subject: [PATCH] Delete warinings BTofSimMaker.cxx (#675) This branch is to address mentioned here: [Issue 149](https://github.com/star-bnl/star-sw/issues/149) --------- Co-authored-by: Daniel Torres Valladares Co-authored-by: Dmitri Smirnov --- StRoot/StBTofSimMaker/StBTofSimMaker.cxx | 22 +++++++++++----------- mgr/warnoff_dirs.txt | 1 - 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/StRoot/StBTofSimMaker/StBTofSimMaker.cxx b/StRoot/StBTofSimMaker/StBTofSimMaker.cxx index 8fc44ea2c74..9d95dddd4b3 100644 --- a/StRoot/StBTofSimMaker/StBTofSimMaker.cxx +++ b/StRoot/StBTofSimMaker/StBTofSimMaker.cxx @@ -296,7 +296,10 @@ int StBTofSimMaker::CellResponse(g2t_ctf_hit_st* tofHitsFromGeant, g2t_track_st *tof_track = g2t_track->GetTable(); int no_tracks= g2t_track->GetNRows(); - double beta; + // Initialize beta to be a large negative value. This is a flag in case the following if + // condition is not satisfied and meaning there is something wrong with the beta value. + // + double beta = -999.; int trackId = -1; for(int j=0;jtrack_p==tof_track[j].id){ @@ -803,7 +806,11 @@ int StBTofSimMaker::FastCellResponse(g2t_ctf_hit_st* tofHitsFromGeant, StBTofCol int no_tracks= g2t_track->GetNRows(); StMcTrack *partnerTrk = 0; - int partnerTrkId; + + // Initialize partnerTrkId to be a negative value. This is a flag in case the following if + // condition is not satisfied and meaning there is something wrong with the track ID. + // + int partnerTrkId = -1; for(int j=0;jtrack_p==tof_track[j].id){ partnerTrk = new StMcTrack(&(tof_track[j])); @@ -820,15 +827,8 @@ int StBTofSimMaker::FastCellResponse(g2t_ctf_hit_st* tofHitsFromGeant, StBTofCol double pathL = tofHitsFromGeant->s_track; double q = 0.; - double Rawtof = tofHitsFromGeant->tof*1000./nanosecond; - float Rawbeta=pathL/Rawtof/3e-2; - double momentum=partnerTrk->momentum().mag(); - double mass=partnerTrk->fourMomentum().m(); - double calcTof=pathL/(3e-2)/sqrt(1 - mass*mass/(momentum*momentum + mass*mass)); - double time_blur = ranGauss.shoot()*mSimResDb->timeres_tof(itray, imodule, icell)*1e-9/nanosecond; double tof = tofHitsFromGeant->tof*1000./nanosecond + time_blur; //! 85ps per channel - if ( mVpdSim ) { // VpdSimMaker present, assume vpdstart tof += mVpdSimConfig->getMcClock()*1000; } @@ -851,9 +851,9 @@ int StBTofSimMaker::FastCellResponse(g2t_ctf_hit_st* tofHitsFromGeant, StBTofCol } } - // tof = tof - mSimDb->toffset(); // Apply offset correction. + // tof = tof - mSimDb->toffset(); // Apply offset correction. double t0 = tofHitsFromGeant->tof*1000./nanosecond; - float beta=pathL/tof/3e-2; + // float beta=pathL/tof/3e-2; StMcBTofHit *mcBTofHit = new StMcBTofHit(itray,imodule,icell,de,pathL,t0,tof,q); mcBTofHit->setPosition(local); diff --git a/mgr/warnoff_dirs.txt b/mgr/warnoff_dirs.txt index 74a46211c86..e6ddc18ff2a 100644 --- a/mgr/warnoff_dirs.txt +++ b/mgr/warnoff_dirs.txt @@ -3,7 +3,6 @@ StRoot/RTS StRoot/StAnalysisMaker StRoot/StAssociationMaker StRoot/StBTofPool.* -StRoot/StBTofSimMaker StRoot/StChain StRoot/StDaqLib StRoot/StDbLib