Skip to content
Snippets Groups Projects
Commit bcb173f1 authored by Jihee Kim's avatar Jihee Kim
Browse files

testing

parent 17e61040
Branches
No related tags found
1 merge request!237Resolve "Add ZDC benchmark"
This commit is part of merge request !237. Comments created here will be created in the context of that merge request.
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
R__LOAD_LIBRARY(libeicd.so) R__LOAD_LIBRARY(libeicd.so)
R__LOAD_LIBRARY(libDD4pod.so) R__LOAD_LIBRARY(libDD4pod.so)
#include "fmt/core.h"
#include "DD4hep/Detector.h" #include "DD4hep/Detector.h"
#include "DDG4/Geant4Data.h" #include "DDG4/Geant4Data.h"
#include "DDRec/CellIDPositionConverter.h" #include "DDRec/CellIDPositionConverter.h"
...@@ -75,43 +76,22 @@ void analysis_zdc_neutrons(const char* input_fname = "sim_zdc_uniform_neutron.ro ...@@ -75,43 +76,22 @@ void analysis_zdc_neutrons(const char* input_fname = "sim_zdc_uniform_neutron.ro
// Theta [mrad] // Theta [mrad]
auto Thetathr = [](std::vector<dd4pod::Geant4ParticleData> const& input) { auto Thetathr = [](std::vector<dd4pod::Geant4ParticleData> const& input) {
auto p = input[2]; auto p = input[2];
TVector3 mom(p.ps.x, p.ps.y, p.ps.z); auto theta = p.ps.theta();
// removing crossing angle return theta*1000.0;
auto crossing_angle = -0.025; // unit [rad]
auto sin_term = std::sin(-crossing_angle);
auto cos_term = std::cos(-crossing_angle);
auto pz = cos_term * mom.Z() - sin_term * mom.X();
auto px = sin_term * mom.Z() + cos_term * mom.X();
TVector3 org_mom(px, mom.Y(), pz);
return org_mom.Theta()*1000.0;
}; };
// Phi [rad] // Phi [rad]
auto Phithr = [](std::vector<dd4pod::Geant4ParticleData> const& input) { auto Phithr = [](std::vector<dd4pod::Geant4ParticleData> const& input) {
auto p = input[2]; auto p = input[2];
TVector3 mom(p.ps.x, p.ps.y, p.ps.z); auto phi = p.ps.phi();
// removing crossing angle return phi;
auto crossing_angle = -0.025; // unit [rad]
auto s = std::sin(-crossing_angle);
auto c = std::cos(-crossing_angle);
auto pz = c*mom.Z() - s*mom.X();
auto px = s*mom.Z() + c*mom.X();
TVector3 transmom(px, mom.Y(), pz);
return transmom.Phi();
}; };
// Eta // Eta
auto Etathr = [](std::vector<dd4pod::Geant4ParticleData> const& input) { auto Etathr = [](std::vector<dd4pod::Geant4ParticleData> const& input) {
auto p = input[2]; auto p = input[2];
TVector3 mom(p.ps.x, p.ps.y, p.ps.z); auto eta = p.ps.eta();
// removing crossing angle return eta;
auto crossing_angle = -0.025; // unit [rad]
auto sin_term = std::sin(-crossing_angle);
auto cos_term = std::cos(-crossing_angle);
auto pz = cos_term * mom.Z() - sin_term * mom.X();
auto px = sin_term * mom.Z() + cos_term * mom.X();
TVector3 org_mom(px, mom.Y(), pz);
return org_mom.Eta();
}; };
// Define variables // Define variables
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment