Commit 760437d9 authored by Sylvester Joosten's avatar Sylvester Joosten
Browse files

Also allow reconstruction of e+n events (for BeAGLE)

parent 92b102ed
......@@ -27,6 +27,7 @@ public:
SmartIF<IParticleSvc> m_pidSvc;
double m_proton;
double m_neutron;
InclusiveKinematicsTruth(const std::string& name, ISvcLocator* svcLoc)
: GaudiAlgorithm(name, svcLoc), AlgorithmIDMixin(name, info()) {
......@@ -46,6 +47,7 @@ public:
return StatusCode::FAILURE;
}
m_proton = m_pidSvc->particle(2212).mass;
m_neutron = m_pidSvc->particle(2112).mass;
return StatusCode::SUCCESS;
}
......@@ -78,7 +80,14 @@ public:
ei.setE(p.energy());
ebeam_found = true;
}
if (p.genStatus() == 4 && p.pdgID() == 2212) { // Incoming proton
else if (p.genStatus() == 4 && p.pdgID() == 2212) { // Incoming proton
pi.setPx(p.ps().x);
pi.setPy(p.ps().y);
pi.setPz(p.ps().z);
pi.setE(p.energy());
pbeam_found = true;
}
else if (p.genStatus() == 4 && p.pdgID() == 2112) { // Incoming neutron
pi.setPx(p.ps().x);
pi.setPy(p.ps().y);
pi.setPz(p.ps().z);
......@@ -89,7 +98,7 @@ public:
// which seems to be correct based on a cursory glance at the Pythia8 output. In the future,
// it may be better to trace back each final-state electron and see which one originates from
// the beam.
if (p.genStatus() == 1 && p.pdgID() == 11 && mcscatID == -1) {
else if (p.genStatus() == 1 && p.pdgID() == 11 && mcscatID == -1) {
ef.setPx(p.ps().x);
ef.setPy(p.ps().y);
ef.setPz(p.ps().z);
......
......@@ -38,7 +38,7 @@ public:
Gaudi::Property<double> m_crossingAngle{this, "crossingAngle", -0.025 * Gaudi::Units::radian};
SmartIF<IParticleSvc> m_pidSvc;
double m_proton, m_electron;
double m_proton, m_neutron, m_electron;
InclusiveKinematicsDA(const std::string& name, ISvcLocator* svcLoc)
: GaudiAlgorithm(name, svcLoc), AlgorithmIDMixin(name, info()) {
......@@ -59,6 +59,7 @@ public:
return StatusCode::FAILURE;
}
m_proton = m_pidSvc->particle(2212).mass;
m_neutron = m_pidSvc->particle(2112).mass;
m_electron = m_pidSvc->particle(11).mass;
return StatusCode::SUCCESS;
......@@ -102,7 +103,7 @@ public:
found_electron = true;
}
if (p.genStatus() == 4 && p.pdgID() == 2212) {
if (p.genStatus() == 4 && (p.pdgID() == 2212 || p.pdgID() == 2112)) {
// Incoming proton
pi.x = p.ps().x;
pi.y = p.ps().y;
......@@ -126,7 +127,7 @@ public:
pi.z = 275.0*cos(m_crossingAngle);
}
pi.t = sqrt( pi.x*pi.x + pi.z*pi.z + m_proton*m_proton);
pi.t = std::hypot(pi.x, pi.z, (p.pdgID() == 2212) ? m_proton : m_neutron);
found_proton = true;
}
......
......@@ -38,7 +38,7 @@ public:
Gaudi::Property<double> m_crossingAngle{this, "crossingAngle", -0.025 * Gaudi::Units::radian};
SmartIF<IParticleSvc> m_pidSvc;
double m_proton, m_electron;
double m_proton, m_neutron, m_electron;
InclusiveKinematicsElectron(const std::string& name, ISvcLocator* svcLoc)
: GaudiAlgorithm(name, svcLoc), AlgorithmIDMixin(name, info()) {
......@@ -59,6 +59,7 @@ public:
return StatusCode::FAILURE;
}
m_proton = m_pidSvc->particle(2212).mass;
m_neutron = m_pidSvc->particle(2112).mass;
m_electron = m_pidSvc->particle(11).mass;
return StatusCode::SUCCESS;
......@@ -102,7 +103,7 @@ public:
found_electron = true;
}
if (p.genStatus() == 4 && p.pdgID() == 2212) {
if (p.genStatus() == 4 && (p.pdgID() == 2212 || p.pdgID() == 2112)) {
// Incoming proton
pi.x = p.ps().x;
pi.y = p.ps().y;
......@@ -125,8 +126,8 @@ public:
pi.x = 275.0*sin(m_crossingAngle);
pi.z = 275.0*cos(m_crossingAngle);
}
pi.t = sqrt( pi.x*pi.x + pi.z*pi.z + m_proton*m_proton);
pi.t = std::hypot(pi.x, pi.z, (p.pdgID() == 2212) ? m_proton : m_neutron);
found_proton = true;
}
......
......@@ -38,7 +38,7 @@ public:
Gaudi::Property<double> m_crossingAngle{this, "crossingAngle", -0.025 * Gaudi::Units::radian};
SmartIF<IParticleSvc> m_pidSvc;
double m_proton, m_electron;
double m_proton, m_neutron, m_electron;
InclusiveKinematicsJB(const std::string& name, ISvcLocator* svcLoc)
: GaudiAlgorithm(name, svcLoc), AlgorithmIDMixin(name, info()) {
......@@ -59,6 +59,7 @@ public:
return StatusCode::FAILURE;
}
m_proton = m_pidSvc->particle(2212).mass;
m_neutron = m_pidSvc->particle(2112).mass;
m_electron = m_pidSvc->particle(11).mass;
return StatusCode::SUCCESS;
......@@ -102,7 +103,7 @@ public:
found_electron = true;
}
if (p.genStatus() == 4 && p.pdgID() == 2212) {
if (p.genStatus() == 4 && (p.pdgID() == 2212 || p.pdgID() == 2112)) {
// Incoming proton
pi.x = p.ps().x;
pi.y = p.ps().y;
......@@ -126,7 +127,7 @@ public:
pi.z = 275.0*cos(m_crossingAngle);
}
pi.t = sqrt( pi.x*pi.x + pi.z*pi.z + m_proton*m_proton);
pi.t = std::hypot(pi.x, pi.z, (p.pdgID() == 2212) ? m_proton : m_neutron);
found_proton = true;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment