Skip to content

Commit 1fe3ee7

Browse files
author
Szymon Pulawski
committed
FV0: update Digitizer trigger handling
1 parent 0432c88 commit 1fe3ee7

File tree

2 files changed

+14
-15
lines changed

2 files changed

+14
-15
lines changed

Detectors/FIT/FV0/simulation/include/FV0Simulation/FV0DigParam.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,8 @@ struct FV0DigParam : o2::conf::ConfigurableParamHelper<FV0DigParam> {
7171
short mTimeThresholdForReco = 1000; // only channels with time below will participate in calibration and collision time
7272
int NchannelsLevel = 8; // trigger Nchannels paramter
7373
float InnerRingsChargeLevel = 0; // InnerRingsChargeLevel, Tclu
74-
float OuterRingsChargeLevel = 0; //TcluOuterRingsChargeLevel, Tclu
75-
float ChargeLevel = 10; //ChargeLevel, Tclu
76-
74+
float OuterRingsChargeLevel = 0; // TcluOuterRingsChargeLevel, Tclu
75+
float ChargeLevel = 10; // ChargeLevel, Tclu
7776

7877
O2ParamDef(FV0DigParam, "FV0DigParam");
7978
};

Detectors/FIT/FV0/simulation/src/Digitizer.cxx

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ void Digitizer::clear()
3838
void Digitizer::init()
3939
{
4040
LOG(info) << "init";
41-
mNBins = FV0DigParam::Instance().waveformNbins; //Will be computed using detector set-up from CDB
42-
mBinSize = FV0DigParam::Instance().waveformBinWidth; //Will be set-up from CDB
41+
mNBins = FV0DigParam::Instance().waveformNbins; // Will be computed using detector set-up from CDB
42+
mBinSize = FV0DigParam::Instance().waveformBinWidth; // Will be set-up from CDB
4343
mNTimeBinsPerBC = std::lround(o2::constants::lhc::LHCBunchSpacingNS / mBinSize); // 1920 bins/BC
4444

4545
for (Int_t detID = 0; detID < Constants::nFv0Channels; detID++) {
@@ -149,8 +149,8 @@ void Digitizer::process(const std::vector<o2::fv0::Hit>& hits,
149149

150150
createPulse(mipFraction, hit.GetTrackID(), hitTime, hit.GetPos().R(), cachedIR, nCachedIR, detId);
151151

152-
} //while loop
153-
} //hitloop
152+
} // while loop
153+
} // hitloop
154154
}
155155

156156
void Digitizer::createPulse(float mipFraction, int parID, const double hitTime, const float hitR,
@@ -200,7 +200,7 @@ void Digitizer::createPulse(float mipFraction, int parID, const double hitTime,
200200
}
201201
added[ir] = true;
202202
}
203-
///Add MC labels to BCs for those contributed to the PMT signal
203+
/// Add MC labels to BCs for those contributed to the PMT signal
204204
for (int ir = 0; ir < nCachedIR; ir++) {
205205
if (added[ir]) {
206206
auto bcCache = getBCCache(cachedIR[ir]);
@@ -304,13 +304,13 @@ void Digitizer::storeBC(const BCCache& bc,
304304
} else {
305305
avgTime = o2::fit::Triggers::DEFAULT_TIME;
306306
}
307-
///Triggers for FV0
307+
/// Triggers for FV0
308308
bool isA, isNchannels, isAIn, isAOut, isTotalCharge;
309309
isA = nTrgFiredCells > 0;
310310
isNchannels = nTrgFiredCells > FV0DigParam::Instance().NchannelsLevel;
311-
isAIn = nSignalInner > FV0DigParam::Instance().;NchannelsLevel // ring 1,2 and 3
311+
isAIn = nSignalInner > FV0DigParam::Instance().NchannelsLevel; // ring 1,2 and 3
312312
isAOut = nSignalOuter > FV0DigParam::Instance().NchannelsLevel; // ring 4 and 5
313-
isTotalCharge = 0.125*totalChargeAllRing > 2*FV0DigParam::Instance().ChargeLevel;
313+
isTotalCharge = 0.125 * totalChargeAllRing > 2 * FV0DigParam::Instance().ChargeLevel;
314314

315315
Triggers triggers;
316316
const int unusedCharge = o2::fit::Triggers::DEFAULT_AMP;
@@ -321,7 +321,7 @@ void Digitizer::storeBC(const BCCache& bc,
321321
triggers.setTriggers(isA, isAIn, isAOut, isTotalCharge, isNchannels, nTrgFiredCells, (int8_t)unusedZero,
322322
(int32_t)(0.125 * totalChargeAllRing), (int32_t)unusedCharge, (int16_t)avgTime, (int16_t)unusedTime, unusedBitsInSim, unusedBitsInSim, bitDataIsValid);
323323
digitsBC.emplace_back(first, nTotFiredCells, bc, triggers, mEventId - 1);
324-
digitsTrig.emplace_back(bc, isA, isAIn, isAOut, isTotalCharge, isNChannels);
324+
digitsTrig.emplace_back(bc, isA, isAIn, isAOut, isTotalCharge, isNchannels);
325325
for (auto const& lbl : bc.labels) {
326326
labels.addElement(nBC, lbl);
327327
}
@@ -346,8 +346,8 @@ Int_t Digitizer::SimulateLightYield(Int_t pmt, Int_t nPhot) const
346346
//---------------------------------------------------------------------------
347347
Float_t Digitizer::IntegrateCharge(const ChannelDigitF& pulse) const
348348
{
349-
int const chargeIntMin = FV0DigParam::Instance().isIntegrateFull ? 0 : (FV0DigParam::Instance().avgCfdTimeForMip - 6.0) / mBinSize; //Charge integration offset (cfd mean time - 6 ns)
350-
int const chargeIntMax = FV0DigParam::Instance().isIntegrateFull ? mNTimeBinsPerBC : (FV0DigParam::Instance().avgCfdTimeForMip + 14.0) / mBinSize; //Charge integration offset (cfd mean time + 14 ns)
349+
int const chargeIntMin = FV0DigParam::Instance().isIntegrateFull ? 0 : (FV0DigParam::Instance().avgCfdTimeForMip - 6.0) / mBinSize; // Charge integration offset (cfd mean time - 6 ns)
350+
int const chargeIntMax = FV0DigParam::Instance().isIntegrateFull ? mNTimeBinsPerBC : (FV0DigParam::Instance().avgCfdTimeForMip + 14.0) / mBinSize; // Charge integration offset (cfd mean time + 14 ns)
351351
if (chargeIntMin < 0 || chargeIntMin > mNTimeBinsPerBC || chargeIntMax > mNTimeBinsPerBC) {
352352
LOG(fatal) << "invalid indicess: chargeInMin=" << chargeIntMin << " chargeIntMax=" << chargeIntMax;
353353
}
@@ -404,7 +404,7 @@ float Digitizer::getDistFromCellCenter(UInt_t cellId, double hitx, double hity)
404404
double a = -(y0 - pCell->y) / (x0 - pCell->x);
405405
double b = 1;
406406
double c = -(y0 - a * x0);
407-
//Return the distance from hit to this line
407+
// Return the distance from hit to this line
408408
return (a * hitx + b * hity + c) / TMath::Sqrt(a * a + b * b);
409409
}
410410

0 commit comments

Comments
 (0)