Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 18 additions & 8 deletions Detectors/TRD/simulation/include/TRDSimulation/Digitizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<int, constants::MAXCHAMBER> mFedChamberStatus{}; // access to time-dependent FED chamber status in CCDB
PileupTool pileupTool;

Expand Down
4 changes: 2 additions & 2 deletions Detectors/TRD/simulation/include/TRDSimulation/SimParam.h
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,9 @@ class SimParam
float mTRFhi{3.58f}; ///< Higher boundary of the TRF and x-talk
float mInvTRFwid{static_cast<float>(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
};

Expand Down
6 changes: 3 additions & 3 deletions Detectors/TRD/simulation/src/Digitizer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ void Digitizer::process(std::vector<Hit> 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;
}
Expand Down Expand Up @@ -259,7 +259,7 @@ bool Digitizer::convertHits(const int det, const std::vector<Hit>& 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);
Expand Down Expand Up @@ -298,7 +298,7 @@ bool Digitizer::convertHits(const int det, const std::vector<Hit>& 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).
Expand Down
8 changes: 4 additions & 4 deletions Detectors/TRD/workflow/src/TRDDigitizerSpec.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ class TRDDPLDigitizerTask : public o2::base::BaseDPLDigitizer
pc.services().get<ControlService>().readyToQuit(QuitRequest::Me);
finished = true;
}

void finaliseCCDB(ConcreteDataMatcher& matcher, void* obj)
{
if (matcher == ConcreteDataMatcher("TRD", "CALVDRIFTEXB", 0)) {
Expand All @@ -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<int, constants::MAXCHAMBER>* fedStatus = (std::array<int, constants::MAXCHAMBER>*) obj;
std::array<int, constants::MAXCHAMBER>* fedStatus = (std::array<int, constants::MAXCHAMBER>*)obj;
for (int det = 0; det < constants::MAXCHAMBER; det++) {
mDigitizer.setFedChamberStatus(det, (*fedStatus)[det]);
}
Expand Down Expand Up @@ -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<InputSpec> inputs;
inputs.emplace_back("collisioncontext", "SIM", "COLLISIONCONTEXT", static_cast<SubSpecificationType>(channel), Lifetime::Timeframe);
inputs.emplace_back("calvdexb", "TRD", "CALVDRIFTEXB", 0, Lifetime::Condition, ccdbParamSpec("TRD/Calib/CalVdriftExB"));
Expand All @@ -264,7 +264,7 @@ o2::framework::DataProcessorSpec getTRDDigitizerSpec(int channel, bool mctruth)

return DataProcessorSpec{
"TRDDigitizer",
//Inputs{InputSpec{"collisioncontext", "SIM", "COLLISIONCONTEXT", static_cast<SubSpecificationType>(channel), Lifetime::Timeframe}},
// Inputs{InputSpec{"collisioncontext", "SIM", "COLLISIONCONTEXT", static_cast<SubSpecificationType>(channel), Lifetime::Timeframe}},
inputs,
outputs,

Expand Down
Loading