Commit 22a9bab4 authored by Whitney Armstrong's avatar Whitney Armstrong
Browse files

Doc build

parent 5fdae579
......@@ -30,10 +30,6 @@ variables:
## build. This is to avoid circular dependencies
TRIGGERED_BY_NIGHTLY: 0
default:
tags:
- silicon
stages:
- config
- build ## build new version of juggler
......@@ -60,6 +56,8 @@ workflow:
version:
stage: config
rules:
- if: '$CI_SERVER_HOST == "eicweb.phy.anl.gov"'
script:
- |
## version info
......@@ -82,6 +80,8 @@ version:
juggler:default:
stage: build
rules:
- if: '$CI_SERVER_HOST == "eicweb.phy.anl.gov"'
needs:
- version
script:
......@@ -113,6 +113,8 @@ juggler:default:
${INTERNAL_TAG} --eicweb
juggler:singularity:default:
stage: deploy
rules:
- if: '$CI_SERVER_HOST == "eicweb.phy.anl.gov"'
artifacts:
expire_in: 90 days
paths:
......@@ -128,7 +130,7 @@ juggler:singularity:default:
jug_xl:master:
stage: deploy
rules:
- if: '$CI_COMMIT_BRANCH == "master" && $TRIGGERED_BY_NIGHTLY == "0"'
- if: '$CI_COMMIT_BRANCH == "master" && $TRIGGERED_BY_NIGHTLY == "0" && $CI_SERVER_HOST == "eicweb.phy.anl.gov"'
when: on_success
- when: never
needs:
......@@ -140,6 +142,8 @@ jug_xl:master:
benchmarks:reconstruction:
stage: deploy
rules:
- if: '$CI_SERVER_HOST == "eicweb.phy.anl.gov"'
needs:
- version
- juggler:default
......@@ -154,6 +158,8 @@ benchmarks:reconstruction:
benchmarks:physics:
stage: deploy
rules:
- if: '$CI_SERVER_HOST == "eicweb.phy.anl.gov"'
needs:
- version
- juggler:default
......@@ -181,6 +187,8 @@ pages:
cleanup:
stage: finalize
rules:
- if: '$CI_SERVER_HOST == "eicweb.phy.anl.gov"'
rules:
- when: always
dependencies:
......
......@@ -8,6 +8,10 @@
#include "GaudiKernel/IMessageSvc.h"
#include "GaudiKernel/MsgStream.h"
/** Filter
*
* \ingroup base
*/
class GaudiFilterPolicy : public Acts::Logging::OutputFilterPolicy {
public:
GaudiFilterPolicy(IMessageSvc* owner) : m_owner(owner) {}
......
......@@ -15,10 +15,11 @@
#include <type_traits>
/**
* Specialisation of the Gaudi DataHandle
/** Specialisation of the Gaudi DataHandle
* for use with podio collections.
*/
*
* \ingroup base
*/
template <typename T>
class DataHandle : public DataObjectHandle<DataWrapper<T>> {
......
......@@ -7,6 +7,10 @@
#include "GaudiKernel/DataObject.h"
#include "podio/CollectionBase.h"
/** Data wrapper.
*
* \ingroup base
*/
class GAUDI_API DataWrapperBase : public DataObject {
public:
// ugly hack to circumvent the usage of boost::any yet
......@@ -15,6 +19,10 @@ public:
virtual ~DataWrapperBase(){};
};
/** Data wrapper.
*
* \ingroup base
*/
template <class T>
class GAUDI_API DataWrapper : public DataWrapperBase {
public:
......
......@@ -12,6 +12,8 @@ class EventStore;
* Interface for the tool used in the overlay algorithm.
* Must implement the correct collection and I/O and merging behavior,
* especially for the case when there are associations between parts of the EDM.
*
* \ingroup base
*/
class IEDMMergeTool : virtual public IAlgTool {
public:
......
//
// IGeoSvc.h
//
//
// Created by Julia Hrdinka on 30/03/15.
//
//
#ifndef IGEOSVC_H
#define IGEOSVC_H
......@@ -31,6 +23,11 @@ namespace genfit {
class G4VUserDetectorConstruction;
/** Geometry service interface.
*
* \ingroup base
* \ingroup geosvc
*/
class GAUDI_API IGeoSvc : virtual public IService {
public:
using VolumeSurfaceMap = std::unordered_map<uint64_t, const Acts::Surface*>;
......
......@@ -9,6 +9,10 @@ std::vector<std::string> split(const std::string& s, char delim);
int wildcmp(const char* wild, const char* string);
/** Data output controller.
*
* \ingroup base
*/
class KeepDropSwitch {
public:
enum Cmd { KEEP, DROP, UNKNOWN };
......
......@@ -17,6 +17,8 @@
* An EvtDataSvc for PODIO classes
*
* @author B. Hegner
*
* \ingroup base
*/
class PodioDataSvc : public DataSvc {
public:
......
......@@ -13,16 +13,16 @@
namespace Jug {
/// A wrapper around a pair of iterators to simplify range-based loops.
///
/// Some standard library algorithms return pairs of iterators to identify
/// a sub-range. This wrapper simplifies the iteration and should be used as
/// follows:
///
/// for (auto x : makeRange(std::equal_range(...)) {
/// ...
/// }
///
/** A wrapper around a pair of iterators to simplify range-based loops.
*
* Some standard library algorithms return pairs of iterators to identify
* a sub-range. This wrapper simplifies the iteration and should be used as
* follows:
*
* for (auto x : makeRange(std::equal_range(...)) {
* ...
* }
*/
template <typename Iterator>
class Range {
public:
......
#pragma once
#include <tuple>
namespace Jug::Utils
{
// ref: https://www.reedbeta.com/blog/python-like-enumerate-in-cpp17/
template <typename T,
typename TIter = decltype(std::begin(std::declval<T>())),
typename = decltype(std::end(std::declval<T>()))>
constexpr auto Enumerate(T && iterable)
{
namespace Jug::Utils {
/** Enumerate helper.
*
* ref: https://www.reedbeta.com/blog/python-like-enumerate-in-cpp17/
*/
template <typename T, typename TIter = decltype(std::begin(std::declval<T>())),
typename = decltype(std::end(std::declval<T>()))>
constexpr auto Enumerate(T&& iterable)
{
struct iterator
{
size_t i;
......
......@@ -23,6 +23,7 @@ gaudi_add_module(JugDigiPlugins
src/components/PhotoMultiplierDigi.cpp
src/components/SOIPIXTrackerDigi.cpp
src/components/UFSDTrackerDigi.cpp
src/components/SiliconTrackerDigi.cpp
LINK
Gaudi::GaudiAlgLib Gaudi::GaudiKernel
JugBase
......
......@@ -27,79 +27,81 @@ using namespace Gaudi::Units;
namespace Jug::Digi {
class CalorimeterHitDigi : public GaudiAlgorithm {
public:
/** Generic calorimeter hit digitiziation.
*
* \ingroup digi
* \ingroup calorimetry
*/
class CalorimeterHitDigi : public GaudiAlgorithm {
public:
// additional smearing resolutions
Gaudi::Property<std::vector<double>> u_eRes{this, "energyResolutions", {}}; // a/sqrt(E/GeV) + b + c/(E/GeV)
Gaudi::Property<double> m_tRes{this, "timineResolution", 0.0*ns};
Gaudi::Property<std::vector<double>> u_eRes{this, "energyResolutions", {}}; // a/sqrt(E/GeV) + b + c/(E/GeV)
Gaudi::Property<double> m_tRes{this, "timineResolution", 0.0 * ns};
// digitization settings
Gaudi::Property<int> m_capADC{this, "capacityADC", 8096};
Gaudi::Property<double> m_dyRangeADC{this, "dynamicRangeADC", 100*MeV};
Gaudi::Property<int> m_pedMeanADC{this, "pedestalMean", 400};
Gaudi::Property<double> m_pedSigmaADC{this, "pedestalSigma", 3.2};
Rndm::Numbers m_normDist;
Gaudi::Property<int> m_capADC{this, "capacityADC", 8096};
Gaudi::Property<double> m_dyRangeADC{this, "dynamicRangeADC", 100 * MeV};
Gaudi::Property<int> m_pedMeanADC{this, "pedestalMean", 400};
Gaudi::Property<double> m_pedSigmaADC{this, "pedestalSigma", 3.2};
Rndm::Numbers m_normDist;
DataHandle<dd4pod::CalorimeterHitCollection>
m_inputHitCollection{"inputHitCollection", Gaudi::DataHandle::Reader, this};
DataHandle<eic::RawCalorimeterHitCollection>
m_outputHitCollection{"outputHitCollection", Gaudi::DataHandle::Writer, this};
DataHandle<dd4pod::CalorimeterHitCollection> m_inputHitCollection{"inputHitCollection", Gaudi::DataHandle::Reader,
this};
DataHandle<eic::RawCalorimeterHitCollection> m_outputHitCollection{"outputHitCollection", Gaudi::DataHandle::Writer,
this};
// unitless counterparts of inputs
double dyRangeADC, tRes, eRes[3] = {0., 0., 0.};
// ill-formed: using GaudiAlgorithm::GaudiAlgorithm;
// ill-formed: using GaudiAlgorithm::GaudiAlgorithm;
CalorimeterHitDigi(const std::string& name, ISvcLocator* svcLoc) : GaudiAlgorithm(name, svcLoc)
{
declareProperty("inputHitCollection", m_inputHitCollection, "");
declareProperty("outputHitCollection", m_outputHitCollection, "");
declareProperty("inputHitCollection", m_inputHitCollection, "");
declareProperty("outputHitCollection", m_outputHitCollection, "");
}
StatusCode initialize() override
{
if (GaudiAlgorithm::initialize().isFailure()) {
return StatusCode::FAILURE;
}
// random number generator from service
auto randSvc = svc<IRndmGenSvc>("RndmGenSvc", true);
auto sc = m_normDist.initialize(randSvc, Rndm::Gauss(0.0, 1.0));
if (!sc.isSuccess()) {
return StatusCode::FAILURE;
}
// set energy resolution numbers
for (size_t i = 0; i < u_eRes.size() && i < 3; ++i) {
eRes[i] = u_eRes[i];
}
if (GaudiAlgorithm::initialize().isFailure()) {
return StatusCode::FAILURE;
}
// random number generator from service
auto randSvc = svc<IRndmGenSvc>("RndmGenSvc", true);
auto sc = m_normDist.initialize(randSvc, Rndm::Gauss(0.0, 1.0));
if (!sc.isSuccess()) {
return StatusCode::FAILURE;
}
// set energy resolution numbers
for (size_t i = 0; i < u_eRes.size() && i < 3; ++i) {
eRes[i] = u_eRes[i];
}
// using juggler internal units (GeV, mm, radian, ns)
dyRangeADC = m_dyRangeADC.value()/GeV;
tRes = m_tRes.value()/ns;
// using juggler internal units (GeV, mm, radian, ns)
dyRangeADC = m_dyRangeADC.value() / GeV;
tRes = m_tRes.value() / ns;
return StatusCode::SUCCESS;
return StatusCode::SUCCESS;
}
StatusCode execute() override
{
// input collections
const auto simhits = m_inputHitCollection.get();
// Create output collections
auto rawhits = m_outputHitCollection.createAndPut();
for (const auto& ahit : *simhits) {
// Note: juggler internal unit of energy is GeV
double eResRel = std::sqrt(std::pow(m_normDist()*eRes[0] / sqrt(ahit.energyDeposit()), 2)
+ std::pow(m_normDist()*eRes[1], 2)
+ std::pow(m_normDist()*eRes[2] / (ahit.energyDeposit()), 2));
double ped = m_pedMeanADC + m_normDist()*m_pedSigmaADC;
long long adc = std::llround(ped + ahit.energyDeposit()*(1. + eResRel)/dyRangeADC*m_capADC);
eic::RawCalorimeterHit rawhit(
(long long) ahit.cellID(),
(adc > m_capADC.value() ? m_capADC.value() : adc),
(double) ahit.truth().time + m_normDist()*tRes
);
rawhits->push_back(rawhit);
}
return StatusCode::SUCCESS;
// input collections
const auto simhits = m_inputHitCollection.get();
// Create output collections
auto rawhits = m_outputHitCollection.createAndPut();
for (const auto& ahit : *simhits) {
// Note: juggler internal unit of energy is GeV
double eResRel = std::sqrt(std::pow(m_normDist() * eRes[0] / sqrt(ahit.energyDeposit()), 2) +
std::pow(m_normDist() * eRes[1], 2) +
std::pow(m_normDist() * eRes[2] / (ahit.energyDeposit()), 2));
double ped = m_pedMeanADC + m_normDist() * m_pedSigmaADC;
long long adc = std::llround(ped + ahit.energyDeposit() * (1. + eResRel) / dyRangeADC * m_capADC);
eic::RawCalorimeterHit rawhit((long long)ahit.cellID(), (adc > m_capADC.value() ? m_capADC.value() : adc),
(double)ahit.truth().time + m_normDist() * tRes);
rawhits->push_back(rawhit);
}
return StatusCode::SUCCESS;
}
};
DECLARE_COMPONENT(CalorimeterHitDigi)
};
DECLARE_COMPONENT(CalorimeterHitDigi)
} // namespace Jug::Digi
......@@ -20,7 +20,7 @@ namespace Jug {
/** Crystal Endcaps Calorimeter detector digitization.
*
*
* \ingroup digi
*/
class CrystalEndcapsDigi : public GaudiAlgorithm {
public:
......
......@@ -18,6 +18,10 @@
namespace Jug {
namespace Digi {
/** Electromagnetic calorimeter digitization.
*
* \ingroup digi
*/
class EMCalorimeterDigi : public GaudiAlgorithm {
public:
using SimHit = dd4pod::CalorimeterHitCollection;
......
......@@ -23,7 +23,7 @@ namespace Jug {
/** Ecal Tungsten Sampling Calorimeter detector digitization.
*
*
* \ingroup digi
*/
class EcalTungstenSamplingDigi : public GaudiAlgorithm {
public:
......
......@@ -28,7 +28,7 @@ namespace Jug {
* Resolution terms are added in quadrature.
* When digitizing they are assumed to be independent random variables and are sampled as such.
*
*
* \ingroup digi
*/
class HadronicCalDigi : public GaudiAlgorithm {
public:
......
......@@ -28,6 +28,10 @@ using namespace Gaudi::Units;
namespace Jug::Digi {
/** PhotoMultiplierDigi.
*
* \ingroup digi
*/
class PhotoMultiplierDigi : public GaudiAlgorithm
{
public:
......
......@@ -19,7 +19,7 @@ namespace Jug {
/** Ultra-fast silicon detector digitization.
*
*
* \ingroup digi
*/
class SOIPIXTrackerDigi : public GaudiAlgorithm {
public:
......
#include <algorithm>
#include <cmath>
#include "GaudiAlg/Transformer.h"
#include "GaudiAlg/GaudiTool.h"
#include "GaudiKernel/RndmGenerators.h"
#include "Gaudi/Property.h"
// FCCSW
#include "JugBase/DataHandle.h"
// Event Model related classes
//#include "GaudiExamples/MyTrack.h"
//
// dd4pod's tracker hit is the input collectiopn
#include "dd4pod/TrackerHitCollection.h"
// eicd's RawTrackerHit is the output
#include "eicd/RawTrackerHitCollection.h"
namespace Jug::Digi {
/** Silicon detector digitization.
*
* \ingroup digi
*/
class SiliconTrackerDigi : public GaudiAlgorithm {
public:
Gaudi::Property<double> m_timeResolution{this, "timeResolution", 10}; // todo : add units
Rndm::Numbers m_gaussDist;
DataHandle<dd4pod::TrackerHitCollection> m_inputHitCollection{"inputHitCollection", Gaudi::DataHandle::Reader,
this};
DataHandle<eic::RawTrackerHitCollection> m_outputHitCollection{"outputHitCollection", Gaudi::DataHandle::Writer,
this};
public:
// ill-formed: using GaudiAlgorithm::GaudiAlgorithm;
SiliconTrackerDigi(const std::string& name, ISvcLocator* svcLoc) : GaudiAlgorithm(name, svcLoc)
{
declareProperty("inputHitCollection", m_inputHitCollection, "");
declareProperty("outputHitCollection", m_outputHitCollection, "");
}
StatusCode initialize() override
{
if (GaudiAlgorithm::initialize().isFailure())
return StatusCode::FAILURE;
IRndmGenSvc* randSvc = svc<IRndmGenSvc>("RndmGenSvc", true);
StatusCode sc = m_gaussDist.initialize(randSvc, Rndm::Gauss(0.0, m_timeResolution.value()));
if (!sc.isSuccess()) {
return StatusCode::FAILURE;
}
return StatusCode::SUCCESS;
}
StatusCode execute() override
{
// input collection
const dd4pod::TrackerHitCollection* simhits = m_inputHitCollection.get();
// Create output collections
auto rawhits = m_outputHitCollection.createAndPut();
// eic::RawTrackerHitCollection* rawHitCollection = new eic::RawTrackerHitCollection();
std::map<long long, int> cell_hit_map;
for (const auto& ahit : *simhits) {
debug() << "--------------------" << ahit.cellID() << endmsg;
debug() << "Hit in cellID = " << ahit.cellID() << endmsg;
debug() << " position = (" << ahit.position().x << "," << ahit.position().y <<","<< ahit.position().z << ")" << endmsg;
debug() << " xy_radius = " << std::hypot(ahit.position().x , ahit.position().y ) << endmsg;
debug() << " momentum = (" << ahit.momentum().x << "," << ahit.momentum().y <<","<< ahit.momentum().z << ")" << endmsg;
// std::cout << ahit << "\n";
if (cell_hit_map.count(ahit.cellID()) == 0) {
cell_hit_map[ahit.cellID()] = rawhits->size();
eic::RawTrackerHit rawhit((long long)ahit.cellID(),
ahit.truth().time * 1e6 + m_gaussDist() * 1e3, // ns->fs
std::llround(ahit.energyDeposit() * 1e6));
rawhits->push_back(rawhit);
} else {
auto hit = (*rawhits)[cell_hit_map[ahit.cellID()]];
hit.time(ahit.truth().time * 1e6 + m_gaussDist() * 1e3);
auto ch = hit.charge();
hit.charge(ch + std::llround(ahit.energyDeposit() * 1e6));
}
}
return StatusCode::SUCCESS;
}
};
DECLARE_COMPONENT(SiliconTrackerDigi)
} // namespace Jug::Digi
......@@ -19,9 +19,9 @@
namespace Jug::Digi {
/** Ultra-fast silicon detector digitization.
*
/** UFSD detector digitization.
*
* \ingroup digi
*/
class UFSDTrackerDigi : public GaudiAlgorithm {
public:
......
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