Skip to content
Snippets Groups Projects
Commit 7ff6b01e authored by Whitney Armstrong's avatar Whitney Armstrong
Browse files

Fixing CI block

	modified:   .gitlab-ci.yml
parent 0639e38d
Branches
Tags
1 merge request!97Added simple smearing of Dummy data
......@@ -132,8 +132,9 @@ benchmarks:physics:
purge_image:
stage: cleanup
dependencies:
- env
needs:
- benchmarks:reconstruction
- benchmarks:physics
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
script:
......
......@@ -4,6 +4,7 @@
#include "GaudiAlg/Producer.h"
#include "GaudiAlg/GaudiTool.h"
#include "Gaudi/Algorithm.h"
#include "GaudiKernel/RndmGenerators.h"
// FCCSW
#include "JugBase/DataHandle.h"
......@@ -20,6 +21,8 @@ namespace Jug {
public:
DataHandle<dd4pod::Geant4ParticleCollection> m_inputHitCollection{"mcparticles", Gaudi::DataHandle::Reader, this};
DataHandle<eic::ReconstructedParticleCollection> m_outputHitCollection{"DummyReconstructedParticles", Gaudi::DataHandle::Writer, this};
Rndm::Numbers m_gaussDist;
Gaudi::Property<double> m_smearing{this, "smearing", 0.01 /* 1 percent*/};
MC2DummyParticle(const std::string& name, ISvcLocator* svcLoc) : GaudiAlgorithm(name, svcLoc)
{
......@@ -30,6 +33,12 @@ namespace Jug {
{
if (GaudiAlgorithm::initialize().isFailure())
return StatusCode::FAILURE;
IRndmGenSvc* randSvc = svc<IRndmGenSvc>("RndmGenSvc", true);
StatusCode sc = m_gaussDist.initialize(randSvc, Rndm::Gauss(0.0, m_smearing.value()));
if (!sc.isSuccess()) {
return StatusCode::FAILURE;
}
return StatusCode::SUCCESS;
}
StatusCode execute() override
......@@ -42,9 +51,10 @@ namespace Jug {
if (p.genStatus() != 1) {
continue;
}
double momentum = std::hypot(p.psx(), p.psy(), p.psz());
double energy = std::hypot(momentum, p.mass());
eic::ReconstructedParticle rec_part(p.pdgID(), energy, {p.psx(),p.psy(),p.psz()}, (double)p.charge(), p.mass());
eic::ReconstructedParticle rec_part(p.pdgID(), energy*m_gaussDist(), {p.psx()*m_gaussDist(),p.psy()*m_gaussDist(),p.psz()*m_gaussDist()}, (double)p.charge(), p.mass());
out_parts->push_back(rec_part);
}
return StatusCode::SUCCESS;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment