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
1 change: 0 additions & 1 deletion include/FastCaloSim/Core/TFCSBinnedShower.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#include "FastCaloSim/Core/TFCSLateralShapeParametrizationHitBase.h"
#include "FastCaloSim/Core/TFCSParametrizationBinnedChain.h"
#include "FastCaloSim/Core/TFCSSimulationState.h"
#include "TFCSBinnedShowerBase.h"

class CaloGeo;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ class TFCSLateralShapeParametrizationHitBase
inline const auto& center_z() const { return m_center_z; }
inline const auto& center_eta() const { return m_center_eta; }
inline const auto& center_phi() const { return m_center_phi; }
inline const auto& idx() { return m_hit_index; };
inline const auto& idx() const { return m_hit_index; };

inline void setCenter_r(float r) { m_center_r = r; }
inline void setCenter_z(float z) { m_center_z = z; }
Expand Down
9 changes: 4 additions & 5 deletions source/Core/TFCSBinnedShower.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -809,7 +809,7 @@ void TFCSBinnedShower::load_sub_bin_distribution(const std::string& filename)
m_use_upscaling = true;
TFile* file = TFile::Open(filename.c_str(), "READ");
if (!file || file->IsZombie()) {
std::cerr << "Failed to open file: " << filename << std::endl;
FCS_MSG_ERROR("Failed to open file: " << filename);
return;
}

Expand Down Expand Up @@ -861,13 +861,12 @@ void TFCSBinnedShower::load_sub_bin_distribution(const std::string& filename)
data.push_back(std::move(layer_vec));
}

// Example output
for (size_t i = 0; i < energies.size(); ++i) {
std::cout << "Energy index " << i << ": " << energies[i] << " GeV\n";
FCS_MSG_DEBUG("Energy index " << i << ": " << energies[i] << " GeV");
for (size_t j = 0; j < data[i].size(); ++j) {
if (!data[i][j].empty()) {
std::cout << " Layer " << j << " Shape: (" << data[i][j].size() << ", "
<< data[i][j][0].size() << ")\n";
FCS_MSG_DEBUG(" Layer " << j << " Shape: (" << data[i][j].size()
<< ", " << data[i][j][0].size() << ")");
}
}
}
Expand Down
1 change: 0 additions & 1 deletion source/Core/TFCSBinnedShowerBase.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ FCSReturnCode TFCSBinnedShowerBase::simulate(
// layer 6 is EME2
reference_layer_index = 6;
}
// TODO: What about the endcap?
eta_center = extrapol->eta(reference_layer_index, Cell::SubPos::MID);
phi_center = extrapol->phi(reference_layer_index, Cell::SubPos::MID);

Expand Down
17 changes: 10 additions & 7 deletions source/Core/TFCSBinnedShowerONNX.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,6 @@ void TFCSBinnedShowerONNX::load_bin_boundaries(const std::string& filename,
}
}

// TODO: Could probably be removed in the end
void TFCSBinnedShowerONNX::Streamer(TBuffer& R__b)
{
// Stream an object of class TFCSBinnedShowerONNX
Expand Down Expand Up @@ -343,7 +342,12 @@ std::tuple<float, float> TFCSBinnedShowerONNX::get_coordinates(
simulstate, R_min, R_max, alpha_min, alpha_max, layer_index, bin_index);
}

float R = CLHEP::RandFlat::shoot(simulstate.randomEngine(), R_min, R_max);
float R;
if (TMath::Abs(R_max - R_min) > std::numeric_limits<float>::epsilon()) {
R = CLHEP::RandFlat::shoot(simulstate.randomEngine(), R_min, R_max);
} else {
R = R_min; // If the range is too small, just use the minimum value
}
float alpha =
CLHEP::RandFlat::shoot(simulstate.randomEngine(), alpha_min, alpha_max);

Expand Down Expand Up @@ -537,7 +541,7 @@ void TFCSBinnedShowerONNX::load_sub_bin_distribution(
m_use_upscaling = true;
TFile* file = TFile::Open(filename.c_str(), "READ");
if (!file || file->IsZombie()) {
std::cerr << "Failed to open file: " << filename << std::endl;
FCS_MSG_ERROR("Failed to open file: " << filename);
return;
}

Expand Down Expand Up @@ -589,13 +593,12 @@ void TFCSBinnedShowerONNX::load_sub_bin_distribution(
data.push_back(std::move(layer_vec));
}

// Example output
for (size_t i = 0; i < energies.size(); ++i) {
std::cout << "Energy index " << i << ": " << energies[i] << " GeV\n";
FCS_MSG_DEBUG("Energy index " << i << ": " << energies[i] << " GeV");
for (size_t j = 0; j < data[i].size(); ++j) {
if (!data[i][j].empty()) {
std::cout << " Layer " << j << " Shape: (" << data[i][j].size() << ", "
<< data[i][j][0].size() << ")\n";
FCS_MSG_DEBUG(" Layer " << j << " Shape: (" << data[i][j].size()
<< ", " << data[i][j][0].size() << ")");
}
}
}
Expand Down