Skip to content

Commit 77e433a

Browse files
committed
Add common mode per pad saturation
The largest common mode per pad is given by the pedestal value. Saturate the CM signal in case it would be larger.
1 parent fe8ac9b commit 77e433a

4 files changed

Lines changed: 12 additions & 5 deletions

File tree

‎Detectors/TPC/base/include/TPCBase/ParameterElectronics.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ struct ParameterElectronics : public o2::conf::ConfigurableParamHelper<Parameter
4848
bool doIonTail = false; ///< add ion tail in simulation
4949
bool doIonTailPerPad = false; ///< add ion tail in simulation using pad-by-pad values
5050
bool doCommonModePerPad = true; ///< add common mode in simulation using pad-by-pad values
51+
bool doCommonModePerPadSaturation = true; ///< Saturate the common mode signal by the per pad pedestal value
5152
bool doSaturationTail = false; ///< add saturation tail in simulation
5253
bool doNoiseEmptyPads = false; ///< add noise in pads without signal in simulation
5354
bool applyDeadMap = true; ///< apply dead channel map

‎Detectors/TPC/simulation/include/TPCSimulation/DigitGlobalPad.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ class DigitGlobalPad
8080
o2::dataformats::LabelContainer<std::pair<MCCompLabel, int>, false>&);
8181

8282
/// Fold signal with previous pad signal add ion tail and ToT for sigmal saturation
83-
void foldSignal(PrevDigitInfo& prevDigit, const int sector, const int pad, const TimeBin time, Streamer* debugStream = nullptr, const CalPad* padParams[3] = nullptr);
83+
void foldSignal(PrevDigitInfo& prevDigit, const int sector, const int pad, const TimeBin time, Streamer* debugStream = nullptr, const CalPad* padParams[4] = nullptr);
8484

8585
void setID(int id) { mID = id; }
8686
int getID() const { return mID; }
@@ -131,7 +131,7 @@ inline void DigitGlobalPad::addDigit(const MCCompLabel& label, float signal,
131131
mChargePad += signal;
132132
}
133133

134-
inline void DigitGlobalPad::foldSignal(PrevDigitInfo& prevDigit, const int sector, const int pad, const TimeBin time, Streamer* debugStream, const CalPad* padParams[3])
134+
inline void DigitGlobalPad::foldSignal(PrevDigitInfo& prevDigit, const int sector, const int pad, const TimeBin time, Streamer* debugStream, const CalPad* padParams[4])
135135
{
136136
const auto& eleParam = ParameterElectronics::Instance();
137137
const auto& itSettings = IonTailSettings::Instance();

‎Detectors/TPC/simulation/include/TPCSimulation/DigitTime.h‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ inline float DigitTime::getCommonMode(const GEMstack& gemstack) const
129129
template <DigitzationMode MODE>
130130
inline void DigitTime::fillOutputContainer(std::vector<Digit>& output, dataformats::MCTruthContainer<MCCompLabel>& mcTruth,
131131
std::vector<CommonMode>& commonModeOutput, const Sector& sector, TimeBin timeBin,
132-
PrevDigitInfoArray* prevTime, Streamer* debugStream, const CalPad* padParams[3],
132+
PrevDigitInfoArray* prevTime, Streamer* debugStream, const CalPad* padParams[4],
133133
const CalDet<bool>* deadMap)
134134
{
135135
const auto& mapper = Mapper::instance();
@@ -148,7 +148,12 @@ inline void DigitTime::fillOutputContainer(std::vector<Digit>& output, dataforma
148148
}
149149
const CRU cru = mapper.getCRU(sector, iPad);
150150
const float cmKValue = (padParams[2]) ? padParams[2]->getValue(sector.getSector(), iPad) : 1.f;
151-
mCommonMode[cru.gemStack()] += digit.getChargePad() * eleParam.commonModeCoupling * cmKValue; // TODO: Add stack-by-stack variation?
151+
float commonModeSignal = digit.getChargePad() * eleParam.commonModeCoupling * cmKValue; // TODO: Add stack-by-stack variation?
152+
if (eleParam.doCommonModePerPadSaturation) {
153+
const float pedestal = (padParams[3]) ? padParams[3]->getValue(sector.getSector(), iPad) : 77.f;
154+
commonModeSignal = std::min(commonModeSignal, pedestal);
155+
}
156+
mCommonMode[cru.gemStack()] += commonModeSignal;
152157
}
153158

154159
// fill common mode output container

‎Detectors/TPC/simulation/src/DigitContainer.cxx‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ void DigitContainer::fillOutputContainer(std::vector<Digit>& output,
4646
auto& cdb = CDBInterface::instance();
4747

4848
// ion tail per pad parameters
49-
const CalPad* padParams[3] = {nullptr, nullptr, nullptr};
49+
const CalPad* padParams[4] = {nullptr, nullptr, nullptr, nullptr};
5050

5151
if (eleParam.doIonTailPerPad) {
5252
const auto& itSettings = IonTailSettings::Instance();
@@ -59,6 +59,7 @@ void DigitContainer::fillOutputContainer(std::vector<Digit>& output,
5959
if (eleParam.doCommonModePerPad) {
6060
padParams[2] = &cdb.getCMkValues();
6161
}
62+
padParams[3] = &cdb.getPedestals();
6263

6364
const bool needsPrevDigArray = eleParam.doIonTail || eleParam.doIonTailPerPad || eleParam.doSaturationTail;
6465
const bool needsEmptyTimeBins = needsPrevDigArray || eleParam.doNoiseEmptyPads;

0 commit comments

Comments
 (0)