Commit 5f6e92d1 authored by Whitney Armstrong's avatar Whitney Armstrong
Browse files

Added missing digi algo

- added missing algo: EMCalorimeterDigi
- Cleaned up ci
parent 96b84a7f
...@@ -11,40 +11,11 @@ stages: ...@@ -11,40 +11,11 @@ stages:
- docker_push - docker_push
- run - run
#compile:
# stage: build
# tags:
# - silicon
# before_script:
# - pwd && ls -lrth
# script:
# - export homedir=$(pwd) && pwd && cd /tmp && git clone --depth=1 https://eicweb.phy.anl.gov/EIC/NPDet.git && mkdir build && cd build && cmake ../NPDet/. && make -j20 install
# - cd /tmp && git clone --depth=1 https://eicweb.phy.anl.gov/EIC/eicd.git && mkdir eicd_build && cd eicd_build && cmake ../eicd/. && make -j20 install
# - cd $homedir && ls -lrth && mkdir build && cd build && cmake .. && make -j10
#run_example:
# stage: run
# tags:
# - silicon
# script:
# - ./build/run gaudirun.py Examples/options/hello_world.py
#
#run_example2:
# image: eicweb.phy.anl.gov:4567/eic/npdet/npdet:latest
# stage: run
# tags:
# - silicon
# script:
# - ./build/run gaudirun.py JugBase/tests/options/simple_reader.py
docker_image: docker_image:
image: eicweb.phy.anl.gov:4567/containers/image_recipes/ubuntu_dind:latest image: eicweb.phy.anl.gov:4567/containers/image_recipes/ubuntu_dind:latest
stage: docker_build stage: docker_build
tags: tags:
- silicon - silicon
# only:
# - master
# - ci_dev
script: script:
- cd containers/docker - cd containers/docker
- make build-nc - make build-nc
...@@ -54,9 +25,6 @@ docker_image_push: ...@@ -54,9 +25,6 @@ docker_image_push:
stage: docker_push stage: docker_push
tags: tags:
- silicon - silicon
# only:
# - master
# - ci_dev
script: script:
- cd containers/docker - cd containers/docker
- make push - make push
......
#include <algorithm>
#include "GaudiAlg/Transformer.h"
#include "GaudiAlg/Producer.h"
#include "GaudiAlg/GaudiTool.h"
#include "GaudiKernel/RndmGenerators.h"
#include "Gaudi/Property.h"
// FCCSW
#include "JugBase/DataHandle.h"
// Event Model related classes
#include "eicd/RawCalorimeterHitCollection.h"
#include "eicd/RawCalorimeterHitData.h"
#include "dd4pod/CalorimeterHitCollection.h"
namespace Jug {
namespace Digi {
class EMCalorimeterDigi : public GaudiAlgorithm {
public:
using SimHit = dd4pod::CalorimeterHitCollection;
using RawHit = eic::RawCalorimeterHitCollection;
DataHandle<SimHit> m_inputHitCollection{"inputHitCollection", Gaudi::DataHandle::Reader, this};
DataHandle<RawHit> m_outputHitCollection{"outputHitCollection", Gaudi::DataHandle::Writer, this};
Gaudi::Property<double> m_energyResolution{this, "energyResolution", 0.05 /* 5 percent*/};
Rndm::Numbers m_gaussDist;
EMCalorimeterDigi(const std::string& name, ISvcLocator* svcLoc) : GaudiAlgorithm(name, svcLoc)
{
declareProperty("inputHitCollection", m_inputHitCollection, "");
declareProperty("outputHitCollection", m_outputHitCollection, "");
}
StatusCode initialize() override
{
IRndmGenSvc* randSvc = svc<IRndmGenSvc>("RndmGenSvc", true);
StatusCode sc = m_gaussDist.initialize(randSvc, Rndm::Gauss(0.0, m_energyResolution.value() ));
if (!sc.isSuccess()) {
return StatusCode::FAILURE;
}
if (GaudiAlgorithm::initialize().isFailure())
return StatusCode::FAILURE;
return StatusCode::SUCCESS;
}
StatusCode execute() override
{
// input collection
const dd4pod::CalorimeterHitCollection* simhits = m_inputHitCollection.get();
// Create output collections
auto rawhits = m_outputHitCollection.createAndPut();
eic::RawCalorimeterHitCollection* rawHitCollection = new eic::RawCalorimeterHitCollection();
for (const auto& ahit : *simhits) {
// std::cout << ahit << "\n";
double sqrtE = std::sqrt(ahit.energyDeposit()) ;
double aterm = m_gaussDist()*sqrtE;
eic::RawCalorimeterHit rawhit((long long)ahit.cellID(),
(long long)((ahit.energyDeposit() + aterm) * 1e6),
ahit.truth().time * 1e6);
rawhits->push_back(rawhit);
}
return StatusCode::SUCCESS;
}
};
DECLARE_COMPONENT(EMCalorimeterDigi)
} // namespace Digi
} // namespace Jug
Markdown is supported
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