Skip to content
Snippets Groups Projects
Commit 218d8c0e authored by Marshall Scott's avatar Marshall Scott
Browse files

Added count function

parent d51626fb
Branches
No related tags found
1 merge request!37Fix pions
This commit is part of merge request !29. Comments created here will be created in the context of that merge request.
...@@ -61,10 +61,12 @@ void emcal_barrel_pions_electrons_analysis(const char* input_fname = "sim_output ...@@ -61,10 +61,12 @@ void emcal_barrel_pions_electrons_analysis(const char* input_fname = "sim_output
auto Esim_ele = [](const std::vector<dd4pod::CalorimeterHitData>& evt, std::vector<dd4pod::Geant4ParticleData> const& input) { auto Esim_ele = [](const std::vector<dd4pod::CalorimeterHitData>& evt, std::vector<dd4pod::Geant4ParticleData> const& input) {
std::vector<double> result; std::vector<double> result;
auto total_edep = 0.0; auto total_edep = 0.0;
int count = 0;
if (input[2].pdgID == 11)// Electron if (input[2].pdgID == 11)// Electron
{ {
for (const auto& i: evt) for (const auto& i: evt && count > 1)
total_edep += i.energyDeposit; total_edep += i.energyDeposit;
count++;
} }
result.push_back(total_edep); result.push_back(total_edep);
return result; return result;
...@@ -74,10 +76,12 @@ void emcal_barrel_pions_electrons_analysis(const char* input_fname = "sim_output ...@@ -74,10 +76,12 @@ void emcal_barrel_pions_electrons_analysis(const char* input_fname = "sim_output
auto Esim_pi = [](const std::vector<dd4pod::CalorimeterHitData>& evt, std::vector<dd4pod::Geant4ParticleData> const& input) { auto Esim_pi = [](const std::vector<dd4pod::CalorimeterHitData>& evt, std::vector<dd4pod::Geant4ParticleData> const& input) {
std::vector<double> result; std::vector<double> result;
auto total_edep = 0.0; auto total_edep = 0.0;
int count = 0;
if (input[2].pdgID == -211)// Negative pion if (input[2].pdgID == -211)// Negative pion
{ {
for (const auto& i: evt) for (const auto& i: evt && count < 1)
total_edep += i.energyDeposit; total_edep += i.energyDeposit;
count++;
} }
result.push_back(total_edep); result.push_back(total_edep);
return result; return result;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment