Skip to content
Open
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
2 changes: 1 addition & 1 deletion .github/workflows/linux-eic-shell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ jobs:
- name: Check for pragma once in changed files
if: ${{ github.event_name == 'pull_request' }}
run: |
missing_pragma_headers=$(git diff --name-only ${{ github.event.pull_request.head.sha }} ${{ github.event.pull_request.base.sha }} | grep "\.h$" | xargs -n 1 grep -L 'pragma once')
missing_pragma_headers=$(git diff --name-only ${{ github.event.pull_request.head.sha }} ${{ github.event.pull_request.base.sha }} | grep "\.h$" | xargs -n 1 -r grep -L 'pragma once')
test -z "${missing_pragma_headers}"
- name: Check for pragma once in all files
if: ${{ github.event_name == 'push' || github.event_name == 'schedule' }}
Expand Down
19 changes: 13 additions & 6 deletions src/algorithms/digi/SiliconTrackerDigi.cc
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,14 @@ void SiliconTrackerDigi::process(const SiliconTrackerDigi::Input& input,
debug(" edep is below threshold of {:.2f} [keV]", m_cfg.threshold / dd4hep::keV);
continue;
}

// the charge in RawTrackerHit is defined as int32_t to mimic ADC value.
// because our energy threshold is often sub-keV, it's better to save charge as eV.
// allowed range of int32_t would be eV to ~2GeV which should be sufficient.
int32_t sim_hit_charge = sim_hit.getEDep() * dd4hep::GeV / dd4hep::eV;
if (!cell_hit_map.contains(sim_hit.getCellID())) {
// This cell doesn't have hits
cell_hit_map[sim_hit.getCellID()] = {
sim_hit.getCellID(), (std::int32_t)std::llround(sim_hit.getEDep() * 1e6),
sim_hit.getCellID(), sim_hit_charge,
hit_time_stamp // ns->ps
};
} else {
Expand All @@ -83,18 +86,22 @@ void SiliconTrackerDigi::process(const SiliconTrackerDigi::Input& input,

// sum deposited energy
auto charge = hit.getCharge();
hit.setCharge(charge + (std::int32_t)std::llround(sim_hit.getEDep() * 1e6));
hit.setCharge(charge + sim_hit_charge);
}
}

for (auto item : cell_hit_map) {
raw_hits->push_back(item.second);

auto raw_hit = item.second;
raw_hits->push_back(raw_hit);
for (const auto& sim_hit : *sim_hits) {
if (item.first == sim_hit.getCellID()) {
// set association
auto hitassoc = associations->create();
hitassoc.setWeight(1.0);
double weight = 0.0;
if (raw_hit.getCharge() > 0) {
weight = sim_hit.getEDep() * dd4hep::GeV / dd4hep::eV / raw_hit.getCharge();
}
hitassoc.setWeight(weight);
hitassoc.setRawHit(item.second);
hitassoc.setSimHit(sim_hit);
}
Expand Down
5 changes: 3 additions & 2 deletions src/algorithms/tracking/TrackerHitReconstruction.cc
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,9 @@ void TrackerHitReconstruction::process(const Input& input, const Output& output)
std::size(dim) > 2 ? get_variance(dim[2] / mm) : 0.},
static_cast<float>((double)(raw_hit.getTimeStamp()) / 1000.0), // ns
m_cfg.timeResolution, // in ns
static_cast<float>(raw_hit.getCharge() / 1.0e6), // Collected energy (GeV)
0.0F); // Error on the energy
static_cast<float>(raw_hit.getCharge() * dd4hep::eV /
dd4hep::GeV), // Collected energy (GeV)
0.0F); // Error on the energy
rec_hit.setRawHit(raw_hit);
}
}
Expand Down
Loading