Skip to content

Commit

Permalink
abstract trapconfig methonds away in TrapSimulator
Browse files Browse the repository at this point in the history
  • Loading branch information
bazinski committed Dec 21, 2023
1 parent 9e38fb9 commit d04a8b7
Show file tree
Hide file tree
Showing 4 changed files with 141 additions and 74 deletions.
2 changes: 1 addition & 1 deletion Detectors/TRD/calibration/src/CalibratorConfigEvents.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ void CalibratorConfigEvents::init()
LOGP(info, "Could not find a halfchamberstatusqc for this time, searching for a known time");
// TODO ...
}
setMaskedHalfChambers(halfChamberStatus->getBitSet());
// setMaskedHalfChambers(halfChamberStatus->getBitSet());
}

void CalibratorConfigEvents::process(const gsl::span<MCMEvent>& MCMEvents)
Expand Down
1 change: 0 additions & 1 deletion Detectors/TRD/reconstruction/src/EventRecord.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ void EventRecordContainer::sendData(o2::framework::ProcessingContext& pc, bool g
LOG(debug) << "Preparing for sending and sending data took " << std::chrono::duration_cast<std::chrono::milliseconds>(dataReadTime).count() << "ms";
if (mConfigEventPresent) {
pc.outputs().snapshot(o2::framework::Output{o2::header::gDataOriginTRD, "CONFEVT", 0}, mConfigEventData);
// pc.outputs().snapshot(o2::framework::Output{o2::header::gDataOriginTRD, "CONFEVT", 0, o2::framework::Lifetime::Condition}, mConfigEventData);
}
}

Expand Down
11 changes: 9 additions & 2 deletions Detectors/TRD/simulation/include/TRDSimulation/TrapSimulator.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include "TRDBase/FeeParam.h"

#include "DataFormatsTRD/TrapConfigEvent.h"
#include "TRDSimulation/TrapConfig.h"
#include "DataFormatsTRD/Digit.h"
#include "DataFormatsTRD/Tracklet64.h"
#include "DataFormatsTRD/RawData.h"
Expand Down Expand Up @@ -108,6 +109,7 @@ class TrapSimulator

// Initialize MCM by the position parameters
void init(TrapConfigEvent* trapconfig, int det, int rob, int mcm);
void init(TrapConfig* trapconfig, int det, int rob, int mcm);

bool checkInitialized() const { return mInitialized; }

Expand Down Expand Up @@ -195,7 +197,7 @@ class TrapSimulator

static bool readPackedConfig(TrapConfigEvent* cfg, int hc, unsigned int* data, int size);

// DMEM addresses
// DMEM addresses None of these are accesable from a trapconfig event.
static constexpr int mgkDmemAddrLUTcor0 = 0xC02A;
static constexpr int mgkDmemAddrLUTcor1 = 0xC028;
static constexpr int mgkDmemAddrLUTnbins = 0xC029;
Expand All @@ -213,7 +215,9 @@ class TrapSimulator
static constexpr int mgkDmemAddrDeflCutEnd = 0xc055; // DMEM end address of deflection cut
static constexpr int mgkDmemAddrTimeOffset = 0xc3fe; // DMEM address of time offset t0
static constexpr int mgkDmemAddrYcorr = 0xc3ff; // DMEM address of y correction (mis-alignment)
static constexpr int mQ2Startbin = 3; // Start range of Q2, for now here. TODO pull from a revised TrapConfigEvent?
// DMEM addresses None of these are accesable from a trapconfig event.

static constexpr int mQ2Startbin = 3; // Start range of Q2, for now here. TODO pull from a revised TrapConfigEvent?
static constexpr int mQ2Endbin = 5; // End range of Q2, also pull from a revised trapconfig at some point.

static const int mgkFormatIndex; // index for format settings in stream
Expand Down Expand Up @@ -275,6 +279,9 @@ class TrapSimulator
// Parameter classes
FeeParam* mFeeParam{FeeParam::instance()}; // FEE parameters, a singleton
TrapConfigEvent* mTrapConfigEvent{nullptr}; // TRAP config
TrapConfig* mTrapConfig{nullptr}; // TRAP config
bool mUseTrapConfigEvent{false}; // this is temporary until we fully migrate to TrapConfigEvent

// wrappers for trap config events.
uint32_t getTrapReg(uint32_t reg, uint32_t det, uint32_t rob, uint32_t mcm);

Expand Down
Loading

0 comments on commit d04a8b7

Please sign in to comment.