Skip to content

Commit

Permalink
Do not add event time for unsmeared hits (#331)
Browse files Browse the repository at this point in the history
Unsmeared hits are relative to MC global time. Adding in the event time was causing an artificial shift in the hit times if smeared hit times was turned off.
  • Loading branch information
S81D authored Jan 13, 2025
1 parent 4a88c36 commit 5b3a549
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions UserTools/LoadWCSim/LoadWCSim.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -658,10 +658,13 @@ bool LoadWCSim::Execute(){
if(verbosity>2) cout<<"digit Q is "<<digiq<<endl;
// Get hit parent information
std::vector<int> parents = GetHitParentIds(digihit, firsttrigt);
//std::cout <<"digittime before adding event time: "<<digittime<<","<<EventTimeNs<<std::endl;
if(verbosity>2){ std::cout <<"digittime before adding event time: "<<digittime<<","<<EventTimeNs<<std::endl; }

if (!splitSubtriggers) digittime += EventTimeNs;
//std::cout <<"digittime after adding event time: "<<digittime<<std::endl;
// Unsmeared hit times are with respect to the MC global time --> therefore we shouldn't add the event / trigger time if using unsmeared
if(use_smeared_digit_time){
if (!splitSubtriggers) digittime += EventTimeNs;
}
if(verbosity>2){ std::cout <<"digittime after adding event time: "<<digittime<<std::endl; }

MCHit nexthit(key, digittime, digiq, parents);
if(MCHits->count(key)==0) MCHits->emplace(key, std::vector<MCHit>{nexthit});
Expand Down

0 comments on commit 5b3a549

Please # to comment.