diff --git a/Core/include/ACTS/Extrapolation/ExtrapolationEngine.hpp b/Core/include/ACTS/Extrapolation/ExtrapolationEngine.hpp index 05b63c3bd0991edd78ff7c5bd18859db622a0aa2..b35dacb97a0b1b5586dcdec08130c640027c84e6 100644 --- a/Core/include/ACTS/Extrapolation/ExtrapolationEngine.hpp +++ b/Core/include/ACTS/Extrapolation/ExtrapolationEngine.hpp @@ -12,6 +12,7 @@ #include "ACTS/Extrapolation/INavigationEngine.hpp" #include "ACTS/EventData/TrackParameters.hpp" #include "ACTS/EventData/NeutralParameters.hpp" +#include "ACTS/Utilities/Logger.hpp" namespace Acts { @@ -41,7 +42,7 @@ namespace Acts { with the setConfig method. */ struct Config { - + std::shared_ptr<Logger> logger; std::shared_ptr<const TrackingGeometry> trackingGeometry; //!< the tracking geometry used by the navigator std::vector< std::shared_ptr<IExtrapolationEngine> > extrapolationEngines; //!< the extrapolation engines for different geometry layouts std::shared_ptr<IPropagationEngine> propagationEngine; //!< the used propagation engine for navigation initialization @@ -50,6 +51,7 @@ namespace Acts { std::string postfix; //!< output postfix Config() : + logger(getDefaultLogger("ExtrapolationEngine",Logging::INFO)), trackingGeometry(nullptr), extrapolationEngines(), propagationEngine(nullptr), @@ -94,6 +96,7 @@ namespace Acts { Config m_config; private: + const Logger& logger() const {return *m_config.logger;} /** main extrapolation method, templated to chared/neutral */ template <class T> ExtrapolationCode extrapolateT(ExtrapolationCell<T>& eCell, const Surface* sf = nullptr, diff --git a/Core/include/ACTS/Extrapolation/MaterialEffectsEngine.hpp b/Core/include/ACTS/Extrapolation/MaterialEffectsEngine.hpp index 7cd62cddf100a410c38071b5080e28cf31d363f1..7ba079f9e76c301a35d92ef4b1fb9500a552f80b 100644 --- a/Core/include/ACTS/Extrapolation/MaterialEffectsEngine.hpp +++ b/Core/include/ACTS/Extrapolation/MaterialEffectsEngine.hpp @@ -13,7 +13,8 @@ #include "ACTS/EventData/TrackParameters.hpp" #include "ACTS/EventData/NeutralParameters.hpp" #include "ACTS/Utilities/Definitions.hpp" - +#include "ACTS/Utilities/Logger.hpp" + namespace Acts { class Layer; @@ -35,6 +36,7 @@ namespace Acts { Configuration struct for the MaterialEffectsEngine */ struct Config { + std::shared_ptr<Logger> logger; bool eLossCorrection; //!< apply the energy loss correction bool eLossMpv; //!< apply the energy loss correction as most probable value bool mscCorrection; //!< apply the multiple (coulomb) scattering correction @@ -42,6 +44,7 @@ namespace Acts { std::string postfix; //!< screen output postfix Config() : + logger(getDefaultLogger("MaterialEffectsEngine",Logging::INFO)), eLossCorrection(true), eLossMpv(true), mscCorrection(true), @@ -78,6 +81,7 @@ namespace Acts { Config m_config; //!< configuration struct private: + const Logger& logger() const {return *m_config.logger;} /** charged extrapolation - depending on the MaterialUpdateStage - it either manipulates or creates new parameters @TODO check for memory handling diff --git a/Core/include/ACTS/Extrapolation/RungeKuttaEngine.hpp b/Core/include/ACTS/Extrapolation/RungeKuttaEngine.hpp index 30e90ec0a8a1e29b8759680a502c7c607589105e..a4df82c555d20ddd7659ced124a8ac76963f8d8d 100644 --- a/Core/include/ACTS/Extrapolation/RungeKuttaEngine.hpp +++ b/Core/include/ACTS/Extrapolation/RungeKuttaEngine.hpp @@ -17,6 +17,7 @@ #include "ACTS/Surfaces/ConeSurface.hpp" #include "ACTS/Surfaces/BoundaryCheck.hpp" #include "ACTS/MagneticField/IMagneticFieldSvc.hpp" +#include "ACTS/Utilities/Logger.hpp" namespace Acts { @@ -152,6 +153,7 @@ namespace Acts { @TODO explain parametr meanings (input from Igor needed) */ struct Config { + std::shared_ptr<Logger> logger; std::shared_ptr<IMagneticFieldSvc> fieldService ; //!< the field service double dlt ; //!< accuracy parameter @@ -163,6 +165,7 @@ namespace Acts { std::string postfix ; //!< screen output postfix Config() : + logger(getDefaultLogger("RungeKuttaEngine",Logging::INFO)), fieldService(nullptr), dlt(0.000200), helixStep(1.), @@ -206,7 +209,9 @@ namespace Acts { RungeKuttaUtils m_rkUtils; //!< RungeKuttaUtils class private: - /** Templated RungeKutta propagation method - charged/neutral */ + const Logger& logger() const {return *m_config.logger;} + + /** Templated RungeKutta propagation method - charged/neutral */ template <class T> bool propagateRungeKuttaT(ExtrapolationCell<T>& eCell, PropagationCache& pCache, const T& tParameters, diff --git a/Core/include/ACTS/Extrapolation/StaticEngine.hpp b/Core/include/ACTS/Extrapolation/StaticEngine.hpp index 30da15bf42f5784fd239c20a40ba897a695334b4..59c81eb81b77e28c160bb7c723dad3a99bb55a05 100644 --- a/Core/include/ACTS/Extrapolation/StaticEngine.hpp +++ b/Core/include/ACTS/Extrapolation/StaticEngine.hpp @@ -18,6 +18,7 @@ #include "ACTS/Extrapolation/detail/ExtrapolationMacros.hpp" #include "ACTS/EventData/TrackParameters.hpp" #include "ACTS/EventData/NeutralParameters.hpp" +#include "ACTS/Utilities/Logger.hpp" namespace Acts { @@ -57,6 +58,7 @@ namespace Acts { holds the helper engines that can be configured */ struct Config { + std::shared_ptr<Logger> logger; std::shared_ptr<IPropagationEngine> propagationEngine; //!< the used propagation engine std::shared_ptr<INavigationEngine> navigationEngine; //!< the navigation engine to resolve the boundary @@ -66,7 +68,8 @@ namespace Acts { std::string postfix; //!< output postfix Config() : - propagationEngine(nullptr), + logger(getDefaultLogger("StaticEngine",Logging::INFO)), + propagationEngine(nullptr), navigationEngine(nullptr), materialEffectsEngine(nullptr), prefix("[SE] - "), @@ -108,7 +111,9 @@ namespace Acts { Config m_config; private: - /** main loop extrapolation method */ + const Logger& logger() const {return *m_config.logger;} + + /** main loop extrapolation method */ template <class T> ExtrapolationCode extrapolateT(ExtrapolationCell<T>& eCell, const Surface* sf = 0, PropDirection dir=alongMomentum, diff --git a/Core/include/ACTS/Extrapolation/StaticNavigationEngine.hpp b/Core/include/ACTS/Extrapolation/StaticNavigationEngine.hpp index e41d74034be4523c148887f8376128044fbf322e..fb398734c1868fa3566d04d635865de54644038a 100644 --- a/Core/include/ACTS/Extrapolation/StaticNavigationEngine.hpp +++ b/Core/include/ACTS/Extrapolation/StaticNavigationEngine.hpp @@ -13,6 +13,7 @@ #include "ACTS/Volumes/BoundarySurface.hpp" #include "ACTS/EventData/TrackParameters.hpp" #include "ACTS/EventData/NeutralParameters.hpp" +#include "ACTS/Utilities/Logger.hpp" namespace Acts { @@ -33,6 +34,7 @@ namespace Acts { configuration struct for the StaticNavigationEngine */ struct Config { + std::shared_ptr<Logger> logger; std::shared_ptr<IPropagationEngine> propagationEngine; //!< the used propagation engine std::shared_ptr<IMaterialEffectsEngine> materialEffectsEngine; //!< the material effects updated @@ -42,6 +44,7 @@ namespace Acts { std::string postfix; //!< output postfix Config() : + logger(getDefaultLogger("StaticNavigationEngine",Logging::INFO)), propagationEngine(nullptr), materialEffectsEngine(nullptr), trackingGeometry(nullptr), @@ -84,6 +87,7 @@ namespace Acts { Config m_config; private: + const Logger& logger() const {return *m_config.logger;} /** resolve the boundary situation */ template <class T> ExtrapolationCode resolveBoundaryT(ExtrapolationCell<T>& eCell, PropDirection dir=alongMomentum) const; diff --git a/Core/include/ACTS/Extrapolation/detail/ExtrapolationMacros.hpp b/Core/include/ACTS/Extrapolation/detail/ExtrapolationMacros.hpp index 355e870bb0a2d32317323d3c67f9c8ac68f8dac9..e1b4530a6822085308bda8c95f2cb9eb17f73500 100644 --- a/Core/include/ACTS/Extrapolation/detail/ExtrapolationMacros.hpp +++ b/Core/include/ACTS/Extrapolation/detail/ExtrapolationMacros.hpp @@ -7,11 +7,11 @@ #ifndef EXSCREENOUTPUTDEFS #define EXSCREENOUTPUTDEFS 1 -#define EX_MSG_INFO(navstep, step, idx, x) MSG_INFO ( m_sopPrefix << std::setw(4) << navstep << m_sopPostfix << std::setw(12) << step << m_sopPostfix << std::setw(4) << idx << m_sopPostfix << x) -#define EX_MSG_DEBUG(navstep, step, idx, x) MSG_DEBUG ( m_sopPrefix << std::setw(4) << navstep << m_sopPostfix << std::setw(12) << step << m_sopPostfix << std::setw(4) << idx << m_sopPostfix << x) -#define EX_MSG_VERBOSE(navstep, step, idx, x) MSG_VERBOSE(m_sopPrefix << std::setw(4) << navstep << m_sopPostfix << std::setw(12) << step << m_sopPostfix << std::setw(4) << idx << m_sopPostfix << x) -#define EX_MSG_WARNING(navstep, step, idx, x) MSG_WARNING( m_sopPrefix << std::setw(4) << navstep << m_sopPostfix << std::setw(12) << step << m_sopPostfix << std::setw(4) << idx << m_sopPostfix << x) -#define EX_MSG_FATAL(navstep, step, idx, x) MSG_FATAL ( m_sopPrefix << std::setw(4) << navstep << m_sopPostfix << std::setw(12) << step << m_sopPostfix << std::setw(4) << idx << m_sopPostfix << x) +#define EX_MSG_INFO(navstep, step, idx, x) ACTS_INFO ( m_sopPrefix << std::setw(4) << navstep << m_sopPostfix << std::setw(12) << step << m_sopPostfix << std::setw(4) << idx << m_sopPostfix << x) +#define EX_MSG_DEBUG(navstep, step, idx, x) ACTS_DEBUG ( m_sopPrefix << std::setw(4) << navstep << m_sopPostfix << std::setw(12) << step << m_sopPostfix << std::setw(4) << idx << m_sopPostfix << x) +#define EX_MSG_VERBOSE(navstep, step, idx, x) ACTS_VERBOSE(m_sopPrefix << std::setw(4) << navstep << m_sopPostfix << std::setw(12) << step << m_sopPostfix << std::setw(4) << idx << m_sopPostfix << x) +#define EX_MSG_WARNING(navstep, step, idx, x) ACTS_WARNING( m_sopPrefix << std::setw(4) << navstep << m_sopPostfix << std::setw(12) << step << m_sopPostfix << std::setw(4) << idx << m_sopPostfix << x) +#define EX_MSG_FATAL(navstep, step, idx, x) ACTS_FATAL ( m_sopPrefix << std::setw(4) << navstep << m_sopPostfix << std::setw(12) << step << m_sopPostfix << std::setw(4) << idx << m_sopPostfix << x) #endif #ifndef EXENINGE_OUTPUTHELPER diff --git a/Core/include/ACTS/Tools/CylinderGeometryBuilder.hpp b/Core/include/ACTS/Tools/CylinderGeometryBuilder.hpp index d3af3a79566369db3e89352048738673104939e3..bd2c28e1790ed03e567f5ac78ee071a1a16fc46e 100644 --- a/Core/include/ACTS/Tools/CylinderGeometryBuilder.hpp +++ b/Core/include/ACTS/Tools/CylinderGeometryBuilder.hpp @@ -10,6 +10,7 @@ #include <list> #include "ACTS/Utilities/Definitions.hpp" +#include "ACTS/Utilities/Logger.hpp" #include "ACTS/Tools/ITrackingGeometryBuilder.hpp" #include "ACTS/Tools/ITrackingVolumeBuilder.hpp" #include "ACTS/Tools/ITrackingVolumeHelper.hpp" @@ -25,7 +26,7 @@ namespace Acts It retrieves ITrackingVolumeBuilders as configured and builds one detector around the other one. - @author Andreas.Salzburger@cern.ch + @author Andreas.Salzburger@cern.ch */ class CylinderGeometryBuilder : public ITrackingGeometryBuilder @@ -33,43 +34,47 @@ namespace Acts public: /** @struct Config Configuration for the CylinderVolumeBuilder */ - struct Config { - + struct Config { + + std::shared_ptr<Logger> logger; //! logging instance std::shared_ptr<ITrackingVolumeBuilder> beamPipeBuilder; //!< a special builder for the beam pipe (for post-insertion) std::list<std::shared_ptr<ITrackingVolumeBuilder> > trackingVolumeBuilders; //!< the sub detector TrackingVolume builder std::shared_ptr<ITrackingVolumeHelper> trackingVolumeHelper; //!< used for creating a container - + Config() : - beamPipeBuilder(nullptr), + logger(getDefaultLogger("CylinderGeometryBuilder",Logging::INFO)), + beamPipeBuilder(nullptr), trackingVolumeBuilders(), - trackingVolumeHelper(nullptr) + trackingVolumeHelper(nullptr) {} - }; - + }; + /** Constructor */ CylinderGeometryBuilder(const Config& cgbConfig); - + /** Destructor */ virtual ~CylinderGeometryBuilder() = default; - + /** TrackingGeometry Interface method */ virtual std::unique_ptr<TrackingGeometry> trackingGeometry() const override; - + /** Set configuration method */ void setConfiguration(const Config& cgbConfig); - + /** Get configuration method */ - Config getConfiguration() const; - - protected: - /** Configuration member */ - Config m_config; + Config getConfiguration() const; + + private: + /** Configuration member */ + Config m_config; + + const Logger& logger() const {return *m_config.logger;} }; - - inline CylinderGeometryBuilder::Config CylinderGeometryBuilder::getConfiguration() const + + inline CylinderGeometryBuilder::Config CylinderGeometryBuilder::getConfiguration() const { return m_config; } - + } // end of namespace #endif // ACTS_GEOMETRYTOOLS_TRACKINGGEOMETRYBUILDER_H diff --git a/Core/include/ACTS/Tools/CylinderVolumeBuilder.hpp b/Core/include/ACTS/Tools/CylinderVolumeBuilder.hpp index 94948e0b5dab6334241174444104065c5011360b..13b9fb227df0795b87a4f9a5a82729261e9c9f08 100644 --- a/Core/include/ACTS/Tools/CylinderVolumeBuilder.hpp +++ b/Core/include/ACTS/Tools/CylinderVolumeBuilder.hpp @@ -11,6 +11,7 @@ #include "ACTS/Tools/ITrackingVolumeHelper.hpp" #include "ACTS/Tools/ILayerBuilder.hpp" #include "ACTS/Utilities/BinningType.hpp" +#include "ACTS/Utilities/Logger.hpp" #ifndef ATAS_GEOMETRYTOOLS_TAKESMALLERBIGGER #define ATAS_GEOMETRYTOOLS_TAKESMALLERBIGGER @@ -23,49 +24,50 @@ namespace Acts { class TrackingVolume; class VolumeBounds; - + /** @ LayerSetup struct to understand the layer setup */ - struct LayerSetup { + struct LayerSetup { bool present; //!< layers are present BinningValue binningValue; //!< in what way they are binned - + std::pair<double,double> rBoundaries; //!< raidal boundaries - std::pair<double,double> zBoundaries; //!< zBoundaries - - //std::vector<double> ringBoundaries; //!< ring boundaries if present //!< @TODO insert ring layout + std::pair<double,double> zBoundaries; //!< zBoundaries + + //std::vector<double> ringBoundaries; //!< ring boundaries if present //!< @TODO insert ring layout LayerSetup() : present(false), binningValue(binR), rBoundaries(std::pair<double,double>(10e10,-10e10)), zBoundaries(std::pair<double,double>(10e10,-10e10)) - {} - + {} + /** Conversion operator to bool */ - operator bool() const { return present; } - + operator bool() const { return present; } + }; - + /** @class CylinderVolumeBuilder - + A simple cylindrical volume builder to be used for building a concentrical cylindrical volume - a) configured volume - b) wrapping around a cylindrical/disk layer setup - + All are optionally wrapped around a given volume which has to by a cylinder volume and which has to be center at z == 0 - + To receive the tracking volume it is possible to also hand over a triple of layers, which is a C++ tuple of three pointers to layer vectors (defined in the ITrackingVolumeBuilder). This functionality is needed for a possible translation of an geometry existing in another format. The first entry represents the layers of the negative endcap, the second the layers of the barrel and the third the layers of the positive endcap. If the one of these pointers is a nullptr no layers will be created for this volume Another functionality needed to translate an already existing geometry is to hand over a volume triple, which is a triple of shared pointers of volumes (defined in the ITrackingVolumeBuilder). The first entry contains the negative endcap volume, the second the barrel volume and the third one the positive endcap volume. This volumes are then used to get the internal boundaries of the current hierarchy. - - @author Andreas.Salzburger@cern.ch + + @author Andreas.Salzburger@cern.ch */ - + class CylinderVolumeBuilder : public ITrackingVolumeBuilder{ public: - /** @struct Config + /** @struct Config Configuration struct for this CylinderVolumeBuilder */ struct Config { + std::shared_ptr<Logger> logger; //!< logging instance std::shared_ptr<ITrackingVolumeHelper> trackingVolumeHelper; //!< the tracking volume creator for container volume creation std::string volumeName; //!< the name of the volume to be created std::vector< double > volumeDimension; //!< The dimensions of the manually created world @@ -74,38 +76,42 @@ namespace Acts { std::shared_ptr<ILayerBuilder> layerBuilder; //!< needed to build layers within the volume double layerEnvelopeR; //!< the envelope covering the potential layers double layerEnvelopeZ; //!< the envelope covering the potential layers - int volumeSignature; //!< the volume signature - }; - + int volumeSignature; //!< the volume signature + + Config(): + logger(getDefaultLogger("CylinderVolumeBuilder",Logging::INFO)) + {} + }; + /** Constructor */ CylinderVolumeBuilder(const Config& cvbConfig); - + /** Destructor */ virtual ~CylinderVolumeBuilder(); - + /** CylinderVolumeBuilder interface method - returns the volumes of Volumes */ TrackingVolumePtr trackingVolume(TrackingVolumePtr insideVolume = nullptr, VolumeBoundsPtr outsideBounds = nullptr, const LayerTriple* layerTriple = nullptr, const VolumeTriple* volumeTriple = nullptr) const override; - + /** Set configuration method */ void setConfiguration(const Config& cvbConfig); - + /** Get configuration method */ - Config getConfiguration() const; - - protected: - /** Configuration struct */ - Config m_config; - + Config getConfiguration() const; + private: - /** analyse the layer setup */ - LayerSetup analyzeLayerSetup(const LayerVector lVector) const; + /** Configuration struct */ + Config m_config; + + const Logger& logger() const {return *m_config.logger;} + /** analyse the layer setup */ + LayerSetup analyzeLayerSetup(const LayerVector lVector) const; }; - - /** Return the configuration object */ + + /** Return the configuration object */ inline CylinderVolumeBuilder::Config CylinderVolumeBuilder::getConfiguration() const { return m_config; } } // end of namespace diff --git a/Core/include/ACTS/Tools/CylinderVolumeHelper.hpp b/Core/include/ACTS/Tools/CylinderVolumeHelper.hpp index 3fbfbe5940b13ee3a308f6204c3ed7bada16749d..a7e8af2a48c7560501bbf2cc59d9188779f80348 100644 --- a/Core/include/ACTS/Tools/CylinderVolumeHelper.hpp +++ b/Core/include/ACTS/Tools/CylinderVolumeHelper.hpp @@ -17,54 +17,58 @@ #include "ACTS/Volumes/BoundarySurfaceFace.hpp" #include "ACTS/Tools/ILayerArrayCreator.hpp" #include "ACTS/Tools/ITrackingVolumeArrayCreator.hpp" +#include "ACTS/Utilities/Logger.hpp" + // STL #include <string> #include <vector> #include <memory> namespace Acts -{ +{ class Layer; class TrackingVolume; class VolumeBounds; class CylinderVolumeBounds; class Material; - + /** @class CylinderVolumeHelper - + The concrete implementation for cylindrical TrackingVolume objects of the ITrackingVolumeCreator interface - + @author Andreas.Salzburger@cern.ch */ - + class CylinderVolumeHelper : public ITrackingVolumeHelper - { + { public: - /** @struct Config + /** @struct Config Configuration struct for this CylinderVolumeHelper */ - struct Config { + struct Config { + std::shared_ptr<Logger> logger; //!< logging instance std::shared_ptr<ILayerArrayCreator> layerArrayCreator; //!< A Tool for coherent LayerArray creation std::shared_ptr<ITrackingVolumeArrayCreator> trackingVolumeArrayCreator; //!< Helper Tool to create TrackingVolume Arrays double passiveLayerThickness; //!< thickness of passive layers int passiveLayerPhiBins; //!< bins in phi for the passive layer - int passiveLayerRzBins; //!< bins in r/z for the passive layer + int passiveLayerRzBins; //!< bins in r/z for the passive layer Config() : - layerArrayCreator(nullptr), + logger(getDefaultLogger("CylinderVolumeHelper",Logging::INFO)), + layerArrayCreator(nullptr), trackingVolumeArrayCreator(nullptr), passiveLayerThickness(1), passiveLayerPhiBins(1), passiveLayerRzBins(100) {} }; - + /** Constructor */ CylinderVolumeHelper(const Config& cvhConfig); - + /** Destructor */ virtual ~CylinderVolumeHelper() = default; - + /** @copydoc ITrackingVolumeCreator::createTrackingVolume(const LayerVector&, std::shared_ptr<const Material> matprop, VolumeBounds*, Transform3D*,bool, const std::string&) const; */ TrackingVolumePtr createTrackingVolume(const LayerVector& layers, std::shared_ptr<Material> matprop, @@ -72,7 +76,7 @@ namespace Acts std::shared_ptr<Transform3D> transform = nullptr, const std::string& volumeName = "UndefinedVolume", BinningType btype = arbitrary) const; - + /** @copydoc ITrackingVolumeCreator::createTrackingVolume(const std::vector<const Layer*>& , std::shared_ptr<const Material>, ,double,double,double,double,bool,const std::string&) const; */ TrackingVolumePtr createTrackingVolume(const LayerVector& layers, @@ -81,7 +85,7 @@ namespace Acts double loc2Min, double loc2Max, const std::string& volumeName = "UndefinedVolume", BinningType btype = arbitrary) const; - + /** @copydoc ITrackingVolumeCreator::createGapTrackingVolume(std::shared_ptr<const Material>, double,double,double,double,int,bool,const std::string&) const; */ TrackingVolumePtr createGapTrackingVolume(std::shared_ptr<Material> matprop, double rMin, double rMax, @@ -89,7 +93,7 @@ namespace Acts unsigned int materialLayers, bool cylinder = true, const std::string& volumeName = "UndefinedVolume") const; - + /** @copydoc ITrackingVolumeCreator::createGaoTrackingVolume(std::shared_ptr<const Material>,,std::vector<double>&,int,bool,const std::string&) const; */ TrackingVolumePtr createGapTrackingVolume(std::shared_ptr<Material> matprop, double rMin, double rMax, @@ -98,21 +102,22 @@ namespace Acts bool cylinder = true, const std::string& volumeName = "UndefinedVolume", BinningType btype = arbitrary) const; - + /** Create a container volumes from sub volumes, input volumes are ordered in R or Z by convention */ TrackingVolumePtr createContainerTrackingVolume(const TrackingVolumeVector& volumes) const; /** Set configuration method */ void setConfiguration(const Config& cvbConfig); - + /** Get configuration method */ - Config getConfiguration() const; + Config getConfiguration() const; protected: /** Configuration object */ - Config m_config; - + Config m_config; + private: + const Logger& logger() const {return *m_config.logger;} /** Private method - it estimates the CylinderBounds and Translation of layers, if given, these are checked against the layer positions/dimensions. */ bool estimateAndCheckDimension(const LayerVector& layers, @@ -122,14 +127,14 @@ namespace Acts double& zMinClean, double& zMaxClean, BinningValue& bValue, BinningType bType = arbitrary) const; - + /** Private method - interglue all volumes contained by a TrackingVolume and set the outside glue volumes in the descriptor */ bool interGlueTrackingVolume(TrackingVolumePtr tVolume, bool rBinned, double rMin, double rMax, double zMin, double zMax) const; - + /** Private method - glue volume to the other -- use trackingVolume helper */ void glueTrackingVolumes(TrackingVolumePtr volumeOne, BoundarySurfaceFace faceOne, @@ -137,14 +142,14 @@ namespace Acts BoundarySurfaceFace faceTwod, double rMin, double rMax, double zMin, double zMax) const; - - + + /** Private method - helper method not to duplicate code */ void addFaceVolumes(TrackingVolumePtr tVolume, Acts::BoundarySurfaceFace bsf, TrackingVolumeVector& vols) const; - - + + /** Private method - helper method to save some code */ LayerPtr createCylinderLayer(double z, double r, @@ -152,18 +157,18 @@ namespace Acts double thickness, int binsPhi, int binsZ) const; - + /** Private method - helper method to save some code */ LayerPtr createDiscLayer(double z, double rMin, double rMax, double thickness, int binsPhi, int binsR) const; - - + + }; - - /** Return the configuration object */ + + /** Return the configuration object */ inline CylinderVolumeHelper::Config CylinderVolumeHelper::getConfiguration() const { return m_config; } } diff --git a/Core/include/ACTS/Tools/LayerArrayCreator.hpp b/Core/include/ACTS/Tools/LayerArrayCreator.hpp index 9b3c31fd73bf0f1a8b2247bbc6be8034f6728974..9397825a9a4d3664a52f6d6f6e6d6ab46a5165b8 100644 --- a/Core/include/ACTS/Tools/LayerArrayCreator.hpp +++ b/Core/include/ACTS/Tools/LayerArrayCreator.hpp @@ -14,6 +14,7 @@ // Core module #include "ACTS/Utilities/Definitions.hpp" +#include "ACTS/Utilities/Logger.hpp" // Geometry module #include "ACTS/Tools/ILayerArrayCreator.hpp" // STL @@ -40,8 +41,19 @@ namespace Acts { class LayerArrayCreator : public ILayerArrayCreator { public: + struct Config + { + std::shared_ptr<Logger> logger; //!< logging instance + + Config(): + logger(getDefaultLogger("LayerArrayCreator",Logging::INFO)) + {} + }; + /** Constructor */ - LayerArrayCreator() = default; + LayerArrayCreator(const Config& c): + m_config(c) + {} /** Destructor */ virtual ~LayerArrayCreator() = default; @@ -54,7 +66,19 @@ namespace Acts { BinningType btype = arbitrary, BinningValue bvalue = binX) const override; - private: + /** Set configuration method */ + void setConfiguration(const Config& c) + { + m_config = c; + } + + /** Get configuration method */ + Config getConfiguration() const {return m_config;} + + private: + const Logger& logger() const {return *m_config.logger;} + + Config m_config; Surface* createNavigationSurface(const Layer& layer, BinningValue bvalue, double offset) const; }; diff --git a/Core/include/ACTS/Tools/LayerCreator.hpp b/Core/include/ACTS/Tools/LayerCreator.hpp index f1f1de1ab796d5e0a614aafa3786a8049b44896b..6d828c88553eafda931ce0fb4a8b45467545543d 100644 --- a/Core/include/ACTS/Tools/LayerCreator.hpp +++ b/Core/include/ACTS/Tools/LayerCreator.hpp @@ -8,6 +8,7 @@ // Geometry module #include "ACTS/Tools/ILayerCreator.hpp" #include "ACTS/Tools/ISurfaceArrayCreator.hpp" +#include "ACTS/Utilities/Logger.hpp" #ifndef ACTS_LAYERCREATOR_TAKESMALLERBIGGER #define ACTS_LAYERCREATOR_TAKESMALLERBIGGER @@ -33,11 +34,12 @@ namespace Acts { /** @struct Config Configuration for the LayerCreator */ struct Config { - + std::shared_ptr<Logger> logger; //!< logging instance std::shared_ptr<ISurfaceArrayCreator> surfaceArrayCreator; //!< geometry tool binning the surfaces into arrays Config() : - surfaceArrayCreator(nullptr) + logger(getDefaultLogger("LayerCreator",Logging::INFO)), + surfaceArrayCreator(nullptr) {} }; /** constructor */ @@ -80,6 +82,7 @@ namespace Acts { /** configuration object */ Config m_config; + const Logger& logger() const {return *m_config.logger;} }; diff --git a/Core/include/ACTS/Tools/PassiveLayerBuilder.hpp b/Core/include/ACTS/Tools/PassiveLayerBuilder.hpp index e6b8d8cbcacc4a3bc7d8b4ef9f615109dc928916..a1ab741bec2ec59a86b6a58d30bedb233a12ba32 100644 --- a/Core/include/ACTS/Tools/PassiveLayerBuilder.hpp +++ b/Core/include/ACTS/Tools/PassiveLayerBuilder.hpp @@ -8,27 +8,28 @@ // Geoemtry module #include "ACTS/Tools/ILayerBuilder.hpp" #include "ACTS/Layers/Layer.hpp" +#include "ACTS/Utilities/Logger.hpp" namespace Acts { - + /** @class PassiveLayerBuilder - + The PassiveLayerBuilder is able to build cylinder & disc layers with given detector - + @TODO Julia: make private tools private again after Gaudi update (bug in Gaudi), marked with //b - + @author Andreas.Salzburger@cern.ch */ - + class PassiveLayerBuilder : public ILayerBuilder { - + public: - /** @struct Config + /** @struct Config Configuration struct for the passive layer builder */ struct Config { - + std::shared_ptr<Logger> logger; //!< logging instance std::string layerIdentification; - + std::vector<double> centralLayerRadii; std::vector<double> centralLayerHalflengthZ; std::vector<double> centralLayerThickness; @@ -37,8 +38,8 @@ namespace Acts { std::vector<double> centralLayerMaterialA; std::vector<double> centralLayerMaterialZ; std::vector<double> centralLayerMaterialRho; - - // the layers at p/e side + + // the layers at p/e side std::vector<double> posnegLayerPositionZ; std::vector<double> posnegLayerRmin; std::vector<double> posnegLayerRmax; @@ -48,23 +49,27 @@ namespace Acts { std::vector<double> posnegLayerMaterialA; std::vector<double> posnegLayerMaterialZ; std::vector<double> posnegLayerMaterialRho; + + Config(): + logger(getDefaultLogger("PassiveLayerBuilder",Logging::INFO)) + {} }; - + /** constructor */ PassiveLayerBuilder(const Config& plConfig); - + /** destructor */ virtual ~PassiveLayerBuilder() = default; - + /** LayerBuilder interface method - returning the layers at negative side */ const LayerVector negativeLayers() const override; - + /** LayerBuilder interface method - returning the central layers */ const LayerVector centralLayers() const override; - + /** LayerBuilder interface method - returning the layers at negative side */ - const LayerVector positiveLayers() const override; - + const LayerVector positiveLayers() const override; + /**ILayerBuilder method*/ const std::string& identification() const override { return m_config.layerIdentification; } @@ -72,31 +77,32 @@ namespace Acts { void setConfiguration(const Config& meConfig); /** Get configuration method */ - Config getConfiguration() const; - + Config getConfiguration() const; + protected: - Config m_config; //!< configuration + Config m_config; //!< configuration private: - + + const Logger& logger() const {return *m_config.logger;} bool constructLayers() const; - + mutable LayerVector m_nLayers; //!< layers on negative side mutable LayerVector m_cLayers; //!< layers on central side mutable LayerVector m_pLayers; //!< layers on positive side - + mutable bool m_constructionFlag; //!< indicator if the layer construction has been done already }; inline PassiveLayerBuilder::Config PassiveLayerBuilder::getConfiguration() const { return m_config; } - + inline const LayerVector PassiveLayerBuilder::positiveLayers() const { if(not m_constructionFlag) constructLayers(); return m_pLayers; } inline const LayerVector PassiveLayerBuilder::negativeLayers() const { if(not m_constructionFlag) constructLayers(); return m_nLayers; } - + inline const LayerVector PassiveLayerBuilder::centralLayers() const { if(not m_constructionFlag) constructLayers(); return m_cLayers; } - + } //end of namespace #endif // ACTS_GEOMETRYTOOLS_PASSIVELAYERBUILDER_H diff --git a/Core/include/ACTS/Tools/SurfaceArrayCreator.hpp b/Core/include/ACTS/Tools/SurfaceArrayCreator.hpp index 731775889026110e39afe161d8bd479ff89acebd..b86782dec01ae7c8ae23788df1f1e45e82868d25 100644 --- a/Core/include/ACTS/Tools/SurfaceArrayCreator.hpp +++ b/Core/include/ACTS/Tools/SurfaceArrayCreator.hpp @@ -9,6 +9,7 @@ #include "ACTS/Utilities/Definitions.hpp" // Geometry module #include "ACTS/Tools/ISurfaceArrayCreator.hpp" +#include "ACTS/Utilities/Logger.hpp" namespace Acts { @@ -30,8 +31,18 @@ namespace Acts { class SurfaceArrayCreator : virtual public ISurfaceArrayCreator { public: + struct Config + { + std::shared_ptr<Logger> logger; //!< logging instance + Config(): + logger(getDefaultLogger("SurfaceArrayCreator",Logging::INFO)) + {} + }; + /** Constructor */ - SurfaceArrayCreator(); + SurfaceArrayCreator(const Config& c): + m_config(c) + {} /** Destructor */ virtual ~SurfaceArrayCreator() = default; @@ -55,7 +66,16 @@ namespace Acts { size_t binsX, size_t binsY, std::shared_ptr<Transform3D> transform = nullptr) const final; + void setConfiguration(const Config& c) {m_config = c;} + + /** Get configuration method */ + Config getConfiguration() const {return m_config;} + private: + /** Configuration struct */ + Config m_config; + const Logger& logger() const {return *m_config.logger;} + void completeBinning(const std::vector<const Surface*>& surfaces, const BinUtility& binUtility, std::vector<SurfacePosition>& sVector, diff --git a/Core/include/ACTS/Tools/TrackingVolumeArrayCreator.hpp b/Core/include/ACTS/Tools/TrackingVolumeArrayCreator.hpp index 67b804a175341360c0da4e36858098f9be2f5853..a31f87719802af4d7b02b3c217b4254a1d9e263e 100644 --- a/Core/include/ACTS/Tools/TrackingVolumeArrayCreator.hpp +++ b/Core/include/ACTS/Tools/TrackingVolumeArrayCreator.hpp @@ -8,6 +8,7 @@ // Core module #include "ACTS/Tools/ITrackingVolumeArrayCreator.hpp" #include "ACTS/Utilities/BinnedArray.hpp" +#include "ACTS/Utilities/Logger.hpp" // STL #include <algorithm> #include "ACTS/Utilities/Definitions.hpp" @@ -31,14 +32,36 @@ namespace Acts { class TrackingVolumeArrayCreator : public ITrackingVolumeArrayCreator { public: + struct Config + { + std::shared_ptr<Logger> logger; //!< logging instance + + Config(): + logger(getDefaultLogger("LayerArrayCreator",Logging::INFO)) + {} + }; + /** Constructor */ - TrackingVolumeArrayCreator() = default; + TrackingVolumeArrayCreator(const Config& c): + m_config(c) + {} /** Destructor */ virtual ~TrackingVolumeArrayCreator() = default; /** create a tracking volume array */ - std::shared_ptr<const TrackingVolumeArray> trackingVolumeArray(const TrackingVolumeVector& vols, BinningValue bVal) const; + std::shared_ptr<const TrackingVolumeArray> trackingVolumeArray(const TrackingVolumeVector& vols, BinningValue bVal) const; + + void setConfiguration(const Config& c) {m_config = c;} + + /** Get configuration method */ + Config getConfiguration() const {return m_config;} + + private: + /** Configuration struct */ + Config m_config; + const Logger& logger() const {return *m_config.logger;} + }; } diff --git a/Core/include/ACTS/Utilities/Logger.hpp b/Core/include/ACTS/Utilities/Logger.hpp new file mode 100644 index 0000000000000000000000000000000000000000..fe2e0a72ef70970ff59b33f7a1b4f0456c4385e8 --- /dev/null +++ b/Core/include/ACTS/Utilities/Logger.hpp @@ -0,0 +1,262 @@ +#ifndef ACTS_LOGGER_H +#define ACTS_LOGGER_H 1 + +// STL include(s) +#include <sstream> +#include <cstdio> +#include <ios> +#include <iomanip> +#include <ctime> +#include <string> +#include <functional> +#include <ostream> +#include <memory> +#include <thread> + +#define ACTS_VERBOSE(x) if(logger().print(Acts::Logging::VERBOSE)) logger().log(Acts::Logging::VERBOSE) << x; +#define ACTS_DEBUG(x) if(logger().print(Acts::Logging::DEBUG) ) logger().log(Acts::Logging::DEBUG) << x; +#define ACTS_INFO(x) if(logger().print(Acts::Logging::INFO) ) logger().log(Acts::Logging::INFO) << x; +#define ACTS_WARNING(x) if(logger().print(Acts::Logging::WARNING)) logger().log(Acts::Logging::WARNING) << x; +#define ACTS_ERROR(x) if(logger().print(Acts::Logging::ERROR) ) logger().log(Acts::Logging::ERROR) << x; +#define ACTS_FATAL(x) if(logger().print(Acts::Logging::FATAL) ) logger().log(Acts::Logging::FATAL) << x; + +namespace Acts +{ + /** + * @brief logging related helper classes + */ + namespace Logging + { + /** + * @enum Level + * + * @brief different logging levels + */ + enum Level {VERBOSE = 0, DEBUG, INFO, WARNING, ERROR, FATAL}; + + /** + * @brief abstract base class for logging output policy + */ + class OutputPolicy + { + public: + virtual ~OutputPolicy() = default; + + virtual void flush(const Level& lvl,const std::ostringstream& input) = 0; + }; + + /** + * @brief abstract base class for logging printing policy + */ + class PrintPolicy + { + public: + virtual ~PrintPolicy() = default; + + virtual bool doPrint(const Level& lvl) const = 0; + }; + + /** + * @brief thread-safe output stream + */ + class OutStream + { + typedef std::function<void(const std::ostringstream&)> OutputFunc; + public: + OutStream(OutputFunc output): + m_stream(), + m_outputFunctor(output) + {} + + OutStream(const OutStream& copy): + m_stream(), + m_outputFunctor(copy.m_outputFunctor) + { + m_stream << copy.m_stream.str(); + } + + ~OutStream() + { + m_outputFunctor(m_stream); + } + + template<typename T> + OutStream& operator<<(T&& input) + { + m_stream << std::forward<T>(input); + return *this; + } + + template<typename T> + OutStream& operator<<(T& (*f)(T&)) + { + f(m_stream); + return *this; + } + + private: + std::ostringstream m_stream; + OutputFunc m_outputFunctor; + }; + + class DefaultPrintPolicy: public PrintPolicy + { + public: + DefaultPrintPolicy(const Level& lvl): + m_level(lvl) + {} + + bool doPrint(const Level& lvl) const override {return m_level <= lvl;} + + private: + Level m_level; + }; + + class OutputDecorator: public OutputPolicy + { + public: + OutputDecorator(std::unique_ptr<OutputPolicy> wrappee): + m_wrappee(std::move(wrappee)) + {} + + void flush(const Level& lvl,const std::ostringstream& input) override + { + m_wrappee->flush(lvl,input); + } + + private: + std::unique_ptr<OutputPolicy> m_wrappee; + }; + + class NamedOutputDecorator final : public OutputDecorator + { + public: + NamedOutputDecorator(std::unique_ptr<OutputPolicy> wrappee,const std::string& name,unsigned int maxWidth=15): + OutputDecorator(std::move(wrappee)), + m_name(name), + m_maxWidth(maxWidth) + {} + + void flush(const Level& lvl,const std::ostringstream& input) override + { + std::ostringstream os; + os << std::left << std::setw(m_maxWidth) << m_name.substr(0,m_maxWidth - 3) << input.str(); + OutputDecorator::flush(lvl,os); + } + + private: + std::string m_name; + unsigned int m_maxWidth; + }; + + class TimedOutputDecorator final : public OutputDecorator + { + public: + TimedOutputDecorator(std::unique_ptr<OutputPolicy> wrappee,const std::string& format = "%X"): + OutputDecorator(std::move(wrappee)), + m_format(format) + {} + + void flush(const Level& lvl,const std::ostringstream& input) override + { + std::ostringstream os; + os << std::left << std::setw(12) << now() << input.str(); + OutputDecorator::flush(lvl,os); + } + + private: + std::string now() const + { + char buffer[20]; + time_t t; + std::time(&t); + std::strftime(buffer, sizeof(buffer), m_format.c_str(), localtime(&t)); + return buffer; + } + + std::string m_format; + }; + + class ThreadOutputDecorator final : public OutputDecorator + { + public: + ThreadOutputDecorator(std::unique_ptr<OutputPolicy> wrappee): + OutputDecorator(std::move(wrappee)) + {} + + void flush(const Level& lvl,const std::ostringstream& input) override + { + std::ostringstream os; + os << std::left << std::setw(20) << std::this_thread::get_id() << input.str(); + OutputDecorator::flush(lvl,os); + } + }; + + class LevelOutputDecorator final : public OutputDecorator + { + public: + LevelOutputDecorator(std::unique_ptr<OutputPolicy> wrappee): + OutputDecorator(std::move(wrappee)) + {} + + void flush(const Level& lvl,const std::ostringstream& input) override + { + std::ostringstream os; + os << std::left << std::setw(10) << toString(lvl) << input.str(); + OutputDecorator::flush(lvl,os); + } + + private: + std::string toString(const Level& lvl) const + { + static const char* const buffer[] = {"VERBOSE", "DEBUG", "INFO", "WARNING", "ERROR", "FATAL"}; + return buffer[lvl]; + } + }; + + class DefaultOutputPolicy: public OutputPolicy + { + public: + DefaultOutputPolicy(std::FILE* out = stdout): + m_out(out) + {} + + void flush(const Level&,const std::ostringstream& input) final + { + fprintf(m_out, "%s\n", input.str().c_str()); + fflush(m_out); + } + + private: + std::FILE* m_out; + }; + } // end of namespace Logging + + /** + * @brief logging class + */ + class Logger + { + public: + template<typename Output,typename Print> + Logger(std::unique_ptr<Output> pOutput,std::unique_ptr<Print> pPrint): + m_outputPolicy(std::move(pOutput)), + m_printPolicy(std::move(pPrint)) + {} + + bool print(const Logging::Level& lvl) const {return m_printPolicy->doPrint(lvl);} + + Logging::OutStream log(const Logging::Level& lvl) const + { + return Logging::OutStream(std::bind(&Logging::OutputPolicy::flush,m_outputPolicy.get(),lvl,std::placeholders::_1)); + } + + private: + std::unique_ptr<Logging::OutputPolicy> m_outputPolicy; + std::unique_ptr<Logging::PrintPolicy> m_printPolicy; + }; + + std::unique_ptr<Logger> getDefaultLogger(const std::string& name,const Logging::Level& lvl); +} // end of namespace Acts + +#endif // ACTS_LOGGER_H diff --git a/Core/src/Tools/CylinderGeometryBuilder.cpp b/Core/src/Tools/CylinderGeometryBuilder.cpp index c79df92746da9b6d7f74d070c4f375f447d3c776..ca8e00b59cd9a033259006cad829014a774b1e3a 100644 --- a/Core/src/Tools/CylinderGeometryBuilder.cpp +++ b/Core/src/Tools/CylinderGeometryBuilder.cpp @@ -12,17 +12,17 @@ // constructor Acts::CylinderGeometryBuilder::CylinderGeometryBuilder(const Acts::CylinderGeometryBuilder::Config& cgbConfig): m_config() -{ - setConfiguration(cgbConfig); +{ + setConfiguration(cgbConfig); } // configuration void Acts::CylinderGeometryBuilder::setConfiguration(const Acts::CylinderGeometryBuilder::Config& cgbConfig) { - // @TODO check consistency - // copy the configuration + // @TODO check consistency + // copy the configuration m_config = cgbConfig; -} +} std::unique_ptr<Acts::TrackingGeometry> Acts::CylinderGeometryBuilder::trackingGeometry() const { @@ -39,7 +39,7 @@ std::unique_ptr<Acts::TrackingGeometry> Acts::CylinderGeometryBuilder::trackingG // see if the beampipe needs to be wrapped if (m_config.beamPipeBuilder && m_config.trackingVolumeHelper){ // some screen output - // MSG_DEBUG("BeamPipe is being built and inserted."); + ACTS_DEBUG("BeamPipe is being built and inserted."); // cast to cylinder volume bounds const CylinderVolumeBounds* cvB = dynamic_cast<const CylinderVolumeBounds*>(&(highestVolume->volumeBounds())); if (cvB){ @@ -54,8 +54,8 @@ std::unique_ptr<Acts::TrackingGeometry> Acts::CylinderGeometryBuilder::trackingG } } // create the TrackingGeoemtry - trackingGeometry.reset(new Acts::TrackingGeometry(highestVolume)); + trackingGeometry.reset(new Acts::TrackingGeometry(highestVolume)); } // return the geometry to the service return trackingGeometry; -} +} diff --git a/Core/src/Tools/CylinderVolumeBuilder.cpp b/Core/src/Tools/CylinderVolumeBuilder.cpp index 0eb649f7ed48d7b41dea059e0403edf533305692..fd58b4689ccb267dc0d4e25146706864bf978d23 100644 --- a/Core/src/Tools/CylinderVolumeBuilder.cpp +++ b/Core/src/Tools/CylinderVolumeBuilder.cpp @@ -19,7 +19,7 @@ Acts::CylinderVolumeBuilder::CylinderVolumeBuilder(const Acts::CylinderVolumeBui m_config() { setConfiguration(cvbConfig); -} +} // destructor Acts::CylinderVolumeBuilder::~CylinderVolumeBuilder() @@ -27,10 +27,10 @@ Acts::CylinderVolumeBuilder::~CylinderVolumeBuilder() // configuration void Acts::CylinderVolumeBuilder::setConfiguration(const Acts::CylinderVolumeBuilder::Config& cvbConfig) { - // @TODO check consistency - // copy the configuration + // @TODO check consistency + // copy the configuration m_config = cvbConfig; -} +} std::shared_ptr<const Acts::TrackingVolume> Acts::CylinderVolumeBuilder::trackingVolume(TrackingVolumePtr insideVolume, VolumeBoundsPtr outsideBounds, @@ -42,8 +42,8 @@ std::shared_ptr<const Acts::TrackingVolume> Acts::CylinderVolumeBuilder::trackin // used throughout TrackingVolumePtr nEndcap = nullptr; TrackingVolumePtr barrel = nullptr; - TrackingVolumePtr pEndcap = nullptr; - + TrackingVolumePtr pEndcap = nullptr; + // get the full extend double volumeRmin = 10e10; double volumeRmax = -10e10; @@ -82,13 +82,13 @@ std::shared_ptr<const Acts::TrackingVolume> Acts::CylinderVolumeBuilder::trackin double layerZmax = 0.; // possbile configurations are: // - // 111 - all layers present + // 111 - all layers present // 010 - central layers present - // 0 - no layers present + // 0 - no layers present int layerConfiguration = 0; if (nLayerSetup) { - // negative layers are present - // MSG_DEBUG("Negative layers are present with r(min,max) / z(min,max) = " << nLayerSetup.rBoundaries << " / " << nLayerSetup.zBoundaries ); + // negative layers are present + //ACTS_DEBUG("Negative layers are present with r(min,max) / z(min,max) = " << nLayerSetup.rBoundaries << " / " << nLayerSetup.zBoundaries ); takeSmaller(layerRmin,nLayerSetup.rBoundaries.first); takeBigger(layerRmax,nLayerSetup.rBoundaries.second); takeBigger(layerZmax,fabs(nLayerSetup.zBoundaries.first)); @@ -97,7 +97,7 @@ std::shared_ptr<const Acts::TrackingVolume> Acts::CylinderVolumeBuilder::trackin } if (cLayerSetup) { // central layers are present - // MSG_DEBUG("Central layers are present with r(min,max) / z(min,max) = " << cLayerSetup.rBoundaries << " / " << cLayerSetup.zBoundaries << " layerRmin: " << layerRmin << " layerEnvelopeR: " << m_config.layerEnvelopeR); + //ACTS_DEBUG("Central layers are present with r(min,max) / z(min,max) = " << cLayerSetup.rBoundaries << " / " << cLayerSetup.zBoundaries << " layerRmin: " << layerRmin << " layerEnvelopeR: " << m_config.layerEnvelopeR); takeSmaller(layerRmin,cLayerSetup.rBoundaries.first); takeBigger(layerRmax,cLayerSetup.rBoundaries.second); takeBigger(layerZmax,fabs(cLayerSetup.zBoundaries.first)); @@ -106,8 +106,8 @@ std::shared_ptr<const Acts::TrackingVolume> Acts::CylinderVolumeBuilder::trackin layerConfiguration += 10; } if (pLayerSetup) { - // positive layers are present - // MSG_DEBUG("Positive layers are present with r(min,max) / z(min,max) = " << pLayerSetup.rBoundaries << " / " << pLayerSetup.zBoundaries << " layerRmin: " << layerRmin << " layerEnvelopeR: " << m_config.layerEnvelopeR); + // positive layers are present + //ACTS_DEBUG("Positive layers are present with r(min,max) / z(min,max) = " << pLayerSetup.rBoundaries << " / " << pLayerSetup.zBoundaries << " layerRmin: " << layerRmin << " layerEnvelopeR: " << m_config.layerEnvelopeR); takeSmaller(layerRmin,pLayerSetup.rBoundaries.first); takeBigger(layerRmax,pLayerSetup.rBoundaries.second); takeBigger(layerZmax,pLayerSetup.zBoundaries.second); @@ -115,82 +115,82 @@ std::shared_ptr<const Acts::TrackingVolume> Acts::CylinderVolumeBuilder::trackin layerConfiguration += 1; } if (layerConfiguration) { - // MSG_DEBUG("Layer configuration estimated as " << layerConfiguration << " with r(min,max) / z(min,max) = " << + ACTS_DEBUG("Layer configuration estimated as " << layerConfiguration << " with r(min,max) / z(min,max) = "); } else { - // MSG_DEBUG("No layers present in this setup." ); + ACTS_DEBUG("No layers present in this setup." ); } - + // the inside volume dimensions ------------------------------------------------------------------ double insideVolumeRmin = 0.; double insideVolumeRmax = 0.; double insideVolumeZmax = 0.; if (insideVolume){ - // cast to cylinder volume - const CylinderVolumeBounds* icvBounds = + // cast to cylinder volume + const CylinderVolumeBounds* icvBounds = dynamic_cast<const CylinderVolumeBounds*>(&(insideVolume->volumeBounds())); // cylindrical volume bounds are there - if (icvBounds){ + if (icvBounds){ // the outer radius of the inner volume insideVolumeRmin = icvBounds->innerRadius(); insideVolumeRmax = icvBounds->outerRadius(); insideVolumeZmax = insideVolume->center().z()+icvBounds->halflengthZ(); - // MSG_VERBOSE("Inner CylinderVolumeBounds provided from external builder, rMin/rMax/zMax = " << insideVolumeRmin << ", " << insideVolumeRmax << ", " << insideVolumeZmax); + ACTS_VERBOSE("Inner CylinderVolumeBounds provided from external builder, rMin/rMax/zMax = " << insideVolumeRmin << ", " << insideVolumeRmax << ", " << insideVolumeZmax); } else { // we need to bail out, the given volume is not cylindrical - // MSG_ERROR("Given volume to wrap was not cylindrical. Bailing out."); - // cleanup teh memory + ACTS_ERROR("Given volume to wrap was not cylindrical. Bailing out."); + // cleanup teh memory negativeLayers.clear(); centralLayers.clear(); positiveLayers.clear(); // return a null pointer, upstream builder will have to understand this return nullptr; } } - // -------------------- outside boundary conditions -------------------------------------------------- - //check if we have outsideBounds + // -------------------- outside boundary conditions -------------------------------------------------- + //check if we have outsideBounds if (outsideBounds){ const CylinderVolumeBounds* ocvBounds = dynamic_cast<const CylinderVolumeBounds*>(outsideBounds.get()); // the cast to CylinderVolumeBounds needs to be successful if (ocvBounds){ - // get values from the out bounds + // get values from the out bounds volumeRmin = ocvBounds->innerRadius(); volumeRmax = ocvBounds->outerRadius(); volumeZmax = ocvBounds->halflengthZ(); - // MSG_VERBOSE("Outer CylinderVolumeBounds provided from external builder, rMin/rMax/zMax = " << volumeRmin << ", " << volumeRmax << ", " << volumeZmax); + ACTS_VERBOSE("Outer CylinderVolumeBounds provided from external builder, rMin/rMax/zMax = " << volumeRmin << ", " << volumeRmax << ", " << volumeZmax); } else { - // MSG_ERROR("Non-cylindrical bounds given to the CylinderVolumeBuilder. Bailing out."); - // cleanup teh memory + ACTS_ERROR("Non-cylindrical bounds given to the CylinderVolumeBuilder. Bailing out."); + // cleanup teh memory negativeLayers.clear(); centralLayers.clear(); positiveLayers.clear(); // return a null pointer, upstream builder will have to understand this return nullptr; } - // check if the outside bounds cover all the layers + // check if the outside bounds cover all the layers if (layerConfiguration && (volumeRmin > layerRmin || volumeRmax < layerRmax || volumeZmax < layerZmax)){ - // MSG_ERROR("Given layer dimensions do not fit inside the provided volume bounds. Bailing out." << " volumeRmin: " << volumeRmin << " volumeRmax: " << volumeRmax << " layerRmin: " << layerRmin << " layerRmax: " << layerRmax << " volumeZmax: " << volumeZmax << " layerZmax: " << layerZmax); - // cleanup teh memory + ACTS_ERROR("Given layer dimensions do not fit inside the provided volume bounds. Bailing out." << " volumeRmin: " << volumeRmin << " volumeRmax: " << volumeRmax << " layerRmin: " << layerRmin << " layerRmax: " << layerRmax << " volumeZmax: " << volumeZmax << " layerZmax: " << layerZmax); + // cleanup teh memory negativeLayers.clear(); centralLayers.clear(); positiveLayers.clear(); // return a null pointer, upstream builder will have to understand this - return nullptr; + return nullptr; } } else if (m_config.volumeDimension.size() > 2) { // cylinder volume - // get values from the out bounds + // get values from the out bounds volumeRmin = m_config.volumeDimension.at(0); volumeRmax = m_config.volumeDimension.at(1); volumeZmax = m_config.volumeDimension.at(2); - // MSG_VERBOSE("Outer CylinderVolumeBounds provided by configuration, rMin/rMax/zMax = " << volumeRmin << ", " << volumeRmax << ", " << volumeZmax); - + ACTS_VERBOSE("Outer CylinderVolumeBounds provided by configuration, rMin/rMax/zMax = " << volumeRmin << ", " << volumeRmax << ", " << volumeZmax); + } else { // outside dimensions will have to be determined by the layer dimensions volumeRmin = m_config.volumeToBeamPipe ? 0. : layerRmin - m_config.layerEnvelopeR; volumeRmax = layerRmax + m_config.layerEnvelopeR; volumeZmax = layerZmax + m_config.layerEnvelopeZ; - // from setup - // MSG_VERBOSE("Outer CylinderVolumeBounds estimated from layer setup, rMin/rMax/zMax = " << volumeRmin << ", " << volumeRmax << ", " << volumeZmax); + // from setup + ACTS_VERBOSE("Outer CylinderVolumeBounds estimated from layer setup, rMin/rMax/zMax = " << volumeRmin << ", " << volumeRmax << ", " << volumeZmax); } - // -------------------- analyse the layer setups -------------------------------------------------- + // -------------------- analyse the layer setups -------------------------------------------------- TrackingVolumePtr negativeSector = nullptr; TrackingVolumePtr centralSector = nullptr; TrackingVolumePtr positiveSector = nullptr; - + // wrapping condition // 0 - no wrapping // 1 - wrap central barrel plus endcap volumes around inside volume @@ -203,7 +203,7 @@ std::shared_ptr<const Acts::TrackingVolume> Acts::CylinderVolumeBuilder::trackin //check if layers are present if (layerConfiguration){ // screen output - // MSG_DEBUG("Building Volume from layer configuration."); + ACTS_DEBUG("Building Volume from layer configuration."); // barrel configuration double barrelRmin = 0.; double barrelRmax = 0.; @@ -223,9 +223,9 @@ std::shared_ptr<const Acts::TrackingVolume> Acts::CylinderVolumeBuilder::trackin barrelRmin = barrelBounds->innerRadius(); barrelRmax = barrelBounds->outerRadius(); barrelZmax = barrelVolume->center().z() + barrelBounds->halflengthZ(); - // MSG_VERBOSE("Outer Barrel bounds provided by configuration, rMin/rMax/zMax = " << barrelRmin << ", " << barrelRmax << ", " << barrelZmax); - } else - // MSG_ERROR("No Barrel volume given for current hierarchy!"); + ACTS_VERBOSE("Outer Barrel bounds provided by configuration, rMin/rMax/zMax = " << barrelRmin << ", " << barrelRmax << ", " << barrelZmax); + } else + ACTS_ERROR("No Barrel volume given for current hierarchy!"); //check if end cap volumes are provided if (endcapVolume) { const CylinderVolumeBounds* endcapBounds = dynamic_cast<const CylinderVolumeBounds*>(&(endcapVolume->volumeBounds())); @@ -233,7 +233,7 @@ std::shared_ptr<const Acts::TrackingVolume> Acts::CylinderVolumeBuilder::trackin endcapRmax = endcapBounds->outerRadius(); endcapZmin = fabs(endcapVolume->center().z())-endcapBounds->halflengthZ(); endcapZmax = fabs(endcapVolume->center().z())+endcapBounds->halflengthZ(); - // MSG_VERBOSE("Outer Endcap bounds provided by configuration, rMin/rMax/zMin/zMax = " << endcapRmin << ", " << endcapRmax << ", " << endcapZmin << ", " << endcapZmax); + ACTS_VERBOSE("Outer Endcap bounds provided by configuration, rMin/rMax/zMin/zMax = " << endcapRmin << ", " << endcapRmax << ", " << endcapZmin << ", " << endcapZmax); } //now set the wrapping condition // wrapping condition can only be set if there's an inside volume @@ -247,7 +247,7 @@ std::shared_ptr<const Acts::TrackingVolume> Acts::CylinderVolumeBuilder::trackin if (insideVolume){ if (insideVolumeRmax > volumeRmax || insideVolumeZmax > volumeZmax) { // we need to bail out, the given volume does not fit around the other - // MSG_ERROR("Given layer dimensions do not fit around the provided inside volume. Bailing out." << "insideVolumeRmax: " << insideVolumeRmax << " layerRmin: " << layerRmin); + ACTS_ERROR("Given layer dimensions do not fit around the provided inside volume. Bailing out." << "insideVolumeRmax: " << insideVolumeRmax << " layerRmin: " << layerRmin); // cleanup teh memory negativeLayers.clear(); centralLayers.clear(); positiveLayers.clear(); // return a null pointer, upstream builder will have to understand this @@ -289,19 +289,19 @@ std::shared_ptr<const Acts::TrackingVolume> Acts::CylinderVolumeBuilder::trackin endcapRmax = volumeRmax; endcapZmin = barrelZmax; endcapZmax = volumeZmax; - + } }//else - no volume bounds given from translation - - + + // the barrel is created barrel = m_config.trackingVolumeHelper->createTrackingVolume(centralLayers, m_config.volumeMaterial, barrelRmin, barrelRmax, -barrelZmax, barrelZmax, m_config.volumeName+"::Barrel"); - - + + // the negative endcap is created nEndcap = !negativeLayers.empty() ? m_config.trackingVolumeHelper->createTrackingVolume(negativeLayers, @@ -309,7 +309,7 @@ std::shared_ptr<const Acts::TrackingVolume> Acts::CylinderVolumeBuilder::trackin endcapRmin, endcapRmax, -endcapZmax, -endcapZmin, m_config.volumeName+"::NegativeEndcap") : nullptr; - + // the positive endcap is created pEndcap = !positiveLayers.empty() ? m_config.trackingVolumeHelper->createTrackingVolume(positiveLayers, @@ -317,8 +317,8 @@ std::shared_ptr<const Acts::TrackingVolume> Acts::CylinderVolumeBuilder::trackin endcapRmin, endcapRmax, endcapZmin, endcapZmax, m_config.volumeName+"::PositiveEndcap") : nullptr; - - + + // no wrapping condition if (wrappingCondition == 0){ // we have endcap volumes @@ -327,7 +327,7 @@ std::shared_ptr<const Acts::TrackingVolume> Acts::CylinderVolumeBuilder::trackin volume = m_config.trackingVolumeHelper->createContainerTrackingVolume({nEndcap, barrel, pEndcap}); } else // just take the barrel as the return value volume = barrel; - + } else if (wrappingCondition == 1) { // a new barrel sector volume = m_config.trackingVolumeHelper->createContainerTrackingVolume({nEndcap, barrel, pEndcap}); @@ -351,7 +351,7 @@ std::shared_ptr<const Acts::TrackingVolume> Acts::CylinderVolumeBuilder::trackin } // update the volume volume = m_config.trackingVolumeHelper->createContainerTrackingVolume({insideVolume, volume}); - + } else if (wrappingCondition == 2){ //create gap volumes if needed if (barrelZmax>insideVolumeZmax) { @@ -361,7 +361,7 @@ std::shared_ptr<const Acts::TrackingVolume> Acts::CylinderVolumeBuilder::trackin -barrelZmax,-insideVolumeZmax, 1, false, m_config.volumeName+"::InnerNegativeGap"); - + auto piGap = m_config.trackingVolumeHelper->createGapTrackingVolume(m_config.volumeMaterial, insideVolumeRmin, volumeRmin, insideVolumeZmax, barrelZmax, @@ -376,7 +376,7 @@ std::shared_ptr<const Acts::TrackingVolume> Acts::CylinderVolumeBuilder::trackin } } else if (outsideBounds){ // screen output - // MSG_DEBUG("Building Volume without layer configuration."); + ACTS_DEBUG("Building Volume without layer configuration."); if (insideVolume && outsideBounds){ // the barrel is created barrel = m_config.trackingVolumeHelper->createTrackingVolume({}, @@ -403,12 +403,12 @@ std::shared_ptr<const Acts::TrackingVolume> Acts::CylinderVolumeBuilder::trackin // pack into a the container volume = m_config.trackingVolumeHelper->createContainerTrackingVolume({nEndcap, barrel, pEndcap}); } - + } else volume = TrackingVolume::create(nullptr, outsideBounds, m_config.volumeMaterial); - + } else { - // MSG_ERROR("Neither layer configuration nor volume bounds given. Bailing out."); + ACTS_ERROR("Neither layer configuration nor volume bounds given. Bailing out."); } // sign the volume volume->sign(GeometrySignature(m_config.volumeSignature)); @@ -426,7 +426,7 @@ Acts::LayerSetup Acts::CylinderVolumeBuilder::analyzeLayerSetup(const LayerVecto for (auto& layer : lVector){ // the thickness of the layer needs to be taken into account double thickness = layer->thickness(); - // get the center of the layer + // get the center of the layer const Vector3D& center = layer->surfaceRepresentation().center(); // check if it is a cylinder layer const CylinderLayer* cLayer = dynamic_cast<const CylinderLayer*>(layer.get()); @@ -459,6 +459,6 @@ Acts::LayerSetup Acts::CylinderVolumeBuilder::analyzeLayerSetup(const LayerVecto //!< @TODO check for Ring setup } } - } + } return lSetup; -} +} diff --git a/Core/src/Tools/CylinderVolumeHelper.cpp b/Core/src/Tools/CylinderVolumeHelper.cpp index 226cf5f058f8cfe2d6b031e5662245cfebbfe317..a5597a0092eeeb96b240c0f40be69061545d476d 100644 --- a/Core/src/Tools/CylinderVolumeHelper.cpp +++ b/Core/src/Tools/CylinderVolumeHelper.cpp @@ -31,10 +31,10 @@ Acts::CylinderVolumeHelper::CylinderVolumeHelper(const Acts::CylinderVolumeHelpe // configuration void Acts::CylinderVolumeHelper::setConfiguration(const Acts::CylinderVolumeHelper::Config& cvhConfig) { - // @TODO check consistency - // copy the configuration + // @TODO check consistency + // copy the configuration m_config = cvhConfig; -} +} std::shared_ptr<const Acts::TrackingVolume> Acts::CylinderVolumeHelper::createTrackingVolume(const LayerVector& layers, std::shared_ptr<Material> matprop, @@ -59,7 +59,7 @@ std::shared_ptr<const Acts::TrackingVolume> Acts::CylinderVolumeHelper::createTr if (volBounds) { cylinderBounds = dynamic_cast<const CylinderVolumeBounds*>(volBounds.get()); if (!cylinderBounds){ - // MSG_WARNING( "[!] Problem: given bounds are not cylindrical - return nullptr" ); + ACTS_WARNING( "[!] Problem: given bounds are not cylindrical - return nullptr" ); return tVolume; } } @@ -80,7 +80,7 @@ std::shared_ptr<const Acts::TrackingVolume> Acts::CylinderVolumeHelper::createTr zMinRaw,zMaxRaw, bValue, bType)) { - // MSG_WARNING( "[!] Problem with given dimensions - return nullptr and delete provided objects" ); + ACTS_WARNING( "[!] Problem with given dimensions - return nullptr and delete provided objects" ); // delete if newly created bounds if (volBounds == nullptr) delete cylinderBounds; return tVolume; @@ -94,7 +94,7 @@ std::shared_ptr<const Acts::TrackingVolume> Acts::CylinderVolumeHelper::createTr double rMin = cylinderBounds->innerRadius(); double rMax = cylinderBounds->outerRadius(); - // MSG_VERBOSE("Filling the layers into an appropriate layer array - with binningValue = " << bValue); + ACTS_VERBOSE("Filling the layers into an appropriate layer array - with binningValue = " << bValue); // create the Layer Array layerArray = (bValue == binR) ? m_config.layerArrayCreator->layerArray(layers, rMin, rMax, bType, bValue) : @@ -113,8 +113,8 @@ std::shared_ptr<const Acts::TrackingVolume> Acts::CylinderVolumeHelper::createTr {}, {}, {}, volumeName); // screen output - // MSG_VERBOSE( "Created cylindrical volume at z-position :" << tVolume->center().z() ); - // MSG_VERBOSE( " created bounds : " << tVolume->volumeBounds() ); + ACTS_VERBOSE( "Created cylindrical volume at z-position :" << tVolume->center().z() ); + ACTS_VERBOSE( " created bounds : " << tVolume->volumeBounds() ); // return the constructed TrackingVolume return tVolume; } @@ -131,16 +131,16 @@ std::shared_ptr<const Acts::TrackingVolume> Acts::CylinderVolumeHelper::createTr CylinderVolumeBounds* cBounds = nullptr; // screen output - // MSG_VERBOSE( "Create cylindrical TrackingVolume '" << volumeName << "'."); - // MSG_VERBOSE( " -> with given dimensions of (rMin/rMax/zMin/Max) = " - // << rMin << " / " << rMax << " / " << zMin << " / " << zMax ); + ACTS_VERBOSE( "Create cylindrical TrackingVolume '" << volumeName << "'."); + ACTS_VERBOSE( " -> with given dimensions of (rMin/rMax/zMin/Max) = " + << rMin << " / " << rMax << " / " << zMin << " / " << zMax ); // check for consistency if (zMin > zMax || rMin > rMax) { - // MSG_WARNING( "Inconsistent dimensions given :" - // << ( ( zMin > zMax ) ? " zMin > zMax (" : " rMin > rMax (" ) - // << ( ( zMin > zMax ) ? zMin : rMin ) << " > " - // << ( ( zMin > zMax ) ? zMax : rMax ) << " ) - return 0" ); + ACTS_WARNING( "Inconsistent dimensions given :" + << ( ( zMin > zMax ) ? " zMin > zMax (" : " rMin > rMax (" ) + << ( ( zMin > zMax ) ? zMin : rMin ) << " > " + << ( ( zMin > zMax ) ? zMax : rMax ) << " ) - return 0" ); return nullptr; } @@ -170,8 +170,8 @@ std::shared_ptr<const Acts::TrackingVolume> Acts::CylinderVolumeHelper::createGa { // screen output - // MSG_VERBOSE( "Create cylindrical gap TrackingVolume '" << volumeName << "' with (rMin/rMax/zMin/Max) = "); - // MSG_VERBOSE( '\t' << rMin << " / " << rMax << " / " << zMin << " / " << zMax ); + ACTS_VERBOSE( "Create cylindrical gap TrackingVolume '" << volumeName << "' with (rMin/rMax/zMin/Max) = "); + ACTS_VERBOSE( '\t' << rMin << " / " << rMax << " / " << zMin << " / " << zMax ); // assing min/max double min = cylinder ? rMin : zMin; @@ -202,8 +202,8 @@ std::shared_ptr<const Acts::TrackingVolume> Acts::CylinderVolumeHelper::createGa { // screen output - // MSG_VERBOSE( "Create cylindrical gap TrackingVolume '" << volumeName << "' with (rMin/rMax/zMin/Max) = "); - // MSG_VERBOSE( '\t' << rMin << " / " << rMax << " / " << zMin << " / " << zMax ); + ACTS_VERBOSE( "Create cylindrical gap TrackingVolume '" << volumeName << "' with (rMin/rMax/zMin/Max) = "); + ACTS_VERBOSE( '\t' << rMin << " / " << rMax << " / " << zMin << " / " << zMax ); // create the layers LayerVector layers; @@ -253,21 +253,21 @@ std::shared_ptr<const Acts::TrackingVolume> Acts::CylinderVolumeHelper::createCo { // check if you have more than one volume if (volumes.size() <= (size_t)1) { - // MSG_WARNING( "None (only one) TrackingVolume given to create container volume (min required: 2) - returning 0 " ); + ACTS_WARNING( "None (only one) TrackingVolume given to create container volume (min required: 2) - returning 0 " ); return nullptr; } // screen output std::string volumeName = "{ "; - // MSG_VERBOSE( "[start] Creating a container volume with " << volumes.size() << " sub volumes:" ); + ACTS_VERBOSE( "[start] Creating a container volume with " << volumes.size() << " sub volumes:" ); // volumes need to be sorted in either r or z - both increasing // set the iterator to the volumes, the first and the end auto firstVolume = volumes.begin(); auto lastVolume = volumes.end(); for (size_t ivol=0 ; firstVolume != lastVolume; ++firstVolume, ++ivol) { - // MSG_VERBOSE( " - volume (" << ivol << ") is : " << (*firstVolume)->volumeName() ); - // MSG_VERBOSE( " at position : " << toString((*firstVolume)->center()) ); - // MSG_VERBOSE( " with bounds : " << (*firstVolume)->volumeBounds() ); + ACTS_VERBOSE( " - volume (" << ivol << ") is : " << (*firstVolume)->volumeName() ); + //ACTS_VERBOSE( " at position : " << toString((*firstVolume)->center()) ); + ACTS_VERBOSE( " with bounds : " << (*firstVolume)->volumeBounds() ); // put the name together volumeName += (*firstVolume)->volumeName(); if (ivol+1 < volumes.size()) volumeName += " | "; @@ -280,7 +280,7 @@ std::shared_ptr<const Acts::TrackingVolume> Acts::CylinderVolumeHelper::createCo --lastVolume; // set to the last volume if (firstVolume == lastVolume) { - // MSG_WARNING( "Only one TrackingVolume given to create Top level volume (min required: 2) - returning 0 " ); + ACTS_WARNING( "Only one TrackingVolume given to create Top level volume (min required: 2) - returning 0 " ); return nullptr; } @@ -291,7 +291,7 @@ std::shared_ptr<const Acts::TrackingVolume> Acts::CylinderVolumeHelper::createCo dynamic_cast<const CylinderVolumeBounds*>(&((*lastVolume)->volumeBounds())); // check the dynamic cast if (!firstVolumeBounds || !lastVolumeBounds) { - // MSG_WARNING( "VolumeBounds given are not of type: CylinderVolumeBounds (required) - returning 0 " ); + ACTS_WARNING( "VolumeBounds given are not of type: CylinderVolumeBounds (required) - returning 0 " ); return nullptr; } @@ -337,7 +337,7 @@ std::shared_ptr<const Acts::TrackingVolume> Acts::CylinderVolumeHelper::createCo std::shared_ptr<const TrackingVolumeArray> volumeArray = (rCase) ? m_config.trackingVolumeArrayCreator->trackingVolumeArray(volumes, binR) : m_config.trackingVolumeArrayCreator->trackingVolumeArray(volumes, binZ); if (volumeArray == nullptr) { - // MSG_WARNING( "Creation of TrackingVolume array did not succeed - returning 0 " ); + ACTS_WARNING( "Creation of TrackingVolume array did not succeed - returning 0 " ); delete topVolumeBounds; return nullptr; } @@ -349,11 +349,11 @@ std::shared_ptr<const Acts::TrackingVolume> Acts::CylinderVolumeHelper::createCo volumeName); // glueing section -------------------------------------------------------------------------------------- if (not interGlueTrackingVolume(topVolume,rCase, rMin, rMax, zSep1, zSep2)) { - // MSG_WARNING( "Problem with inter-glueing of TrackingVolumes (needed) - returning 0 " ); + ACTS_WARNING( "Problem with inter-glueing of TrackingVolumes (needed) - returning 0 " ); return nullptr; } - // MSG_VERBOSE( "[ end ] return newly created container : " << topVolume->volumeName() ); + ACTS_VERBOSE( "[ end ] return newly created container : " << topVolume->volumeName() ); return topVolume; } @@ -368,12 +368,12 @@ bool Acts::CylinderVolumeHelper::estimateAndCheckDimension(const LayerVector& la { // check and bail out if no layers are given if (!layers.size()) { - // MSG_VERBOSE( "No layers given, you shouldn't use : "<< type() ); + //ACTS_VERBOSE( "No layers given, you shouldn't use : "<< type() ); return false; } // some verbose output - // MSG_VERBOSE( "Parsing the " << layers.size() << " layers to gather overall dimensions" ); + ACTS_VERBOSE( "Parsing the " << layers.size() << " layers to gather overall dimensions" ); // if (cylinderVolumeBounds) // MSG_DEBUG( "Cylinder volume bounds are given: (rmin/rmax/dz) = " << "(" << cylinderVolumeBounds->innerRadius() << "/" << cylinderVolumeBounds->outerRadius() << "/" << cylinderVolumeBounds->halflengthZ() << ")"); @@ -434,7 +434,7 @@ bool Acts::CylinderVolumeHelper::estimateAndCheckDimension(const LayerVector& la // set the binning value bValue = radial ? binR : binZ; - // MSG_VERBOSE( "Estimate/check CylinderVolumeBounds from/w.r.t. enclosed layers + envelope covers" ); + ACTS_VERBOSE( "Estimate/check CylinderVolumeBounds from/w.r.t. enclosed layers + envelope covers" ); // the z from the layers w and w/o envelopes double zEstFromLayerEnv = 0.5*((layerZmax)+(layerZmin)); double halflengthFromLayer = 0.5*fabs((layerZmax)-(layerZmin)); @@ -461,12 +461,11 @@ bool Acts::CylinderVolumeHelper::estimateAndCheckDimension(const LayerVector& la halflengthFromLayer); } - // MSG_VERBOSE( " -> dimensions from layers (rMin/rMax/zMin/zMax) = " - // << layerRmin << " / " << layerRmax << " / " << layerZmin << " / " << layerZmax ); + ACTS_VERBOSE( " -> dimensions from layers (rMin/rMax/zMin/zMax) = " + << layerRmin << " / " << layerRmax << " / " << layerZmin << " / " << layerZmax ); double zFromTransform = transform ? transform->translation().z() : 0.; - // MSG_VERBOSE( " -> while created bounds are (rMin/rMax/zMin/zMax) = " - // << cylinderVolumeBounds->innerRadius() << " / " << cylinderVolumeBounds->outerRadius() << " / " - // << zFromTransform-cylinderVolumeBounds->halflengthZ() << " / " << zFromTransform+cylinderVolumeBounds->halflengthZ() ); + ACTS_VERBOSE( " -> while created bounds are (rMin/rMax/zMin/zMax) = " + << cylinderVolumeBounds->innerRadius() << " / " << cylinderVolumeBounds->outerRadius() << " / " ); // both is NOW given --- check it ----------------------------- @@ -478,12 +477,12 @@ bool Acts::CylinderVolumeHelper::estimateAndCheckDimension(const LayerVector& la cylinderVolumeBounds->outerRadius() >= layerRmax) return true; else { - // MSG_WARNING( "Provided layers are not contained by volume ! Bailing out. " << "zFromTransform: " << zFromTransform << "volumeZmin:" << zFromTransform-cylinderVolumeBounds->halflengthZ() << ", layerZmin: " << layerZmin << ", volumeZmax: " << zFromTransform+cylinderVolumeBounds->halflengthZ() << ", layerZmax: " << layerZmax << ", volumeRmin: " << cylinderVolumeBounds->innerRadius() << ", layerRmin: " << layerRmin << ", volumeRmax: " << cylinderVolumeBounds->outerRadius() << ", layerRmax: " << layerRmax); + ACTS_WARNING( "Provided layers are not contained by volume ! Bailing out. " << "zFromTransform: " << zFromTransform << "volumeZmin:" << zFromTransform-cylinderVolumeBounds->halflengthZ() << ", layerZmin: " << layerZmin << ", volumeZmax: " << zFromTransform+cylinderVolumeBounds->halflengthZ() << ", layerZmax: " << layerZmax << ", volumeRmin: " << cylinderVolumeBounds->innerRadius() << ", layerRmin: " << layerRmin << ", volumeRmax: " << cylinderVolumeBounds->outerRadius() << ", layerRmax: " << layerRmax); return false; } } - // MSG_VERBOSE( "Created/Checked " << *cylinderVolumeBounds ); + ACTS_VERBOSE( "Created/Checked " << *cylinderVolumeBounds ); return true; } @@ -494,7 +493,7 @@ bool Acts::CylinderVolumeHelper::interGlueTrackingVolume(std::shared_ptr<const T double zMin, double zMax) const { - // MSG_VERBOSE( "Glue contained TrackingVolumes of container '" << tVolume->volumeName() << "'." ); + ACTS_VERBOSE( "Glue contained TrackingVolumes of container '" << tVolume->volumeName() << "'." ); // only go on if you have confinedVolumes if (tVolume->confinedVolumes()){ @@ -530,7 +529,7 @@ bool Acts::CylinderVolumeHelper::interGlueTrackingVolume(std::shared_ptr<const T // loop over the volumes ------------------------------- for ( ; tVolIter != tVolEnd; ) { // screen output - // MSG_VERBOSE("r-binning: Processing volume [" << ivol++ << "]"); + ACTS_VERBOSE("r-binning: Processing volume [" << ivol++ << "]"); // for the first one if (tVolIter == tVolFirst) addFaceVolumes((*tVolIter),tubeInnerCover,glueVolumesInnerTube); @@ -551,7 +550,7 @@ bool Acts::CylinderVolumeHelper::interGlueTrackingVolume(std::shared_ptr<const T // loop over the volumes for ( ; tVolIter != tVolEnd; ) { // screen output - // MSG_VERBOSE("z-binning: Processing volume '" << (*tVolIter)->volumeName() << "'."); + ACTS_VERBOSE("z-binning: Processing volume '" << (*tVolIter)->volumeName() << "'."); if (tVolIter == tVolFirst) addFaceVolumes((*tVolIter),negativeFaceXY,glueVolumesNegativeFace); addFaceVolumes((*tVolIter),tubeInnerCover,glueVolumesInnerTube); @@ -629,11 +628,11 @@ void Acts::CylinderVolumeHelper::glueTrackingVolumes(std::shared_ptr<const Track const GlueVolumesDescriptor& gvDescriptorTwo = tvolTwo->glueVolumesDescriptor(); size_t volOneGlueVols = gvDescriptorOne.glueVolumes(faceOne) ? gvDescriptorOne.glueVolumes(faceOne)->arrayObjects().size() : 0; - // MSG_VERBOSE( "GlueVolumeDescriptor of volume '" << tvolOne->volumeName() <<"' has " - // << volOneGlueVols << " @ " << faceOne ); + ACTS_VERBOSE( "GlueVolumeDescriptor of volume '" << tvolOne->volumeName() <<"' has " + << volOneGlueVols << " @ " << faceOne ); size_t volTwoGlueVols = gvDescriptorTwo.glueVolumes(faceTwo) ? gvDescriptorTwo.glueVolumes(faceTwo)->arrayObjects().size() : 0; - // MSG_VERBOSE( "GlueVolumeDescriptor of volume '" << tvolTwo->volumeName() <<"' has " - // << volTwoGlueVols << " @ " << faceTwo ); + ACTS_VERBOSE( "GlueVolumeDescriptor of volume '" << tvolTwo->volumeName() <<"' has " + << volTwoGlueVols << " @ " << faceTwo ); // they could still be a container though - should not happen usually TrackingVolumePtr glueVolOne = volOneGlueVols ? gvDescriptorOne.glueVolumes(faceOne)->arrayObjects()[0] : tvolOne; @@ -642,23 +641,23 @@ void Acts::CylinderVolumeHelper::glueTrackingVolumes(std::shared_ptr<const Track // check the cases if ( volOneGlueVols <= 1 && volTwoGlueVols <= 1) { // (i) one -> one - // MSG_VERBOSE( " glue : one[ "<< glueVolOne->volumeName() << " @ " << faceOne - // << " ]-to-one[ "<< glueVolTwo->volumeName() << " @ " << faceTwo << " ]" ); + ACTS_VERBOSE( " glue : one[ "<< glueVolOne->volumeName() << " @ " << faceOne + << " ]-to-one[ "<< glueVolTwo->volumeName() << " @ " << faceTwo << " ]" ); glueVolOne->glueTrackingVolume(faceOne,glueVolTwo,faceTwo); } else if (volOneGlueVols <= 1) { // (ii) one -> many - // MSG_VERBOSE( " glue : one[ "<< glueVolOne->volumeName() << " @ " << faceOne - // << " ]-to-many[ "<< tvolTwo->volumeName() << " @ " << faceTwo << " ]" ); + ACTS_VERBOSE( " glue : one[ "<< glueVolOne->volumeName() << " @ " << faceOne + << " ]-to-many[ "<< tvolTwo->volumeName() << " @ " << faceTwo << " ]" ); glueVolOne->glueTrackingVolumes(faceOne,gvDescriptorTwo.glueVolumes(faceTwo),faceTwo); } else if (volTwoGlueVols <= 1 ) { // (iii) many -> one - // MSG_VERBOSE( " glue : many[ "<< tvolOne->volumeName() << " @ " << faceOne - // << " ]-to-one[ "<< glueVolTwo->volumeName() << " @ " << faceTwo << " ]" ); + ACTS_VERBOSE( " glue : many[ "<< tvolOne->volumeName() << " @ " << faceOne + << " ]-to-one[ "<< glueVolTwo->volumeName() << " @ " << faceTwo << " ]" ); glueVolTwo->glueTrackingVolumes(faceTwo,gvDescriptorOne.glueVolumes(faceOne),faceOne); } else { // (iv) glue array to array - // MSG_VERBOSE( " glue : many[ "<< tvolOne->volumeName() << " @ " << faceOne - // << " ]-to-many[ "<< tvolTwo->volumeName() << " @ " << faceTwo << " ]" ); + ACTS_VERBOSE( " glue : many[ "<< tvolOne->volumeName() << " @ " << faceOne + << " ]-to-many[ "<< tvolTwo->volumeName() << " @ " << faceTwo << " ]" ); // create the BoundarySurface as shared pointer const BoundarySurface<TrackingVolume>* boundarySurface = nullptr; @@ -676,12 +675,12 @@ void Acts::CylinderVolumeHelper::glueTrackingVolumes(std::shared_ptr<const Track // (1) create the BoundaryCylinderSurface // now create the CylinderSurface CylinderSurface cSurface(transform,rMin,0.5*(zMax-zMin)); - // MSG_VERBOSE(" creating a new cylindrical boundary surface with bounds = " << cSurface.bounds() ); + ACTS_VERBOSE(" creating a new cylindrical boundary surface with bounds = " << cSurface.bounds() ); boundarySurface = new BoundaryCylinderSurface<TrackingVolume>(gvDescriptorOne.glueVolumes(faceOne),gvDescriptorTwo.glueVolumes(faceTwo),cSurface); } else { // (2) create teh BoundaryDiscSurface, in that case the zMin/zMax provided are both the position of the disk in question DiscSurface dSurface(transform,rMin,rMax); - // MSG_VERBOSE(" creating a new disc-like boundary surface with bounds = " << dSurface.bounds() ); + ACTS_VERBOSE(" creating a new disc-like boundary surface with bounds = " << dSurface.bounds() ); boundarySurface = new BoundaryDiscSurface<TrackingVolume>(gvDescriptorOne.glueVolumes(faceOne), gvDescriptorTwo.glueVolumes(faceTwo),dSurface); } // create the BoundarySurface as shared pointer @@ -702,7 +701,7 @@ void Acts::CylinderVolumeHelper::addFaceVolumes(std::shared_ptr<const TrackingVo TrackingVolumeVector& vols) const { - // MSG_VERBOSE( "Adding face volumes of face " << glueFace << " for the volume '" << tvol->volumeName() << "'." ); + ACTS_VERBOSE( "Adding face volumes of face " << glueFace << " for the volume '" << tvol->volumeName() << "'." ); // retrieve the gluevolume descriptor const GlueVolumesDescriptor& gvDescriptor = tvol->glueVolumesDescriptor(); // if volumes are registered: take them @@ -711,14 +710,14 @@ void Acts::CylinderVolumeHelper::addFaceVolumes(std::shared_ptr<const TrackingVo auto volIter = gvDescriptor.glueVolumes(glueFace)->arrayObjects().begin(); auto volEnd = gvDescriptor.glueVolumes(glueFace)->arrayObjects().end(); for ( ; volIter != volEnd; ++volIter){ - // MSG_VERBOSE( " -> adding : " << (*volIter)->volumeName() ); + ACTS_VERBOSE( " -> adding : " << (*volIter)->volumeName() ); vols.push_back(*volIter); } // screen output - // MSG_VERBOSE( vols.size() << " navigation volumes registered as glue volumes." ); + ACTS_VERBOSE( vols.size() << " navigation volumes registered as glue volumes." ); } else { // the volume itself is on navigation level - // MSG_VERBOSE( " -> adding only volume itself (at navigation level)." ); + ACTS_VERBOSE( " -> adding only volume itself (at navigation level)." ); vols.push_back(tvol); } } @@ -730,7 +729,7 @@ std::shared_ptr<const Acts::Layer> Acts::CylinderVolumeHelper::createCylinderLay int binsPhi, int binsZ) const { - // MSG_VERBOSE( "Creating a CylinderLayer at position " << z << " and radius " << r ); + ACTS_VERBOSE( "Creating a CylinderLayer at position " << z << " and radius " << r ); // positioning std::shared_ptr<Transform3D> transform = 0; transform = (fabs(z)>0.1) ? std::make_shared<Transform3D>() : 0; @@ -742,15 +741,14 @@ std::shared_ptr<const Acts::Layer> Acts::CylinderVolumeHelper::createCylinderLay if (binsPhi==1){ // the BinUtility for the material // ---------------------> create material for the layer surface - // MSG_VERBOSE( " -> Preparing the binned material with " << binsZ << " bins in Z. "); + ACTS_VERBOSE( " -> Preparing the binned material with " << binsZ << " bins in Z. "); } else { // break the phi symmetry // update the BinUtility: local position on Cylinder is rPhi, z BinUtility layerBinUtilityPhiZ(binsPhi,-r*M_PI,+r*M_PI,closed,binPhi); layerBinUtilityPhiZ += layerBinUtility; // ---------------------> create material for the layer surface - // MSG_VERBOSE( " -> Preparing the binned material with " << binsPhi << " / " << binsZ << " bins in - // phi / Z. "); + ACTS_VERBOSE( " -> Preparing the binned material with " << binsPhi << " / " << binsZ << " bins in phi / Z. "); } // @TODO create the SurfaceMaterial // bounds for cylinderical surface @@ -771,7 +769,7 @@ std::shared_ptr<const Acts::Layer> Acts::CylinderVolumeHelper::createDiscLayer(d int binsR) const { - // MSG_VERBOSE( "Creating a DiscLayer at position " << z << " and rMin/rMax " << rMin << " / " << rMax); + ACTS_VERBOSE( "Creating a DiscLayer at position " << z << " and rMin/rMax " << rMin << " / " << rMax); // positioning std::shared_ptr<Transform3D> transform = fabs(z)>0.1 ? std::make_shared<Transform3D>() : 0; @@ -781,11 +779,11 @@ std::shared_ptr<const Acts::Layer> Acts::CylinderVolumeHelper::createDiscLayer(d // R is the primary binning for the material BinUtility materialBinUtility(binsR, rMin, rMax, open, binR); if (binsPhi==1) { - // MSG_VERBOSE( " -> Preparing the binned material with " << binsR << " bins in R. "); + ACTS_VERBOSE( " -> Preparing the binned material with " << binsR << " bins in R. "); } else { // also binning in phi chosen materialBinUtility += BinUtility(binsPhi, -M_PI, M_PI, closed, binPhi); - // MSG_VERBOSE( " -> Preparing the binned material with " << binsPhi << " / " << binsR << " bins in phi / R. "); + ACTS_VERBOSE( " -> Preparing the binned material with " << binsPhi << " / " << binsR << " bins in phi / R. "); } // @TODO create the SurfaceMaterial diff --git a/Core/src/Tools/PassiveLayerBuilder.cpp b/Core/src/Tools/PassiveLayerBuilder.cpp index 627a8985b6e22a50e8c0ee81cab06edfa2d574b6..2b4b8c6707e473ec2a77338f7d704d130407cd8e 100644 --- a/Core/src/Tools/PassiveLayerBuilder.cpp +++ b/Core/src/Tools/PassiveLayerBuilder.cpp @@ -31,16 +31,16 @@ void Acts::PassiveLayerBuilder::setConfiguration(const PassiveLayerBuilder::Conf bool Acts::PassiveLayerBuilder::constructLayers() const { - + // the central layers size_t numcLayers = m_config.centralLayerRadii.size(); if (numcLayers){ - // MSG_DEBUG("Configured to build " << numcLayers << " passive central layers."); + ACTS_DEBUG("Configured to build " << numcLayers << " passive central layers."); m_cLayers.reserve(numcLayers); // loop through for (size_t icl = 0; icl < numcLayers; ++icl){ // some screen output - // MSG_VERBOSE("- build layer " << icl << " with radius = " << m_config.centralLayerRadii.at(icl) << " and halfZ = " << m_config.centralLayerHalflengthZ.at(icl)); + ACTS_VERBOSE("- build layer " << icl << " with radius = " << m_config.centralLayerRadii.at(icl) << " and halfZ = " << m_config.centralLayerHalflengthZ.at(icl)); // create the layer and push it back auto cBounds = std::make_shared<CylinderBounds>(m_config.centralLayerRadii[icl],m_config.centralLayerHalflengthZ.at(icl)); // create the layer @@ -59,22 +59,22 @@ bool Acts::PassiveLayerBuilder::constructLayers() const // sign it to the surface cLayer->surfaceRepresentation().setSurfaceMaterial(material); - } + } // push it into the layer vector m_cLayers.push_back(cLayer); } } - + // pos/neg layers size_t numpnLayers = m_config.posnegLayerPositionZ.size(); if (numpnLayers){ - // MSG_DEBUG("Configured to build 2 * " << numpnLayers << " passive positive/negative side layers."); + ACTS_DEBUG("Configured to build 2 * " << numpnLayers << " passive positive/negative side layers."); m_pLayers.reserve(numpnLayers); m_nLayers.reserve(numpnLayers); // loop through for (size_t ipnl = 0; ipnl < numpnLayers; ++ipnl){ // some screen output - // MSG_VERBOSE("- build layers " << (2*ipnl) << " and "<< (2*ipnl)+1 << " at +/- z = " << m_config.posnegLayerPositionZ.at(ipnl) + ACTS_VERBOSE("- build layers " << (2*ipnl) << " and "<< (2*ipnl)+1 << " at +/- z = " << m_config.posnegLayerPositionZ.at(ipnl)); // << " and rMin/rMax = " << m_config.posnegLayerRmin.at(ipnl) << " / " << m_config.posnegLayerRmax.at(ipnl)); // create the share disc bounds std::shared_ptr<const DiscBounds> dBounds = std::make_shared<RadialBounds>(m_config.posnegLayerRmin.at(ipnl), m_config.posnegLayerRmax.at(ipnl)); @@ -100,7 +100,7 @@ bool Acts::PassiveLayerBuilder::constructLayers() const // sign it to the surface nLayer->surfaceRepresentation().setSurfaceMaterial(material); pLayer->surfaceRepresentation().setSurfaceMaterial(material); - } + } // push it into the layer vector m_nLayers.push_back(nLayer); m_pLayers.push_back(pLayer); diff --git a/Core/src/Tools/SurfaceArrayCreator.cpp b/Core/src/Tools/SurfaceArrayCreator.cpp index 8fa6074b4ae9c1b620684fdf52a6386818fcb94c..dbd99b012fe9afc4903140665e82f049018f34e1 100644 --- a/Core/src/Tools/SurfaceArrayCreator.cpp +++ b/Core/src/Tools/SurfaceArrayCreator.cpp @@ -12,10 +12,6 @@ // Core module #include "ACTS/Utilities/Definitions.hpp" -// constructor -Acts::SurfaceArrayCreator::SurfaceArrayCreator() -{} - /** SurfaceArrayCreator interface method - create an array in a cylinder, binned in phi, z */ std::unique_ptr<Acts::SurfaceArray> Acts::SurfaceArrayCreator::surfaceArrayOnCylinder(const std::vector<const Acts::Surface*>& surfaces, double R, double minPhi, double maxPhi, double halfZ, diff --git a/Core/src/Utilities/Logger.cpp b/Core/src/Utilities/Logger.cpp new file mode 100644 index 0000000000000000000000000000000000000000..0327f795272ec5a22b54f9e798602c94a6ce3a75 --- /dev/null +++ b/Core/src/Utilities/Logger.cpp @@ -0,0 +1,12 @@ +#include "ACTS/Utilities/Logger.hpp" + +namespace Acts +{ + std::unique_ptr<Logger> getDefaultLogger(const std::string& name,const Logging::Level& lvl) + { + using namespace Logging; + auto output= std::make_unique<LevelOutputDecorator>(std::make_unique<NamedOutputDecorator>(std::make_unique<TimedOutputDecorator>(std::make_unique<DefaultOutputPolicy>(stdout)),name)); + auto print= std::make_unique<DefaultPrintPolicy>(lvl); + return std::make_unique<Logger>(std::move(output),std::move(print)); + } +} // end of namespace Acts diff --git a/Examples/GenericDetectorExample/include/ACTS/Examples/GenericDetectorExample/GenericLayerBuilder.hpp b/Examples/GenericDetectorExample/include/ACTS/Examples/GenericDetectorExample/GenericLayerBuilder.hpp index 634894eafd7500f97c7895fa8106d53ad1008d42..4248148e1e8ee93f22f4d10ba1f45234930b1931 100644 --- a/Examples/GenericDetectorExample/include/ACTS/Examples/GenericDetectorExample/GenericLayerBuilder.hpp +++ b/Examples/GenericDetectorExample/include/ACTS/Examples/GenericDetectorExample/GenericLayerBuilder.hpp @@ -7,6 +7,7 @@ // Utilities #include "ACTS/Utilities/Definitions.hpp" +#include "ACTS/Utilities/Logger.hpp" // Geometry module #include "ACTS/Tools/ILayerBuilder.hpp" #include "ACTS/Layers/Layer.hpp" @@ -35,6 +36,7 @@ namespace Acts { /** @struct Config Configuration for the GenericLayerBuilder */ struct Config { + std::shared_ptr<Logger> logger; std::string layerIdentification; // a single paramater for the approach surface envelope double approachSurfaceEnvelope; @@ -140,7 +142,8 @@ namespace Acts { Config m_config; - + const Logger& logger() const {return *m_config.logger;} + }; @@ -152,7 +155,6 @@ namespace Acts { inline GenericLayerBuilder::Config GenericLayerBuilder::getConfiguration() const { return m_config; } - } // end of namespace #endif //ACTS_GEOMETRYTOOLS_GENERICLAYERBUILDER_H diff --git a/Examples/GenericDetectorExample/src/BuildGenericDetector.cpp b/Examples/GenericDetectorExample/src/BuildGenericDetector.cpp index e98d7c31d21e3e66887517be948d64d4a5893bad..ab0eff1d3ae24d9cb65508628dfa2e0881b1ed79 100644 --- a/Examples/GenericDetectorExample/src/BuildGenericDetector.cpp +++ b/Examples/GenericDetectorExample/src/BuildGenericDetector.cpp @@ -23,12 +23,12 @@ namespace Acts { // configure the layer creator with the surface array creator Acts::LayerCreator::Config lcConfig; - lcConfig.surfaceArrayCreator = std::make_shared<Acts::SurfaceArrayCreator>(); + lcConfig.surfaceArrayCreator = std::make_shared<Acts::SurfaceArrayCreator>(Acts::SurfaceArrayCreator::Config()); auto LayerCreator = std::make_shared<Acts::LayerCreator>(lcConfig); // configure the cylinder volume helper Acts::CylinderVolumeHelper::Config cvhConfig; - cvhConfig.layerArrayCreator = std::make_shared<Acts::LayerArrayCreator>(); - cvhConfig.trackingVolumeArrayCreator = std::make_shared<Acts::TrackingVolumeArrayCreator>(); + cvhConfig.layerArrayCreator = std::make_shared<Acts::LayerArrayCreator>(Acts::LayerArrayCreator::Config()); + cvhConfig.trackingVolumeArrayCreator = std::make_shared<Acts::TrackingVolumeArrayCreator>(Acts::TrackingVolumeArrayCreator::Config()); auto CylinderVolumeHelper = std::make_shared<Acts::CylinderVolumeHelper>(cvhConfig); //------------------------------------------------------------------------------------- //beam pipe diff --git a/Examples/GenericDetectorExample/src/GenericLayerBuilder.cpp b/Examples/GenericDetectorExample/src/GenericLayerBuilder.cpp index 676336712388be4e5cb582b57976b28df935aea6..c73530859197f004464110108593d06c710cf1c9 100644 --- a/Examples/GenericDetectorExample/src/GenericLayerBuilder.cpp +++ b/Examples/GenericDetectorExample/src/GenericLayerBuilder.cpp @@ -39,7 +39,7 @@ Acts::GenericLayerBuilder::GenericLayerBuilder(const Acts::GenericLayerBuilder:: //@TODO make checks if needed parameters are set and if vectors have all same size - waiting for message stream - //MSG_DEBUG( "initialize()" ); + ACTS_DEBUG( "initialize()" ); //Tool needs to be initialized // if (!AlgToolBase::initialize()) return StatusCode::FAILURE;