Skip to content

Commit

Permalink
[FDD] Now propagate avg time for all the BCs in Rec (Requested by Evg…
Browse files Browse the repository at this point in the history
…eny for the background study)
  • Loading branch information
Arvindiiti committed Jan 10, 2023
1 parent 45a3781 commit fcca577
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions Detectors/FIT/FDD/reconstruction/src/Reconstructor.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ void Reconstructor::process(o2::fdd::Digit const& digitBC, gsl::span<const o2::f
bool inTime = inChData[ich].getFlag(ChannelData::EEventDataBit::kIsEventInTVDC);
bool inAdcGate = inChData[ich].getFlag(ChannelData::EEventDataBit::kIsCFDinADCgate);
if (inAdcGate) {
outChData.emplace_back(inChData[ich].mPMNumber, (inChData[ich].mTime) * timePerTDC,
outChData.emplace_back((int)inChData[ich].mPMNumber, (inChData[ich].mTime) * timePerTDC,
(double)inChData[ich].mChargeADC, inChData[ich].mFEEBits);
nStored++;
}
Expand All @@ -49,9 +49,9 @@ void Reconstructor::process(o2::fdd::Digit const& digitBC, gsl::span<const o2::f
}
Float_t timeErr = 1;
if (adc > 3) {
timeErr = 1 / adc;
timeErr = 1. / adc;
}
if (outChData[ich].mPMNumber < 8) {
if ((int)inChData[ich].mPMNumber < 8) {
nInTimeC += inTime;
timeFDC += time / (timeErr * timeErr);
weightFDC += 1. / (timeErr * timeErr);
Expand All @@ -63,18 +63,24 @@ void Reconstructor::process(o2::fdd::Digit const& digitBC, gsl::span<const o2::f
}
const int nsToPs = 1e3;
std::array<int, 2> mCollisionTime = {o2::fdd::RecPoint::sDummyCollissionTime, o2::fdd::RecPoint::sDummyCollissionTime};
/// Avg time for each side, only if one channel satisfy the TVDC condition
/// Avg time for each side, only if one channel satisfy the TVDC condition (if not, also avg time is propagated for background study using AO2D)
if (nInTimeA > 0) {
mCollisionTime[o2::fdd::RecPoint::TimeA] = (weightFDA > 1) ? round(timeFDA / weightFDA * nsToPs)
: o2::fdd::RecPoint::sDummyCollissionTime;
} else {
if (weightFDA > 0) {
mCollisionTime[o2::fdd::RecPoint::TimeA] = round(timeFDA / weightFDA * nsToPs);
}
}
if (nInTimeC > 0) {
mCollisionTime[o2::fdd::RecPoint::TimeC] = (weightFDC > 1) ? round(timeFDC / weightFDC * nsToPs)
: o2::fdd::RecPoint::sDummyCollissionTime;
} else {
if (weightFDC > 0) {
mCollisionTime[o2::fdd::RecPoint::TimeC] = round(timeFDC / weightFDC * nsToPs);
}
}
if (nStored != 0) {
RecPoints.emplace_back(mCollisionTime, firstEntry, nStored, digitBC.getIntRecord(), digitBC.mTriggers);
}
RecPoints.emplace_back(mCollisionTime, firstEntry, nStored, digitBC.getIntRecord(), digitBC.mTriggers);
}
//________________________________________________________
void Reconstructor::finish()
Expand Down

0 comments on commit fcca577

Please sign in to comment.