Skip to content

Commit 8579914

Browse files
martenoledavidrohr
authored andcommitted
Additional documentation and cleanup for TRAPsim
- rename getters for offset and slope of Tracklet64 to make clear they are uncalibrated values - move TRAP processing into an extra method to avoid duplicating a code block - explain a bit more the MC label assignment to tracklets based on digit indices
1 parent cdf246a commit 8579914

File tree

5 files changed

+92
-139
lines changed

5 files changed

+92
-139
lines changed

DataFormats/Detectors/TRD/include/DataFormatsTRD/Tracklet64.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ class Tracklet64
8181
// ----- Getters for tracklet information -----
8282
int getMCM() const { return 4 * (getPadRow() % 4) + getColumn(); } // returns MCM position on ROB [0..15]
8383
int getROB() const { return (getHCID() % 2) ? (getPadRow() / 4) * 2 + 1 : (getPadRow() / 4) * 2; } // returns ROB number [0..5] for C0 chamber and [0..7] for C1 chamber
84-
float getY() const; // translate local position into global y (in cm)
85-
float getDy(float nTbDrift = 19.4f) const; // translate local slope into dy/dx with dx=3m (drift length) and default drift time in time bins (19.4 timebins / 3cm)
84+
float getUncalibratedY() const; // translate local position into global y (in cm) not taking into account calibrations (ExB, vDrift, t0)
85+
float getUncalibratedDy(float nTbDrift = 19.4f) const; // translate local slope into dy/dx with dx=3m (drift length) and default drift time in time bins (19.4 timebins / 3cm)
8686

8787
// ----- Getters for offline corresponding values -----
8888
int getDetector() const { return getHCID() / 2; }

DataFormats/Detectors/TRD/src/Tracklet64.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ namespace trd
2222

2323
using namespace constants;
2424

25-
float Tracklet64::getY() const
25+
float Tracklet64::getUncalibratedY() const
2626
{
2727
int padLocalBin = getPosition();
2828
int padLocal = 0;
@@ -37,7 +37,7 @@ float Tracklet64::getY() const
3737
return (offset + padLocal * GRANULARITYTRKLPOS) * padWidth;
3838
}
3939

40-
float Tracklet64::getDy(float nTbDrift) const
40+
float Tracklet64::getUncalibratedDy(float nTbDrift) const
4141
{
4242
float dy;
4343
int dyLocalBin = getSlope();

Detectors/TRD/simulation/include/TRDSimulation/TrapSimulator.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ class TrapSimulator
342342
std::vector<unsigned int> mMCMT; // tracklet word for one mcm/trap-chip
343343
std::vector<Tracklet64> mTrackletArray64; // Array of 64 bit tracklets
344344
std::vector<unsigned short> mTrackletDigitCount; // Keep track of the number of digits contributing to the tracklet (for MC labels)
345-
std::vector<unsigned int> mTrackletDigitIndices; // For each tracklet the up to two indices of the digits which contributed
345+
std::vector<unsigned int> mTrackletDigitIndices; // For each tracklet the up to two global indices of the digits which contributed (global digit indices are managed in the TRDDPLTrapSimulatorTask class)
346346
std::vector<TrackletDetail> mTrackletDetails; // store additional tracklet information for eventual debug output.
347347
std::vector<int> mZSMap; // Zero suppression map (1 dimensional projection)
348348

Detectors/TRD/workflow/include/TRDWorkflow/TRDTrapSimulatorSpec.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
#include "Framework/Task.h"
2020
#include "TRDSimulation/TrapSimulator.h"
2121
#include "TRDSimulation/TrapConfig.h"
22+
#include "DataFormatsTRD/Tracklet64.h"
23+
#include <SimulationDataFormat/MCCompLabel.h>
24+
#include <SimulationDataFormat/ConstMCTruthContainer.h>
2225

2326
class Calibrations;
2427

@@ -48,12 +51,13 @@ class TRDDPLTrapSimulatorTask : public o2::framework::Task
4851
std::string mTrapConfigName; // the name of the config to be used.
4952
std::string mOnlineGainTableName;
5053
std::unique_ptr<Calibrations> mCalib; // store the calibrations connection to CCDB. Used primarily for the gaintables in line above.
51-
54+
std::chrono::duration<double> mTrapSimTime{0}; // timer for the actual processing in the TRAP chips
5255

5356
TrapConfig* getTrapConfig();
5457
void loadTrapConfig();
5558
void loadDefaultTrapConfig();
5659
void setOnlineGainTables();
60+
void processTRAPchips(int currDetector, int& nTrackletsInTrigRec, std::vector<Tracklet64>& trapTrackletsAccum, o2::dataformats::MCTruthContainer<o2::MCCompLabel>& trackletMCLabels, const o2::dataformats::ConstMCTruthContainer<o2::MCCompLabel>& digitMCLabels);
5761
};
5862

5963
o2::framework::DataProcessorSpec getTRDTrapSimulatorSpec();

0 commit comments

Comments
 (0)