diff --git a/Detectors/TRD/simulation/include/TRDSimulation/Digitizer.h b/Detectors/TRD/simulation/include/TRDSimulation/Digitizer.h index 0ab57cee27af5..3cb901fc94a61 100644 --- a/Detectors/TRD/simulation/include/TRDSimulation/Digitizer.h +++ b/Detectors/TRD/simulation/include/TRDSimulation/Digitizer.h @@ -65,23 +65,33 @@ class Digitizer void setSrcID(int sourceID) { mSrcID = sourceID; } void setCalibrations(Calibrations* calibrations) { mCalib = calibrations; } void setCalVdriftExB(const CalVdriftExB* calVdriftExB) { mCalVdriftExB = calVdriftExB; } - void setFedChamberStatus(int det, int value) { if (det >= constants::MAXCHAMBER) return; mFedChamberStatus[det] = value; } + void setFedChamberStatus(int det, int value) + { + if (det >= constants::MAXCHAMBER) + return; + mFedChamberStatus[det] = value; + } void setCalGain(const CalGain* calGain) { mCalGain = calGain; } void setCreateSharedDigits(bool flag) { mCreateSharedDigits = flag; } int getEventTime() const { return mTime; } int getEventID() const { return mEventID; } int getSrcID() const { return mSrcID; } bool getCreateSharedDigits() const { return mCreateSharedDigits; } - int getFedChamberStatus(int det) { if (det >= constants::MAXCHAMBER) return -1.; return mFedChamberStatus[det]; } + int getFedChamberStatus(int det) + { + if (det >= constants::MAXCHAMBER) + return -1.; + return mFedChamberStatus[det]; + } std::string dumpFlaggedChambers() const; private: - Geometry* mGeo = nullptr; // access to Geometry - PadResponse mPRF{}; // access to PadResponse - SimParam mSimParam{}; // simulation parameters - Calibrations* mCalib = nullptr; // access to Calibrations in CCDB - const CalVdriftExB* mCalVdriftExB = nullptr; // access to time-dependent calibrations CalVdriftExB in CCDB - const CalGain* mCalGain = nullptr; // access to time-dependent calibrations CalGain in CCDB + Geometry* mGeo = nullptr; // access to Geometry + PadResponse mPRF{}; // access to PadResponse + SimParam mSimParam{}; // simulation parameters + Calibrations* mCalib = nullptr; // access to Calibrations in CCDB + const CalVdriftExB* mCalVdriftExB = nullptr; // access to time-dependent calibrations CalVdriftExB in CCDB + const CalGain* mCalGain = nullptr; // access to time-dependent calibrations CalGain in CCDB std::array mFedChamberStatus{}; // access to time-dependent FED chamber status in CCDB PileupTool pileupTool; diff --git a/Detectors/TRD/simulation/include/TRDSimulation/SimParam.h b/Detectors/TRD/simulation/include/TRDSimulation/SimParam.h index 8b175a077860d..f7cad2e2fc4d9 100644 --- a/Detectors/TRD/simulation/include/TRDSimulation/SimParam.h +++ b/Detectors/TRD/simulation/include/TRDSimulation/SimParam.h @@ -136,9 +136,9 @@ class SimParam float mTRFhi{3.58f}; ///< Higher boundary of the TRF and x-talk float mInvTRFwid{static_cast(mTRFbin) / (mTRFhi - mTRFlo)}; ///< Inverse of the bin width of the integrated TRF and x-talk float mGasGain{4000.f}; ///< Gas gain - + float mEffVdriftDefault{1.22f}; ///< The CCDB contains an effective drift velocity, and not the true drift velocity, so we anchor only the variations. This default parameter is the one reproducing data the best for run 568191. - + ClassDefNV(SimParam, 2); // The TRD simulation parameters }; diff --git a/Detectors/TRD/simulation/src/Digitizer.cxx b/Detectors/TRD/simulation/src/Digitizer.cxx index 11d3fe4dd0a70..03d824db7d87a 100644 --- a/Detectors/TRD/simulation/src/Digitizer.cxx +++ b/Detectors/TRD/simulation/src/Digitizer.cxx @@ -161,7 +161,7 @@ void Digitizer::process(std::vector const& hits) // Jump to the next detector if the detector is // switched off, not installed, etc // In the chamber Fed status, 3 corresponds to good chamber - //if (mCalib->getChamberStatus()->isNoData(det)) { + // if (mCalib->getChamberStatus()->isNoData(det)) { if (getFedChamberStatus(det) != 3) { continue; } @@ -259,7 +259,7 @@ bool Digitizer::convertHits(const int det, const std::vector& hits, SignalC if (TMath::Abs(mCalVdriftExB->getVdrift(det, true) - constants::VDRIFTDEFAULT) > 1e-6) { driftVelocity = mCalVdriftExB->getVdrift(det, true) * constants::VDRIFTDEFAULT / mSimParam.getEffVdriftDefault(); // If they are available in the CCDB, we anchor the vdrift variations } - float t0 = mCalib->getT0(det, colE, rowE); // The T0 velocity + float t0 = mCalib->getT0(det, colE, rowE); // The T0 velocity // Loop over all created electrons const int nElectrons = std::fabs(qTotal); @@ -298,7 +298,7 @@ bool Digitizer::convertHits(const int det, const std::vector& hits, SignalC continue; } const double colOffset = padPlane->getPadColOffset(colE, locCd + offsetTilt); - //driftVelocity = mCalib->getVDrift(det, colE, rowE); // The drift velocity for the updated col and row + // driftVelocity = mCalib->getVDrift(det, colE, rowE); // The drift velocity for the updated col and row t0 = mCalib->getT0(det, colE, rowE); // The T0 velocity for the updated col and row // Convert the position to drift time [mus], using either constant drift velocity or // time structure of drift cells (non-isochronity, GARFIELD calculation). diff --git a/Detectors/TRD/workflow/src/TRDDigitizerSpec.cxx b/Detectors/TRD/workflow/src/TRDDigitizerSpec.cxx index 874940ce04f94..e3cb11a724c3a 100644 --- a/Detectors/TRD/workflow/src/TRDDigitizerSpec.cxx +++ b/Detectors/TRD/workflow/src/TRDDigitizerSpec.cxx @@ -210,7 +210,7 @@ class TRDDPLDigitizerTask : public o2::base::BaseDPLDigitizer pc.services().get().readyToQuit(QuitRequest::Me); finished = true; } - + void finaliseCCDB(ConcreteDataMatcher& matcher, void* obj) { if (matcher == ConcreteDataMatcher("TRD", "CALVDRIFTEXB", 0)) { @@ -225,7 +225,7 @@ class TRDDPLDigitizerTask : public o2::base::BaseDPLDigitizer } if (matcher == ConcreteDataMatcher("TRD", "FEDCHAMBERSTATUS", 0)) { LOG(info) << "Fed chamber status has been updated"; - std::array* fedStatus = (std::array*) obj; + std::array* fedStatus = (std::array*)obj; for (int det = 0; det < constants::MAXCHAMBER; det++) { mDigitizer.setFedChamberStatus(det, (*fedStatus)[det]); } @@ -255,7 +255,7 @@ o2::framework::DataProcessorSpec getTRDDigitizerSpec(int channel, bool mctruth) outputs.emplace_back("TRD", "LABELS", 0, Lifetime::Timeframe); } outputs.emplace_back("TRD", "ROMode", 0, Lifetime::Timeframe); - + std::vector inputs; inputs.emplace_back("collisioncontext", "SIM", "COLLISIONCONTEXT", static_cast(channel), Lifetime::Timeframe); inputs.emplace_back("calvdexb", "TRD", "CALVDRIFTEXB", 0, Lifetime::Condition, ccdbParamSpec("TRD/Calib/CalVdriftExB")); @@ -264,7 +264,7 @@ o2::framework::DataProcessorSpec getTRDDigitizerSpec(int channel, bool mctruth) return DataProcessorSpec{ "TRDDigitizer", - //Inputs{InputSpec{"collisioncontext", "SIM", "COLLISIONCONTEXT", static_cast(channel), Lifetime::Timeframe}}, + // Inputs{InputSpec{"collisioncontext", "SIM", "COLLISIONCONTEXT", static_cast(channel), Lifetime::Timeframe}}, inputs, outputs,