[FV0] pile-up simulation#4500
[FV0] pile-up simulation#4500sawenzel merged 3 commits intoAliceO2Group:devfrom arvindkhuntia:fv0-pileup
Conversation
mslupeck
left a comment
There was a problem hiding this comment.
The failed test is unrelated to this PR.
shahor02
left a comment
There was a problem hiding this comment.
Hi @arvindkhuntia @mslupeck please see a few comments below.
| public: | ||
| Digitizer() | ||
| : mTimeStamp(0), mIntRecord(), mEventId(-1), mSrcId(-1), mMCLabels(), mPmtChargeVsTime(), mNBins(), mPmtResponseGlobal(), mPmtResponseTemp() | ||
| : mTimeStamp(0), mIntRecord(), mEventId(-1), mSrcId(-1), mMCLabels(), mCache(), mPmtChargeVsTime(), mNBins(), NTimeBinsPerBC(), mPmtResponseGlobal(), mPmtResponseTemp() |
There was a problem hiding this comment.
data members start with mXXX.
| private: | ||
| static constexpr int BCCacheMin = 0, BCCacheMax = 7, NBC2Cache = 1 + BCCacheMax - BCCacheMin; | ||
| void createPulse(float mipFraction, int parID, double hitTime, std::array<o2::InteractionRecord, NBC2Cache> const& cachedIR, | ||
| int nCachedIR, const int& detID); |
There was a problem hiding this comment.
detId is 4B int, no need to pass 8B reference, then dereference it, pass by value.
| mPmtResponseTemp = mPmtResponseGlobal; | ||
| ///Time of flight subtracted from Hit time //TODO have different TOF according to thr ring number | ||
| Size_t NBinShift = std::lround((hitTime - FV0DigParam::Instance().globalTimeOfFlight) / FV0DigParam::Instance().waveformBinWidth); | ||
|
|
||
| for (int m = 0; m < NBinShift; m++) { | ||
| mPmtResponseTemp.push_back(0); | ||
| } | ||
| /// rotate the vector element to shift all the elements by hit time | ||
| std::rotate(mPmtResponseTemp.rbegin(), mPmtResponseTemp.rbegin() + NBinShift, mPmtResponseTemp.rend()); | ||
| mPmtResponseTemp.resize(FV0DigParam::Instance().waveformNbins); |
There was a problem hiding this comment.
with 1st NBinShift filled by 0s, the rest filled by values from mPmtResponseGlobal. If this is what you want, I thing it will be faster to do
mPmtResponseTemp.resize(FV0DigParam::Instance().waveformNbins, 0);
memcpy(&mPmtResponseTemp[NBinShift], &mPmtResponseGlobal[0], sizeof(double)*(FV0DigParam::Instance().waveformNbins-NBinShift));
There was a problem hiding this comment.
Yes, indeed this is what we want. Thank you for the suggestion.
|
Did you test this already with the embedding pileup test in |
yes, I have checked with the check_embedding_pileup.sh but only with FV0 detector and it showed pileup 1 embedding 1. |
jotwinow
left a comment
There was a problem hiding this comment.
Please go ahead with the PR
* [FV0] pile-up simulation
(1) FV0 simulation with proper pile-up
(2) Tuning of digitisation parameter