diff --git a/DetectorDescription/ReadoutGeometryBase/ReadoutGeometryBase/DetectorDesign.h b/DetectorDescription/ReadoutGeometryBase/ReadoutGeometryBase/DetectorDesign.h index 7cb0a60ff18ec1ba4ccc6c48af87a060b8608b99..7e72dd3eebabe82af86df6000733df7054f7ace9 100644 --- a/DetectorDescription/ReadoutGeometryBase/ReadoutGeometryBase/DetectorDesign.h +++ b/DetectorDescription/ReadoutGeometryBase/ReadoutGeometryBase/DetectorDesign.h @@ -37,7 +37,7 @@ class SiLocalPosition; class SiIntersect; enum DetectorShape { - Box=0, Trapezoid, Annulus,Other + Box=0, Trapezoid, Annulus,Other,PolarAnnulus }; /** @class DetectorDesign diff --git a/DetectorDescription/ReadoutGeometryBase/src/SolidStateDetectorElementBase.cxx b/DetectorDescription/ReadoutGeometryBase/src/SolidStateDetectorElementBase.cxx index 5435f62b56da0d4834404698ebd82bfad87685b3..42af4e92565e76f47a523c4489974e7f829612d9 100644 --- a/DetectorDescription/ReadoutGeometryBase/src/SolidStateDetectorElementBase.cxx +++ b/DetectorDescription/ReadoutGeometryBase/src/SolidStateDetectorElementBase.cxx @@ -519,7 +519,19 @@ SolidStateDetectorElementBase::hitLocalToLocal(double xEta, double xPhi) const if (!m_baseCacheValid) updateCache(); if (!m_etaDirection) xEta = -xEta; if (!m_phiDirection) xPhi = -xPhi; - return Amg::Vector2D(xPhi, xEta); + auto result = Amg::Vector2D(xPhi, xEta); + + + if (m_design->shape() == InDetDD::PolarAnnulus) { // Do conversion to polar co-ords as well + double y = result.x(); // gets xPhi which is y... + double x = result.y(); // gets xEta which is x... + + double r = std::hypot(x,y); + double phi = std::atan2(y,x); + result = Amg::Vector2D(phi,r); + } + + return result; } HepGeom::Point3D diff --git a/HighGranularityTimingDetector/HGTD_DetDescr/HGTD_GeoModel/HGTD_GeoModel/HGTD_DetectorFactory.h b/HighGranularityTimingDetector/HGTD_DetDescr/HGTD_GeoModel/HGTD_GeoModel/HGTD_DetectorFactory.h index 36a00d7680a46bc5de63b3f18827eb64906d097d..2b76b367b5a3e5455fa29eb2a31f3917bd8b9a23 100644 --- a/HighGranularityTimingDetector/HGTD_DetDescr/HGTD_GeoModel/HGTD_GeoModel/HGTD_DetectorFactory.h +++ b/HighGranularityTimingDetector/HGTD_DetDescr/HGTD_GeoModel/HGTD_GeoModel/HGTD_DetectorFactory.h @@ -23,108 +23,104 @@ class GeoTube ; class GeoPhysVol; class StoredMaterialManager ; -namespace HGTDGeo { - - struct HgtdGeoParams { - double rMid; - double rOuter; - double disk1Rotation; - double disk2Rotation; - double rowSpaceSide; - double rowBacksideInnerShift; - double rowBacksideOuterShift; - double moduleSpaceInner; - double moduleSpaceOuter; - double flexSheetSpacing; - }; - - struct ModulePosition { - double x; - double y; - double phiRotation; - // below for backward compatibilty - bool flipped; - int row; - int el_in_row; - }; - - struct GeoCylVolParams { - std::string name; - double rMin; - double rMax; - double zHalf; - double zOffsetLocal; - std::string material; - }; - - struct GeoBoxVolParams { - std::string name; - double xHalf; - double yHalf; - double zHalf; - double zOffsetLocal; - std::string material; - }; - - typedef std::array,21> PositionsInQuadrant; +struct HgtdGeoParams { + double rMid; + double rOuter; + double disk1Rotation; + double disk2Rotation; + double rowSpaceSide; + double rowBacksideInnerShift; + double rowBacksideOuterShift; + double moduleSpaceInner; + double moduleSpaceOuter; + double flexSheetSpacing; +}; + +struct ModulePosition { + double x; + double y; + double phiRotation; + // below for backward compatibilty + bool flipped; + int row; + int el_in_row; +}; + +struct GeoCylVolParams { + std::string name; + double rMin; + double rMax; + double zHalf; + double zOffsetLocal; + std::string material; +}; + +struct GeoBoxVolParams { + std::string name; + double xHalf; + double yHalf; + double zHalf; + double zOffsetLocal; + std::string material; +}; + +typedef std::array,21> PositionsInQuadrant; class HGTD_DetectorFactory : public InDetDD::DetectorFactoryBase { public: - HGTD_DetectorFactory(InDetDD::AthenaComps* athenaComps, InDetDD::SiCommonItems* commonItems); - virtual ~HGTD_DetectorFactory(); + HGTD_DetectorFactory(InDetDD::AthenaComps* athenaComps, InDetDD::SiCommonItems* commonItems); + virtual ~HGTD_DetectorFactory(); - // Creation of geometry: - virtual void create(GeoPhysVol* world); + // Creation of geometry: + virtual void create(GeoPhysVol* world); - // Access to the results: - virtual HGTD_DetectorManager* getDetectorManager() const; + // Access to the results: + virtual HGTD_DetectorManager* getDetectorManager() const; - void setPrintIdentifierDict( bool ); + void setPrintIdentifierDict( bool ); - private: - // Copy and assignments operations illegal and so are made private - HGTD_DetectorFactory(HGTD_DetectorFactory &right); - HGTD_DetectorFactory & operator=(HGTD_DetectorFactory &right); +private: + // Copy and assignments operations illegal and so are made private + HGTD_DetectorFactory(HGTD_DetectorFactory &right); + HGTD_DetectorFactory & operator=(HGTD_DetectorFactory &right); - void readDbParameters(); - GeoLogVol* buildEndcapLogicalVolume(bool isPositiveSide); - GeoVPhysVol* build( const GeoLogVol* logicalEnvelope, bool bPos); + void readDbParameters(); + GeoLogVol* buildEndcapLogicalVolume(bool isPositiveSide); + GeoVPhysVol* build( const GeoLogVol* logicalEnvelope, bool bPos); - InDetDD::HGTD_ModuleDesign* createHgtdDesign( double thickness ); + InDetDD::HGTD_ModuleDesign* createHgtdDesign( double thickness ); - // below 3 members prepare 3-ring vs 2-ring layout controlled implicitly by geomVersion - std::array< PositionsInQuadrant, 4 > prepareLayersFromQuadrants( unsigned int ) ; - PositionsInQuadrant prepareQuadrantsFromRows( int layer, unsigned int maxRow ); - std::string formModuleName( int layer, int quadrant, unsigned int maxrows, int row, int mod, - ModulePosition module, double & myx, double & myy, double & myrot, - int & phi, int & eta ) ; + // below 3 members prepare 3-ring vs 2-ring layout controlled implicitly by geomVersion + std::array< PositionsInQuadrant, 4 > prepareLayersFromQuadrants( unsigned int ) ; + PositionsInQuadrant prepareQuadrantsFromRows( int layer, unsigned int maxRow ); + std::string formModuleName( int layer, int quadrant, unsigned int maxrows, int row, int mod, + ModulePosition module, double & myx, double & myy, double & myrot, + int & phi, int & eta ) ; - // 3-ring layout - PositionsInQuadrant mirrorModulesInQuadrant( PositionsInQuadrant ); - std::vector< ModulePosition > prepareModulePositionsInRowThreeRing( int row, int back = 0 ); - int reorderRows( PositionsInQuadrant* quadrant ); + // 3-ring layout + PositionsInQuadrant mirrorModulesInQuadrant( PositionsInQuadrant ); + std::vector< ModulePosition > prepareModulePositionsInRowThreeRing( int row, int back = 0 ); + int reorderRows( PositionsInQuadrant* quadrant ); - void mirrorPositionsAroundYaxis(std::array< PositionsInQuadrant, 4 >& arr); + void mirrorPositionsAroundYaxis(std::array< PositionsInQuadrant, 4 >& arr); - // 2-ring layout - std::vector prepareModulePositionsInRowTwoRing(int row, bool back = false); + // 2-ring layout + std::vector prepareModulePositionsInRowTwoRing(int row, bool back = false); - HGTD_DetectorManager* m_detectorManager; - InDetDD::AthenaComps* m_athComps; - InDetDD::SiCommonItems* m_commonItems; - StoredMaterialManager* m_materialMgr; + HGTD_DetectorManager* m_detectorManager; + InDetDD::AthenaComps* m_athComps; + InDetDD::SiCommonItems* m_commonItems; + StoredMaterialManager* m_materialMgr; - int m_geomVersion; + int m_geomVersion; - // whether print number of modules per row for to the input for Identifier dictionary - bool m_outputIdfr; + // whether print number of modules per row for to the input for Identifier dictionary + bool m_outputIdfr; - std::map m_cylVolPars; - std::map m_boxVolPars; - HgtdGeoParams m_hgtdPars; - }; - -} // End HGTDGeo namespace + std::map m_cylVolPars; + std::map m_boxVolPars; + HgtdGeoParams m_hgtdPars; +}; #endif // HGTD_GEOMODEL_HGTD_DETECTORFACTORY_H diff --git a/HighGranularityTimingDetector/HGTD_DetDescr/HGTD_GeoModel/src/HGTD_DetectorFactory.cxx b/HighGranularityTimingDetector/HGTD_DetDescr/HGTD_GeoModel/src/HGTD_DetectorFactory.cxx index 525383e6bffbc44ef0e044c28cd2236cdd93a35b..a55e3a9d50c5ca6e86bbdf6fc8ec230c3c562890 100644 --- a/HighGranularityTimingDetector/HGTD_DetDescr/HGTD_GeoModel/src/HGTD_DetectorFactory.cxx +++ b/HighGranularityTimingDetector/HGTD_DetDescr/HGTD_GeoModel/src/HGTD_DetectorFactory.cxx @@ -53,8 +53,6 @@ using namespace std; -namespace HGTDGeo { - HGTD_DetectorFactory::HGTD_DetectorFactory( InDetDD::AthenaComps* athComps, InDetDD::SiCommonItems* commonItems ) : InDetDD::DetectorFactoryBase( athComps ), m_athComps( athComps ), @@ -1143,5 +1141,3 @@ std::vector HGTD_DetectorFactory::prepareModulePositionsInRowTwo return modulePositions; } - -} // end HGTDGeo namespace diff --git a/HighGranularityTimingDetector/HGTD_DetDescr/HGTD_GeoModel/src/HGTD_DetectorTool.cxx b/HighGranularityTimingDetector/HGTD_DetDescr/HGTD_GeoModel/src/HGTD_DetectorTool.cxx index ce62ee0d794ac079b59cb47c6acf220b76c8b944..61b431c7320ddc62d0bfb73c8bc645b53c452741 100644 --- a/HighGranularityTimingDetector/HGTD_DetDescr/HGTD_GeoModel/src/HGTD_DetectorTool.cxx +++ b/HighGranularityTimingDetector/HGTD_DetDescr/HGTD_GeoModel/src/HGTD_DetectorTool.cxx @@ -77,7 +77,7 @@ StatusCode HGTD_DetectorTool::create(StoreGateSvc* detStore) { // The * converts a ConstPVLink to a ref to a GeoVPhysVol, the & takes the address of the GeoVPhysVol GeoPhysVol *world = &*theExpt->getPhysVol(); - HGTDGeo::HGTD_DetectorFactory theHGTDFactory( m_athenaComps, m_commonItems ); + HGTD_DetectorFactory theHGTDFactory( m_athenaComps, m_commonItems ); theHGTDFactory.setPrintIdentifierDict( m_printIDdict ); theHGTDFactory.create(world); diff --git a/HighGranularityTimingDetector/HGTD_DetDescr/HGTD_TrackingGeometry/HGTD_TrackingGeometry/HGTD_LayerBuilder.h b/HighGranularityTimingDetector/HGTD_DetDescr/HGTD_TrackingGeometry/HGTD_TrackingGeometry/HGTD_LayerBuilder.h index 0040e31154b0b341daf3d0f0d9a56a2ea816637a..99dc4814f8a4c78c77ea6a2ffbf8bdb8017ff2ac 100644 --- a/HighGranularityTimingDetector/HGTD_DetDescr/HGTD_TrackingGeometry/HGTD_TrackingGeometry/HGTD_LayerBuilder.h +++ b/HighGranularityTimingDetector/HGTD_DetDescr/HGTD_TrackingGeometry/HGTD_TrackingGeometry/HGTD_LayerBuilder.h @@ -32,84 +32,77 @@ namespace Trk { typedef std::pair< SharedObject, Amg::Vector3D > SurfaceOrderPosition; } -namespace HGTDet { - - /** @class HGTD_LayerBuilder - - The HGTD_LayerBuilder parses the senstive detector elments and orders them onto a - Disc surface; no cylindrical layers are expected. - This implementation is based on what done in the SiLayerBuilder, adapted to the HGTD use case. - - It also uses the SiNumerology to construct the BinUtility and then orders the representing - detector surfaces on the layers. - - */ - - class HGTD_LayerBuilder : public AthAlgTool, virtual public Trk::ILayerBuilder { +/** @class HGTD_LayerBuilder + + The HGTD_LayerBuilder parses the senstive detector elments and orders them onto a + Disc surface; no cylindrical layers are expected. + This implementation is based on what done in the SiLayerBuilder, adapted to the HGTD use case. + + It also uses the SiNumerology to construct the BinUtility and then orders the representing + detector surfaces on the layers. + + */ + +class HGTD_LayerBuilder : public AthAlgTool, virtual public Trk::ILayerBuilder { + + public: + + /** AlgTool style constructor */ + HGTD_LayerBuilder(const std::string&,const std::string&,const IInterface*); + + /** Destructor */ + virtual ~HGTD_LayerBuilder(); + + /** AlgTool initialize method */ + StatusCode initialize(); + /** AlgTool finalize method */ + StatusCode finalize(); + + /** LayerBuilder interface method - returning Barrel-like layers */ + const std::vector< const Trk::CylinderLayer* >* cylindricalLayers() const; + + /** LayerBuilder interface method - returning Endcap-like layers */ + const std::vector< const Trk::DiscLayer* >* discLayers() const; + + /** LayerBuilder interface method - returning Planar-like layers */ + const std::vector< const Trk::PlaneLayer* >* planarLayers() const; + + /** Name identification */ + const std::string& identification() const; + + private: + const Trk::LayerMaterialProperties* discLayerMaterial(double rMin, double rMax) const; //!< helper method to construct HGTD material + + void registerSurfacesToLayer(const std::vector& surfaces, const Trk::Layer& layer) const; //!< layer association + + void evaluateBestBinning(std::vector& surfaces, + std::vector& rBins, float& maxRadius, + std::vector>& phiBins) const; + + const HGTD_DetectorManager* m_hgtdMgr; //!< the HGTD Detector Manager + const HGTD_ID* m_hgtdHelper; //!< HGTD Id Helper + + bool m_setLayerAssociation; //!< Set Layer Association + + std::string m_identification; //!< string identification + + int m_rBins; //!< set the number of bins + int m_phiBins; //!< set the number of bins - public: + float m_discEnvelopeR; //!< set disc envelope + float m_discThickness; //!< set disc thickness - /** AlgTool style constructor */ - HGTD_LayerBuilder(const std::string&,const std::string&,const IInterface*); - - /** Destructor */ - virtual ~HGTD_LayerBuilder(); - - /** AlgTool initialize method */ - StatusCode initialize(); - /** AlgTool finalize method */ - StatusCode finalize(); - - /** LayerBuilder interface method - returning Barrel-like layers */ - const std::vector< const Trk::CylinderLayer* >* cylindricalLayers() const; - - /** LayerBuilder interface method - returning Endcap-like layers */ - const std::vector< const Trk::DiscLayer* >* discLayers() const; - - /** LayerBuilder interface method - returning Planar-like layers */ - const std::vector< const Trk::PlaneLayer* >* planarLayers() const; - - /** Name identification */ - const std::string& identification() const; - - private: - const Trk::LayerMaterialProperties* discLayerMaterial(double rMin, double rMax) const; //!< helper method to construct HGTD material - - void registerSurfacesToLayer(const std::vector& surfaces, const Trk::Layer& layer) const; //!< layer association - - void evaluateBestBinning(std::vector& surfaces, - std::vector& rBins, float& maxRadius, - std::vector>& phiBins) const; - - const HGTD_DetectorManager* m_hgtdMgr; //!< the HGTD Detector Manager - const HGTD_ID* m_hgtdHelper; //!< HGTD Id Helper - - bool m_setLayerAssociation; //!< Set Layer Association - - std::string m_identification; //!< string identification - - int m_rBins; //!< set the number of bins - int m_phiBins; //!< set the number of bins - - float m_discEnvelopeR; //!< set disc envelope - float m_discThickness; //!< set disc thickness - - bool m_runGeometryValidation; //!< run geometry validation - - }; - - inline const std::vector< const Trk::CylinderLayer* >* HGTD_LayerBuilder::cylindricalLayers() const - { return 0; } - - inline const std::vector< const Trk::PlaneLayer* >* HGTD_LayerBuilder::planarLayers() const - { return 0; } - - inline const std::string& HGTD_LayerBuilder::identification() const - { return m_identification; } - -} // end of namespace + bool m_runGeometryValidation; //!< run geometry validation +}; -#endif // HGTD_TRACKINGGEOMETRY_HGTDLAYERBUILDERN_H +inline const std::vector< const Trk::CylinderLayer* >* HGTD_LayerBuilder::cylindricalLayers() const +{ return 0; } +inline const std::vector< const Trk::PlaneLayer* >* HGTD_LayerBuilder::planarLayers() const +{ return 0; } +inline const std::string& HGTD_LayerBuilder::identification() const +{ return m_identification; } + +#endif // HGTD_TRACKINGGEOMETRY_HGTDLAYERBUILDERN_H diff --git a/HighGranularityTimingDetector/HGTD_DetDescr/HGTD_TrackingGeometry/HGTD_TrackingGeometry/HGTD_OverlapDescriptor.h b/HighGranularityTimingDetector/HGTD_DetDescr/HGTD_TrackingGeometry/HGTD_TrackingGeometry/HGTD_OverlapDescriptor.h index 38863d4a88898e221de5478eed2d7fc6897d789f..0e49a29c99f04e1eb93994b924bc2e000c0f4170 100644 --- a/HighGranularityTimingDetector/HGTD_DetDescr/HGTD_TrackingGeometry/HGTD_TrackingGeometry/HGTD_OverlapDescriptor.h +++ b/HighGranularityTimingDetector/HGTD_DetDescr/HGTD_TrackingGeometry/HGTD_TrackingGeometry/HGTD_OverlapDescriptor.h @@ -19,74 +19,69 @@ namespace Trk { class Surface; } -namespace InDetDD { +namespace InDetDD { class HGTD_DetectorElement; } class HGTD_ID; -namespace HGTDet { - - /** @class HGTD_OverlapDescriptor - * Class to describe overlaps in the HGTD detector. - * It extends the Trk::OverlapDescriptor base class. - * - * There are two interface methods, one provides the most probably overlapcell, - * the second provides a list of overlap cells, based on an restricted area - * - */ - - class HGTD_OverlapDescriptor : public Trk::OverlapDescriptor { - public: - - /** Constructor */ - HGTD_OverlapDescriptor(const Trk::BinnedArray* bin_array = nullptr, - std::vector < float > valuesR = {}, - std::vector < std::vector< float> > valuesPhi = {}, - int nStepsR=3, int nStepsPhi=10); - - /** Destructor */ - virtual ~HGTD_OverlapDescriptor() { - } - - /**Pseudo-Constructor*/ - HGTD_OverlapDescriptor* clone() const; - - /** get the compatible surfaces - - return vector : surfaces - - primary bin surface : sf - - position & direction : pos, dir - */ - bool reachableSurfaces(std::vector& surfaces, - const Trk::Surface& sf, - const Amg::Vector3D& pos, - const Amg::Vector3D& dir) const override; - - bool reachableSurfaces(std::vector& surfaces, - const Amg::Vector3D& pos, - const Amg::Vector3D& dir) const override; - - private: - bool getSurfaces(std::vector& surfaces, const Amg::Vector3D& pos) const; - - void dumpSurfaces(std::vector& surfaces) const; - - - float m_binSize; - const Trk::BinnedArray* m_binnedArray; - std::vector < float > m_valuesR; - std::vector < std::vector< float> > m_valuesPhi; - int m_nStepsR; - int m_nStepsPhi; - - }; - - - inline HGTD_OverlapDescriptor* HGTD_OverlapDescriptor::clone() const { - return new HGTD_OverlapDescriptor(); +/** @class HGTD_OverlapDescriptor + * Class to describe overlaps in the HGTD detector. + * It extends the Trk::OverlapDescriptor base class. + * + * There are two interface methods, one provides the most probably overlapcell, + * the second provides a list of overlap cells, based on an restricted area + * + */ + +class HGTD_OverlapDescriptor : public Trk::OverlapDescriptor { +public: + + /** Constructor */ + HGTD_OverlapDescriptor(const Trk::BinnedArray* bin_array = nullptr, + std::vector < float > valuesR = {}, + std::vector < std::vector< float> > valuesPhi = {}, + int nStepsR=3, int nStepsPhi=10); + + /** Destructor */ + virtual ~HGTD_OverlapDescriptor() { } - + + /**Pseudo-Constructor*/ + HGTD_OverlapDescriptor* clone() const; + + /** get the compatible surfaces + - return vector : surfaces + - primary bin surface : sf + - position & direction : pos, dir + */ + bool reachableSurfaces(std::vector& surfaces, + const Trk::Surface& sf, + const Amg::Vector3D& pos, + const Amg::Vector3D& dir) const override; + + bool reachableSurfaces(std::vector& surfaces, + const Amg::Vector3D& pos, + const Amg::Vector3D& dir) const override; + +private: + bool getSurfaces(std::vector& surfaces, const Amg::Vector3D& pos) const; + + void dumpSurfaces(std::vector& surfaces) const; + + + float m_binSize; + const Trk::BinnedArray* m_binnedArray; + std::vector < float > m_valuesR; + std::vector < std::vector< float> > m_valuesPhi; + int m_nStepsR; + int m_nStepsPhi; + +}; + +inline HGTD_OverlapDescriptor* HGTD_OverlapDescriptor::clone() const { + return new HGTD_OverlapDescriptor(); } #endif // end of HGTDET_HGTDTRACKINGGEOMETRY_HGTDOVERLAPDESCRIPTOR diff --git a/HighGranularityTimingDetector/HGTD_DetDescr/HGTD_TrackingGeometry/HGTD_TrackingGeometry/HGTD_TrackingGeometryBuilder.h b/HighGranularityTimingDetector/HGTD_DetDescr/HGTD_TrackingGeometry/HGTD_TrackingGeometry/HGTD_TrackingGeometryBuilder.h index bc49d43df8bd69a14ad0855196af778a7d864ba9..9c60448739f014171034cdb6b43593b052959a43 100644 --- a/HighGranularityTimingDetector/HGTD_DetDescr/HGTD_TrackingGeometry/HGTD_TrackingGeometry/HGTD_TrackingGeometryBuilder.h +++ b/HighGranularityTimingDetector/HGTD_DetDescr/HGTD_TrackingGeometry/HGTD_TrackingGeometry/HGTD_TrackingGeometryBuilder.h @@ -40,61 +40,53 @@ struct DiscLayerInfo { float maxR = 0.; float maxZ = 0.; float thickness = 0.; - float minZ = std::numeric_limits::max(); - float minR = std::numeric_limits::max(); + float minZ = std::numeric_limits::max(); + float minR = std::numeric_limits::max(); }; -namespace HGTDet { - - class HGTD_TrackingGeometryBuilder : public AthAlgTool, - virtual public Trk::IGeometryBuilder { - - public: - /** Constructor */ - HGTD_TrackingGeometryBuilder(const std::string&,const std::string&,const IInterface*); - - /** Destructor */ - virtual ~HGTD_TrackingGeometryBuilder(); - - /** AlgTool initailize method.*/ - StatusCode initialize(); - - /** AlgTool finalize method */ - StatusCode finalize(); - - /** TrackingGeometry Interface methode */ - const Trk::TrackingGeometry* trackingGeometry(const Trk::TrackingVolume* tvol = 0) const; - - /** The unique signature */ - //TODO: Add HGTD Trk signature - Trk::GeometrySignature geometrySignature() const { return Trk::HGTD; } - - private: - /** Service to handle the envelope definition */ - ServiceHandle m_enclosingEnvelopeSvc; - /** Helper tools for the geometry building */ - ToolHandle m_layerBuilder; - /** Helper Tool to create TrackingVolumes */ - ToolHandle m_trackingVolumeCreator; - - /** configurations for the layer builder */ - /** forces robust indexing for layers */ - bool m_indexStaticLayers; - /** create boundary layers */ - bool m_buildBoundaryLayers; - /** run with replacement of all joint boundaries */ - bool m_replaceJointBoundaries; - /** binning type for layers */ - int m_layerBinningType; - /** Color code for layers */ - unsigned int m_colorCodeConfig; - - }; - - - -} // end of namespace +class HGTD_TrackingGeometryBuilder : public AthAlgTool, + virtual public Trk::IGeometryBuilder { +public: + /** Constructor */ + HGTD_TrackingGeometryBuilder(const std::string&,const std::string&,const IInterface*); + /** Destructor */ + virtual ~HGTD_TrackingGeometryBuilder(); + + /** AlgTool initailize method.*/ + StatusCode initialize(); + + /** AlgTool finalize method */ + StatusCode finalize(); + + /** TrackingGeometry Interface methode */ + const Trk::TrackingGeometry* trackingGeometry(const Trk::TrackingVolume* tvol = 0) const; + + /** The unique signature */ + //TODO: Add HGTD Trk signature + Trk::GeometrySignature geometrySignature() const { return Trk::HGTD; } + +private: + /** Service to handle the envelope definition */ + ServiceHandle m_enclosingEnvelopeSvc; + /** Helper tools for the geometry building */ + ToolHandle m_layerBuilder; + /** Helper Tool to create TrackingVolumes */ + ToolHandle m_trackingVolumeCreator; + + /** configurations for the layer builder */ + /** forces robust indexing for layers */ + bool m_indexStaticLayers; + /** create boundary layers */ + bool m_buildBoundaryLayers; + /** run with replacement of all joint boundaries */ + bool m_replaceJointBoundaries; + /** binning type for layers */ + int m_layerBinningType; + /** Color code for layers */ + unsigned int m_colorCodeConfig; + +}; #endif // HGTD_TRACKINGGEOMETRY_HGTD_TRACKINGGEOMETRYBUILDER_H diff --git a/HighGranularityTimingDetector/HGTD_DetDescr/HGTD_TrackingGeometry/python/ConfiguredHGTDTrackingGeometryBuilder.py b/HighGranularityTimingDetector/HGTD_DetDescr/HGTD_TrackingGeometry/python/ConfiguredHGTDTrackingGeometryBuilder.py index 6fca3f333428278f525d90ecab2922274b98125f..5cfc55a124493b57e12d7f4fe48682d0bee0c817 100644 --- a/HighGranularityTimingDetector/HGTD_DetDescr/HGTD_TrackingGeometry/python/ConfiguredHGTDTrackingGeometryBuilder.py +++ b/HighGranularityTimingDetector/HGTD_DetDescr/HGTD_TrackingGeometry/python/ConfiguredHGTDTrackingGeometryBuilder.py @@ -12,17 +12,17 @@ from AthenaCommon.Include import Include, IncludeError, include # import the Extrapolator configurable -from HGTD_TrackingGeometry.HGTD_TrackingGeometryConf import HGTDet__HGTD_TrackingGeometryBuilder +from HGTD_TrackingGeometry.HGTD_TrackingGeometryConf import HGTD_TrackingGeometryBuilder # define the class -class ConfiguredHGTDTrackingGeometryBuilder( HGTDet__HGTD_TrackingGeometryBuilder ): +class ConfiguredHGTDTrackingGeometryBuilder( HGTD_TrackingGeometryBuilder ): # constructor def __init__(self,name = 'HGTDTrackingGeometryBuilder'): from AthenaCommon.AppMgr import ToolSvc, ServiceMgr from TrkDetDescrSvc.TrkDetDescrJobProperties import TrkDetFlags - from HGTD_TrackingGeometry.HGTD_TrackingGeometryConf import HGTDet__HGTD_LayerBuilder + from HGTD_TrackingGeometry.HGTD_TrackingGeometryConf import HGTD_LayerBuilder # HGTD building - HGTD_LayerBuilder = HGTDet__HGTD_LayerBuilder(name='HGTD_LayerBuilder') + HGTD_LayerBuilder = HGTD_LayerBuilder(name='HGTD_LayerBuilder') HGTD_LayerBuilder.Identification = 'HGTD' HGTD_LayerBuilder.SetLayerAssociation = True # output level @@ -32,7 +32,7 @@ class ConfiguredHGTDTrackingGeometryBuilder( HGTDet__HGTD_TrackingGeometryBuilde # HGTD -> ToolSvc ToolSvc += HGTD_LayerBuilder - HGTDet__HGTD_TrackingGeometryBuilder.__init__(self,name, - LayerBuilder = HGTD_LayerBuilder, - EnvelopeDefinitionSvc = ServiceMgr.AtlasEnvelopeSvcDefinitionSvc, - TrackingVolumeCreator = ToolSvc.InDetCylinderVolumeCreator) + HGTD_TrackingGeometryBuilder.__init__(self,name, + LayerBuilder = HGTD_LayerBuilder, + EnvelopeDefinitionSvc = ServiceMgr.AtlasEnvelopeSvcDefinitionSvc, + TrackingVolumeCreator = ToolSvc.InDetCylinderVolumeCreator) diff --git a/HighGranularityTimingDetector/HGTD_DetDescr/HGTD_TrackingGeometry/src/HGTD_LayerBuilder.cxx b/HighGranularityTimingDetector/HGTD_DetDescr/HGTD_TrackingGeometry/src/HGTD_LayerBuilder.cxx index 92e4040941729d66b68076d5298c03639e77f9a2..9d7c393f4f54947ce5080f5555a410453bf33871 100644 --- a/HighGranularityTimingDetector/HGTD_DetDescr/HGTD_TrackingGeometry/src/HGTD_LayerBuilder.cxx +++ b/HighGranularityTimingDetector/HGTD_DetDescr/HGTD_TrackingGeometry/src/HGTD_LayerBuilder.cxx @@ -43,7 +43,7 @@ #include // constructor -HGTDet::HGTD_LayerBuilder::HGTD_LayerBuilder(const std::string& t, const std::string& n, const IInterface* p) : +HGTD_LayerBuilder::HGTD_LayerBuilder(const std::string& t, const std::string& n, const IInterface* p) : AthAlgTool(t,n,p), m_hgtdMgr(0), m_hgtdHelper(0), @@ -70,12 +70,12 @@ HGTDet::HGTD_LayerBuilder::HGTD_LayerBuilder(const std::string& t, const std::st } // destructor -HGTDet::HGTD_LayerBuilder::~HGTD_LayerBuilder() +HGTD_LayerBuilder::~HGTD_LayerBuilder() {} // Athena standard methods // initialize -StatusCode HGTDet::HGTD_LayerBuilder::initialize() +StatusCode HGTD_LayerBuilder::initialize() { ATH_MSG_DEBUG( "initialize()" ); @@ -87,7 +87,7 @@ StatusCode HGTDet::HGTD_LayerBuilder::initialize() } // finalize -StatusCode HGTDet::HGTD_LayerBuilder::finalize() +StatusCode HGTD_LayerBuilder::finalize() { ATH_MSG_DEBUG( "finalize() successful" ); return StatusCode::SUCCESS; @@ -95,9 +95,9 @@ StatusCode HGTDet::HGTD_LayerBuilder::finalize() /** LayerBuilder interface method - returning Endcap-like layers */ -const std::vector< const Trk::DiscLayer* >* HGTDet::HGTD_LayerBuilder::discLayers() const +const std::vector< const Trk::DiscLayer* >* HGTD_LayerBuilder::discLayers() const { - ATH_MSG_DEBUG( "calling HGTDet::HGTD_LayerBuilder::discLayers()" ); + ATH_MSG_DEBUG( "calling HGTD_LayerBuilder::discLayers()" ); // get general layout InDetDD::HGTD_DetectorElementCollection::const_iterator hgtdDetIter = m_hgtdMgr->getDetectorElementBegin(); @@ -294,7 +294,7 @@ const std::vector< const Trk::DiscLayer* >* HGTDet::HGTD_LayerBuilder::discLayer } -const Trk::LayerMaterialProperties* HGTDet::HGTD_LayerBuilder::discLayerMaterial(double rMin, double rMax) const +const Trk::LayerMaterialProperties* HGTD_LayerBuilder::discLayerMaterial(double rMin, double rMax) const { Trk::BinUtility layerBinUtilityR(m_rBins, rMin, rMax, Trk::open, Trk::binR); Trk::BinUtility layerBinUtilityPhi(m_phiBins, -M_PI, M_PI, Trk::closed, Trk::binPhi); @@ -304,7 +304,7 @@ const Trk::LayerMaterialProperties* HGTDet::HGTD_LayerBuilder::discLayerMaterial return layerMaterial; } -void HGTDet::HGTD_LayerBuilder::registerSurfacesToLayer(const std::vector& layerSurfaces, const Trk::Layer& lay) const +void HGTD_LayerBuilder::registerSurfacesToLayer(const std::vector& layerSurfaces, const Trk::Layer& lay) const { if (!m_setLayerAssociation) return; // register the surfaces to the layer @@ -317,9 +317,9 @@ void HGTDet::HGTD_LayerBuilder::registerSurfacesToLayer(const std::vector& surfaces, - std::vector& rBins, float& maxRadius, - std::vector>& phiBins) const +void HGTD_LayerBuilder::evaluateBestBinning(std::vector& surfaces, + std::vector& rBins, float& maxRadius, + std::vector>& phiBins) const { // get all the centers (r,phi), as you want to play with them std::vector < std::pair< float, float> > centers = {}; diff --git a/HighGranularityTimingDetector/HGTD_DetDescr/HGTD_TrackingGeometry/src/HGTD_OverlapDescriptor.cxx b/HighGranularityTimingDetector/HGTD_DetDescr/HGTD_TrackingGeometry/src/HGTD_OverlapDescriptor.cxx index f66fb4fcfbb0da2ce6cd6fad4fa74fc61c2f4f93..8762f10202d37af377b87c50aed6952e9bf4ee80 100644 --- a/HighGranularityTimingDetector/HGTD_DetDescr/HGTD_TrackingGeometry/src/HGTD_OverlapDescriptor.cxx +++ b/HighGranularityTimingDetector/HGTD_DetDescr/HGTD_TrackingGeometry/src/HGTD_OverlapDescriptor.cxx @@ -18,10 +18,10 @@ #include "StoreGate/StoreGateSvc.h" #include "Identifier/Identifier.h" -HGTDet::HGTD_OverlapDescriptor::HGTD_OverlapDescriptor(const Trk::BinnedArray* bin_array, - std::vector < float > valuesR, - std::vector < std::vector< float> > valuesPhi, - int nStepsR, int nStepsPhi): +HGTD_OverlapDescriptor::HGTD_OverlapDescriptor(const Trk::BinnedArray* bin_array, + std::vector < float > valuesR, + std::vector < std::vector< float> > valuesPhi, + int nStepsR, int nStepsPhi): m_binnedArray(bin_array), m_valuesR(valuesR), m_valuesPhi(valuesPhi), @@ -30,10 +30,10 @@ HGTDet::HGTD_OverlapDescriptor::HGTD_OverlapDescriptor(const Trk::BinnedArray& surfaces, - const Trk::Surface& tsf, - const Amg::Vector3D& pos, - const Amg::Vector3D&) const +bool HGTD_OverlapDescriptor::reachableSurfaces(std::vector& surfaces, + const Trk::Surface& tsf, + const Amg::Vector3D& pos, + const Amg::Vector3D&) const { surfaces.push_back(Trk::SurfaceIntersection(Trk::Intersection(pos, 0., true),&tsf)); @@ -44,9 +44,9 @@ bool HGTDet::HGTD_OverlapDescriptor::reachableSurfaces(std::vector& surfaces, - const Amg::Vector3D& pos, - const Amg::Vector3D&) const +bool HGTD_OverlapDescriptor::reachableSurfaces(std::vector& surfaces, + const Amg::Vector3D& pos, + const Amg::Vector3D&) const { // add the other targets if any starting from the position you have @@ -54,8 +54,8 @@ bool HGTDet::HGTD_OverlapDescriptor::reachableSurfaces(std::vector& surfaces, - const Amg::Vector3D& pos) const +bool HGTD_OverlapDescriptor::getSurfaces(std::vector& surfaces, + const Amg::Vector3D& pos) const { float centerR = pos.perp(); float centerPhi = pos.phi(); @@ -99,7 +99,7 @@ bool HGTDet::HGTD_OverlapDescriptor::getSurfaces(std::vector& surfaces) const { +void HGTD_OverlapDescriptor::dumpSurfaces(std::vector& surfaces) const { // Get Storegate, ID helpers, and so on ISvcLocator* svcLocator = Gaudi::svcLocator(); diff --git a/HighGranularityTimingDetector/HGTD_DetDescr/HGTD_TrackingGeometry/src/HGTD_TrackingGeometryBuilder.cxx b/HighGranularityTimingDetector/HGTD_DetDescr/HGTD_TrackingGeometry/src/HGTD_TrackingGeometryBuilder.cxx index 1c21b1fbde424d231667b68ecb3915096bd56fe3..367b7bd2bc9960dfafda8d66e83c7b5145a0ddf0 100644 --- a/HighGranularityTimingDetector/HGTD_DetDescr/HGTD_TrackingGeometry/src/HGTD_TrackingGeometryBuilder.cxx +++ b/HighGranularityTimingDetector/HGTD_DetDescr/HGTD_TrackingGeometry/src/HGTD_TrackingGeometryBuilder.cxx @@ -6,7 +6,7 @@ // HGTD_TrackingGeometryBuilder.cxx, (c) ATLAS Detector software /////////////////////////////////////////////////////////////////// -// HGTDet +// HGTD #include "HGTD_TrackingGeometry/HGTD_TrackingGeometryBuilder.h" // Trk interfaces #include "TrkDetDescrInterfaces/ILayerBuilder.h" @@ -37,7 +37,7 @@ #include // constructor -HGTDet::HGTD_TrackingGeometryBuilder::HGTD_TrackingGeometryBuilder(const std::string& t, const std::string& n, const IInterface* p) : +HGTD_TrackingGeometryBuilder::HGTD_TrackingGeometryBuilder(const std::string& t, const std::string& n, const IInterface* p) : AthAlgTool(t,n,p), m_enclosingEnvelopeSvc("AtlasGeometry_EnvelopeDefSvc", n), m_trackingVolumeCreator("Trk::CylinderVolumeCreator/CylinderVolumeCreator"), @@ -62,13 +62,13 @@ HGTDet::HGTD_TrackingGeometryBuilder::HGTD_TrackingGeometryBuilder(const std::st } // destructor -HGTDet::HGTD_TrackingGeometryBuilder::~HGTD_TrackingGeometryBuilder() +HGTD_TrackingGeometryBuilder::~HGTD_TrackingGeometryBuilder() { } // Athena standard methods // initialize -StatusCode HGTDet::HGTD_TrackingGeometryBuilder::initialize() +StatusCode HGTD_TrackingGeometryBuilder::initialize() { // retrieve envelope definition service ATH_CHECK(m_enclosingEnvelopeSvc.retrieve()); @@ -84,13 +84,13 @@ StatusCode HGTDet::HGTD_TrackingGeometryBuilder::initialize() } // finalize -StatusCode HGTDet::HGTD_TrackingGeometryBuilder::finalize() +StatusCode HGTD_TrackingGeometryBuilder::finalize() { ATH_MSG_INFO( "finalize() successful" ); return StatusCode::SUCCESS; } -const Trk::TrackingGeometry* HGTDet::HGTD_TrackingGeometryBuilder::trackingGeometry(const Trk::TrackingVolume* innerVol) const +const Trk::TrackingGeometry* HGTD_TrackingGeometryBuilder::trackingGeometry(const Trk::TrackingVolume* innerVol) const { ATH_MSG_VERBOSE( "Starting to build HGTD_TrackingGeometry ..." ); diff --git a/HighGranularityTimingDetector/HGTD_DetDescr/HGTD_TrackingGeometry/src/components/HGTD_TrackingGeometry_entries.cxx b/HighGranularityTimingDetector/HGTD_DetDescr/HGTD_TrackingGeometry/src/components/HGTD_TrackingGeometry_entries.cxx index 85e6e623a187cecfad9ab8d8b20fc7b385891ac1..a217d0578b423e30d8c3c7c07c5284c5870807ef 100644 --- a/HighGranularityTimingDetector/HGTD_DetDescr/HGTD_TrackingGeometry/src/components/HGTD_TrackingGeometry_entries.cxx +++ b/HighGranularityTimingDetector/HGTD_DetDescr/HGTD_TrackingGeometry/src/components/HGTD_TrackingGeometry_entries.cxx @@ -3,8 +3,6 @@ #include "HGTD_TrackingGeometry/HGTD_LayerBuilder.h" #include "HGTD_TrackingGeometry/HGTD_TrackingGeometryBuilder.h" -using namespace HGTDet; - DECLARE_TOOL_FACTORY( HGTD_LayerBuilder ) DECLARE_TOOL_FACTORY( HGTD_TrackingGeometryBuilder ) diff --git a/HighGranularityTimingDetector/HGTD_Digitization/HGTD_Digitization/HGTD_Digitization/HGTD_DigitizationTool.h b/HighGranularityTimingDetector/HGTD_Digitization/HGTD_Digitization/HGTD_Digitization/HGTD_DigitizationTool.h index f9ce87245f36d1a1e0451f443848bae60e1152c1..5eb37f1c213357d1cc7f1d51009fa46be58a1815 100644 --- a/HighGranularityTimingDetector/HGTD_Digitization/HGTD_Digitization/HGTD_Digitization/HGTD_DigitizationTool.h +++ b/HighGranularityTimingDetector/HGTD_Digitization/HGTD_Digitization/HGTD_Digitization/HGTD_DigitizationTool.h @@ -95,10 +95,10 @@ private: */ void applyProcessorTools(SiChargedDiodeCollection*); - std::unique_ptr + std::unique_ptr createRDOCollection(SiChargedDiodeCollection*); - StatusCode storeRDOCollection(std::unique_ptr); + StatusCode storeRDOCollection(std::unique_ptr); // inserts the created SDO elements into the m_sdo_collection object. void createAndStoreSDO(SiChargedDiodeCollection* collection); @@ -110,12 +110,16 @@ private: const HGTD_ID* m_id_helper; const HGTD_DetectorManager* m_det_mgr; - HGTD::HGTD_RDOContainer* m_hgtd_rdo_container; + HGTD_RDOContainer* m_hgtd_rdo_container; std::string m_output_rdo_cont_name; InDetSimDataCollection* m_sdo_collection; std::string m_output_sdo_coll_name; + float m_integrated_luminosity; + + bool m_smear_meantime; + /** @brief In order to process all element rather than just those with hits we * create a vector to keep track of which elements have been processed. * This is useful for adding random noise (?!) @@ -137,6 +141,8 @@ private: * digitization procedure, the rest is discarded. Given in ns.*/ float m_active_time_window; + float m_charge_threshold; + ServiceHandle m_rndm_svc; CLHEP::HepRandomEngine* m_rndm_engine; diff --git a/HighGranularityTimingDetector/HGTD_Digitization/HGTD_Digitization/HGTD_Digitization/HGTD_SurfaceChargesGenerator.h b/HighGranularityTimingDetector/HGTD_Digitization/HGTD_Digitization/HGTD_Digitization/HGTD_SurfaceChargesGenerator.h index d1ea2f7fa93d36401f2fe3550477c05dca453b9d..f0018ea4275e26f66ef0d06edbc46f6c68e7c324 100644 --- a/HighGranularityTimingDetector/HGTD_Digitization/HGTD_Digitization/HGTD_Digitization/HGTD_SurfaceChargesGenerator.h +++ b/HighGranularityTimingDetector/HGTD_Digitization/HGTD_Digitization/HGTD_Digitization/HGTD_SurfaceChargesGenerator.h @@ -25,14 +25,16 @@ #include +class HGTD_TimingResolution; + class HGTD_SurfaceChargesGenerator : public AthAlgTool, public virtual IHGTD_SurfaceChargesGenerator { public: /** constructor */ - HGTD_SurfaceChargesGenerator(const std::string& type, const std::string& name, - const IInterface* parent); + HGTD_SurfaceChargesGenerator(const std::string &type, const std::string &name, + const IInterface *parent); /** Destructor */ virtual ~HGTD_SurfaceChargesGenerator() = default; @@ -41,15 +43,29 @@ public: StatusCode initialize() override; virtual void createSurfaceChargesFromHit( - const TimedHitPtr& timed_hit_ptr, - SiChargedDiodeCollection* diode_coll, - const InDetDD::SolidStateDetectorElementBase* element, - CLHEP::HepRandomEngine* rndm_engine) const override; + const TimedHitPtr &timed_hit_ptr, + SiChargedDiodeCollection *diode_coll, + const InDetDD::SolidStateDetectorElementBase *element, + CLHEP::HepRandomEngine *rndm_engine) const override; + + inline void setIntegratedLuminosity(float integrated_luminosity) override { + m_integrated_luminosity = integrated_luminosity; + } + + inline void setSmearingTime(bool smear_meantime=true) override { + m_smear_meantime = smear_meantime; + } + + void createTimingResolutionTool() override; + private: // TODO: where do we get this from? FloatProperty m_small_step_length; /*um*/ + std::unique_ptr m_hgtd_timing_resolution_tool; float m_diffusion_constant; + bool m_smear_meantime; + float m_integrated_luminosity; // TODO what does the BooleanProperty allow to do? BooleanProperty m_needs_mc_evt_coll_helper{false}; }; diff --git a/HighGranularityTimingDetector/HGTD_Digitization/HGTD_Digitization/HGTD_Digitization/HGTD_TimingResolution.h b/HighGranularityTimingDetector/HGTD_Digitization/HGTD_Digitization/HGTD_Digitization/HGTD_TimingResolution.h new file mode 100644 index 0000000000000000000000000000000000000000..6d271892edd04bd5c10b1e222dcddb6eb366e881 --- /dev/null +++ b/HighGranularityTimingDetector/HGTD_Digitization/HGTD_Digitization/HGTD_Digitization/HGTD_TimingResolution.h @@ -0,0 +1,100 @@ +/** + * Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration. + * + * @file HGTD_Digitization/HGTD_TimingResolution.h + * + * @author Tao Wang + * + * @date October, 2021 + * + * @brief Smearing LGAD timing based on integrated luminosity and radius + */ + +#ifndef HGTD_TIMINGRESOLUTION_H +#define HGTD_TIMINGRESOLUTION_H + +#include +#include +#include + +#include "CLHEP/Random/RandomEngine.h" + +class HGTD_TimingResolution { +public: + HGTD_TimingResolution(float integratedLumi = 0, float Rmin = 120., + float Rmax = 670., float z = 3500.); + + // Initialize and check + void init(); + bool radiusInRange(float) const; + bool etaInRange(float); + + // methods + float hitTimingResolution(float radius) const; + + bool changeResolution2(float integratedLumi); + float resolution(float) const; + float gain(float); + float sensorResolution() const; + + float translateR2Eta(float); + float translateEta2R(float); + + void radToResolution(); + void radToGain(); + void ComputeDose(float lumi); + void print(); + + /** Return simulated CFD time */ + float calculateTime(const float t, const float E, float r, CLHEP::HepRandomEngine* rndm_engine) const; + + constexpr static float HGTDInitialLuminosity = 0.0; + constexpr static float HGTDIntermediateLuminosity_pre_Replacement = 2000.0; + constexpr static float HGTDIntermediateLuminosity_post_Replacement = 2001.0; + constexpr static float HGTDFinalLuminosity = 4000.0; + +private: + std::string m_version; + + float m_Rmin; + float m_Rmax; + + float m_z; + float m_integratedLumi; + + float m_sensorResolution; + + std::vector m_radii; + // Inner ring is replaced every 1 ab-1, middle ring replaced every 2 ab-1, + // outer ring will be used till 4000 fb-1 Dose radius relation for inner ring + // at 1000 fb-1 integrated luminosity + std::vector m_doseInner1000; + std::vector m_doseMiddle2000; + std::vector m_doseOuter4000; + std::vector m_dose; + std::vector m_resolution; + std::vector m_gain; + + std::vector> m_doseResolution; + std::vector> m_doseGain; + + float m_sensorNoiseFactor = + 0.0229; // factor use to simulate the electronic noise (1mm*1mm) + + float m_cfdThreshold = 0.5; // fraction of max amplitude at which the time is + // extracted (default: 50%) + + float mutable m_pulseWaveform[400] = {0}; // Signal Pulse + + /** Simulate a new pulse that can be acess using the PulseShape method */ + void simulatePulse(CLHEP::HepRandomEngine* rndm_engine) const; + + /** Calculate the pulse as a vector of float (400 points) */ + void calculatePulse(std::map> &pulsebin, + float t, float E, float *max, CLHEP::HepRandomEngine* rndm_engine) const; + + + // std::unique_ptr m_timingResolution; +}; + +#endif diff --git a/HighGranularityTimingDetector/HGTD_Digitization/HGTD_Digitization/HGTD_Digitization/IHGTD_SurfaceChargesGenerator.h b/HighGranularityTimingDetector/HGTD_Digitization/HGTD_Digitization/HGTD_Digitization/IHGTD_SurfaceChargesGenerator.h index 59ef0dcbbc778d5d079d307e0cd834a59e43c3df..5c2e106baba65ff409bc839d47d8b965225a4867 100644 --- a/HighGranularityTimingDetector/HGTD_Digitization/HGTD_Digitization/HGTD_Digitization/IHGTD_SurfaceChargesGenerator.h +++ b/HighGranularityTimingDetector/HGTD_Digitization/HGTD_Digitization/HGTD_Digitization/IHGTD_SurfaceChargesGenerator.h @@ -51,8 +51,15 @@ public: const InDetDD::SolidStateDetectorElementBase* ele, CLHEP::HepRandomEngine* rndmEngine) const = 0; + virtual void setIntegratedLuminosity(float integrated_luminosity) = 0; + + virtual void setSmearingTime(bool smear_meantime) = 0; + + virtual void createTimingResolutionTool() = 0; + // Creates the InterfaceID and interfaceID() method DeclareInterfaceID(IHGTD_SurfaceChargesGenerator, 1, 0); + }; #endif // HGTD_DIGITZATION_IHGTD_SURFACECHARGESGENERATOR_H diff --git a/HighGranularityTimingDetector/HGTD_Digitization/HGTD_Digitization/src/HGTD_DigitizationTool.cxx b/HighGranularityTimingDetector/HGTD_Digitization/HGTD_Digitization/src/HGTD_DigitizationTool.cxx index 410a78bbc7aa2b70a83913e407d42361db84eb58..651cee20243576c01e3b61c756ac351cef62a613 100644 --- a/HighGranularityTimingDetector/HGTD_Digitization/HGTD_Digitization/src/HGTD_DigitizationTool.cxx +++ b/HighGranularityTimingDetector/HGTD_Digitization/HGTD_Digitization/src/HGTD_DigitizationTool.cxx @@ -37,9 +37,12 @@ HGTD_DigitizationTool::HGTD_DigitizationTool(const std::string& type, m_output_rdo_cont_name("HGTD_RDOs"), m_sdo_collection(nullptr), m_output_sdo_coll_name("HGTD_SDO_Map"), + m_integrated_luminosity(0), + m_smear_meantime(true), m_input_collection_name("HGTD_Hits"), m_timed_hit_coll(nullptr), m_active_time_window(10000), + m_charge_threshold(625.), m_rndm_svc("AtRndmGenSvc", name), m_rndm_engine(nullptr), m_hgtd_surf_charge_gen("HGTD_SurfaceChargesGenerator", this), @@ -53,6 +56,8 @@ HGTD_DigitizationTool::HGTD_DigitizationTool(const std::string& type, "Name of the retrieved RDO collection"); declareProperty("ActiveTimeWindow", m_active_time_window = 10000, "Hits within this time window are used for digitization"); + declareProperty("ChargeThreshold", m_charge_threshold = 625., + "Minimum charge threshold in ASIC"); declareProperty("RndmSvc", m_rndm_svc, "Random Number Service used in HGTD & Pixel digitization"); declareProperty("HGTD_SurfaceChargesGenerator", m_hgtd_surf_charge_gen, @@ -61,6 +66,9 @@ HGTD_DigitizationTool::HGTD_DigitizationTool(const std::string& type, "Tool for pulse shape simulation"); declareProperty("OutputSDOName", m_output_sdo_coll_name = "HGTD_SDO_Map", "Output SDO container name"); + declareProperty("SmearMeanTime", m_smear_meantime); + declareProperty("IntegratedLuminosity", m_integrated_luminosity = 0, + "Integraed Luminosity"); } StatusCode HGTD_DigitizationTool::initialize() { @@ -76,6 +84,9 @@ StatusCode HGTD_DigitizationTool::initialize() { m_rndm_engine = m_rndm_svc->GetEngine("HGTD_Digitization"); ATH_CHECK(m_hgtd_surf_charge_gen.retrieve()); + m_hgtd_surf_charge_gen->setIntegratedLuminosity(m_integrated_luminosity); + m_hgtd_surf_charge_gen->createTimingResolutionTool(); + m_hgtd_surf_charge_gen->setSmearingTime(m_smear_meantime); ATH_CHECK(m_hgtd_front_end_tool.retrieve()); m_hgtd_front_end_tool->setRandomEngine(m_rndm_engine); @@ -118,7 +129,7 @@ HGTD_DigitizationTool::processBunchXing(int bunch_xing, SubEventIterator loc_sub_event_itr = sub_event_itr; for (; loc_sub_event_itr != sub_event_itr_end; loc_sub_event_itr++) { - StoreGateSvc& store_gate_svc = *loc_sub_event_itr->ptr()->evtStore(); + StoreGateSvc &store_gate_svc = *loc_sub_event_itr->ptr()->evtStore(); ATH_MSG_DEBUG("SubEvt StoreGate " << store_gate_svc.name() << " :" << " bunch crossing : " << bunch_xing << " time offset : " @@ -126,7 +137,7 @@ HGTD_DigitizationTool::processBunchXing(int bunch_xing, << loc_sub_event_itr->ptr()->eventNumber() << " run number : " << loc_sub_event_itr->ptr()->runNumber()); - const SiHitCollection* hit_coll(nullptr); + const SiHitCollection *hit_coll(nullptr); if (store_gate_svc.retrieve(hit_coll, m_input_collection_name) .isFailure()) { @@ -141,7 +152,7 @@ HGTD_DigitizationTool::processBunchXing(int bunch_xing, pileupTypeMapper(loc_sub_event_itr->type())); // FIXME do I really need this? - SiHitCollection* hit_coll_cpy = new SiHitCollection(*hit_coll); + SiHitCollection *hit_coll_cpy = new SiHitCollection(*hit_coll); m_timed_hit_coll->insert(time_idx, hit_coll_cpy); @@ -159,7 +170,7 @@ StatusCode HGTD_DigitizationTool::mergeEvent() { // FIXME: needs to be added once noise/selftriggering has to go in // ATH_CHECK(simulateNoisePerDetectorElement()); - for (std::vector::iterator it = m_hit_coll_ptrs.begin(); + for (std::vector::iterator it = m_hit_coll_ptrs.begin(); it != m_hit_coll_ptrs.end(); it++) { (*it)->Clear(); delete (*it); @@ -177,8 +188,7 @@ StatusCode HGTD_DigitizationTool::prepareEvent(unsigned int /*index*/) { ATH_MSG_DEBUG("HGTD_DigitizationTool::prepareEvent()"); // Create the IdentifiableContainer to contain the digit collections Create // a new RDO container - m_hgtd_rdo_container = - new HGTD::HGTD_RDOContainer(m_id_helper->wafer_hash_max()); + m_hgtd_rdo_container = new HGTD_RDOContainer(m_id_helper->wafer_hash_max()); // register RDO container with storegate ATH_CHECK(evtStore()->record(m_hgtd_rdo_container, m_output_rdo_cont_name)); @@ -228,7 +238,7 @@ StatusCode HGTD_DigitizationTool::retrieveHitCollection() { // FIXME removed m_HardScatterSplittingMode and // m_HardScatterSplittingSkipper until we have confirmed we need this - const SiHitCollection* collection(coll_itr->second); + const SiHitCollection *collection(coll_itr->second); m_timed_hit_coll->insert(coll_itr->first, collection); @@ -253,14 +263,14 @@ StatusCode HGTD_DigitizationTool::digitizeHitsPerDetectorElement() { // loop while (m_timed_hit_coll->nextDetectorElement(coll_itr, coll_itr_end)) { - const TimedHitPtr& fist_hit = *coll_itr; + const TimedHitPtr &fist_hit = *coll_itr; Identifier id = m_id_helper->wafer_id( fist_hit->getBarrelEndcap(), fist_hit->getLayerDisk(), fist_hit->getPhiModule(), fist_hit->getEtaModule()); // get the det element from the manager - HGTD_DetectorElement* det_elem = m_det_mgr->getDetectorElement(id); + HGTD_DetectorElement *det_elem = m_det_mgr->getDetectorElement(id); // FIXME check for null?? // create a diode collection holding the digitized hits // FIXME (init once outside the while loop and use clear and set det elem??) @@ -272,7 +282,7 @@ StatusCode HGTD_DigitizationTool::digitizeHitsPerDetectorElement() { // diodes for (; coll_itr != coll_itr_end; coll_itr++) { - const TimedHitPtr& current_hit = *coll_itr; + const TimedHitPtr ¤t_hit = *coll_itr; // skip hits that are far away in time if (std::abs(current_hit->meanTime()) > @@ -290,7 +300,7 @@ StatusCode HGTD_DigitizationTool::digitizeHitsPerDetectorElement() { // now that the charges have been built, apply all digitization tools applyProcessorTools(charged_diode_coll.get()); // at this point, the RDOs and SDOs need to be created!!! - std::unique_ptr rdo_collection = + std::unique_ptr rdo_collection = createRDOCollection(charged_diode_coll.get()); ATH_CHECK(storeRDOCollection(std::move(rdo_collection))); @@ -304,11 +314,11 @@ StatusCode HGTD_DigitizationTool::digitizeHitsPerDetectorElement() { } void HGTD_DigitizationTool::applyProcessorTools( - SiChargedDiodeCollection* charged_diodes) { + SiChargedDiodeCollection *charged_diodes) { ATH_MSG_DEBUG("applyProcessorTools()"); int processorNumber = 0; - std::list::iterator provessor_itr = + std::list::iterator provessor_itr = m_diode_processor_tools.begin(); for (; provessor_itr != m_diode_processor_tools.end(); ++provessor_itr) { (*provessor_itr)->process(*charged_diodes); @@ -320,7 +330,7 @@ void HGTD_DigitizationTool::applyProcessorTools( } StatusCode HGTD_DigitizationTool::storeRDOCollection( - std::unique_ptr coll) { + std::unique_ptr coll) { // Create the RDO collection if (m_hgtd_rdo_container @@ -332,14 +342,13 @@ StatusCode HGTD_DigitizationTool::storeRDOCollection( return StatusCode::SUCCESS; } -std::unique_ptr -HGTD_DigitizationTool::createRDOCollection( +std::unique_ptr HGTD_DigitizationTool::createRDOCollection( SiChargedDiodeCollection* charged_diodes) { IdentifierHash idHash_de = charged_diodes->identifyHash(); - std::unique_ptr rdo_collection = - std::make_unique(idHash_de); + std::unique_ptr rdo_collection = + std::make_unique(idHash_de); // need the DE identifier const Identifier id_de = charged_diodes->identify(); @@ -350,6 +359,18 @@ HGTD_DigitizationTool::createRDOCollection( for (; i_chargedDiode != i_chargedDiode_end; ++i_chargedDiode) { + // skip deposits below the charge threshold of ~2fC after amplif. + // the charge here is the purely deposited charge, so factor ~20 less + // FIXME: gain radiation dependent, compensated with higher bias voltage + // more precise modelling in the future + SiChargedDiode& diode = (*i_chargedDiode).second; + if (diode.totalCharge().charge() < m_charge_threshold) { + ATH_MSG_DEBUG("charge of " << diode.totalCharge().charge() + << " does not pass threshold of " + << m_charge_threshold); + continue; + } + InDetDD::SiReadoutCellId readout_cell = (*i_chargedDiode).second.getReadoutCell(); int eta_index = readout_cell.etaIndex(); @@ -361,10 +382,8 @@ HGTD_DigitizationTool::createRDOCollection( // FIXME the method takes ID, phi, eta // FIXME switching order here to fix upstream issue with orientations const Identifier id_readout = - m_id_helper->pixel_id(charged_diodes->identify(), phi_index, - eta_index); + m_id_helper->pixel_id(charged_diodes->identify(), phi_index, eta_index); - SiChargedDiode& diode = (*i_chargedDiode).second; const SiTotalCharge& charge = diode.totalCharge(); // this is the time of the main charge. For now this might be OK as long as @@ -377,7 +396,7 @@ HGTD_DigitizationTool::createRDOCollection( int dummy_l1a = 0; int dummy_l1id = 0; - std::unique_ptr p_rdo = std::make_unique( + std::unique_ptr p_rdo = std::make_unique( id_readout, toa, dummy_tot, dummy_bcid, dummy_l1a, dummy_l1id); rdo_collection->push_back(p_rdo.release()); @@ -386,7 +405,7 @@ HGTD_DigitizationTool::createRDOCollection( } void HGTD_DigitizationTool::createAndStoreSDO( - SiChargedDiodeCollection* charged_diodes) { + SiChargedDiodeCollection *charged_diodes) { using list_t = SiTotalCharge::list_t; std::vector deposits; deposits.reserve(5); // no idea what a reasonable number for this would be @@ -398,7 +417,7 @@ void HGTD_DigitizationTool::createAndStoreSDO( for (; i_chargedDiode != i_chargedDiode_end; ++i_chargedDiode) { deposits.clear(); - const list_t& charges = + const list_t &charges = (*i_chargedDiode).second.totalCharge().chargeComposition(); bool real_particle_hit = false; @@ -409,7 +428,7 @@ void HGTD_DigitizationTool::createAndStoreSDO( for (; charge_list_itr != charge_list_itr_end; ++charge_list_itr) { - const HepMcParticleLink& trkLink = charge_list_itr->particleLink(); + const HepMcParticleLink &trkLink = charge_list_itr->particleLink(); const int barcode = trkLink.barcode(); if ((barcode == 0) or (barcode == crazyParticleBarcode)) { diff --git a/HighGranularityTimingDetector/HGTD_Digitization/HGTD_Digitization/src/HGTD_SurfaceChargesGenerator.cxx b/HighGranularityTimingDetector/HGTD_Digitization/HGTD_Digitization/src/HGTD_SurfaceChargesGenerator.cxx index d7adc0fa3b6bc1ba3b8e6828fc780710ea073ed7..468af681af13b1ebbf7ead75737da06bba8939d3 100644 --- a/HighGranularityTimingDetector/HGTD_Digitization/HGTD_Digitization/src/HGTD_SurfaceChargesGenerator.cxx +++ b/HighGranularityTimingDetector/HGTD_Digitization/HGTD_Digitization/src/HGTD_SurfaceChargesGenerator.cxx @@ -13,6 +13,7 @@ */ #include "HGTD_Digitization/HGTD_SurfaceChargesGenerator.h" +#include "HGTD_Digitization/HGTD_TimingResolution.h" #include "AtlasCLHEP_RandomGenerators/RandGaussZiggurat.h" #include "CLHEP/Random/RandomEngine.h" @@ -25,11 +26,10 @@ #include "SiDigitization/SiChargedDiodeCollection.h" HGTD_SurfaceChargesGenerator::HGTD_SurfaceChargesGenerator( - const std::string& type, const std::string& name, const IInterface* parent) - : AthAlgTool(type, name, parent), - m_small_step_length(1), - m_diffusion_constant(.007), - m_needs_mc_evt_coll_helper(false) { + const std::string &type, const std::string &name, const IInterface *parent) + : AthAlgTool(type, name, parent), m_small_step_length(1), + m_diffusion_constant(.007), m_smear_meantime(true), + m_integrated_luminosity(0), m_needs_mc_evt_coll_helper(false) { declareProperty("SmallStepLength", m_small_step_length = 1); declareProperty("DiffusionConstant", m_diffusion_constant); declareProperty("UseMcEventCollectionHelper", @@ -44,13 +44,18 @@ StatusCode HGTD_SurfaceChargesGenerator::initialize() { return StatusCode::SUCCESS; } +inline void HGTD_SurfaceChargesGenerator::createTimingResolutionTool() { + m_hgtd_timing_resolution_tool = + std::make_unique(m_integrated_luminosity); +} + void HGTD_SurfaceChargesGenerator::createSurfaceChargesFromHit( - const TimedHitPtr& timed_hit_ptr, - SiChargedDiodeCollection* diode_coll, - const InDetDD::SolidStateDetectorElementBase* element, - CLHEP::HepRandomEngine* rndm_engine) const { + const TimedHitPtr &timed_hit_ptr, + SiChargedDiodeCollection *diode_coll, + const InDetDD::SolidStateDetectorElementBase *element, + CLHEP::HepRandomEngine *rndm_engine) const { - const SiHit& hit = *timed_hit_ptr; + const SiHit &hit = *timed_hit_ptr; // check the status of truth information for this SiHit // some Truth information is cut for pile up events @@ -74,6 +79,13 @@ void HGTD_SurfaceChargesGenerator::createSurfaceChargesFromHit( float pixel_size_xphi = element->design().phiPitch(); float pixel_size_xeta = element->design().etaPitch(); + Amg::Vector3D element_center = element->center(); + ATH_MSG_DEBUG("x and y, z are: " << element_center.x() << ", " + << element_center.y() << ", " + << element_center.z()); + float element_r = sqrt(element_center.x() * element_center.x() + + element_center.y() * element_center.y()); + const CLHEP::Hep3Vector start_pos(hit.localStartPosition()); const CLHEP::Hep3Vector end_pos(hit.localEndPosition()); @@ -84,7 +96,11 @@ void HGTD_SurfaceChargesGenerator::createSurfaceChargesFromHit( CLHEP::Hep3Vector direction = end_pos - start_pos; float deposit_length = direction.mag(); int n_steps = deposit_length / m_small_step_length + 1; - direction.setMag(deposit_length / static_cast(n_steps)); + //the start and end pos can sit at the same position. Resizing the zero-length + //Hep3Vector would cause an error, so this we protect agains + if (deposit_length > 1.e-10) { + direction.setMag(deposit_length / static_cast(n_steps)); + } float tot_eloss = hit.energyLoss(); // FIXME using the mean ionization energy in Silicon @@ -94,7 +110,19 @@ void HGTD_SurfaceChargesGenerator::createSurfaceChargesFromHit( // FIXME is this correct? does the eventTime include a "later" truth event and // the meanTime is just the TOF? + ATH_MSG_DEBUG(">>>>>>> before processing, event_t, t, E, r: " + << timed_hit_ptr.eventTime() << ", " << hit.meanTime() << ", " + << tot_eloss << ", " << element_r); + float time_of_flight = timed_hit_ptr.eventTime() + hit.meanTime(); + if (m_smear_meantime) { + // Smearing based on radius and luminosity, and substract the time shift due + // to pulse leading edge (0.4 ns) + time_of_flight = m_hgtd_timing_resolution_tool->calculateTime( + time_of_flight, tot_eloss, element_r, rndm_engine) - + 0.4; + } + ATH_MSG_DEBUG(">>>>>>> after processing, t: " << time_of_flight); // FIXME needed to check for deposits in guardrings. This should be taken over // by the module design class and not hardcoded here! diff --git a/HighGranularityTimingDetector/HGTD_Digitization/HGTD_Digitization/src/HGTD_TimingResolution.cxx b/HighGranularityTimingDetector/HGTD_Digitization/HGTD_Digitization/src/HGTD_TimingResolution.cxx new file mode 100644 index 0000000000000000000000000000000000000000..d7650a3ad78a89647ea9f4ef99f6f2fdda77e7ef --- /dev/null +++ b/HighGranularityTimingDetector/HGTD_Digitization/HGTD_Digitization/src/HGTD_TimingResolution.cxx @@ -0,0 +1,370 @@ +/** + * Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration. + * + * @file HGTD_Digitization/src/HGTD_TimingResolution.cxx + * + * @author Tao Wang + * + * @date October, 2021 + */ + +#include "HGTD_Digitization/HGTD_TimingResolution.h" + +#include "CLHEP/Random/RandGaussZiggurat.h" +#include "TMath.h" +#include +#include + +namespace { +inline float remainder_1(float a, int b) { + float remainderValue = std::fmod(a, b); + if (remainderValue != 0. || a == 0.) { + return remainderValue; + } else { + return static_cast(b); + } +} + +inline float exp16(float x) { + x = 1.0 + x / 16.0; + return std::pow(x, 16); +} +} // namespace + +HGTD_TimingResolution::HGTD_TimingResolution(float integratedLumi, float Rmin, + float Rmax, float z) { + m_integratedLumi = std::fabs(integratedLumi); + m_z = z; + m_Rmin = Rmin; + m_Rmax = Rmax; + init(); +} +void HGTD_TimingResolution::init() { + m_version = "HGTD Timing three-ring layout"; + + if (m_radii.empty()) { + // Contain also the peripheral electronics region, i.e. (R>640 mm) + m_radii = {120, 130, 140, 150, 160, 170, 180, 190, 200, 210, 220, 230, + 240, 250, 260, 270, 280, 290, 300, 310, 320, 330, 340, 350, + 360, 370, 380, 390, 400, 410, 420, 430, 440, 450, 460, 470, + 480, 490, 500, 510, 520, 530, 540, 550, 560, 570, 580, 590, + 600, 610, 620, 630, 640, 650, 660, 670, 680, 690}; + } + if (m_doseInner1000.empty()) { + m_doseInner1000 = {1.995, 1.953, 1.787, 1.687, 1.608, 1.518, + 1.448, 1.425, 1.354, 1.328, 1.275}; + } + if (m_doseMiddle2000.empty()) { + m_doseMiddle2000 = {2.44, 2.355, 2.26, 2.204, 2.137, 2.081, 2.015, 1.96, + 1.878, 1.87, 1.809, 1.732, 1.722, 1.63, 1.588, 1.57, + 1.509, 1.464, 1.44, 1.38, 1.333, 1.321, 1.284, 1.271}; + } + if (m_doseOuter4000.empty()) { + m_doseOuter4000 = {2.458, 2.4, 2.382, 2.362, 2.266, 2.207, 2.122, 2.067, + 2.046, 1.973, 1.94, 1.9, 1.869, 1.83, 1.711, 1.701, + 1.685, 1.615, 1.626, 1.565, 1.53, 1.499, 1.429}; + } + if (m_doseResolution.empty()) { + m_doseResolution = {{0.01, 0.025}, {0.1, 0.031}, {0.3, 0.035}, {0.6, 0.040}, + {1.0, 0.046}, {3.0, 0.065}, {6.0, 0.065}}; + } + + if (m_doseGain.empty()) { + m_doseGain = {{0.01, 39}, {0.1, 23}, {0.3, 21}, {0.6, 19}, + {1.0, 10}, {3.0, 5}, {6.0, 4}}; + } + + // resolution in ns + m_sensorResolution = std::sqrt((0.025 * 0.025) - (0.010 * 0.010)); + + if (m_radii.size() != (m_doseInner1000.size() + m_doseMiddle2000.size() + + m_doseOuter4000.size())) { + std::cout << "ERROR while Initializing the timing resolution. Vector of " + "different size." + << std::endl; + return; + } + + m_dose.clear(); + m_resolution.clear(); + m_gain.clear(); + ComputeDose(m_integratedLumi); + radToResolution(); + radToGain(); +} + +// get the timing resolution for a hit at a radius R (unit: mm) +float HGTD_TimingResolution::hitTimingResolution(float radius) const { + + if (!radiusInRange(radius)) + return 99999.; + float sigmaT = 9999.; + if (m_integratedLumi == 0) + sigmaT = m_resolution[0]; + else + sigmaT = resolution(std::fabs(radius)); + + // include the effect of electronics as 25ps added in quadrature + float sigmaT2 = sigmaT * sigmaT + m_sensorResolution * m_sensorResolution; + return std::sqrt(sigmaT2); +} + +bool HGTD_TimingResolution::changeResolution2(float integratedLumi) { + m_integratedLumi = integratedLumi; + init(); + return true; +} + +// returns the per Hit resolution for the final performance +float HGTD_TimingResolution::resolution(float radius) const { + float resolution = 9999.; + + if (radius < m_radii[0]) { + resolution = m_resolution[0]; + return resolution; + } + + for (unsigned int i = 1; i < m_radii.size(); i++) { + + if (radius < m_radii[i]) { + resolution = + m_resolution[i - 1] + + (((radius - m_radii[i - 1]) / (m_radii[i] - m_radii[i - 1])) * + (m_resolution[i] - m_resolution[i - 1])); + return resolution; + } + } + + resolution = m_resolution[m_resolution.size() - 1]; + return resolution; +} + +float HGTD_TimingResolution::gain(float radius) { + float gain = 1.; + + if (radius < m_radii[0]) { + gain = m_gain[0]; + return gain; + } + + for (unsigned int i = 1; i < m_radii.size(); i++) { + + if (radius < m_radii[i]) { + gain = m_gain[i - 1] + + (((radius - m_radii[i - 1]) / (m_radii[i] - m_radii[i - 1])) * + (m_gain[i] - m_gain[i - 1])); + return gain; + } + } + + gain = m_gain[m_gain.size() - 1]; + return gain; +} + +inline float HGTD_TimingResolution::sensorResolution() const { + return m_sensorResolution; +} + +// check if the request is in range: +bool HGTD_TimingResolution::radiusInRange(float radius) const { + return (std::fabs(radius) >= m_Rmin && std::fabs(radius) <= m_Rmax); +} + +// check if the request is in range: +bool HGTD_TimingResolution::etaInRange(float eta) { + float radius = translateEta2R(eta); + return radiusInRange(radius); +} + +// translate radius to eta +float HGTD_TimingResolution::translateR2Eta(float radius) { + return std::fabs( + -std::log(std::tan(std::atan(std::fabs(radius) / m_z) / 2.))); +} + +// translate eta to radius +float HGTD_TimingResolution::translateEta2R(float eta) { + return std::fabs(std::tan(std::atan(std::exp(-eta)) * 2.) * m_z); +} + +void HGTD_TimingResolution::ComputeDose(float lumi) { + for (unsigned int i = 0; i < m_doseInner1000.size(); ++i) { + m_dose.push_back(remainder_1(lumi, 1000) / 1000 * m_doseInner1000[i]); + } + for (unsigned int i = 0; i < m_doseMiddle2000.size(); ++i) { + m_dose.push_back(remainder_1(lumi, 2000) / 2000 * m_doseMiddle2000[i]); + } + for (unsigned int i = 0; i < m_doseOuter4000.size(); ++i) { + m_dose.push_back(lumi / 4000 * m_doseOuter4000[i]); + } +} + +void HGTD_TimingResolution::radToResolution() { + + for (unsigned int i = 0; i < m_dose.size(); i++) { + if (m_dose[i] < m_doseResolution[0].first) { + m_resolution.push_back(m_doseResolution[0].second); + continue; + } + for (unsigned int j = 1; j < m_doseResolution.size(); j++) { + if (m_dose[i] < m_doseResolution[j].first) { + float res = + m_doseResolution[j - 1].second + + (((m_dose[i] - m_doseResolution[j - 1].first) / + (m_doseResolution[j].first - m_doseResolution[j - 1].first)) * + (m_doseResolution[j].second - m_doseResolution[j - 1].second)); + m_resolution.push_back(res); + break; + } + + else if (j == m_doseResolution.size() - 1) { + m_resolution.push_back( + m_doseResolution[m_doseResolution.size() - 1].second); + } + } + } +} + +void HGTD_TimingResolution::radToGain() { + for (unsigned int i = 0; i < m_dose.size(); i++) { + if (m_dose[i] < m_doseGain[0].first) { + m_gain.push_back(m_doseGain[0].second); + continue; + } + for (unsigned int j = 1; j < m_doseGain.size(); j++) { + if (m_dose[i] < m_doseGain[j].first) { + float gain = m_doseGain[j - 1].second + + (((m_dose[i] - m_doseGain[j - 1].first) / + (m_doseGain[j].first - m_doseGain[j - 1].first)) * + (m_doseGain[j].second - m_doseGain[j - 1].second)); + m_gain.push_back(gain); + break; + } + + else if (j == m_doseGain.size() - 1) { + m_gain.push_back(m_doseGain[m_doseGain.size() - 1].second); + } + } + } +} + +void HGTD_TimingResolution::print() { + std::cout << "HGTD_TimingResolution version: " << m_version << std::endl; + std::cout << "Integrated Lumi: " << m_integratedLumi << std::endl; + std::cout << "Rmin = " << m_Rmin << std::endl; + std::cout << "Rmax = " << m_Rmax << std::endl; + std::cout << "Z = " << m_z << std::endl; + + std::cout << std::endl; + for (unsigned int i = 0; i < m_resolution.size(); i++) { + std::cout << "Resolution r = " << m_radii[i] << " mm " + << hitTimingResolution(m_radii[i]) << " ps" << std::endl; + std::cout << "Gain r = " << m_radii[i] << " mm " << gain(m_radii[i]) + << std::endl; + } +} + +void HGTD_TimingResolution::simulatePulse( + CLHEP::HepRandomEngine *rndm_engine) const { + + float pulseParameter[4] = {0}; + pulseParameter[0] = 0.036; // Width (scale) parameter of Landau density + pulseParameter[1] = + 5.754; // Most Probable (MP, location) parameter of Landau density + pulseParameter[3] = CLHEP::RandGaussZiggurat::shoot( + rndm_engine, 0.318, + m_sensorNoiseFactor - + 0.1 * m_sensorNoiseFactor); // Width (sigma) of convoluted Gaussian + // function + pulseParameter[2] = + 0.4785 + 1.4196 * pulseParameter[3]; // Total area (integral -inf to inf, + // normalization constant) + + // Convoluted Landau and Gaussian Fitting Function + // Adapted to simulate a pulse in an HGTD pad + + // Numeric constants + float invsq2pi = 1 / sqrt(2 * M_PI); // 0.3989422804014; // (2 pi)^(-1/2) + float mpshift = -0.22278298; // Landau maximum location + + // Variables + float mpc = pulseParameter[1] - mpshift * pulseParameter[0]; + float step = 0.03; + float step_par = step / (sqrt(2) * pulseParameter[3]); + float f_weight = pulseParameter[2] * step * invsq2pi / pulseParameter[3]; + float fland; + float p_time; + + // Convolution integral of Landau and Gaussian by sum + for (int i = 412; i < 527; i++) { + + fland = TMath::Landau(3.5 + (i * 0.005), mpc, pulseParameter[0]) / + pulseParameter[0]; + p_time = (1.5 + (i % 6 - i) * 0.005) / (sqrt(2) * pulseParameter[3]); + + for (int point = i % 6; point < 400; point += 6) { + p_time += step_par; + m_pulseWaveform[point] += fland * exp16(-p_time * p_time); + } + } + for (int point = 0; point < 400; point++) { + m_pulseWaveform[point] = f_weight * m_pulseWaveform[point]; + } +} + +void HGTD_TimingResolution::calculatePulse( + std::map> &pulsebin, const float t, + const float E, float *max, CLHEP::HepRandomEngine *rndm_engine) const { + + int timebin = 0; + float energy = 0; + float time = 0; + + for (int point = 0; point < 400; point++) { + + energy = m_pulseWaveform[point] * E + + CLHEP::RandGaussZiggurat::shoot(rndm_engine, 0, 0.015) * E; + time = t + point * 0.005; + timebin = (int)(t / 0.005) + point; + + auto pulse = pulsebin.find(timebin); + if (pulse == pulsebin.end()) { + pulsebin.insert({timebin, {time * energy, energy}}); + pulse = pulsebin.find(timebin); + } else { + (*pulse).second = {(*pulse).second.first + time * energy, + (*pulse).second.second + energy}; + } + if (max[0] < (*pulse).second.second) { + max[0] = (*pulse).second.second; + max[1] = (*pulse).second.first / max[0]; + } + } + return; +} + +float HGTD_TimingResolution::calculateTime( + const float t, const float E, const float r, + CLHEP::HepRandomEngine *rndm_engine) const { + std::map> pulseBins; + float max_hit[4] = {0}; + simulatePulse(rndm_engine); + calculatePulse(pulseBins, t, E, max_hit, rndm_engine); + for (auto &pulse : pulseBins) { + pulse.second.first = pulse.second.first / pulse.second.second; + // We look the the time when E=Emax/2 to get the time + if ((max_hit[1] > pulse.second.first) && + (max_hit[0] * m_cfdThreshold < pulse.second.second) && + (max_hit[3] > pulse.second.first || max_hit[3] == 0)) { + max_hit[2] = pulse.second.second; // Energy when E=Emax*m_cfd + max_hit[3] = pulse.second.first; // Time when E=Emax*m_cfd + } + } + float electronicRes = hitTimingResolution(r); + electronicRes = sqrt(electronicRes * electronicRes - + sensorResolution() * sensorResolution()); + float cfdTime = + max_hit[3] + CLHEP::RandGaussZiggurat::shoot( + rndm_engine, 0, electronicRes); // adds electric noise + return cfdTime; +} diff --git a/HighGranularityTimingDetector/HGTD_Digitization/HGTD_FastDigitization/HGTD_FastDigitization/HGTD_SmearedDigitizationTool.h b/HighGranularityTimingDetector/HGTD_Digitization/HGTD_FastDigitization/HGTD_FastDigitization/HGTD_SmearedDigitizationTool.h index cb89ff9c4802be3ea56d41e08e2efa1cfbfd4b0a..bcb4f3789b4f24ea0b556de7c81176f6168738bb 100644 --- a/HighGranularityTimingDetector/HGTD_Digitization/HGTD_FastDigitization/HGTD_FastDigitization/HGTD_SmearedDigitizationTool.h +++ b/HighGranularityTimingDetector/HGTD_Digitization/HGTD_FastDigitization/HGTD_FastDigitization/HGTD_SmearedDigitizationTool.h @@ -46,9 +46,9 @@ class HepRandomEngine; class HGTD_SmearedDigitizationTool : virtual public PileUpToolBase { public: - using Cluster_t = HGTD::HGTD_Cluster; - using ClusterCollection_t = HGTD::HGTD_ClusterCollection; - using ClusterContainer_t = HGTD::HGTD_ClusterContainer; + using Cluster_t = HGTD_Cluster; + using ClusterCollection_t = HGTD_ClusterCollection; + using ClusterContainer_t = HGTD_ClusterContainer; using HGTD_DetElement_RIO_Map_t = std::multimap; diff --git a/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventAthenaPool/CMakeLists.txt b/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventAthenaPool/CMakeLists.txt index 6077ff6534bde57178aba23b84340f9d81957440..a513a3ae65fda0e25bcd7ab92ce805f7420334e7 100644 --- a/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventAthenaPool/CMakeLists.txt +++ b/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventAthenaPool/CMakeLists.txt @@ -19,7 +19,6 @@ atlas_depends_on_subdirs( PUBLIC atlas_add_poolcnv_library( HGTD_EventAthenaPoolPoolCnv src/*.cxx FILES HGTD_PrepRawData/HGTD_ClusterContainer.h HGTD_RawData/HGTD_RDOContainer.h - TYPES_WITH_NAMESPACE HGTD::HGTD_ClusterContainer HGTD::HGTD_RDOContainer LINK_LIBRARIES AthenaPoolUtilities AthenaPoolCnvSvcLib AtlasSealCLHEP GaudiKernel HGTD_PrepRawData HGTD_EventTPCnv HGTD_RawData) # Install files from the package: diff --git a/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventAthenaPool/src/HGTD_ClusterContainerCnv.cxx b/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventAthenaPool/src/HGTD_ClusterContainerCnv.cxx index 58be748f876fdabcf2961b8b0d581f6c86d2733f..227e4454676a6f5e7e8909b0d5ba102efe59a607 100644 --- a/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventAthenaPool/src/HGTD_ClusterContainerCnv.cxx +++ b/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventAthenaPool/src/HGTD_ClusterContainerCnv.cxx @@ -19,17 +19,17 @@ HGTD_ClusterContainerCnv::HGTD_ClusterContainerCnv(ISvcLocator* svcloc) HGTD_ClusterContainerCnv::~HGTD_ClusterContainerCnv() {} -HGTD::HGTD_ClusterContainer* HGTD_ClusterContainerCnv::createTransient() { +HGTD_ClusterContainer* HGTD_ClusterContainerCnv::createTransient() { static pool::Guid p1_guid( "7B3D57D6-F590-4266-974D-A0807122DA5F"); // with HGTD_Cluster_p1 ATH_MSG_DEBUG("createTransient(): main converter"); - HGTD::HGTD_ClusterContainer* p_collection(0); + HGTD_ClusterContainer* p_collection(0); if (compareClassGuid(p1_guid)) { ATH_MSG_DEBUG("createTransient(): T/P version 1 detected"); - std::auto_ptr p_coll( - poolReadObject()); + std::auto_ptr p_coll( + poolReadObject()); p_collection = m_converter_p1.createTransient(p_coll.get(), msg()); } else { throw std::runtime_error( @@ -39,7 +39,7 @@ HGTD::HGTD_ClusterContainer* HGTD_ClusterContainerCnv::createTransient() { } HGTD_ClusterContainer_PERS* HGTD_ClusterContainerCnv::createPersistent( - HGTD::HGTD_ClusterContainer* transCont) { + HGTD_ClusterContainer* transCont) { HGTD_ClusterContainer_PERS* pldc_p = m_converter_p1.createPersistent(transCont, msg()); diff --git a/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventAthenaPool/src/HGTD_ClusterContainerCnv.h b/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventAthenaPool/src/HGTD_ClusterContainerCnv.h index df3d4902d5f1da1ab44fd2f93305a3bb4d153167..9e2a216b6de9f30e088b687f208eaa749f21a215 100644 --- a/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventAthenaPool/src/HGTD_ClusterContainerCnv.h +++ b/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventAthenaPool/src/HGTD_ClusterContainerCnv.h @@ -18,8 +18,8 @@ #include "HGTD_EventTPCnv/HGTD_ClusterContainerCnv_p1.h" // the latest persistent representation type of DataCollection: -typedef HGTD::HGTD_ClusterContainer_p1 HGTD_ClusterContainer_PERS; -typedef T_AthenaPoolCustomCnv HGTD_ClusterContainerCnvBase; @@ -38,11 +38,11 @@ protected: HGTD_ClusterContainerCnv(ISvcLocator* svcloc); virtual ~HGTD_ClusterContainerCnv() override; virtual HGTD_ClusterContainer_PERS* - createPersistent(HGTD::HGTD_ClusterContainer* transCont) override; - virtual HGTD::HGTD_ClusterContainer* createTransient() override; + createPersistent(HGTD_ClusterContainer* transCont) override; + virtual HGTD_ClusterContainer* createTransient() override; private: - HGTD::HGTD_ClusterContainerCnv_p1 m_converter_p1; + HGTD_ClusterContainerCnv_p1 m_converter_p1; }; #endif // HGTD_CLUSTERCONTAINERCNV_H diff --git a/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventAthenaPool/src/HGTD_RDOContainerCnv.cxx b/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventAthenaPool/src/HGTD_RDOContainerCnv.cxx index 0ede7f5338d7ff987e1b6ffd505fae393653f1b7..21caa58d6f1bf275cdeaf5a0bb6431a1a9897462 100644 --- a/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventAthenaPool/src/HGTD_RDOContainerCnv.cxx +++ b/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventAthenaPool/src/HGTD_RDOContainerCnv.cxx @@ -18,13 +18,13 @@ HGTD_RDOContainerCnv::HGTD_RDOContainerCnv(ISvcLocator* svcloc) HGTD_RDOContainerCnv::~HGTD_RDOContainerCnv() {} -HGTD::HGTD_RDOContainer* HGTD_RDOContainerCnv::createTransient() { +HGTD_RDOContainer* HGTD_RDOContainerCnv::createTransient() { static pool::Guid p1_guid( "C25315CC-F0A2-43D6-8F42-012BE34B0107"); // with HGTD_RDO_p1 ATH_MSG_DEBUG("createTransient(): main converter"); - HGTD::HGTD_RDOContainer* trans_cont(0); + HGTD_RDOContainer* trans_cont(0); if (compareClassGuid(p1_guid)) { ATH_MSG_DEBUG("createTransient(): T/P version 1 detected"); std::auto_ptr pers_cont( @@ -40,7 +40,7 @@ HGTD::HGTD_RDOContainer* HGTD_RDOContainerCnv::createTransient() { } HGTD_RDOContainer_PERS_t* -HGTD_RDOContainerCnv::createPersistent(HGTD::HGTD_RDOContainer* trans_cont) { +HGTD_RDOContainerCnv::createPersistent(HGTD_RDOContainer* trans_cont) { HGTD_RDOContainer_PERS_t* pers_cont = m_converter.createPersistent(trans_cont, msg()); diff --git a/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventAthenaPool/src/HGTD_RDOContainerCnv.h b/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventAthenaPool/src/HGTD_RDOContainerCnv.h index 1cdecdc488d146d2107cdcf921041b7c5634f203..7685c211bada0662bb694ad656046a0e4fce8afa 100644 --- a/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventAthenaPool/src/HGTD_RDOContainerCnv.h +++ b/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventAthenaPool/src/HGTD_RDOContainerCnv.h @@ -19,11 +19,11 @@ // the latest persistent representation type of the container holding // HGTD_RawData -typedef HGTD::HGTD_RDOContainer_p1 HGTD_RDOContainer_PERS_t; +typedef HGTD_RDOContainer_p1 HGTD_RDOContainer_PERS_t; -typedef HGTD::HGTD_RDOContainerCnv_p1 HGTD_RDOContainerCNV_t; +typedef HGTD_RDOContainerCnv_p1 HGTD_RDOContainerCNV_t; -typedef T_AthenaPoolCustomCnv +typedef T_AthenaPoolCustomCnv HGTD_RDOContainerCnvBase_t; class HGTD_RDOContainerCnv : public HGTD_RDOContainerCnvBase_t { @@ -36,9 +36,9 @@ protected: virtual ~HGTD_RDOContainerCnv() override; virtual HGTD_RDOContainer_PERS_t* - createPersistent(HGTD::HGTD_RDOContainer* trans) override; + createPersistent(HGTD_RDOContainer* trans) override; - virtual HGTD::HGTD_RDOContainer* createTransient() override; + virtual HGTD_RDOContainer* createTransient() override; private: HGTD_RDOContainerCNV_t m_converter; diff --git a/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventTPCnv/HGTD_EventTPCnv/HGTD_ClusterCnv_p1.h b/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventTPCnv/HGTD_EventTPCnv/HGTD_ClusterCnv_p1.h index 06a3923429de1f038f5766e174d52b8536a77f0e..08817614fd06754ad5fd1f80cf403962927bf4b3 100644 --- a/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventTPCnv/HGTD_EventTPCnv/HGTD_ClusterCnv_p1.h +++ b/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventTPCnv/HGTD_EventTPCnv/HGTD_ClusterCnv_p1.h @@ -21,23 +21,21 @@ class MsgStream; -namespace HGTD { - class HGTD_ClusterCnv_p1 - : public T_AthenaPoolTPPolyCnvBase { + : public T_AthenaPoolTPPolyCnvBase { public: HGTD_ClusterCnv_p1() = default; - void persToTrans(const HGTD::HGTD_Cluster_p1*, HGTD::HGTD_Cluster*, + void persToTrans(const HGTD_Cluster_p1*, HGTD_Cluster*, MsgStream&); - void transToPers(const HGTD::HGTD_Cluster*, HGTD::HGTD_Cluster_p1*, + void transToPers(const HGTD_Cluster*, HGTD_Cluster_p1*, MsgStream&); // needs to be public since it is called in the container converter - HGTD::HGTD_Cluster - createHGTDCluster(const HGTD::HGTD_Cluster_p1* pers_obj, + HGTD_Cluster + createHGTDCluster(const HGTD_Cluster_p1* pers_obj, const InDetDD::SolidStateDetectorElementBase* delEl, MsgStream& log); @@ -45,6 +43,4 @@ protected: InDet::SiWidthCnv_p2 m_si_width_cnv; }; -} // namespace HGTD - #endif // HGTD_EVENTTPCNV_HGTD_CLUSTER_CNV_P1_H diff --git a/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventTPCnv/HGTD_EventTPCnv/HGTD_ClusterContainerCnv_p1.h b/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventTPCnv/HGTD_EventTPCnv/HGTD_ClusterContainerCnv_p1.h index c856ea49c720c7e878c1b6c0b1c886ef3b4839a5..7eb5c5398d83fb0d78402b060023ba6c5ed99c14 100644 --- a/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventTPCnv/HGTD_EventTPCnv/HGTD_ClusterContainerCnv_p1.h +++ b/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventTPCnv/HGTD_EventTPCnv/HGTD_ClusterContainerCnv_p1.h @@ -22,16 +22,14 @@ class HGTD_ID; class StoreGateSvc; class HGTD_DetectorManager; -namespace HGTD { - class HGTD_ClusterContainerCnv_p1 - : public T_AthenaPoolTPCnvBase { + : public T_AthenaPoolTPCnvBase { public: HGTD_ClusterContainerCnv_p1() : m_is_initialized(false) {} - typedef HGTD::HGTD_ClusterContainer_p1 Pers_t; - typedef HGTD::HGTD_ClusterContainer Trans_t; + typedef HGTD_ClusterContainer_p1 Pers_t; + typedef HGTD_ClusterContainer Trans_t; virtual void persToTrans(const Pers_t* persistent_container, Trans_t* transient_container, MsgStream& log); @@ -50,6 +48,4 @@ private: bool m_is_initialized; }; -} // namespace HGTD - #endif diff --git a/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventTPCnv/HGTD_EventTPCnv/HGTD_ClusterContainer_p1.h b/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventTPCnv/HGTD_EventTPCnv/HGTD_ClusterContainer_p1.h index e8f45e714444d6156e87c16452b267686a65cb32..f49da75dcf150f1663b73b6c8d1c61648553cec1 100644 --- a/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventTPCnv/HGTD_EventTPCnv/HGTD_ClusterContainer_p1.h +++ b/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventTPCnv/HGTD_EventTPCnv/HGTD_ClusterContainer_p1.h @@ -17,8 +17,6 @@ #include #include -namespace HGTD { - class HGTD_ClusterContainer_p1 { public: /// Default constructor @@ -26,11 +24,9 @@ public: // holds information to restore the individual collections from the flattened // list of persistified clusters - std::vector m_collection_separator; + std::vector m_collection_separator; - std::vector m_cluster_list; + std::vector m_cluster_list; }; -} // namespace HGTD - #endif diff --git a/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventTPCnv/HGTD_EventTPCnv/HGTD_Cluster_p1.h b/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventTPCnv/HGTD_EventTPCnv/HGTD_Cluster_p1.h index 3a8e50f46e50d2cd3fc649a9d229b21c2d6707c5..65757afb3c348efe951316d017c16ac3183d2741 100644 --- a/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventTPCnv/HGTD_EventTPCnv/HGTD_Cluster_p1.h +++ b/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventTPCnv/HGTD_EventTPCnv/HGTD_Cluster_p1.h @@ -14,8 +14,6 @@ #include "Identifier/Identifier.h" #include "InDetEventTPCnv/InDetPrepRawData/SiWidth_p2.h" -namespace HGTD { - class HGTD_Cluster_p1 { public: typedef Identifier::value_type IdType_t; @@ -37,6 +35,4 @@ private: InDet::SiWidth_p2 m_width; }; -} // namespace HGTD - #endif // HGTD_CLUSTER_P1_H diff --git a/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventTPCnv/HGTD_EventTPCnv/HGTD_EventTPCnvDict.h b/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventTPCnv/HGTD_EventTPCnv/HGTD_EventTPCnvDict.h index ca7f05eddc85ffe34806f42922ea5898a449ef13..71fba324a8b258460e952d54d29ded24d2f2e379 100644 --- a/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventTPCnv/HGTD_EventTPCnv/HGTD_EventTPCnvDict.h +++ b/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventTPCnv/HGTD_EventTPCnv/HGTD_EventTPCnvDict.h @@ -20,7 +20,7 @@ namespace HGTD_EventTPCnvDict { struct tmp { - std::vector m_v1; + std::vector m_v1; }; } // namespace HGTD_EventTPCnvDict diff --git a/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventTPCnv/HGTD_EventTPCnv/HGTD_PRD_Collection_p1.h b/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventTPCnv/HGTD_EventTPCnv/HGTD_PRD_Collection_p1.h index 47ce7729c70519274b7557569af376637e5494bb..534f02063f4a5453ce1a02820f2cdb66a1e1dec6 100644 --- a/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventTPCnv/HGTD_EventTPCnv/HGTD_PRD_Collection_p1.h +++ b/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventTPCnv/HGTD_EventTPCnv/HGTD_PRD_Collection_p1.h @@ -14,8 +14,6 @@ #include "Identifier/IdentifierHash.h" -namespace HGTD { - class HGTD_PRD_Collection_p1 { public: @@ -34,6 +32,4 @@ private: unsigned short m_size; }; -} // namespace HGTD - #endif // HGTD_PRD_COLLECTION_P1_H diff --git a/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventTPCnv/HGTD_EventTPCnv/HGTD_RDOCnv_p1.h b/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventTPCnv/HGTD_EventTPCnv/HGTD_RDOCnv_p1.h index b0a2144a5dc8f9e75bb47ea35cad32dc64bb5e69..6478cbce1e03ae03f66ad573151f834fc20465c2 100644 --- a/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventTPCnv/HGTD_EventTPCnv/HGTD_RDOCnv_p1.h +++ b/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventTPCnv/HGTD_EventTPCnv/HGTD_RDOCnv_p1.h @@ -17,20 +17,16 @@ class MsgStream; -namespace HGTD { - class HGTD_RDOCnv_p1 - : public T_AthenaPoolTPCnvBase { + : public T_AthenaPoolTPCnvBase { public: HGTD_RDOCnv_p1() = default; - void persToTrans(const HGTD::HGTD_RDO_p1* pers_obj, HGTD::HGTD_RDO* trans_obj, + void persToTrans(const HGTD_RDO_p1* pers_obj, HGTD_RDO* trans_obj, MsgStream& log); - void transToPers(const HGTD::HGTD_RDO* trans_obj, HGTD::HGTD_RDO_p1* pers_obj, + void transToPers(const HGTD_RDO* trans_obj, HGTD_RDO_p1* pers_obj, MsgStream& log); }; -} // namespace HGTD - #endif // HGTD_EVENTTPCNV_HGTD_RDOCNV_P1_H diff --git a/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventTPCnv/HGTD_EventTPCnv/HGTD_RDOCollection_p1.h b/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventTPCnv/HGTD_EventTPCnv/HGTD_RDOCollection_p1.h index be13b3e9f20e3d110721b20f96c2caab12a2bf69..b44ec8f56e14ede307abdd772aebe146dabe4bdd 100644 --- a/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventTPCnv/HGTD_EventTPCnv/HGTD_RDOCollection_p1.h +++ b/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventTPCnv/HGTD_EventTPCnv/HGTD_RDOCollection_p1.h @@ -12,8 +12,6 @@ #include "Identifier/IdentifierHash.h" -namespace HGTD { - class HGTD_RDOCollection_p1 { public: @@ -32,6 +30,4 @@ private: unsigned short m_size; }; -} // namespace HGTD - #endif // HGTD_EVENTTPCNV_HGTD_RDOCOLLECTION_P1_H diff --git a/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventTPCnv/HGTD_EventTPCnv/HGTD_RDOContainerCnv_p1.h b/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventTPCnv/HGTD_EventTPCnv/HGTD_RDOContainerCnv_p1.h index adf2b6d18613d07383b19266e4a24fe43e248319..8a90599eb67f245f442f2e11acfb111b06c14ec9 100644 --- a/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventTPCnv/HGTD_EventTPCnv/HGTD_RDOContainerCnv_p1.h +++ b/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventTPCnv/HGTD_EventTPCnv/HGTD_RDOContainerCnv_p1.h @@ -18,15 +18,13 @@ class HGTD_ID; class StoreGateSvc; -namespace HGTD { - class HGTD_RDOContainerCnv_p1 - : public T_AthenaPoolTPCnvBase { + : public T_AthenaPoolTPCnvBase { public: - typedef HGTD::HGTD_RDOContainer_p1 Pers_t; - typedef HGTD::HGTD_RDOContainer Trans_t; + typedef HGTD_RDOContainer_p1 Pers_t; + typedef HGTD_RDOContainer Trans_t; HGTD_RDOContainerCnv_p1() : m_is_initialized(false) {} @@ -46,6 +44,4 @@ private: bool m_is_initialized; }; -} // namespace HGTD - #endif // HGTD_EVENTTPCNV_HGTD_RDOCONTAINERCNV_P1_H diff --git a/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventTPCnv/HGTD_EventTPCnv/HGTD_RDOContainer_p1.h b/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventTPCnv/HGTD_EventTPCnv/HGTD_RDOContainer_p1.h index 3e2bf44a26dfe7bed6483d097637bb38effb0fa9..f9b8e51a450c55ce443d5a23745f9b2a07ceef0f 100644 --- a/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventTPCnv/HGTD_EventTPCnv/HGTD_RDOContainer_p1.h +++ b/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventTPCnv/HGTD_EventTPCnv/HGTD_RDOContainer_p1.h @@ -15,8 +15,6 @@ #include #include -namespace HGTD { - class HGTD_RDOContainer_p1 { public: /// Default constructor @@ -24,11 +22,9 @@ public: // holds information to restore the individual collections from the flattened // list of persistified clusters - std::vector m_collection_separator; + std::vector m_collection_separator; - std::vector m_rdo_list; + std::vector m_rdo_list; }; -} // namespace HGTD - #endif diff --git a/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventTPCnv/HGTD_EventTPCnv/HGTD_RDO_p1.h b/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventTPCnv/HGTD_EventTPCnv/HGTD_RDO_p1.h index be9ae97fd70493cc6bd8de77cdad979a9c25e477..caab8ba7e7fe958ee0fee991731660a7d49d3fb5 100644 --- a/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventTPCnv/HGTD_EventTPCnv/HGTD_RDO_p1.h +++ b/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventTPCnv/HGTD_EventTPCnv/HGTD_RDO_p1.h @@ -13,8 +13,6 @@ #include "HGTD_RawData/HGTD_RDO.h" #include "Identifier/Identifier.h" -namespace HGTD { - class HGTD_RDO_p1 { public: typedef Identifier::value_type IdType_t; @@ -32,6 +30,4 @@ private: unsigned short m_l1_a; }; -} // namespace HGTD - #endif // HGTD_RDO_P1_H diff --git a/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventTPCnv/HGTD_EventTPCnv/selection.xml b/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventTPCnv/HGTD_EventTPCnv/selection.xml index 7861920380b16fe5a57348d8dc5c5e31c38d2504..532278a43eb2c2fc9faa0467f386252560de843c 100644 --- a/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventTPCnv/HGTD_EventTPCnv/selection.xml +++ b/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventTPCnv/HGTD_EventTPCnv/selection.xml @@ -1,12 +1,12 @@ - - - - + + + + - - - - + + + + diff --git a/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventTPCnv/src/HGTD_ClusterCnv_p1.cxx b/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventTPCnv/src/HGTD_ClusterCnv_p1.cxx index b94ee082315e923dfe52daadf788fc366126ed13..a837bad5bac8795778277dbeeb92df948f943b3d 100644 --- a/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventTPCnv/src/HGTD_ClusterCnv_p1.cxx +++ b/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventTPCnv/src/HGTD_ClusterCnv_p1.cxx @@ -13,15 +13,15 @@ #include #include -void HGTD::HGTD_ClusterCnv_p1::persToTrans( - const HGTD::HGTD_Cluster_p1* pers_obj, HGTD::HGTD_Cluster* trans_obj, +void HGTD_ClusterCnv_p1::persToTrans( + const HGTD_Cluster_p1* pers_obj, HGTD_Cluster* trans_obj, MsgStream& log) { log << MSG::VERBOSE << "In HGTD_ClusterCnv_p1::persToTrans" << endreq; *trans_obj = createHGTDCluster(pers_obj, nullptr, log); } -HGTD::HGTD_Cluster HGTD::HGTD_ClusterCnv_p1::createHGTDCluster( - const HGTD::HGTD_Cluster_p1* pers_obj, +HGTD_Cluster HGTD_ClusterCnv_p1::createHGTDCluster( + const HGTD_Cluster_p1* pers_obj, const InDetDD::SolidStateDetectorElementBase* del_el, MsgStream& log) { log << MSG::VERBOSE << "In HGTD_ClusterCnv_p1::createHGTDCluster" << endreq; // set the cluster identifier @@ -50,11 +50,11 @@ HGTD::HGTD_Cluster HGTD::HGTD_ClusterCnv_p1::createHGTDCluster( (*cmat)(0, 1) = static_cast(pers_obj->m_mat_01); (*cmat)(1, 1) = static_cast(pers_obj->m_mat_11); - HGTD::HGTD_Cluster cluster(cluster_id, local_pos, std::move(rdo_list), - std::move(width), del_el, std::move(cmat), - pers_obj->m_time, - pers_obj->m_time_resolution, - std::move(pers_obj->m_time_over_threshold)); + HGTD_Cluster cluster(cluster_id, local_pos, std::move(rdo_list), + std::move(width), del_el, std::move(cmat), + pers_obj->m_time, + pers_obj->m_time_resolution, + std::move(pers_obj->m_time_over_threshold)); return cluster; } @@ -62,9 +62,9 @@ HGTD::HGTD_Cluster HGTD::HGTD_ClusterCnv_p1::createHGTDCluster( //////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////s -void HGTD::HGTD_ClusterCnv_p1::transToPers(const HGTD::HGTD_Cluster* trans_obj, - HGTD::HGTD_Cluster_p1* pers_obj, - MsgStream& log) { +void HGTD_ClusterCnv_p1::transToPers(const HGTD_Cluster* trans_obj, + HGTD_Cluster_p1* pers_obj, + MsgStream& log) { log << MSG::VERBOSE << "In HGTD_ClusterCnv_p1::transToPers" << endreq; m_si_width_cnv.transToPers(&trans_obj->width(), &pers_obj->m_width, log); diff --git a/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventTPCnv/src/HGTD_ClusterContainerCnv_p1.cxx b/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventTPCnv/src/HGTD_ClusterContainerCnv_p1.cxx index b17e87f763eb9020026b756d9081e4b940d29b33..72312d8acd74196cb9f0c007ef5091ffd2664037 100644 --- a/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventTPCnv/src/HGTD_ClusterContainerCnv_p1.cxx +++ b/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventTPCnv/src/HGTD_ClusterContainerCnv_p1.cxx @@ -23,7 +23,7 @@ #include "StoreGate/StoreGateSvc.h" #include -StatusCode HGTD::HGTD_ClusterContainerCnv_p1::initialize(MsgStream& log) { +StatusCode HGTD_ClusterContainerCnv_p1::initialize(MsgStream& log) { // Do not initialize again: m_is_initialized = true; @@ -59,7 +59,7 @@ StatusCode HGTD::HGTD_ClusterContainerCnv_p1::initialize(MsgStream& log) { return StatusCode::SUCCESS; } -void HGTD::HGTD_ClusterContainerCnv_p1::transToPers( +void HGTD_ClusterContainerCnv_p1::transToPers( const Trans_t* transient_container, Pers_t* persistent_container, MsgStream& log) { @@ -95,7 +95,7 @@ void HGTD::HGTD_ClusterContainerCnv_p1::transToPers( size_t total_n_clusters = 0; for (size_t coll_i = 0; coll_i < n_collections; coll_i++, container_itr++) { - const HGTD::HGTD_ClusterCollection& collection = (**container_itr); + const HGTD_ClusterCollection& collection = (**container_itr); size_t collection_size = collection.size(); @@ -116,12 +116,12 @@ void HGTD::HGTD_ClusterContainerCnv_p1::transToPers( for (size_t clus_i = 0; clus_i < collection_size; clus_i++) { // get pointer to next position in the vector that will be persistified - HGTD::HGTD_Cluster_p1* pers_clus = + HGTD_Cluster_p1* pers_clus = &((persistent_container->m_cluster_list) .at(clus_i + collection_separator_index_begin)); - const HGTD::HGTD_Cluster* trans_clus = - dynamic_cast(collection.at(clus_i)); + const HGTD_Cluster* trans_clus = + dynamic_cast(collection.at(clus_i)); cluster_converter.transToPers(trans_clus, pers_clus, log); } @@ -139,11 +139,11 @@ void HGTD::HGTD_ClusterContainerCnv_p1::transToPers( //////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// -void HGTD::HGTD_ClusterContainerCnv_p1::persToTrans( +void HGTD_ClusterContainerCnv_p1::persToTrans( const Pers_t* persistent_container, Trans_t* transient_container, MsgStream& log) { - HGTD::HGTD_ClusterCollection* collection = nullptr; + HGTD_ClusterCollection* collection = nullptr; HGTD_ClusterCnv_p1 cluster_converter; @@ -152,7 +152,7 @@ void HGTD::HGTD_ClusterContainerCnv_p1::persToTrans( for (size_t coll_i = 0; coll_i < persistent_container->m_collection_separator.size(); ++coll_i) { - const HGTD::HGTD_PRD_Collection_p1& prd_coll = + const HGTD_PRD_Collection_p1& prd_coll = persistent_container->m_collection_separator.at(coll_i); // get the identifier for the collection @@ -162,19 +162,19 @@ void HGTD::HGTD_ClusterContainerCnv_p1::persToTrans( InDetDD::HGTD_DetectorElement* det_elem = m_hgtd_det_mgr->getDetectorElement(coll_idhash); - collection = new HGTD::HGTD_ClusterCollection(coll_idhash); + collection = new HGTD_ClusterCollection(coll_idhash); collection->setIdentifier(coll_id); unsigned short n_clusters = prd_coll.m_size; collection->resize(n_clusters); for (unsigned short clus_i = 0; clus_i < n_clusters; ++clus_i) { - const HGTD::HGTD_Cluster_p1* pers_cluster = + const HGTD_Cluster_p1* pers_cluster = &((persistent_container->m_cluster_list) .at(clus_i + collection_separator_index_begin)); // NOTE the cluster is created without setting the detector element! // NOTE if this is needed down the road, it has to be added here! - HGTD::HGTD_Cluster* trans_cluster = new HGTD::HGTD_Cluster( + HGTD_Cluster* trans_cluster = new HGTD_Cluster( cluster_converter.createHGTDCluster(pers_cluster, det_elem, log)); trans_cluster->setHashAndIndex(coll_idhash, clus_i); @@ -192,7 +192,7 @@ void HGTD::HGTD_ClusterContainerCnv_p1::persToTrans( //////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// -HGTD::HGTD_ClusterContainer* HGTD::HGTD_ClusterContainerCnv_p1::createTransient( +HGTD_ClusterContainer* HGTD_ClusterContainerCnv_p1::createTransient( const Pers_t* persistent_container, MsgStream& log) { if (!m_is_initialized) { diff --git a/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventTPCnv/src/HGTD_RDOCnv_p1.cxx b/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventTPCnv/src/HGTD_RDOCnv_p1.cxx index a6a60349f7927c45acabd8472c1bd551c155d524..678f64b2079875dc210f8da168615d32f8cf9081 100644 --- a/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventTPCnv/src/HGTD_RDOCnv_p1.cxx +++ b/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventTPCnv/src/HGTD_RDOCnv_p1.cxx @@ -9,8 +9,8 @@ #include "HGTD_EventTPCnv/HGTD_RDOCnv_p1.h" -void HGTD::HGTD_RDOCnv_p1::transToPers(const HGTD::HGTD_RDO* trans_obj, - HGTD::HGTD_RDO_p1* pers_obj, +void HGTD_RDOCnv_p1::transToPers(const HGTD_RDO* trans_obj, + HGTD_RDO_p1* pers_obj, MsgStream& log) { log << MSG::VERBOSE << "calling HGTD_RDOCnv_p1::transToPers" << endreq; @@ -22,11 +22,11 @@ void HGTD::HGTD_RDOCnv_p1::transToPers(const HGTD::HGTD_RDO* trans_obj, pers_obj->m_l1_a = trans_obj->getL1A(); } -void HGTD::HGTD_RDOCnv_p1::persToTrans(const HGTD::HGTD_RDO_p1* pers_obj, - HGTD::HGTD_RDO* trans_obj, +void HGTD_RDOCnv_p1::persToTrans(const HGTD_RDO_p1* pers_obj, + HGTD_RDO* trans_obj, MsgStream& log) { log << MSG::VERBOSE << "calling HGTD_RDOCnv_p1::persToTrans" << endreq; - *trans_obj = HGTD::HGTD_RDO(Identifier(pers_obj->m_rdo_id), pers_obj->m_toa, - pers_obj->m_tot, pers_obj->m_bcid, - pers_obj->m_l1_id, pers_obj->m_l1_a); + *trans_obj = HGTD_RDO(Identifier(pers_obj->m_rdo_id), pers_obj->m_toa, + pers_obj->m_tot, pers_obj->m_bcid, + pers_obj->m_l1_id, pers_obj->m_l1_a); } diff --git a/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventTPCnv/src/HGTD_RDOContainerCnv_p1.cxx b/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventTPCnv/src/HGTD_RDOContainerCnv_p1.cxx index 926c605e3183e8562258383eeebd6be5f589a040..8bc8b8e8e15ffc00da74da294bb528d0e0eafe06 100644 --- a/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventTPCnv/src/HGTD_RDOContainerCnv_p1.cxx +++ b/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventTPCnv/src/HGTD_RDOContainerCnv_p1.cxx @@ -21,7 +21,7 @@ #include -StatusCode HGTD::HGTD_RDOContainerCnv_p1::initialize(MsgStream& log) { +StatusCode HGTD_RDOContainerCnv_p1::initialize(MsgStream& log) { // Do not initialize again: m_is_initialized = true; @@ -50,7 +50,7 @@ StatusCode HGTD::HGTD_RDOContainerCnv_p1::initialize(MsgStream& log) { return StatusCode::SUCCESS; } -void HGTD::HGTD_RDOContainerCnv_p1::transToPers( +void HGTD_RDOContainerCnv_p1::transToPers( const Trans_t* transient_container, Pers_t* persistent_container, MsgStream& log) { @@ -71,7 +71,7 @@ void HGTD::HGTD_RDOContainerCnv_p1::transToPers( size_t total_n_clusters = 0; for (size_t coll_i = 0; coll_i < n_collections; coll_i++, container_itr++) { - const HGTD::HGTD_RDOCollection& collection = (**container_itr); + const HGTD_RDOCollection& collection = (**container_itr); size_t collection_size = collection.size(); @@ -92,12 +92,12 @@ void HGTD::HGTD_RDOContainerCnv_p1::transToPers( for (size_t rdo_i = 0; rdo_i < collection_size; rdo_i++) { // get pointer to next position in the vector that will be persistified - HGTD::HGTD_RDO_p1* pers_rdo = + HGTD_RDO_p1* pers_rdo = &((persistent_container->m_rdo_list) .at(rdo_i + collection_separator_index_begin)); - const HGTD::HGTD_RDO* trans_rdo = - dynamic_cast(collection.at(rdo_i)); + const HGTD_RDO* trans_rdo = + dynamic_cast(collection.at(rdo_i)); rdo_converter.transToPers(trans_rdo, pers_rdo, log); } @@ -115,7 +115,7 @@ void HGTD::HGTD_RDOContainerCnv_p1::transToPers( //////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// -void HGTD::HGTD_RDOContainerCnv_p1::persToTrans( +void HGTD_RDOContainerCnv_p1::persToTrans( const Pers_t* persistent_container, Trans_t* transient_container, MsgStream& log) { @@ -126,31 +126,31 @@ void HGTD::HGTD_RDOContainerCnv_p1::persToTrans( } } - std::unique_ptr collection = nullptr; + std::unique_ptr collection = nullptr; HGTD_RDOCnv_p1 rdo_converter; size_t collection_separator_index_begin = 0; for (size_t coll_i = 0; coll_i < persistent_container->m_collection_separator.size(); ++coll_i) { - const HGTD::HGTD_RDOCollection_p1& rdo_coll = + const HGTD_RDOCollection_p1& rdo_coll = persistent_container->m_collection_separator.at(coll_i); // get the identifier for the collection IdentifierHash coll_idhash = IdentifierHash(rdo_coll.m_hash_id); Identifier coll_id = m_hgtd_idhelper->wafer_id(coll_idhash); - collection = std::make_unique(coll_idhash); + collection = std::make_unique(coll_idhash); collection->setIdentifier(coll_id); unsigned short n_clusters = rdo_coll.m_size; collection->resize(n_clusters); for (unsigned short rdo_i = 0; rdo_i < n_clusters; ++rdo_i) { - const HGTD::HGTD_RDO_p1* pers_rdo = + const HGTD_RDO_p1* pers_rdo = &((persistent_container->m_rdo_list) .at(rdo_i + collection_separator_index_begin)); // NOTE I think I have to new it before calling the converter - HGTD::HGTD_RDO* trans_rdo = new HGTD::HGTD_RDO(); + HGTD_RDO* trans_rdo = new HGTD_RDO(); rdo_converter.persToTrans(pers_rdo, trans_rdo, log); (*collection).at(rdo_i) = trans_rdo; } @@ -164,8 +164,8 @@ void HGTD::HGTD_RDOContainerCnv_p1::persToTrans( } } -HGTD::HGTD_RDOContainerCnv_p1::Trans_t* -HGTD::HGTD_RDOContainerCnv_p1::createTransient( +HGTD_RDOContainerCnv_p1::Trans_t* +HGTD_RDOContainerCnv_p1::createTransient( const Pers_t* persistent_container, MsgStream& log) { if (!m_is_initialized) { diff --git a/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventTPCnv/test/HGTD_ClusterCnv_p1_test.cxx b/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventTPCnv/test/HGTD_ClusterCnv_p1_test.cxx index 9188b893ba88bbebfa58ff0e38c77d5e5a3258ef..827e97ebd675d26f17ef56e55ef3a5d9b3c5e025 100644 --- a/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventTPCnv/test/HGTD_ClusterCnv_p1_test.cxx +++ b/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventTPCnv/test/HGTD_ClusterCnv_p1_test.cxx @@ -28,22 +28,22 @@ #include "HGTD_EventTPCnv_testfunctions.cxx" -void convertAndBack(const HGTD::HGTD_Cluster& trans1) { +void convertAndBack(const HGTD_Cluster& trans1) { std::cout << "convertAndBack\n"; Identifier wafer_id = trans1.identify(); std::cout << "Transient wafer ID: " << wafer_id << '\n'; MsgStream log(0, "test"); - HGTD::HGTD_ClusterCnv_p1 cnv; - HGTD::HGTD_Cluster_p1 pers; + HGTD_ClusterCnv_p1 cnv; + HGTD_Cluster_p1 pers; cnv.transToPers(&trans1, &pers, log); - HGTD::HGTD_Cluster trans2; + HGTD_Cluster trans2; cnv.persToTrans(&pers, &trans2, log); HGTDtest::compare(trans1, trans2); std::cout << "convertAndBack done\n"; } -HGTD::HGTD_Cluster setupTransientCluster() { +HGTD_Cluster setupTransientCluster() { std::cout << "setupTransientCluster\n"; Amg::Vector2D locpos(1.5, 2.5); @@ -56,19 +56,19 @@ HGTD::HGTD_Cluster setupTransientCluster() { for (int j = 0; j < 2; j++) cov(i, j) = 100 * (i + 1) * (j + 1); - HGTD::HGTD_Cluster trans_cluster(Identifier(1234), locpos, rdoList, width, - nullptr, new Amg::MatrixX(cov), 14.5, 0.35, - {145}); + HGTD_Cluster trans_cluster(Identifier(1234), locpos, rdoList, width, + nullptr, new Amg::MatrixX(cov), 14.5, 0.35, + {145}); std::cout << "setupTransientCluster done\n"; return trans_cluster; } -BOOST_AUTO_TEST_CASE(HGTD_ClusterCnv_p1) { +BOOST_AUTO_TEST_CASE(HGTD_ClusterCnv_p1_test) { std::cout << "start test\n"; - HGTD::HGTD_Cluster cluster = setupTransientCluster(); + HGTD_Cluster cluster = setupTransientCluster(); convertAndBack(cluster); diff --git a/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventTPCnv/test/HGTD_ClusterContainerCnv_p1_test.cxx b/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventTPCnv/test/HGTD_ClusterContainerCnv_p1_test.cxx index d193aedfd99804a49e5f3a45f56bff3efac48b15..1133b6c97d0f20bceaf637133adefb9b70ab2c10 100644 --- a/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventTPCnv/test/HGTD_ClusterContainerCnv_p1_test.cxx +++ b/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventTPCnv/test/HGTD_ClusterContainerCnv_p1_test.cxx @@ -30,18 +30,18 @@ const HGTD_ID* g_hgtd_idhelper; -void compare(const HGTD::HGTD_ClusterContainer& p1, - const HGTD::HGTD_ClusterContainer& p2) { - HGTD::HGTD_ClusterContainer::const_iterator it1 = p1.begin(); - HGTD::HGTD_ClusterContainer::const_iterator it1e = p1.end(); - HGTD::HGTD_ClusterContainer::const_iterator it2 = p2.begin(); - HGTD::HGTD_ClusterContainer::const_iterator it2e = p2.end(); +void compare(const HGTD_ClusterContainer& p1, + const HGTD_ClusterContainer& p2) { + HGTD_ClusterContainer::const_iterator it1 = p1.begin(); + HGTD_ClusterContainer::const_iterator it1e = p1.end(); + HGTD_ClusterContainer::const_iterator it2 = p2.begin(); + HGTD_ClusterContainer::const_iterator it2e = p2.end(); while (it1 != it1e && it2 != it2e) { BOOST_CHECK(it1.hashId() == it2.hashId()); BOOST_CHECK(it1->hasData() == it2->hasData()); if (it1->hasData()) { - const HGTD::HGTD_ClusterCollection& coll1 = **it1; - const HGTD::HGTD_ClusterCollection& coll2 = **it2; + const HGTD_ClusterCollection& coll1 = **it1; + const HGTD_ClusterCollection& coll2 = **it2; BOOST_CHECK(coll1.size() == coll2.size()); for (size_t j = 0; j < coll1.size(); j++) { HGTDtest::compare(*coll1.at(j), *coll2.at(j)); @@ -53,7 +53,7 @@ void compare(const HGTD::HGTD_ClusterContainer& p1, BOOST_CHECK(it1 == it1e && it2 == it2e); } -std::unique_ptr +std::unique_ptr createCluster(int endcap, int layer, int phi_module, int eta_module, float locx, float locy, float colx, float coly, float phi, float rz, float toa, std::vector tot) { @@ -71,19 +71,19 @@ createCluster(int endcap, int layer, int phi_module, int eta_module, float locx, cov(0, 1) = 0; cov(1, 0) = 0; - return std::make_unique( + return std::make_unique( Identifier(id), locpos, rdoList, width, nullptr, new Amg::MatrixX(cov), toa, 0.035, tot); } -std::unique_ptr makeClusters() { - auto cont = std::make_unique(5); +std::unique_ptr makeClusters() { + auto cont = std::make_unique(5); std::vector n_coll_per_layer = {2, 1, 3}; for (int hash = 2; hash <= 3; hash++) { auto coll = - std::make_unique(IdentifierHash(hash)); + std::make_unique(IdentifierHash(hash)); for (int layer_i = 0; layer_i < 3; layer_i++) { for (int i_clus = 0; i_clus < n_coll_per_layer.at(layer_i); i_clus++) { @@ -201,17 +201,17 @@ BOOST_AUTO_TEST_CASE(HGTD_ClusterContainerCnv_p1_test) { std::cout << "id2 " << id2.get_compact() << '\n'; std::cout << "id2 " << g_hgtd_idhelper->wafer_hash(id2) << '\n'; - std::unique_ptr trans1 = makeClusters(); + std::unique_ptr trans1 = makeClusters(); BOOST_REQUIRE(trans1->size() > 0); // otherwise there is nothing to test // MsgStream log(0, "test"); - HGTD::HGTD_ClusterContainerCnv_p1 cnv; + HGTD_ClusterContainerCnv_p1 cnv; - HGTD::HGTD_ClusterContainer_p1 pers; + HGTD_ClusterContainer_p1 pers; cnv.transToPers(trans1.get(), &pers, log); - std::unique_ptr trans2( + std::unique_ptr trans2( cnv.createTransient(&pers, log)); compare(*trans1, *trans2); diff --git a/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventTPCnv/test/HGTD_EventTPCnv_testfunctions.cxx b/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventTPCnv/test/HGTD_EventTPCnv_testfunctions.cxx index 275fc4078da2b270356adcacad8b85fd164d90aa..0bf76fd3dc427ca316ce46e89db2fe5c7c38e876 100644 --- a/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventTPCnv/test/HGTD_EventTPCnv_testfunctions.cxx +++ b/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventTPCnv/test/HGTD_EventTPCnv_testfunctions.cxx @@ -26,7 +26,7 @@ void compare(const Trk::PrepRawData& p1, const Trk::PrepRawData& p2) { std::cout << "compare PrepRawData done\n"; } -void compare(const HGTD::HGTD_Cluster& p1, const HGTD::HGTD_Cluster& p2) { +void compare(const HGTD_Cluster& p1, const HGTD_Cluster& p2) { std::cout << "compare HGTD_Cluster\n"; compare(static_cast(p1), static_cast(p2)); diff --git a/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventTPCnv/test/HGTD_RDOCnv_p1_test.cxx b/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventTPCnv/test/HGTD_RDOCnv_p1_test.cxx index c6f9785f6486186d4da46829365301c64a97fd7a..cfe2a433e2d0c7e12021b128fbe4a8cad328961f 100644 --- a/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventTPCnv/test/HGTD_RDOCnv_p1_test.cxx +++ b/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventTPCnv/test/HGTD_RDOCnv_p1_test.cxx @@ -15,16 +15,16 @@ #define BOOST_TEST_MAIN #include -HGTD::HGTD_RDO createRDO(int id, float time, int tot, int bcid, int lv1a, - int lv1id) { +HGTD_RDO createRDO(int id, float time, int tot, int bcid, int lv1a, + int lv1id) { std::cout << "createRDO\n"; Identifier identifier(id); - return HGTD::HGTD_RDO(identifier, time, tot, bcid, lv1a, lv1id); + return HGTD_RDO(identifier, time, tot, bcid, lv1a, lv1id); } -void compare(const HGTD::HGTD_RDO& p1, const HGTD::HGTD_RDO& p2) { +void compare(const HGTD_RDO& p1, const HGTD_RDO& p2) { std::cout << "compare HGTD_RDO\n"; BOOST_CHECK(p1.identify() == p2.identify()); BOOST_CHECK(p1.getTOA() == p2.getTOA()); @@ -35,28 +35,28 @@ void compare(const HGTD::HGTD_RDO& p1, const HGTD::HGTD_RDO& p2) { std::cout << "compare HGTD_RDO done\n"; } -void convertAndBack(const HGTD::HGTD_RDO& trans1) { +void convertAndBack(const HGTD_RDO& trans1) { std::cout << "convertAndBack\n"; MsgStream log(0, "test"); - HGTD::HGTD_RDOCnv_p1 cnv; - HGTD::HGTD_RDO_p1 pers; + HGTD_RDOCnv_p1 cnv; + HGTD_RDO_p1 pers; cnv.transToPers(&trans1, &pers, log); - HGTD::HGTD_RDO trans2; + HGTD_RDO trans2; cnv.persToTrans(&pers, &trans2, log); compare(trans1, trans2); std::cout << "convertAndBack done\n"; } -BOOST_AUTO_TEST_CASE(HGTD_RDOCnv_p1) { +BOOST_AUTO_TEST_CASE(HGTD_RDOCnv_p1_test) { std::cout << "start test\n"; - HGTD::HGTD_RDO rdo = createRDO(1234, 14.8348, 266, 1, 2, 3); + HGTD_RDO rdo = createRDO(1234, 14.8348, 266, 1, 2, 3); convertAndBack(rdo); } diff --git a/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventTPCnv/test/HGTD_RDOContainerCnv_p1_test.cxx b/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventTPCnv/test/HGTD_RDOContainerCnv_p1_test.cxx index 5fde7087fe0f365d46cd6edda616d7d9ca17cb01..4f5088ecde90dce5dc2635df935efde75b440258 100644 --- a/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventTPCnv/test/HGTD_RDOContainerCnv_p1_test.cxx +++ b/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventTPCnv/test/HGTD_RDOContainerCnv_p1_test.cxx @@ -23,17 +23,17 @@ const HGTD_ID* g_hgtd_idhelper; -std::unique_ptr createRDO(int id, float time, int tot, int bcid, - int lv1a, int lv1id) { +std::unique_ptr createRDO(int id, float time, int tot, int bcid, + int lv1a, int lv1id) { std::cout << "createRDO\n"; Identifier identifier(id); - return std::make_unique(identifier, time, tot, bcid, lv1a, + return std::make_unique(identifier, time, tot, bcid, lv1a, lv1id); } -void compare(const HGTD::HGTD_RDO& p1, const HGTD::HGTD_RDO& p2) { +void compare(const HGTD_RDO& p1, const HGTD_RDO& p2) { std::cout << "compare HGTD_RDO\n"; BOOST_CHECK(p1.identify() == p2.identify()); BOOST_CHECK(p1.getTOA() == p2.getTOA()); @@ -44,19 +44,19 @@ void compare(const HGTD::HGTD_RDO& p1, const HGTD::HGTD_RDO& p2) { std::cout << "compare HGTD_RDO done\n"; } -void compare(const HGTD::HGTD_RDOContainer& p1, - const HGTD::HGTD_RDOContainer& p2) { +void compare(const HGTD_RDOContainer& p1, + const HGTD_RDOContainer& p2) { std::cout << "start HGTD_RDOContainer comparison\n"; - HGTD::HGTD_RDOContainer::const_iterator it1 = p1.begin(); - HGTD::HGTD_RDOContainer::const_iterator it1e = p1.end(); - HGTD::HGTD_RDOContainer::const_iterator it2 = p2.begin(); - HGTD::HGTD_RDOContainer::const_iterator it2e = p2.end(); + HGTD_RDOContainer::const_iterator it1 = p1.begin(); + HGTD_RDOContainer::const_iterator it1e = p1.end(); + HGTD_RDOContainer::const_iterator it2 = p2.begin(); + HGTD_RDOContainer::const_iterator it2e = p2.end(); while (it1 != it1e && it2 != it2e) { BOOST_CHECK(it1.hashId() == it2.hashId()); BOOST_CHECK(it1->hasData() == it2->hasData()); if (it1->hasData()) { - const HGTD::HGTD_RDOCollection& coll1 = **it1; - const HGTD::HGTD_RDOCollection& coll2 = **it2; + const HGTD_RDOCollection& coll1 = **it1; + const HGTD_RDOCollection& coll2 = **it2; BOOST_CHECK(coll1.size() == coll2.size()); for (size_t j = 0; j < coll1.size(); j++) { compare(*coll1.at(j), *coll2.at(j)); @@ -68,19 +68,19 @@ void compare(const HGTD::HGTD_RDOContainer& p1, BOOST_CHECK(it1 == it1e && it2 == it2e); } -std::unique_ptr makeRDOContainer() { - auto container = std::make_unique(5); +std::unique_ptr makeRDOContainer() { + auto container = std::make_unique(5); for (int hash = 2; hash <= 3; hash++) { // create a collection auto collection = - std::make_unique(IdentifierHash(hash)); + std::make_unique(IdentifierHash(hash)); // fill it with RDOs for (int i = 1; i < 10; i++) { Identifier id = g_hgtd_idhelper->wafer_id(2, 1, hash, i); - std::unique_ptr rdo = + std::unique_ptr rdo = createRDO(id.get_compact(), 14.8348, 266, 1, 2, 3); collection->push_back(std::move(rdo)); } @@ -156,22 +156,22 @@ BOOST_AUTO_TEST_CASE(HGTD_RDOContainerCnv_p1_test) { g_hgtd_idhelper->set_do_checks(true); - std::unique_ptr trans_container = + std::unique_ptr trans_container = makeRDOContainer(); std::cout << "HGTD_RDOContainer created\n"; // otherwise there is nothing to test BOOST_REQUIRE(trans_container->size() > 0); MsgStream log(0, "test"); - HGTD::HGTD_RDOContainerCnv_p1 cnv; + HGTD_RDOContainerCnv_p1 cnv; - HGTD::HGTD_RDOContainer_p1 pers; + HGTD_RDOContainer_p1 pers; std::cout << "HGTD_RDOContainer transToPers\n"; cnv.transToPers(trans_container.get(), &pers, log); std::cout << "HGTD_RDOContainer transToPers done\n"; - HGTD::HGTD_RDOContainer trans(g_hgtd_idhelper->wafer_hash_max()); + HGTD_RDOContainer trans(g_hgtd_idhelper->wafer_hash_max()); std::cout << "HGTD_RDOContainer persToTrans\n"; cnv.persToTrans(&pers, &trans, log); diff --git a/HighGranularityTimingDetector/HGTD_RawEvent/HGTD_RawData/HGTD_RawData/HGTD_RDO.h b/HighGranularityTimingDetector/HGTD_RawEvent/HGTD_RawData/HGTD_RawData/HGTD_RDO.h index c9dd5c7b45feb35319cf103483410900c4b8096e..ef0df13918d232a260469dd3fe959a4695cc9c87 100644 --- a/HighGranularityTimingDetector/HGTD_RawEvent/HGTD_RawData/HGTD_RawData/HGTD_RDO.h +++ b/HighGranularityTimingDetector/HGTD_RawEvent/HGTD_RawData/HGTD_RawData/HGTD_RDO.h @@ -51,8 +51,6 @@ #include -namespace HGTD { - class HGTD_RDO : public Identifiable { public: @@ -129,6 +127,4 @@ inline unsigned short HGTD_RDO::getL1ID() const { return m_l1_id; } inline unsigned short HGTD_RDO::getL1A() const { return m_l1_a; } -} // namespace HGTD - #endif // HGTD_RAWDATA_HGTD_RDORAWDATA_H diff --git a/HighGranularityTimingDetector/HGTD_RawEvent/HGTD_RawData/HGTD_RawData/HGTD_RDOCollection.h b/HighGranularityTimingDetector/HGTD_RawEvent/HGTD_RawData/HGTD_RawData/HGTD_RDOCollection.h index 614c91c0391985779c4fa5fe3b98677c9bb99564..092674dcc71c26e91155e4fd4d23d32abebcbc2a 100644 --- a/HighGranularityTimingDetector/HGTD_RawEvent/HGTD_RawData/HGTD_RawData/HGTD_RDOCollection.h +++ b/HighGranularityTimingDetector/HGTD_RawEvent/HGTD_RawData/HGTD_RawData/HGTD_RDOCollection.h @@ -17,9 +17,7 @@ #include "HGTD_RawData/HGTD_RDO.h" #include "Identifier/IdentifierHash.h" -namespace HGTD { - -class HGTD_RDOCollection : public DataVector { +class HGTD_RDOCollection : public DataVector { // friend class HGTD_RDORawDataCollectionCnv_p1; //FIXME probably later public: @@ -42,6 +40,4 @@ private: Identifier m_id; }; -} // namespace HGTD - #endif // HGTD_RAWDATA_HGTD_RDOCOLLECTION_H diff --git a/HighGranularityTimingDetector/HGTD_RawEvent/HGTD_RawData/HGTD_RawData/HGTD_RDOContainer.h b/HighGranularityTimingDetector/HGTD_RawEvent/HGTD_RawData/HGTD_RawData/HGTD_RDOContainer.h index 60beec6768f28bd826717e577e7df398f546f809..f02530c36b549c7fd152d52644f2321945771ce8 100644 --- a/HighGranularityTimingDetector/HGTD_RawEvent/HGTD_RawData/HGTD_RawData/HGTD_RDOContainer.h +++ b/HighGranularityTimingDetector/HGTD_RawEvent/HGTD_RawData/HGTD_RawData/HGTD_RDOContainer.h @@ -15,10 +15,8 @@ #include "HGTD_RawData/HGTD_RDOCollection.h" #include "SGTools/CLASS_DEF.h" -namespace HGTD { - class HGTD_RDOContainer - : public IdentifiableContainer { + : public IdentifiableContainer { // friend class HGTD_RDOCollectionCnv_p1; //FIXME probably later public: @@ -35,8 +33,6 @@ public: virtual const CLID& clID() const { return classID(); } }; -} // namespace HGTD - -CLASS_DEF(HGTD::HGTD_RDOContainer, 1145604774, 1) +CLASS_DEF(HGTD_RDOContainer, 1188397049, 1) #endif // HGTD_RAWDATA_HGTD_RDOCONTAINER_H diff --git a/HighGranularityTimingDetector/HGTD_RawEvent/HGTD_RawData/src/HGTD_RDO.cxx b/HighGranularityTimingDetector/HGTD_RawEvent/HGTD_RawData/src/HGTD_RDO.cxx index e4b82c5baf1366addf52927f99a90dcace4eba0c..06ca563259c497456bbb554df191db5456df9d5c 100644 --- a/HighGranularityTimingDetector/HGTD_RawEvent/HGTD_RawData/src/HGTD_RDO.cxx +++ b/HighGranularityTimingDetector/HGTD_RawEvent/HGTD_RawData/src/HGTD_RDO.cxx @@ -10,8 +10,6 @@ #include "HGTD_RawData/HGTD_RDO.h" -namespace HGTD { - HGTD_RDO::HGTD_RDO(const Identifier rdo_id, const float toa, const int tot, const unsigned short bcid, const unsigned short l1_id, @@ -23,5 +21,3 @@ HGTD_RDO::HGTD_RDO(const Identifier rdo_id, const float toa, m_bcid(bcid), m_l1_id(l1_id), m_l1_a(l1_a) {} - -} // namespace HGTD diff --git a/HighGranularityTimingDetector/HGTD_RawEvent/HGTD_RawData/src/HGTD_RDOContainer.cxx b/HighGranularityTimingDetector/HGTD_RawEvent/HGTD_RawData/src/HGTD_RDOContainer.cxx index 9e75ce7939f5a06e2a6dd6f2d5ea3292d0d3e402..f8dfcd38af0bdfd0877b8e4bdfa305ee4cf1bf7b 100644 --- a/HighGranularityTimingDetector/HGTD_RawEvent/HGTD_RawData/src/HGTD_RDOContainer.cxx +++ b/HighGranularityTimingDetector/HGTD_RawEvent/HGTD_RawData/src/HGTD_RDOContainer.cxx @@ -10,13 +10,9 @@ #include "HGTD_RawData/HGTD_RDOContainer.h" -namespace HGTD { +HGTD_RDOContainer::HGTD_RDOContainer(unsigned int hashmax) + : IdentifiableContainer(hashmax) {} -HGTD::HGTD_RDOContainer::HGTD_RDOContainer(unsigned int hashmax) - : IdentifiableContainer(hashmax) {} - -const CLID& HGTD::HGTD_RDOContainer::classID() { - return ClassID_traits::ID(); +const CLID& HGTD_RDOContainer::classID() { + return ClassID_traits::ID(); } - -} // namespace HGTD diff --git a/HighGranularityTimingDetector/HGTD_RawEvent/HGTD_RawData/test/test_HGTD_RDO.cxx b/HighGranularityTimingDetector/HGTD_RawEvent/HGTD_RawData/test/test_HGTD_RDO.cxx index 6e79bf02ea11209789f8c589d786246035c416d1..669a294633fb1c6443b6145ac19d2df1dcc53070 100644 --- a/HighGranularityTimingDetector/HGTD_RawEvent/HGTD_RawData/test/test_HGTD_RDO.cxx +++ b/HighGranularityTimingDetector/HGTD_RawEvent/HGTD_RawData/test/test_HGTD_RDO.cxx @@ -15,18 +15,18 @@ #define BOOST_TEST_MAIN #include -HGTD::HGTD_RDO createRDO() { +HGTD_RDO createRDO() { std::cout << "createRDO\n"; Identifier id(5678); - HGTD::HGTD_RDO rdo(id, 14.537, 212, 1, 2, 3); + HGTD_RDO rdo(id, 14.537, 212, 1, 2, 3); std::cout << "createRDO done\n"; return rdo; } -void compare(const HGTD::HGTD_RDO& p1, const HGTD::HGTD_RDO& p2) { +void compare(const HGTD_RDO& p1, const HGTD_RDO& p2) { std::cout << "compare HGTD_RDO\n"; BOOST_CHECK(p1.identify() == p2.identify()); BOOST_CHECK(p1.getTOA() == p2.getTOA()); @@ -37,40 +37,40 @@ void compare(const HGTD::HGTD_RDO& p1, const HGTD::HGTD_RDO& p2) { std::cout << "compare HGTD_RDO done\n"; } -void testCopyCtor(const HGTD::HGTD_RDO& rdo) { +void testCopyCtor(const HGTD_RDO& rdo) { std::cout << "testCopyCtor\n"; - HGTD::HGTD_RDO copied_rdo(rdo); + HGTD_RDO copied_rdo(rdo); compare(rdo, copied_rdo); std::cout << "testCopyCtor done\n"; } -void testAssignment(const HGTD::HGTD_RDO& rdo) { +void testAssignment(const HGTD_RDO& rdo) { std::cout << "testAssignment\n"; - HGTD::HGTD_RDO assigned_rdo = rdo; + HGTD_RDO assigned_rdo = rdo; compare(rdo, assigned_rdo); std::cout << "testAssignment done\n"; } -void testMoveCtor(HGTD::HGTD_RDO rdo) { +void testMoveCtor(HGTD_RDO rdo) { std::cout << "testMoveCtor\n"; - HGTD::HGTD_RDO copied_rdo(std::move(rdo)); + HGTD_RDO copied_rdo(std::move(rdo)); compare(rdo, copied_rdo); std::cout << "testMoveCtor done\n"; } -void testMoveAssignment(HGTD::HGTD_RDO rdo) { +void testMoveAssignment(HGTD_RDO rdo) { std::cout << "testMoveAssignment\n"; - HGTD::HGTD_RDO move_assign_rdo = std::move(rdo); + HGTD_RDO move_assign_rdo = std::move(rdo); compare(rdo, move_assign_rdo); std::cout << "testMoveAssignment done\n"; } -BOOST_AUTO_TEST_CASE(HGTD_RDO, *boost::unit_test::tolerance(1e-10)) { +BOOST_AUTO_TEST_CASE(HGTD_RDO_test, *boost::unit_test::tolerance(1e-10)) { std::cout << "running test_HGTD_RDO\n"; @@ -80,7 +80,7 @@ BOOST_AUTO_TEST_CASE(HGTD_RDO, *boost::unit_test::tolerance(1e-10)) { float toa = 14.8348; - HGTD::HGTD_RDO rdo(id, toa, 266, 1, 2, 3); + HGTD_RDO rdo(id, toa, 266, 1, 2, 3); BOOST_CHECK(rdo.identify() == id); BOOST_CHECK(rdo.getTOA() == toa); @@ -89,7 +89,7 @@ BOOST_AUTO_TEST_CASE(HGTD_RDO, *boost::unit_test::tolerance(1e-10)) { BOOST_CHECK(rdo.getL1ID() == 2); BOOST_CHECK(rdo.getL1A() == 3); - HGTD::HGTD_RDO rdo2 = createRDO(); + HGTD_RDO rdo2 = createRDO(); testCopyCtor(rdo2); diff --git a/HighGranularityTimingDetector/HGTD_RawEvent/HGTD_RawData/test/test_HGTD_RDOColl.cxx b/HighGranularityTimingDetector/HGTD_RawEvent/HGTD_RawData/test/test_HGTD_RDOColl.cxx index 53281568c5198c6c75413a762e07afec25ed393c..6d051ddd803db49f1a499c483445c503a0219e95 100644 --- a/HighGranularityTimingDetector/HGTD_RawEvent/HGTD_RawData/test/test_HGTD_RDOColl.cxx +++ b/HighGranularityTimingDetector/HGTD_RawEvent/HGTD_RawData/test/test_HGTD_RDOColl.cxx @@ -19,22 +19,22 @@ #define BOOST_TEST_MAIN #include -std::unique_ptr createRDO(int id, float time, int tot, int bcid, - int lv1a, int lv1id) { +std::unique_ptr createRDO(int id, float time, int tot, int bcid, + int lv1a, int lv1id) { std::cout << "createRDO\n"; Identifier identifier(id); - return std::make_unique(identifier, time, tot, bcid, lv1a, - lv1id); + return std::make_unique(identifier, time, tot, bcid, lv1a, + lv1id); } BOOST_AUTO_TEST_CASE(HGTD_RDOColl) { // create a collection - auto coll = std::make_unique(IdentifierHash(2)); + auto coll = std::make_unique(IdentifierHash(2)); // fill it with RDOs for (int id = 1234; id < 1244; id++) { - std::unique_ptr rdo = createRDO(id, 14.8348, 266, 1, 2, 3); + std::unique_ptr rdo = createRDO(id, 14.8348, 266, 1, 2, 3); coll->push_back(std::move(rdo)); } diff --git a/HighGranularityTimingDetector/HGTD_RawEvent/HGTD_RawData/test/test_HGTD_RDOCont.cxx b/HighGranularityTimingDetector/HGTD_RawEvent/HGTD_RawData/test/test_HGTD_RDOCont.cxx index 3bb064e5fb1c231901d8ef338096ed4cadd41d21..5ad01253df273f89a251fa71b685e0dec9b2f037 100644 --- a/HighGranularityTimingDetector/HGTD_RawEvent/HGTD_RawData/test/test_HGTD_RDOCont.cxx +++ b/HighGranularityTimingDetector/HGTD_RawEvent/HGTD_RawData/test/test_HGTD_RDOCont.cxx @@ -23,14 +23,14 @@ #define BOOST_TEST_MAIN #include -std::unique_ptr createRDO(int id, float time, int tot, int bcid, - int lv1a, int lv1id) { +std::unique_ptr createRDO(int id, float time, int tot, int bcid, + int lv1a, int lv1id) { std::cout << "createRDO\n"; Identifier identifier(id); - return std::make_unique(identifier, time, tot, bcid, lv1a, - lv1id); + return std::make_unique(identifier, time, tot, bcid, lv1a, + lv1id); } BOOST_AUTO_TEST_CASE(HGTD_RDOCont) { @@ -49,15 +49,15 @@ BOOST_AUTO_TEST_CASE(HGTD_RDOCont) { BOOST_TEST(false); } - auto container = std::make_unique(5); + auto container = std::make_unique(5); for (int hash = 2; hash <= 3; hash++) { // create a collection auto collection = - std::make_unique(IdentifierHash(hash)); + std::make_unique(IdentifierHash(hash)); // fill it with RDOs for (int id = 1234; id < 1244; id++) { - std::unique_ptr rdo = + std::unique_ptr rdo = createRDO(id, 14.8348, 266, 1, 2, 3); collection->push_back(std::move(rdo)); } diff --git a/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecAlgs/HGTD_PRDFormation/HGTD_PRDFormation/PadClusterizationAlg.h b/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecAlgs/HGTD_PRDFormation/HGTD_PRDFormation/PadClusterizationAlg.h index ed0286faf573bc71a1d163dfc6b0c8be6813fb3a..c61bbb8b84f53f3a6f3cc1c4e04a0ad4cbc5b011 100644 --- a/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecAlgs/HGTD_PRDFormation/HGTD_PRDFormation/PadClusterizationAlg.h +++ b/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecAlgs/HGTD_PRDFormation/HGTD_PRDFormation/PadClusterizationAlg.h @@ -38,19 +38,19 @@ public: virtual StatusCode execute() override final; private: - ToolHandle m_clusterization_tool; + ToolHandle m_clusterization_tool; // FIXME: should look like this in master - // SG::ReadHandleKey m_rdo_rh_key{ + // SG::ReadHandleKey m_rdo_rh_key{ // this, "RDOContainerName", "HGTD_RDOs", "Name of the HGTD_RDO // container"}; // - // SG::WriteHandleKey m_prd_wh_key{ + // SG::WriteHandleKey m_prd_wh_key{ // this, "PRDContainerName", "HGTD_Clusters", // "Name of the HGTD_Cluster container"}; - SG::ReadHandleKey m_rdo_rh_key; + SG::ReadHandleKey m_rdo_rh_key; - SG::WriteHandleKey m_prd_wh_key; + SG::WriteHandleKey m_prd_wh_key; const HGTD_ID* m_hgtd_idhelper; }; diff --git a/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecAlgs/HGTD_PRDFormation/src/PadClusterizationAlg.cxx b/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecAlgs/HGTD_PRDFormation/src/PadClusterizationAlg.cxx index ebd8261f4f5fafc73e56c96874f304b6a6fa6775..cf934837d48f839f77e9f7250e444478a96cba20 100644 --- a/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecAlgs/HGTD_PRDFormation/src/PadClusterizationAlg.cxx +++ b/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecAlgs/HGTD_PRDFormation/src/PadClusterizationAlg.cxx @@ -41,9 +41,9 @@ StatusCode PadClusterizationAlg::initialize() { StatusCode PadClusterizationAlg::execute() { // retrieve the RDOs - SG::ReadHandle rdo_container_handle(m_rdo_rh_key); + SG::ReadHandle rdo_container_handle(m_rdo_rh_key); - const HGTD::HGTD_RDOContainer* rdo_container = rdo_container_handle.cptr(); + const HGTD_RDOContainer* rdo_container = rdo_container_handle.cptr(); if (not rdo_container) { //assume this is fast digi input and ignore @@ -51,14 +51,14 @@ StatusCode PadClusterizationAlg::execute() { } // register the PRD container in storegate - SG::WriteHandle prd_container_handle( + SG::WriteHandle prd_container_handle( m_prd_wh_key); ATH_CHECK( - prd_container_handle.record(std::make_unique( + prd_container_handle.record(std::make_unique( m_hgtd_idhelper->wafer_hash_max()))); - HGTD::HGTD_ClusterContainer* locp_prd_container = prd_container_handle.ptr(); + HGTD_ClusterContainer* locp_prd_container = prd_container_handle.ptr(); // Transform the RDOs collection by collection for (const auto& rdo_collection : *rdo_container) { @@ -66,7 +66,7 @@ StatusCode PadClusterizationAlg::execute() { continue; } - std::unique_ptr prd_collection = + std::unique_ptr prd_collection = m_clusterization_tool->clusterize(*rdo_collection); // can happen if some channels are masked, not really relevant currently diff --git a/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecAlgs/HGTD_TrackTimeExtension/HGTD_TrackTimeExtension/TrackTimeExtensionAlg.h b/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecAlgs/HGTD_TrackTimeExtension/HGTD_TrackTimeExtension/TrackTimeExtensionAlg.h index e4a0982bf44ff7e50e8b766efb4c18a5dd007675..76db23298ba5198ad40a94397d088d0c0f73e774 100644 --- a/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecAlgs/HGTD_TrackTimeExtension/HGTD_TrackTimeExtension/TrackTimeExtensionAlg.h +++ b/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecAlgs/HGTD_TrackTimeExtension/HGTD_TrackTimeExtension/TrackTimeExtensionAlg.h @@ -54,9 +54,9 @@ private: const HepMC::GenEvent* hs_event, bool skip_deco = false); - ToolHandle m_extension_tool; + ToolHandle m_extension_tool; - SG::ReadHandleKey m_clustercont_rh_key; + SG::ReadHandleKey m_clustercont_rh_key; SG::ReadHandleKey m_sdo_coll_rh_key; SG::ReadHandleKey m_mc_coll_rh_key; SG::ReadHandleKey m_trk_ptkl_rh_key; @@ -65,7 +65,7 @@ private: float m_eta_cut; - ToolHandle m_truth_tool; + ToolHandle m_truth_tool; std::unique_ptr>> m_dec_layer_has_ext; diff --git a/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecAlgs/HGTD_TrackTimeExtension/share/HGTDRec_jobOptions.py b/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecAlgs/HGTD_TrackTimeExtension/share/HGTDRec_jobOptions.py new file mode 100644 index 0000000000000000000000000000000000000000..99cc93b330c875deb20595474214984e38dd55d1 --- /dev/null +++ b/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecAlgs/HGTD_TrackTimeExtension/share/HGTDRec_jobOptions.py @@ -0,0 +1,69 @@ + +################################################################################ +################################################################################ + +## setup both tools used for clusterization in HGTD +from HGTD_PadClusterizationTools.HGTD_PadClusterizationToolsConf import HGTD_ClusterMakerTool + +cluster_maker_tool = HGTD_ClusterMakerTool(name="HGTD_ClusterMakerTool") +ToolSvc += cluster_maker_tool + +from HGTD_PadClusterizationTools.HGTD_PadClusterizationToolsConf import HGTD__SinglePadClusterTool + +clusterization_tool = HGTD__SinglePadClusterTool(name="SinglePadClusterTool") +clusterization_tool.ClusterMakerTool = cluster_maker_tool +ToolSvc += clusterization_tool + +## schedule the clusterisation tool to produce HGTD_Clusters out of HGTD_RDOs +from HGTD_PRDFormation.HGTD_PRDFormationConf import HGTD__PadClusterizationAlg + +hgtd_cluster_maker_alg = HGTD__PadClusterizationAlg(name="PadClusterizationAlg") +hgtd_cluster_maker_alg.ClusterizationTool = clusterization_tool +hgtd_cluster_maker_alg.PRDContainerName = "HGTD_Cluster" + +topSequence += hgtd_cluster_maker_alg + +################################################################################ +################################################################################ +## setup of tools needed in the track extension +## from the tacking side, extrapolator and Kalman updator are needed + +extrapolator = ToolSvc.AtlasExtrapolator + +kalman_updator = ToolSvc.InDetUpdator + +## for the time of flight correction, us the straight line at speed of light hypothesis +from HGTD_TimeCalibrationTools.HGTD_TimeCalibrationToolsConf import HGTD__StraightLineTOFcorrectionTool + +hgtd_tof_corr_tool = HGTD__StraightLineTOFcorrectionTool(name="StraightLineTOFcorrectionTool") + +ToolSvc += hgtd_tof_corr_tool + +## the extension itself is done within a tool that is called in the algorithm +## configure this tool first +from HGTD_TrackTimeExtensionTools.HGTD_TrackTimeExtensionToolsConf import HGTD_IterativeExtensionTool + +htgd_ext_tool = HGTD_IterativeExtensionTool(name="IterativeExtensionTool") +htgd_ext_tool.ExtrapolatorTool = extrapolator +htgd_ext_tool.UpdatorTool = kalman_updator +htgd_ext_tool.TOFCorrTool = hgtd_tof_corr_tool +htgd_ext_tool.Chi2Cut = 5.0 + +ToolSvc += htgd_ext_tool + +## to classify clusters as coming from HS/PU/... a specific tool is used +from HGTD_TruthTools.HGTD_TruthToolsConf import HGTD__ClusterTruthTool + +hgtd_cluster_truth_tool = HGTD__ClusterTruthTool(name="ClusterTruthTool") + +ToolSvc += hgtd_cluster_truth_tool + +## schedule the extension algorithm from ITk to HGTD +from HGTD_TrackTimeExtension.HGTD_TrackTimeExtensionConf import HGTD__TrackTimeExtensionAlg + +hgtd_alg = HGTD__TrackTimeExtensionAlg(name="TrackTimeExtensionAlg") +hgtd_alg.TimeExtensionTool = htgd_ext_tool +hgtd_alg.HGTDClusterContainerName = "HGTD_Cluster" +hgtd_alg.TruthTool = hgtd_cluster_truth_tool + +topSequence += hgtd_alg diff --git a/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecAlgs/HGTD_TrackTimeExtension/share/postInclude.HGTD_TrkExt.py b/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecAlgs/HGTD_TrackTimeExtension/share/postInclude.HGTD_TrkExt.py deleted file mode 100644 index a51099810f7edcdfa096035797b44e58c7449be2..0000000000000000000000000000000000000000 --- a/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecAlgs/HGTD_TrackTimeExtension/share/postInclude.HGTD_TrkExt.py +++ /dev/null @@ -1,105 +0,0 @@ -##call clustermakertools before running extension when using RDO input - -from HGTD_PadClusterizationTools.HGTD_PadClusterizationToolsConf import HGTD__HGTD_ClusterMakerTool - -cluster_maker_tool = HGTD__HGTD_ClusterMakerTool(name="HGTD_ClusterMakerTool") -cluster_maker_tool.OutputLevel = DEBUG -ToolSvc += cluster_maker_tool - -from HGTD_PadClusterizationTools.HGTD_PadClusterizationToolsConf import HGTD__SinglePadClusterTool - -clusterization_tool = HGTD__SinglePadClusterTool(name="SinglePadClusterTool") -clusterization_tool.ClusterMakerTool = cluster_maker_tool -clusterization_tool.OutputLevel = DEBUG -ToolSvc += clusterization_tool - - -##FIXME NAME!! this needs change in the CMAKE -from HGTD_PRDFormation.PadClusterizationAlgConf import HGTD__PadClusterizationAlg - -hgtd_cluster_maker_alg = HGTD__PadClusterizationAlg(name="PadClusterizationAlg") -hgtd_cluster_maker_alg.OutputLevel = DEBUG -hgtd_cluster_maker_alg.ClusterizationTool = clusterization_tool -hgtd_cluster_maker_alg.PRDContainerName = "HGTD_Cluster" - -topSequence += hgtd_cluster_maker_alg - -##continue with the extension - -extrapolator = ToolSvc.AtlasExtrapolator - -kalman_updator = ToolSvc.InDetUpdator - -from HGTD_TimeCalibrationTools.HGTD_TimeCalibrationToolsConf import HGTD__StraightLineTOFcorrectionTool - -hgtd_tof_corr_tool = HGTD__StraightLineTOFcorrectionTool(name="StraightLineTOFcorrectionTool") -hgtd_tof_corr_tool.OutputLevel = DEBUG - -ToolSvc += hgtd_tof_corr_tool - -from HGTD_TrackTimeExtensionTools.HGTD_TrackTimeExtensionToolsConf import HGTD__HGTD_IterativeExtensionTool - -htgd_ext_tool = HGTD__HGTD_IterativeExtensionTool(name="IterativeExtensionTool") -htgd_ext_tool.OutputLevel = DEBUG -htgd_ext_tool.ExtrapolatorTool = extrapolator -htgd_ext_tool.UpdatorTool = kalman_updator -htgd_ext_tool.TOFCorrTool = hgtd_tof_corr_tool -htgd_ext_tool.Chi2Cut = 5.0 - -ToolSvc += htgd_ext_tool - -from HGTD_TruthTools.HGTD_TruthToolsConf import HGTD__ClusterTruthTool - -hgtd_cluster_truth_tool = HGTD__ClusterTruthTool(name="ClusterTruthTool") -hgtd_cluster_truth_tool.OutputLevel = DEBUG - -ToolSvc += hgtd_cluster_truth_tool - -##FIXME NAME!! this needs change in the CMAKE -from HGTD_TrackTimeExtension.TrackTimeExtensionAlgConf import HGTD__TrackTimeExtensionAlg - -hgtd_alg = HGTD__TrackTimeExtensionAlg(name="TrackTimeExtensionAlg") -hgtd_alg.OutputLevel = DEBUG -hgtd_alg.TimeExtensionTool = htgd_ext_tool -hgtd_alg.HGTDClusterContainerName = "HGTD_Cluster" -hgtd_alg.TruthTool = hgtd_cluster_truth_tool - -topSequence += hgtd_alg - -# print "========= NOW SETTING UP FOR OUTPUT ============" - -# # --- load setup -from AthenaPoolCnvSvc.WriteAthenaPool import AthenaPoolOutputStream - # --- check dictionary -ServiceMgr.AthenaSealSvc.CheckDictionary = True - # --- commit interval (test) -ServiceMgr.AthenaPoolCnvSvc.CommitInterval = 10 - -# MC truth information -truthList = [ 'xAOD::TruthEventContainer#TruthEvents', - 'xAOD::TruthEventAuxContainer#TruthEventsAux.', - 'xAOD::TruthEventContainer#TruthEvents_PU', - 'xAOD::TruthEventAuxContainer#TruthEvents_PUAux.', - 'xAOD::TruthEventContainer#SpclMCPU', - 'xAOD::TruthEventAuxContainer#SpclMCPUAux.', - 'xAOD::TruthPileupEventContainer#TruthPileupEvents', - 'xAOD::TruthPileupEventAuxContainer#TruthPileupEventsAux.', - 'xAOD::TruthParticleContainer#TruthParticles', - 'xAOD::TruthParticleAuxContainer#TruthParticlesAux.', - 'xAOD::TruthVertexContainer#TruthVertices', - 'xAOD::TruthVertexAuxContainer#TruthVerticesAux.', - 'PileUpEventInfo#OverlayEvent' ] - -# --- create stream -StreamESD = AthenaPoolOutputStream ( "StreamESD2", "ESD.HGTD.full.pool.root",asAlg=True) -# --- save MC collections if truth turned on -StreamESD.ItemList += truthList -# ---- load list of objects -include ( "InDetRecExample/WriteInDetESD.py" ) -StreamESD.ItemList += InDetESDList -StreamESD.ItemList += [ 'xAOD::EventInfo#EventInfo' , 'xAOD::EventAuxInfo#EventInfoAux.' ] -StreamESD.ForceRead = True # otherwise unread stuff is not copied - -# StreamESD.ItemList += InDetESDList; - -#topSequence.StreamESD.ItemList+=[\"xAOD::EventInfo#EventInfo\", \"xAOD::EventAuxInfo#EventInfoAux.\"];topSequence.StreamESD.ItemList += [ \"xAOD::TrackParticleAuxContainer#InDetTrackParticlesAuxDyn.HGTD_*\"];topSequence.StreamESD.ForceRead = True; diff --git a/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecAlgs/HGTD_TrackTimeExtension/src/TrackTimeExtensionAlg.cxx b/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecAlgs/HGTD_TrackTimeExtension/src/TrackTimeExtensionAlg.cxx index 41ebd2ea8a10c6f43bbd5ba2498927c63894f543..5b362922336bf96fad112ef955031b9ad55c9515 100644 --- a/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecAlgs/HGTD_TrackTimeExtension/src/TrackTimeExtensionAlg.cxx +++ b/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecAlgs/HGTD_TrackTimeExtension/src/TrackTimeExtensionAlg.cxx @@ -84,9 +84,9 @@ StatusCode TrackTimeExtensionAlg::execute() { ATH_MSG_DEBUG("Start event"); - SG::ReadHandle cluster_container_handle( + SG::ReadHandle cluster_container_handle( m_clustercont_rh_key); - const HGTD::HGTD_ClusterContainer* cluster_container = + const HGTD_ClusterContainer* cluster_container = cluster_container_handle.cptr(); if (not cluster_container) { ATH_MSG_ERROR("[TrackTimeExtensionAlg] HGTD_ClusterContainer not found, " @@ -203,14 +203,14 @@ StatusCode TrackTimeExtensionAlg::decorateTrackParticle( trk_state->fitQualityOnSurface()->chiSquared() / trk_state->fitQualityOnSurface()->doubleNumberDoF()); - const HGTD::HGTD_ClusterOnTrack* cot = - dynamic_cast( + const HGTD_ClusterOnTrack* cot = + dynamic_cast( trk_state->measurementOnTrack()); time_vec.emplace_back(cot->time()); // get the cluster - const HGTD::HGTD_Cluster* cluster = cot->prepRawData(); + const HGTD_Cluster* cluster = cot->prepRawData(); raw_time_vec.emplace_back(cluster->time()); @@ -225,7 +225,7 @@ StatusCode TrackTimeExtensionAlg::decorateTrackParticle( } } - HGTD::ClusterTruthOrigin truth_origin = ClusterTruthOrigin::UNIDENTIFIED; + ClusterTruthOrigin truth_origin = ClusterTruthOrigin::UNIDENTIFIED; bool is_shadowed = false; bool is_merged = false; diff --git a/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecEvent/HGTD_PrepRawData/HGTD_PrepRawData/HGTD_Cluster.h b/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecEvent/HGTD_PrepRawData/HGTD_PrepRawData/HGTD_Cluster.h index 970d3451d9df24470eb2775aeaaa7b021796b71d..8c247ea1ec1571c3887cbf1b0fca250b4a37cd20 100644 --- a/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecEvent/HGTD_PrepRawData/HGTD_PrepRawData/HGTD_Cluster.h +++ b/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecEvent/HGTD_PrepRawData/HGTD_PrepRawData/HGTD_Cluster.h @@ -31,8 +31,6 @@ #include #include -namespace HGTD { - class HGTD_Cluster : public Trk::PrepRawData { public: @@ -120,6 +118,4 @@ inline const std::vector& HGTD_Cluster::totList() const { return m_time_over_threshold; } -} // namespace HGTD - #endif // HGTD_PREPRAWDATA_HGTD_CLUSTER_H diff --git a/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecEvent/HGTD_PrepRawData/HGTD_PrepRawData/HGTD_ClusterCollection.h b/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecEvent/HGTD_PrepRawData/HGTD_PrepRawData/HGTD_ClusterCollection.h index d3ad134e513ecb4c33af6cdcf3c7e341f796f42d..5145d4a21a16a0703f533cab17cb73f54b85c514 100644 --- a/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecEvent/HGTD_PrepRawData/HGTD_PrepRawData/HGTD_ClusterCollection.h +++ b/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecEvent/HGTD_PrepRawData/HGTD_PrepRawData/HGTD_ClusterCollection.h @@ -16,7 +16,6 @@ #include "TrkPrepRawData/PrepRawDataCollection.h" // Containers -namespace HGTD { typedef Trk::PrepRawDataCollection HGTD_ClusterCollection; /**Overload of << operator for MsgStream for debug output*/ @@ -24,8 +23,7 @@ MsgStream& operator<<(MsgStream& sl, const HGTD_ClusterCollection& coll); /**Overload of << operator for std::ostream for debug output*/ std::ostream& operator<<(std::ostream& sl, const HGTD_ClusterCollection& coll); -} // namespace HGTD -CLASS_DEF(HGTD::HGTD_ClusterCollection, 1209066247, 1) +CLASS_DEF(HGTD_ClusterCollection, 1309033586, 1) #endif // HGTD_PREPRAWDATA_HGTD_CLUSTERCOLLECTION_H diff --git a/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecEvent/HGTD_PrepRawData/HGTD_PrepRawData/HGTD_ClusterContainer.h b/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecEvent/HGTD_PrepRawData/HGTD_PrepRawData/HGTD_ClusterContainer.h index 49f79659b7d75e6a6af783213ab8d10ee43d8dde..266dfde1983543b1abae0f77a9f6a65e5bd1d61a 100644 --- a/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecEvent/HGTD_PrepRawData/HGTD_PrepRawData/HGTD_ClusterContainer.h +++ b/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecEvent/HGTD_PrepRawData/HGTD_PrepRawData/HGTD_ClusterContainer.h @@ -17,11 +17,9 @@ #include "SGTools/CLASS_DEF.h" #include "TrkPrepRawData/PrepRawDataContainer.h" -namespace HGTD { typedef Trk::PrepRawDataContainer HGTD_ClusterContainer; -} -CLASS_DEF(HGTD::HGTD_ClusterContainer, 1313575059, 1) -CONTAINER_IS_IDENTCONT(HGTD::HGTD_ClusterContainer) +CLASS_DEF(HGTD_ClusterContainer, 1124691928, 1) +CONTAINER_IS_IDENTCONT(HGTD_ClusterContainer) #endif // HGTD_PREPRAWDATA_HGTD_CLUSTERCONTAINER_H diff --git a/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecEvent/HGTD_PrepRawData/HGTD_PrepRawData/selection.xml b/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecEvent/HGTD_PrepRawData/HGTD_PrepRawData/selection.xml index fa76e6b5ebe385ce2a214f05964e06a039706f29..cea73191eb95ec8ea678dd2870448b826abd8618 100644 --- a/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecEvent/HGTD_PrepRawData/HGTD_PrepRawData/selection.xml +++ b/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecEvent/HGTD_PrepRawData/HGTD_PrepRawData/selection.xml @@ -1,6 +1,6 @@ - + @@ -8,15 +8,15 @@ - - - + + + - + - + - - + + diff --git a/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecEvent/HGTD_PrepRawData/src/HGTD_Cluster.cxx b/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecEvent/HGTD_PrepRawData/src/HGTD_Cluster.cxx index c1a73ee3ac8bd91d753d6020718badc968c39c6a..3adfe55c1dfa7efb469a73c5668cf3823e953d58 100644 --- a/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecEvent/HGTD_PrepRawData/src/HGTD_Cluster.cxx +++ b/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecEvent/HGTD_PrepRawData/src/HGTD_Cluster.cxx @@ -11,8 +11,6 @@ #include -namespace HGTD { - HGTD_Cluster::HGTD_Cluster(const Identifier& rdo_id, const Amg::Vector2D& loc_pos, const std::vector& rdo_list, @@ -107,5 +105,3 @@ HGTD_Cluster& HGTD_Cluster::operator=(HGTD_Cluster&& rhs) { } return *this; } - -} // namespace HGTD diff --git a/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecEvent/HGTD_PrepRawData/test/test_HGTD_Cluster.cxx b/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecEvent/HGTD_PrepRawData/test/test_HGTD_Cluster.cxx index 4ea237c80e58fc5bc976eec6baebc53cb0530262..d4f2d51b25756f904854845fba6c5063fe71531b 100644 --- a/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecEvent/HGTD_PrepRawData/test/test_HGTD_Cluster.cxx +++ b/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecEvent/HGTD_PrepRawData/test/test_HGTD_Cluster.cxx @@ -37,7 +37,7 @@ void compare(const Trk::PrepRawData& p1, const Trk::PrepRawData& p2) { std::cout << "compare PrepRawData done\n"; } -void compare(const HGTD::HGTD_Cluster& p1, const HGTD::HGTD_Cluster& p2) { +void compare(const HGTD_Cluster& p1, const HGTD_Cluster& p2) { std::cout << "compare HGTD_Cluster\n"; compare(static_cast(p1), static_cast(p2)); @@ -49,11 +49,11 @@ void compare(const HGTD::HGTD_Cluster& p1, const HGTD::HGTD_Cluster& p2) { } void testDefaultCtor() { - HGTD::HGTD_Cluster cluster; + HGTD_Cluster cluster; BOOST_CHECK(cluster.detectorElement() == nullptr); } -HGTD::HGTD_Cluster createCluster() { +HGTD_Cluster createCluster() { std::cout << "createCluster\n"; Amg::Vector2D locpos(1.5, 2.5); @@ -66,34 +66,34 @@ HGTD::HGTD_Cluster createCluster() { for (int j = 0; j < 2; j++) cov(i, j) = 100 * (i + 1) * (j + 1); - HGTD::HGTD_Cluster cluster(Identifier(1234), locpos, rdoList, width, nullptr, - new Amg::MatrixX(cov), dummy_toa, dummy_toa_res, - dummy_tot); + HGTD_Cluster cluster(Identifier(1234), locpos, rdoList, width, nullptr, + new Amg::MatrixX(cov), dummy_toa, dummy_toa_res, + dummy_tot); std::cout << "createCluster done\n"; return cluster; } -void testCopyCtor(const HGTD::HGTD_Cluster& cluster) { +void testCopyCtor(const HGTD_Cluster& cluster) { std::cout << "testCopyCtor\n"; - HGTD::HGTD_Cluster copied_cluster(cluster); + HGTD_Cluster copied_cluster(cluster); compare(cluster, copied_cluster); std::cout << "testCopyCtor done\n"; } -void testAssignment(const HGTD::HGTD_Cluster& cluster) { +void testAssignment(const HGTD_Cluster& cluster) { std::cout << "testAssignment\n"; - HGTD::HGTD_Cluster copied_cluster; + HGTD_Cluster copied_cluster; copied_cluster = cluster; compare(cluster, copied_cluster); std::cout << "testAssignment done\n"; } -void testMoveCtor(HGTD::HGTD_Cluster cluster) { +void testMoveCtor(HGTD_Cluster cluster) { std::cout << "testMoveCtor\n"; - HGTD::HGTD_Cluster copied_cluster(std::move(cluster)); + HGTD_Cluster copied_cluster(std::move(cluster)); BOOST_CHECK(cluster.time() == 0.0); std::cout << "copied_cluster.time() " << copied_cluster.time() << '\n'; @@ -101,9 +101,9 @@ void testMoveCtor(HGTD::HGTD_Cluster cluster) { std::cout << "testMoveCtor done\n"; } -void testMoveAssignment(HGTD::HGTD_Cluster cluster) { +void testMoveAssignment(HGTD_Cluster cluster) { std::cout << "testMoveAssignment\n"; - HGTD::HGTD_Cluster move_assign_cluster; + HGTD_Cluster move_assign_cluster; move_assign_cluster = std::move(cluster); BOOST_CHECK(cluster.time() == 0.0); @@ -113,7 +113,7 @@ void testMoveAssignment(HGTD::HGTD_Cluster cluster) { std::cout << "testMoveAssignment done\n"; } -BOOST_AUTO_TEST_CASE(HGTD_Cluster) { +BOOST_AUTO_TEST_CASE(HGTD_Cluster_test) { std::cout << "running test_HGTD_Cluster\n"; diff --git a/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecEvent/HGTD_RIO_OnTrack/HGTD_RIO_OnTrack/HGTD_ClusterOnTrack.h b/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecEvent/HGTD_RIO_OnTrack/HGTD_RIO_OnTrack/HGTD_ClusterOnTrack.h index 2c2d2010886db000794bf4a50bfcd3ecf4cbf5ab..9d9173d40cef1416a4f45e007529770ed65d495a 100644 --- a/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecEvent/HGTD_RIO_OnTrack/HGTD_RIO_OnTrack/HGTD_ClusterOnTrack.h +++ b/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecEvent/HGTD_RIO_OnTrack/HGTD_RIO_OnTrack/HGTD_ClusterOnTrack.h @@ -24,7 +24,6 @@ namespace Trk { class LocalParameters; } -namespace HGTD { class HGTD_ClusterOnTrack : public Trk::RIO_OnTrack { public: @@ -133,7 +132,7 @@ private: float m_calibrated_time_resolution; - ElementLink m_rio; + ElementLink m_rio; }; inline IdentifierHash HGTD_ClusterOnTrack::idDE() const { return m_id_hash; } @@ -160,6 +159,4 @@ inline float HGTD_ClusterOnTrack::timeResolution() const { return m_calibrated_time_resolution; } -} // namespace HGTD - #endif // HGTD_CLUSTERONTRACK_H diff --git a/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecEvent/HGTD_RIO_OnTrack/HGTD_RIO_OnTrack/selection.xml b/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecEvent/HGTD_RIO_OnTrack/HGTD_RIO_OnTrack/selection.xml index b8c006d536fa366e25bd9ed1c64c3043ec403866..dc1b692ec3eccf6b05dc65e0adb83e8743ce93bb 100644 --- a/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecEvent/HGTD_RIO_OnTrack/HGTD_RIO_OnTrack/selection.xml +++ b/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecEvent/HGTD_RIO_OnTrack/HGTD_RIO_OnTrack/selection.xml @@ -1,5 +1,5 @@ - + diff --git a/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecEvent/HGTD_RIO_OnTrack/src/HGTD_ClusterOnTrack.cxx b/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecEvent/HGTD_RIO_OnTrack/src/HGTD_ClusterOnTrack.cxx index 8d7562f4a05635134cc784ba2638fb7abbe3bf93..69f77cad32ccc9112b6531f1bf9dba8cbe6c5f73 100644 --- a/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecEvent/HGTD_RIO_OnTrack/src/HGTD_ClusterOnTrack.cxx +++ b/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecEvent/HGTD_RIO_OnTrack/src/HGTD_ClusterOnTrack.cxx @@ -13,8 +13,6 @@ #include #include -namespace HGTD { - // Default constructor: HGTD_ClusterOnTrack::HGTD_ClusterOnTrack() : RIO_OnTrack(), @@ -166,5 +164,3 @@ void HGTD_ClusterOnTrack::setValues(const Trk::TrkDetElementBase* det_el, m_det_el = dynamic_cast(det_el); } - -} // namespace HGTD diff --git a/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecEvent/HGTD_RIO_OnTrack/test/test_HGTD_ClusterOnTrack.cxx b/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecEvent/HGTD_RIO_OnTrack/test/test_HGTD_ClusterOnTrack.cxx index 9b4a90318f91b08575b8ef341b3407c54bd51ef5..a1b6409b0670f4c6fd2553faaabe90d9b0838e51 100644 --- a/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecEvent/HGTD_RIO_OnTrack/test/test_HGTD_ClusterOnTrack.cxx +++ b/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecEvent/HGTD_RIO_OnTrack/test/test_HGTD_ClusterOnTrack.cxx @@ -33,8 +33,8 @@ void compare(const Trk::PrepRawData* p1, const Trk::PrepRawData* p2) { BOOST_CHECK(p1->localCovariance() == p2->localCovariance()); std::cout << "compare PrepRawData done\n"; } -void compare(const HGTD::HGTD_ClusterOnTrack& p1, - const HGTD::HGTD_ClusterOnTrack& p2) { +void compare(const HGTD_ClusterOnTrack& p1, + const HGTD_ClusterOnTrack& p2) { std::cout << "compare HGTD_ClusterOnTrack\n"; BOOST_CHECK(p1.idDE() == p2.idDE()); compare(p1.prepRawData(), p2.prepRawData()); @@ -45,11 +45,11 @@ void compare(const HGTD::HGTD_ClusterOnTrack& p1, } void testDefaultCtor() { - HGTD::HGTD_ClusterOnTrack cluster; + HGTD_ClusterOnTrack cluster; BOOST_CHECK(cluster.detectorElement() == nullptr); } -HGTD::HGTD_Cluster createCluster() { +HGTD_Cluster createCluster() { std::cout << "createCluster\n"; Amg::Vector2D locpos(1.5, 2.5); @@ -62,16 +62,16 @@ HGTD::HGTD_Cluster createCluster() { for (int j = 0; j < 2; j++) cov(i, j) = 100 * (i + 1) * (j + 1); - HGTD::HGTD_Cluster cluster(Identifier(1234), locpos, rdoList, width, nullptr, - new Amg::MatrixX(cov), dummy_toa, dummy_toa_res, - dummy_tot); + HGTD_Cluster cluster(Identifier(1234), locpos, rdoList, width, nullptr, + new Amg::MatrixX(cov), dummy_toa, dummy_toa_res, + dummy_tot); std::cout << "createCluster done\n"; return cluster; } -HGTD::HGTD_ClusterOnTrack -createClusterOnTrackWithCluster(const HGTD::HGTD_Cluster& cluster) { +HGTD_ClusterOnTrack +createClusterOnTrackWithCluster(const HGTD_Cluster& cluster) { Amg::Vector2D locpars(1.5, 2.5); @@ -80,32 +80,32 @@ createClusterOnTrackWithCluster(const HGTD::HGTD_Cluster& cluster) { for (int j = 0; j < 2; j++) cov(i, j) = 100 * (i + 1) * (j + 1); - HGTD::HGTD_ClusterOnTrack cot(&cluster, locpars, cov, dummy_toa, - dummy_toa_res, IdentifierHash(1234)); + HGTD_ClusterOnTrack cot(&cluster, locpars, cov, dummy_toa, + dummy_toa_res, IdentifierHash(1234)); return cot; } -void testCopyCtor(const HGTD::HGTD_ClusterOnTrack& cot) { +void testCopyCtor(const HGTD_ClusterOnTrack& cot) { std::cout << "testCopyCtor\n"; - HGTD::HGTD_ClusterOnTrack copied_cot(cot); + HGTD_ClusterOnTrack copied_cot(cot); compare(cot, copied_cot); std::cout << "testCopyCtor done\n"; } -void testAssignment(const HGTD::HGTD_ClusterOnTrack& cot) { +void testAssignment(const HGTD_ClusterOnTrack& cot) { std::cout << "testAssignment\n"; - HGTD::HGTD_ClusterOnTrack copied_cot; + HGTD_ClusterOnTrack copied_cot; copied_cot = cot; compare(cot, copied_cot); std::cout << "testAssignment done\n"; } -void testMoveCtor(HGTD::HGTD_ClusterOnTrack cot) { +void testMoveCtor(HGTD_ClusterOnTrack cot) { std::cout << "testMoveCtor\n"; - HGTD::HGTD_ClusterOnTrack copied_cot(std::move(cot)); + HGTD_ClusterOnTrack copied_cot(std::move(cot)); BOOST_CHECK(cot.time() == 0.0); std::cout << "copied_cluster.time() " << copied_cot.time() << '\n'; @@ -113,9 +113,9 @@ void testMoveCtor(HGTD::HGTD_ClusterOnTrack cot) { std::cout << "testMoveCtor done\n"; } -void testMoveAssignment(HGTD::HGTD_ClusterOnTrack cot) { +void testMoveAssignment(HGTD_ClusterOnTrack cot) { std::cout << "testMoveAssignment\n"; - HGTD::HGTD_ClusterOnTrack move_assign_cot; + HGTD_ClusterOnTrack move_assign_cot; move_assign_cot = std::move(cot); BOOST_CHECK(cot.time() == 0.0); @@ -125,7 +125,7 @@ void testMoveAssignment(HGTD::HGTD_ClusterOnTrack cot) { std::cout << "testMoveAssignment done\n"; } -BOOST_AUTO_TEST_CASE(HGTD_ClusterOnTrack) { +BOOST_AUTO_TEST_CASE(HGTD_ClusterOnTrack_test) { std::cout << "running test_HGTD_ClusterOnTrack\n"; @@ -133,10 +133,10 @@ BOOST_AUTO_TEST_CASE(HGTD_ClusterOnTrack) { std::cout << "testing with HGTD_Cluster\n"; - HGTD::HGTD_Cluster cluster = createCluster(); + HGTD_Cluster cluster = createCluster(); // cluster needs to be on heap, otherwise ownership issues arrise when COT is // deleted - HGTD::HGTD_Cluster* cluster_ptr = new HGTD::HGTD_Cluster(cluster); + HGTD_Cluster* cluster_ptr = new HGTD_Cluster(cluster); std::cout << "HGTD_Cluster created\n"; diff --git a/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecTools/HGTD_PadClusterizationTools/HGTD_PadClusterizationTools/HGTD_ClusterMakerTool.h b/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecTools/HGTD_PadClusterizationTools/HGTD_PadClusterizationTools/HGTD_ClusterMakerTool.h index 38081bdfa9ad2833cac5905da192f0ac3f3aa357..f01677ec7104aeec29902f59c71f7568e08d9ae3 100644 --- a/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecTools/HGTD_PadClusterizationTools/HGTD_PadClusterizationTools/HGTD_ClusterMakerTool.h +++ b/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecTools/HGTD_PadClusterizationTools/HGTD_PadClusterizationTools/HGTD_ClusterMakerTool.h @@ -22,8 +22,6 @@ #include "HGTD_PrepRawData/HGTD_Cluster.h" #include -namespace HGTD { - class HGTD_ClusterMakerTool : public AthAlgTool { public: @@ -55,6 +53,4 @@ public: const std::vector& time_over_threshold) const; }; -} // namespace HGTD - #endif // HGTD_CLUSTERMAKERTOOL_H diff --git a/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecTools/HGTD_PadClusterizationTools/HGTD_PadClusterizationTools/SinglePadClusterTool.h b/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecTools/HGTD_PadClusterizationTools/HGTD_PadClusterizationTools/SinglePadClusterTool.h index 030ab7755eb68b1934f43bed8de72a5b47b6719e..f6319ef817f6dd8636d0b78009d1e999d12d4611 100644 --- a/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecTools/HGTD_PadClusterizationTools/HGTD_PadClusterizationTools/SinglePadClusterTool.h +++ b/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecTools/HGTD_PadClusterizationTools/HGTD_PadClusterizationTools/SinglePadClusterTool.h @@ -36,8 +36,8 @@ public: virtual StatusCode initialize(); - virtual std::unique_ptr - clusterize(const HGTD::HGTD_RDOCollection& rdo_coll) const override; + virtual std::unique_ptr + clusterize(const HGTD_RDOCollection& rdo_coll) const override; private: ToolHandle m_cluster_maker; diff --git a/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecTools/HGTD_PadClusterizationTools/src/HGTD_ClusterMakerTool.cxx b/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecTools/HGTD_PadClusterizationTools/src/HGTD_ClusterMakerTool.cxx index e062176ad9937a4ad39c2e93a7ac88535b54dea5..52e1eeac92817d9cd10e87e190ba4606742f2b44 100644 --- a/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecTools/HGTD_PadClusterizationTools/src/HGTD_ClusterMakerTool.cxx +++ b/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecTools/HGTD_PadClusterizationTools/src/HGTD_ClusterMakerTool.cxx @@ -19,14 +19,14 @@ inline double square(const double x) { return x * x; } constexpr double g_one_over_twelve = 1. / 12.; } // namespace -HGTD::HGTD_ClusterMakerTool::HGTD_ClusterMakerTool(const std::string& t, - const std::string& n, - const IInterface* p) +HGTD_ClusterMakerTool::HGTD_ClusterMakerTool(const std::string& t, + const std::string& n, + const IInterface* p) : AthAlgTool(t, n, p) {} -HGTD::HGTD_ClusterMakerTool::~HGTD_ClusterMakerTool() {} +HGTD_ClusterMakerTool::~HGTD_ClusterMakerTool() {} -std::unique_ptr HGTD::HGTD_ClusterMakerTool::createCluster( +std::unique_ptr HGTD_ClusterMakerTool::createCluster( const Identifier& rdo_id, const Amg::Vector2D& loc_pos, const std::vector& rdo_list, const InDet::SiWidth& width, const InDetDD::SolidStateDetectorElementBase* det_el, @@ -48,7 +48,7 @@ std::unique_ptr HGTD::HGTD_ClusterMakerTool::createCluster( 0.035; // 35 pico second resolution at start of operation, given in nano // seconds in ATHENA - return std::make_unique( + return std::make_unique( rdo_id, loc_pos, rdo_list, width, det_el, loc_err_matx, time_of_arrival, time_of_arrival_err, time_over_threshold); } diff --git a/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecTools/HGTD_PadClusterizationTools/src/SinglePadClusterTool.cxx b/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecTools/HGTD_PadClusterizationTools/src/SinglePadClusterTool.cxx index 2186eb20e86d4d3d7d2d88fd52a67e15eb184531..99b0707c8c2b84e7af88db1c8f899beeb08262cf 100644 --- a/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecTools/HGTD_PadClusterizationTools/src/SinglePadClusterTool.cxx +++ b/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecTools/HGTD_PadClusterizationTools/src/SinglePadClusterTool.cxx @@ -19,7 +19,7 @@ SinglePadClusterTool::SinglePadClusterTool(const std::string& type, const std::string& name, const IInterface* parent) : AthAlgTool(type, name, parent), - m_cluster_maker("HGTD::HGTD_ClusterMakerTool/HGTD_ClusterMakerTool"), + m_cluster_maker("HGTD_ClusterMakerTool/HGTD_ClusterMakerTool"), m_hgtd_det_mgr(nullptr) { declareProperty("ClusterMakerTool", m_cluster_maker); } @@ -35,14 +35,14 @@ StatusCode SinglePadClusterTool::initialize() { return StatusCode::SUCCESS; } -std::unique_ptr +std::unique_ptr SinglePadClusterTool::clusterize(const HGTD_RDOCollection& rdo_coll) const { Identifier identifier = rdo_coll.identify(); IdentifierHash id_hash = rdo_coll.identifierHash(); - std::unique_ptr cluster_collection = - std::make_unique(id_hash); + std::unique_ptr cluster_collection = + std::make_unique(id_hash); cluster_collection->setIdentifier(identifier); cluster_collection->reserve(rdo_coll.size()); @@ -90,7 +90,7 @@ SinglePadClusterTool::clusterize(const HGTD_RDOCollection& rdo_coll) const { // gets transformed to cluster directly std::vector time_over_threshold = {static_cast(rdo->getTOT())}; - std::unique_ptr cluster = + std::unique_ptr cluster = m_cluster_maker->createCluster(rdo_id, loc_pos, rdo_list, si_width, element, time_of_arrival, time_over_threshold); diff --git a/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecTools/HGTD_PadClusterizationTools/src/components/HGTD_PadClusterizationTools_entries.cxx b/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecTools/HGTD_PadClusterizationTools/src/components/HGTD_PadClusterizationTools_entries.cxx index b0795204e37e18f5e2aa6cb4c4db0edfeea41b44..6e268bc344657144180bf607a01a27a1c33b6769 100644 --- a/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecTools/HGTD_PadClusterizationTools/src/components/HGTD_PadClusterizationTools_entries.cxx +++ b/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecTools/HGTD_PadClusterizationTools/src/components/HGTD_PadClusterizationTools_entries.cxx @@ -2,13 +2,11 @@ #include "HGTD_PadClusterizationTools/HGTD_ClusterMakerTool.h" #include "HGTD_PadClusterizationTools/SinglePadClusterTool.h" -using namespace HGTD; - DECLARE_TOOL_FACTORY(HGTD_ClusterMakerTool) -DECLARE_TOOL_FACTORY(SinglePadClusterTool) +DECLARE_TOOL_FACTORY(HGTD::SinglePadClusterTool) DECLARE_FACTORY_ENTRIES(HGTD_PadClusterizationTools) { DECLARE_TOOL(HGTD_ClusterMakerTool) - DECLARE_TOOL(SinglePadClusterTool) + DECLARE_TOOL(HGTD::SinglePadClusterTool) } diff --git a/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecTools/HGTD_RecToolInterfaces/HGTD_RecToolInterfaces/IHGTD_ClusterTruthTool.h b/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecTools/HGTD_RecToolInterfaces/HGTD_RecToolInterfaces/IHGTD_ClusterTruthTool.h index da4d4bb8ef8e0322c6040b0c82b7316dac825178..08cc537cbc2be06f01256d2c02f2f2e6e45cacb5 100644 --- a/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecTools/HGTD_RecToolInterfaces/HGTD_RecToolInterfaces/IHGTD_ClusterTruthTool.h +++ b/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecTools/HGTD_RecToolInterfaces/HGTD_RecToolInterfaces/IHGTD_ClusterTruthTool.h @@ -34,10 +34,9 @@ class TruthParticle_v1; typedef TruthParticle_v1 TruthParticle; } // namespace xAOD -namespace HGTD { - class HGTD_Cluster; +namespace HGTD { enum ClusterTruthOrigin { UNIDENTIFIED = 0, TRUTH_PARTICLE = 1, // originates from the tested truth particle @@ -60,9 +59,10 @@ struct ClusterTruthInfo { */ bool is_merged; }; +} // namespace HGTD static const InterfaceID - IID_IHGTD_ClusterTruthTool("HGTD::IHGTD_ClusterTruthTool", 1, 0); + IID_IHGTD_ClusterTruthTool("IHGTD_ClusterTruthTool", 1, 0); class IHGTD_ClusterTruthTool : virtual public IAlgTool { @@ -85,8 +85,8 @@ public: * * @return Struct combining the relevant truth information. */ - virtual ClusterTruthInfo - classifyCluster(const HGTD::HGTD_Cluster* cluster, + virtual HGTD::ClusterTruthInfo + classifyCluster(const HGTD_Cluster* cluster, const xAOD::TruthParticle* tp, const InDetSimDataCollection* sim_data, const HepMC::GenEvent* hard_scatter_evnt = nullptr) const = 0; @@ -98,6 +98,4 @@ inline const InterfaceID& IHGTD_ClusterTruthTool::interfaceID() { return IID_IHGTD_ClusterTruthTool; } -} // namespace HGTD - #endif // IHGTD_CLUSTERTRUTHTOOL_H diff --git a/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecTools/HGTD_RecToolInterfaces/HGTD_RecToolInterfaces/IHGTD_PadClusterizationTool.h b/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecTools/HGTD_RecToolInterfaces/HGTD_RecToolInterfaces/IHGTD_PadClusterizationTool.h index 0d03b7b2fcd6a12649acfe129b14db5720801a43..77fcccc512ed2c1e7f9ca463855fa8b4cd45c40d 100644 --- a/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecTools/HGTD_RecToolInterfaces/HGTD_RecToolInterfaces/IHGTD_PadClusterizationTool.h +++ b/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecTools/HGTD_RecToolInterfaces/HGTD_RecToolInterfaces/IHGTD_PadClusterizationTool.h @@ -25,10 +25,8 @@ class MsgStream; -namespace HGTD { - static const InterfaceID - IID_IHGTD_PadClusterizationTool("HGTD::IHGTD_PadClusterizationTool", 1, 0); + IID_IHGTD_PadClusterizationTool("IHGTD_PadClusterizationTool", 1, 0); class IHGTD_PadClusterizationTool : virtual public IAlgTool { @@ -42,8 +40,8 @@ public: * * @return The collection of clusters built from the RDOs. */ - virtual std::unique_ptr - clusterize(const HGTD::HGTD_RDOCollection& rdo_collection) const = 0; + virtual std::unique_ptr + clusterize(const HGTD_RDOCollection& rdo_collection) const = 0; }; /** Inline methods **/ @@ -52,6 +50,4 @@ inline const InterfaceID& IHGTD_PadClusterizationTool::interfaceID() { return IID_IHGTD_PadClusterizationTool; } -} // namespace HGTD - #endif // IHGTD_CLUSTERMAKERTOOL_H diff --git a/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecTools/HGTD_RecToolInterfaces/HGTD_RecToolInterfaces/IHGTD_TOFcorrectionTool.h b/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecTools/HGTD_RecToolInterfaces/HGTD_RecToolInterfaces/IHGTD_TOFcorrectionTool.h index 8669cf2a1b39eec24af71dc51e7105d343546ffa..cfd5468c78d588a47d148431078c637fe41a82cd 100644 --- a/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecTools/HGTD_RecToolInterfaces/HGTD_RecToolInterfaces/IHGTD_TOFcorrectionTool.h +++ b/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecTools/HGTD_RecToolInterfaces/HGTD_RecToolInterfaces/IHGTD_TOFcorrectionTool.h @@ -24,12 +24,10 @@ namespace Trk { class Track; } -namespace HGTD { - class HGTD_Cluster; static const InterfaceID - IID_IHGTD_TOFcorrectionTool("HGTD::IHGTD_TOFcorrectionTool", 1, 0); + IID_IHGTD_TOFcorrectionTool("IHGTD_TOFcorrectionTool", 1, 0); class IHGTD_TOFcorrectionTool : virtual public IAlgTool { @@ -49,7 +47,7 @@ public: * @return Returns calibrated time of arrival and its resolution. */ virtual std::pair correctTimeAndResolution( - const Trk::Track& track, const HGTD::HGTD_Cluster& cluster, + const Trk::Track& track, const HGTD_Cluster& cluster, const float time_of_arrival, const float time_of_arrival_err) const = 0; }; @@ -59,6 +57,4 @@ inline const InterfaceID& IHGTD_TOFcorrectionTool::interfaceID() { return IID_IHGTD_TOFcorrectionTool; } -} // namespace HGTD - #endif // IHGTD_TOFCORRECTIONTOOL_H diff --git a/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecTools/HGTD_RecToolInterfaces/HGTD_RecToolInterfaces/IHGTD_TrackTimeExtensionTool.h b/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecTools/HGTD_RecToolInterfaces/HGTD_RecToolInterfaces/IHGTD_TrackTimeExtensionTool.h index 0276d4c34fe91ea6cbba2f71994620fc9710736d..a73267a0c586714e1748f6d688dd68ed106ec436 100644 --- a/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecTools/HGTD_RecToolInterfaces/HGTD_RecToolInterfaces/IHGTD_TrackTimeExtensionTool.h +++ b/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecTools/HGTD_RecToolInterfaces/HGTD_RecToolInterfaces/IHGTD_TrackTimeExtensionTool.h @@ -28,10 +28,8 @@ class MsgStream; -namespace HGTD { - static const InterfaceID - IID_IHGTD_TrackExtensionTool("HGTD::IHGTD_TrackTimeExtensionTool", 1, 0); + IID_IHGTD_TrackExtensionTool("IHGTD_TrackTimeExtensionTool", 1, 0); class IHGTD_TrackTimeExtensionTool : virtual public IAlgTool { @@ -49,7 +47,7 @@ public: */ virtual std::array, 4> extendTrackToHGTD(const Trk::Track& track, - const HGTD::HGTD_ClusterContainer* container) = 0; + const HGTD_ClusterContainer* container) = 0; }; /** Inline methods **/ @@ -58,6 +56,4 @@ inline const InterfaceID& IHGTD_TrackTimeExtensionTool::interfaceID() { return IID_IHGTD_TrackExtensionTool; } -} // namespace HGTD - #endif // IHGTD_TRACKTIMEEXTENSIONTOOL_H diff --git a/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecTools/HGTD_TimeCalibrationTools/HGTD_TimeCalibrationTools/StraightLineTOFcorrectionTool.h b/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecTools/HGTD_TimeCalibrationTools/HGTD_TimeCalibrationTools/StraightLineTOFcorrectionTool.h index 3bf240df1da25b86c9b838127845fa79ac28da07..6251ecd8195b655780329af3bf22f2cdbf5e8fd3 100644 --- a/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecTools/HGTD_TimeCalibrationTools/HGTD_TimeCalibrationTools/StraightLineTOFcorrectionTool.h +++ b/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecTools/HGTD_TimeCalibrationTools/HGTD_TimeCalibrationTools/StraightLineTOFcorrectionTool.h @@ -42,7 +42,7 @@ public: virtual std::pair correctTimeAndResolution(const Trk::Track& track, - const HGTD::HGTD_Cluster& cluster, + const HGTD_Cluster& cluster, const float time_of_arrival, const float time_of_arrival_err) const override; diff --git a/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecTools/HGTD_TimeCalibrationTools/src/StraightLineTOFcorrectionTool.cxx b/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecTools/HGTD_TimeCalibrationTools/src/StraightLineTOFcorrectionTool.cxx index 2a633e0a869c0d60fd5b49f684fd77238b2b4734..f0d3031cdd7e035758ce4ef1355c16026e092bd0 100644 --- a/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecTools/HGTD_TimeCalibrationTools/src/StraightLineTOFcorrectionTool.cxx +++ b/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecTools/HGTD_TimeCalibrationTools/src/StraightLineTOFcorrectionTool.cxx @@ -32,7 +32,7 @@ StatusCode HGTD::StraightLineTOFcorrectionTool::initialize() { std::pair HGTD::StraightLineTOFcorrectionTool::correctTimeAndResolution( - const Trk::Track& track, const HGTD::HGTD_Cluster& cluster, + const Trk::Track& track, const HGTD_Cluster& cluster, const float time_of_arrival, const float time_of_arrival_err) const { ATH_MSG_DEBUG("Correcting input time: " << time_of_arrival); diff --git a/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecTools/HGTD_TrackTimeExtensionTools/HGTD_TrackTimeExtensionTools/HGTD_IterativeExtensionTool.h b/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecTools/HGTD_TrackTimeExtensionTools/HGTD_TrackTimeExtensionTools/HGTD_IterativeExtensionTool.h index 3c7f5ccc4bdf1aeb5fb9f78f0e2e869b3bfa6f03..90f912468b38dee7c3965034b012da2056c99889 100644 --- a/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecTools/HGTD_TrackTimeExtensionTools/HGTD_TrackTimeExtensionTools/HGTD_IterativeExtensionTool.h +++ b/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecTools/HGTD_TrackTimeExtensionTools/HGTD_TrackTimeExtensionTools/HGTD_IterativeExtensionTool.h @@ -38,8 +38,6 @@ class HGTD_ID; class HGTD_DetectorManager; -namespace HGTD { - class HGTD_IterativeExtensionTool : virtual public IHGTD_TrackTimeExtensionTool, public AthAlgTool { @@ -63,7 +61,7 @@ public: */ virtual std::array, 4> extendTrackToHGTD(const Trk::Track& track, - const HGTD::HGTD_ClusterContainer* container) override; + const HGTD_ClusterContainer* container) override; MsgStream& dump(MsgStream& out) const; std::ostream& dump(std::ostream& out) const; @@ -134,14 +132,14 @@ private: */ std::unique_ptr updateState(const Trk::TrackParameters* param, - const HGTD::HGTD_Cluster* cluster); + const HGTD_Cluster* cluster); // extrapolation tool ToolHandle m_extrapolator; // kalman updator tool ToolHandle m_updator; - ToolHandle m_tof_corr_tool; + ToolHandle m_tof_corr_tool; // keep a pointer to the currently used track, but does not own it! // FIXME: this is needed for the TOF correction. Maybe there is a smarter way @@ -152,7 +150,7 @@ private: /** * @brief Keep pointer to current cluster container. */ - const HGTD::HGTD_ClusterContainer* m_cluster_container; + const HGTD_ClusterContainer* m_cluster_container; const HGTD_DetectorManager* m_hgtd_det_mgr; const HGTD_ID* m_hgtd_id_helper; @@ -168,6 +166,5 @@ private: */ int m_particle_hypot; }; -} // namespace HGTD #endif // HGTD_ITERATIVEEXTENTSIONTOOL_H diff --git a/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecTools/HGTD_TrackTimeExtensionTools/src/HGTD_IterativeExtensionTool.cxx b/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecTools/HGTD_TrackTimeExtensionTools/src/HGTD_IterativeExtensionTool.cxx index 7ce34c60774c2c483bdc1fd07f22a22fdc83e248..9561d2897adedf08b3d4804c4168fd562aa9b3fb 100644 --- a/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecTools/HGTD_TrackTimeExtensionTools/src/HGTD_IterativeExtensionTool.cxx +++ b/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecTools/HGTD_TrackTimeExtensionTools/src/HGTD_IterativeExtensionTool.cxx @@ -22,7 +22,7 @@ #include #include -HGTD::HGTD_IterativeExtensionTool::HGTD_IterativeExtensionTool( +HGTD_IterativeExtensionTool::HGTD_IterativeExtensionTool( const std::string& t, const std::string& n, const IInterface* p) : AthAlgTool(t, n, p), m_extrapolator("Trk::Extrapolator/AtlasExtrapolator"), @@ -42,7 +42,7 @@ HGTD::HGTD_IterativeExtensionTool::HGTD_IterativeExtensionTool( declareProperty("ParticleHypothesis", m_particle_hypot); } -StatusCode HGTD::HGTD_IterativeExtensionTool::initialize() { +StatusCode HGTD_IterativeExtensionTool::initialize() { StatusCode sc = AthAlgTool::initialize(); ATH_CHECK(m_extrapolator.retrieve()); @@ -57,8 +57,8 @@ StatusCode HGTD::HGTD_IterativeExtensionTool::initialize() { } std::array, 4> -HGTD::HGTD_IterativeExtensionTool::extendTrackToHGTD( - const Trk::Track& track, const HGTD::HGTD_ClusterContainer* container) { +HGTD_IterativeExtensionTool::extendTrackToHGTD( + const Trk::Track& track, const HGTD_ClusterContainer* container) { ATH_MSG_DEBUG("Start extending"); @@ -168,7 +168,7 @@ HGTD::HGTD_IterativeExtensionTool::extendTrackToHGTD( } const Trk::TrackStateOnSurface* -HGTD::HGTD_IterativeExtensionTool::getLastHitOnTrack(const Trk::Track& track) { +HGTD_IterativeExtensionTool::getLastHitOnTrack(const Trk::Track& track) { const DataVector* tsos = track.trackStateOnSurfaces(); @@ -193,7 +193,7 @@ HGTD::HGTD_IterativeExtensionTool::getLastHitOnTrack(const Trk::Track& track) { } std::vector -HGTD::HGTD_IterativeExtensionTool::getCompatibleSurfaces( +HGTD_IterativeExtensionTool::getCompatibleSurfaces( const Trk::TrackParameters& param, const Trk::Layer* layer) { std::vector surfaces; @@ -226,7 +226,7 @@ HGTD::HGTD_IterativeExtensionTool::getCompatibleSurfaces( } std::vector> -HGTD::HGTD_IterativeExtensionTool::extrapolateToSurfaces( +HGTD_IterativeExtensionTool::extrapolateToSurfaces( const Trk::TrackParameters& param, const std::vector& surfaces) { @@ -247,7 +247,7 @@ HGTD::HGTD_IterativeExtensionTool::extrapolateToSurfaces( } std::unique_ptr -HGTD::HGTD_IterativeExtensionTool::updateStateWithBestFittingCluster( +HGTD_IterativeExtensionTool::updateStateWithBestFittingCluster( const std::vector>& params) { ATH_MSG_DEBUG("[updateStateWithBestFittingCluster] start updating"); @@ -280,7 +280,7 @@ HGTD::HGTD_IterativeExtensionTool::updateStateWithBestFittingCluster( } std::unique_ptr -HGTD::HGTD_IterativeExtensionTool::findBestCompatibleCluster( +HGTD_IterativeExtensionTool::findBestCompatibleCluster( const Trk::TrackParameters* param) { ATH_MSG_DEBUG("[findBestCompatibleCluster] start"); @@ -331,8 +331,8 @@ HGTD::HGTD_IterativeExtensionTool::findBestCompatibleCluster( } std::unique_ptr -HGTD::HGTD_IterativeExtensionTool::updateState( - const Trk::TrackParameters* param, const HGTD::HGTD_Cluster* cluster) { +HGTD_IterativeExtensionTool::updateState( + const Trk::TrackParameters* param, const HGTD_Cluster* cluster) { ATH_MSG_DEBUG("[updateState] calling the updator"); // FIXME: the HGTD_Cluster should know its detector element here. needs @@ -345,7 +345,7 @@ HGTD::HGTD_IterativeExtensionTool::updateState( m_tof_corr_tool->correctTimeAndResolution( *m_track, *cluster, cluster->time(), cluster->timeResolution()); - HGTD::HGTD_ClusterOnTrack* cot = new HGTD::HGTD_ClusterOnTrack( + HGTD_ClusterOnTrack* cot = new HGTD_ClusterOnTrack( cluster, Trk::LocalParameters(cluster->localPosition()), cluster->localCovariance(), corr_time_and_res.first, corr_time_and_res.second, det_el->identifyHash()); diff --git a/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecTools/HGTD_TrackTimeExtensionTools/src/components/HGTD_TrackTimeExtensionTools_entries.cxx b/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecTools/HGTD_TrackTimeExtensionTools/src/components/HGTD_TrackTimeExtensionTools_entries.cxx index 3528db9f46dc3f351f3e2a4f8f033087eed23cb6..2490f2f228e6737a68678184430af8d71fef4fc4 100644 --- a/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecTools/HGTD_TrackTimeExtensionTools/src/components/HGTD_TrackTimeExtensionTools_entries.cxx +++ b/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecTools/HGTD_TrackTimeExtensionTools/src/components/HGTD_TrackTimeExtensionTools_entries.cxx @@ -1,8 +1,6 @@ #include "GaudiKernel/DeclareFactoryEntries.h" #include "HGTD_TrackTimeExtensionTools/HGTD_IterativeExtensionTool.h" -using namespace HGTD; - DECLARE_TOOL_FACTORY(HGTD_IterativeExtensionTool) DECLARE_FACTORY_ENTRIES( HGTD_TrackTimeExtensionTools ) diff --git a/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecTools/HGTD_TruthTools/HGTD_TruthTools/ClusterTruthTool.h b/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecTools/HGTD_TruthTools/HGTD_TruthTools/ClusterTruthTool.h index ae452c4b63128de692fa5d807a741cb6dec75074..9b3057dab842ca5c122ff5f9612d29954e2e239a 100644 --- a/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecTools/HGTD_TruthTools/HGTD_TruthTools/ClusterTruthTool.h +++ b/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecTools/HGTD_TruthTools/HGTD_TruthTools/ClusterTruthTool.h @@ -47,8 +47,8 @@ public: * * @return Struct combining the relevant truth information. */ - virtual ClusterTruthInfo classifyCluster( - const HGTD::HGTD_Cluster* cluster, const xAOD::TruthParticle* tp, + virtual HGTD::ClusterTruthInfo classifyCluster( + const HGTD_Cluster* cluster, const xAOD::TruthParticle* tp, const InDetSimDataCollection* sim_data, const HepMC::GenEvent* hard_scatter_evnt = nullptr) const override; }; diff --git a/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecTools/HGTD_TruthTools/src/ClusterTruthTool.cxx b/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecTools/HGTD_TruthTools/src/ClusterTruthTool.cxx index b27ba37aae69a9433c772d0fd4f22126c6d81bbf..1d5ae69d2957164398e22df2042d766d5773850c 100644 --- a/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecTools/HGTD_TruthTools/src/ClusterTruthTool.cxx +++ b/HighGranularityTimingDetector/HGTD_Reconstruction/HGTD_RecTools/HGTD_TruthTools/src/ClusterTruthTool.cxx @@ -26,12 +26,12 @@ HGTD::ClusterTruthTool::ClusterTruthTool(const std::string& t, : AthAlgTool(t, n, p) {} HGTD::ClusterTruthInfo HGTD::ClusterTruthTool::classifyCluster( - const HGTD::HGTD_Cluster* cluster, const xAOD::TruthParticle* tp, + const HGTD_Cluster* cluster, const xAOD::TruthParticle* tp, const InDetSimDataCollection* sim_data, const HepMC::GenEvent* hard_scatter_evnt) const { if (not sim_data) { - return {ClusterTruthOrigin::UNIDENTIFIED, false, false}; + return {HGTD::ClusterTruthOrigin::UNIDENTIFIED, false, false}; } const std::vector& rdo_id_list = cluster->rdoList(); @@ -44,14 +44,14 @@ HGTD::ClusterTruthInfo HGTD::ClusterTruthTool::classifyCluster( // the InDetSimData contains a std::pair, where // the second entry in the pair holds the time of the SiChargedDiode if (pos == sim_data->end()) { - ATH_MSG_WARNING("[ClusterTruthTool::classifyCluster] ID not found in SDO " + ATH_MSG_WARNING("[HGTD::ClusterTruthTool::classifyCluster] ID not found in SDO " "map, going to next ID"); // FIXME I should probably continue here already? otherwise I get an // "empty" entry in shadowed_origins continue; } // collect deposits, sorted with first deposit at start of map bu default - std::map sorted_deposits; + std::map sorted_deposits; ////////////////////////////// // the following is taken from 20.20 as is @@ -63,7 +63,7 @@ HGTD::ClusterTruthInfo HGTD::ClusterTruthTool::classifyCluster( // 0 is also used for detector noise, delta rays and random energy // deposits if (barcode == 0 || barcode > 200000) { - sorted_deposits.emplace(deposit.second, ClusterTruthOrigin::SECONDARY); + sorted_deposits.emplace(deposit.second, HGTD::ClusterTruthOrigin::SECONDARY); // FIXME: shouldn't I "continue" here? } // check for identity with original particle @@ -75,27 +75,27 @@ HGTD::ClusterTruthInfo HGTD::ClusterTruthTool::classifyCluster( // deposit came from the tested truth particle if (barcode == tp->barcode() && tp->p4().DeltaR(l4) < 0.05) { sorted_deposits.emplace(deposit.second, - ClusterTruthOrigin::TRUTH_PARTICLE); + HGTD::ClusterTruthOrigin::TRUTH_PARTICLE); // if given, the parent event can be checked } else if (hard_scatter_evnt and gen_part->parent_event() == hard_scatter_evnt) { sorted_deposits.emplace(deposit.second, - ClusterTruthOrigin::HARD_SCATTER); + HGTD::ClusterTruthOrigin::HARD_SCATTER); // otherwise, a particle that was generated but doesn't come from the // hard scatter is considered to be originating from a pileup // interaction } else { - sorted_deposits.emplace(deposit.second, ClusterTruthOrigin::PILEUP); + sorted_deposits.emplace(deposit.second, HGTD::ClusterTruthOrigin::PILEUP); } } else { // if there is no gen particle, we can guess based on the event index if (particle_link.eventIndex() == 0) { sorted_deposits.emplace(deposit.second, - ClusterTruthOrigin::HARD_SCATTER); + HGTD::ClusterTruthOrigin::HARD_SCATTER); } else { // If the gen was not kept, we assume it is cut away from truth record // and is pileup - sorted_deposits.emplace(deposit.second, ClusterTruthOrigin::PILEUP); + sorted_deposits.emplace(deposit.second, HGTD::ClusterTruthOrigin::PILEUP); } } } // END lOOP over the deposits @@ -104,9 +104,9 @@ HGTD::ClusterTruthInfo HGTD::ClusterTruthTool::classifyCluster( // particle, but it was not the first deposit and is thus not used for the // time measurement -> I will have an incorrect time bool is_shadowed = false; - ClusterTruthOrigin current_origin; + HGTD::ClusterTruthOrigin current_origin; - std::map::iterator elem = + std::map::iterator elem = sorted_deposits.begin(); for (; elem != sorted_deposits.end(); ++elem) { @@ -116,8 +116,8 @@ HGTD::ClusterTruthInfo HGTD::ClusterTruthTool::classifyCluster( // if one of the later deposits originates from the truth particle, then // the hit I want to find was shadowed by something else, and I will // reconstruct an incorrect time - if (current_origin != ClusterTruthOrigin::TRUTH_PARTICLE && - elem->second == ClusterTruthOrigin::TRUTH_PARTICLE) { + if (current_origin != HGTD::ClusterTruthOrigin::TRUTH_PARTICLE && + elem->second == HGTD::ClusterTruthOrigin::TRUTH_PARTICLE) { is_shadowed = true; } } @@ -129,7 +129,7 @@ HGTD::ClusterTruthInfo HGTD::ClusterTruthTool::classifyCluster( if (shadowed_origins.size() == 0) { ATH_MSG_WARNING("did not manage to understand any RDOs..."); - result.origin = ClusterTruthOrigin::UNIDENTIFIED; + result.origin = HGTD::ClusterTruthOrigin::UNIDENTIFIED; result.is_shadowed = false; // A cluster is considered to be merged if more than one particle deposited // energy in a given pad. diff --git a/InnerDetector/InDetDetDescr/InDetReadoutGeometry/src/SiDetectorElement.cxx b/InnerDetector/InDetDetDescr/InDetReadoutGeometry/src/SiDetectorElement.cxx index 251eda481f48bf534aad77d55b3c358bc9cbfa19..2ee880a7796ab7548ad4ae60dde99f97e113bd9f 100644 --- a/InnerDetector/InDetDetDescr/InDetReadoutGeometry/src/SiDetectorElement.cxx +++ b/InnerDetector/InDetDetDescr/InDetReadoutGeometry/src/SiDetectorElement.cxx @@ -365,7 +365,8 @@ double SiDetectorElement::sinStereo() const if (isBarrel()) { sinStereo = m_phiAxis.z(); } else { // endcap - if (m_design->shape() == InDetDD::Annulus) { //built-in Stereo angle for Annulus shape sensor + auto designShape = m_design->shape(); + if (designShape == InDetDD::Annulus) { //built-in Stereo angle for Annulus shape sensor HepGeom::Point3D sensorCenter = m_design->sensorCenter(); //Below retrieved method will return -sin(m_Stereo), thus sinStereolocal = sin(m_Stereo) double sinStereoReco = - static_cast(m_design)->sinStripAngleReco(sensorCenter[1], sensorCenter[0]); @@ -379,8 +380,9 @@ double SiDetectorElement::sinStereo() const Amg::Vector3D globalSFxAxis =(m_center - globalfocus)/radialShift; //Stereo angle is the angle between global radial direction and the x-axis of the Strip frame in the global frame sinStereo = (m_center.y() * globalSFxAxis.x() - m_center.x() * globalSFxAxis.y()) / m_center.perp(); - } - else{ //non built-in Stereo angle + // } else if (designShape == InDetDD::PolarAnnulus) { // Polar specialisation + // sinStereo = m_design->getStereo(); + } else { //non built-in Stereo angle sinStereo = (m_center.y() * m_etaAxis.x() - m_center.x() * m_etaAxis.y()) / m_center.perp(); } } diff --git a/InnerDetector/InDetDetDescr/SCT_ReadoutGeometry/SCT_ReadoutGeometry/StripStereoAnnulusDesign.h b/InnerDetector/InDetDetDescr/SCT_ReadoutGeometry/SCT_ReadoutGeometry/StripStereoAnnulusDesign.h index 52cd6eed35dba9f4fccdca4eea4619739df6db2b..3c1f79f8d78f943f0418dc307e15f0b7100dfada 100644 --- a/InnerDetector/InDetDetDescr/SCT_ReadoutGeometry/SCT_ReadoutGeometry/StripStereoAnnulusDesign.h +++ b/InnerDetector/InDetDetDescr/SCT_ReadoutGeometry/SCT_ReadoutGeometry/StripStereoAnnulusDesign.h @@ -81,7 +81,14 @@ public: const bool &usePC); ~StripStereoAnnulusDesign() = default; - + + SiLocalPosition beamToStrip(const SiLocalPosition &pos) const; + SiLocalPosition beamToStripPC(const SiLocalPosition &pos) const; + SiLocalPosition beamToStripPCpolar(const SiLocalPosition &pos) const; + + SiLocalPosition stripToBeam(const SiLocalPosition &pos) const; + SiLocalPosition stripToBeamPC(const SiLocalPosition &pos) const; + SiLocalPosition stripToBeamPCpolar(const SiLocalPosition &pos) const; HepGeom::Point3D sensorCenter() const; @@ -223,6 +230,10 @@ private: const std::vector m_stripStartRadius; const std::vector m_stripEndRadius; const double m_stereo; + const double m_cos_minus_stereo; + const double m_sin_minus_stereo; + const double m_cos_plus_stereo; + const double m_sin_plus_stereo; const double m_R; const double m_waferCentreR; const double m_lengthBF; @@ -254,11 +265,11 @@ inline double StripStereoAnnulusDesign::stripPitch() const { // Don't use; which } inline double StripStereoAnnulusDesign::phiPitch(const SiLocalPosition &pos) const { -// Return pitch in mm for the strip at this position, at this point's distance along the strip. + // Return pitch in mm for the strip at this position, at this point's distance along the strip. const SiCellId cellId = cellIdOfPosition(pos); const int row = cellId.etaIndex(); if(row<0) return -phiPitch(); - const double radius = sqrt(pos.xEta() * pos.xEta() + pos.xPhi() * pos.xPhi()); + const double radius = (m_usePC) ? pos.xEta() : std::hypot(pos.xEta(), pos.xPhi()); return m_pitch[row] * radius; } diff --git a/InnerDetector/InDetDetDescr/SCT_ReadoutGeometry/src/StripStereoAnnulusDesign.cxx b/InnerDetector/InDetDetDescr/SCT_ReadoutGeometry/src/StripStereoAnnulusDesign.cxx index c234acb7a8fd3bda2a71828db3f526f1bbd5e451..139c1852c56f926ca63763e2a6d436bc5e136611 100644 --- a/InnerDetector/InDetDetDescr/SCT_ReadoutGeometry/src/StripStereoAnnulusDesign.cxx +++ b/InnerDetector/InDetDetDescr/SCT_ReadoutGeometry/src/StripStereoAnnulusDesign.cxx @@ -38,13 +38,15 @@ StripStereoAnnulusDesign::StripStereoAnnulusDesign(const SiDetectorDesign::Axis m_stripStartRadius(stripStartRadius), m_stripEndRadius(stripEndRadius), m_stereo(stereoAngle), + m_cos_minus_stereo(std::cos(-m_stereo)), + m_sin_minus_stereo(std::sin(-m_stereo)), + m_cos_plus_stereo(m_cos_minus_stereo), + m_sin_plus_stereo(-m_sin_minus_stereo), m_R(centreR), m_waferCentreR(waferCentreR),//if not specified in constructor, wafer centre assumed to simply be element centre m_lengthBF(2. * waferCentreR * std::sin(stereoAngle*0.5)), // Eq. 5 p. 7 m_usePC(usePC) { - REPORT_MESSAGE(MSG::INFO) << "StripStereoAnnulusDesign called with usePC=" << usePC << std::endl; - if (nRows < 0) { throw std::runtime_error( "ERROR: StripStereoAnnulusDesign called with negative number of rows"); @@ -105,6 +107,138 @@ StripStereoAnnulusDesign::StripStereoAnnulusDesign(const SiDetectorDesign::Axis //assuming here that centreR==waferCentreR } +SiLocalPosition StripStereoAnnulusDesign::beamToStrip(const SiLocalPosition &pos) const { + if (m_usePC) return beamToStripPC(pos); + + const double x_beam = pos.xEta(); + const double y_beam = pos.xPhi(); + + // Transform to strip frame SF (eq. 36 in ver G, combined with eq. 2 since we are in beam frame) + // + // x_strip cos(-m_stereo) -sin(-m_stereo) x-R R + // ( ) = [ ]( ) + ( ) + // y_strip sin(-m_stereo) cos(-m_stereo) y 0 + const double x_strip = m_cos_minus_stereo * (x_beam - m_waferCentreR) - m_sin_minus_stereo * y_beam + m_waferCentreR; + const double y_strip = m_sin_minus_stereo * (x_beam - m_waferCentreR) + m_cos_minus_stereo * y_beam; + + return {x_strip, y_strip}; +} + +SiLocalPosition StripStereoAnnulusDesign::beamToStripPC(const SiLocalPosition &pos) const { + const double phi_beam = pos.xPhi(); + const double rad_beam = pos.xEta(); + + // Convert to cart and use cartesian transform + const double x_beam = rad_beam * std::cos(phi_beam); + const double y_beam = rad_beam * std::sin(phi_beam); + + // Transform to strip frame SF (eq. 36 in ver G, combined with eq. 2 since we are in beam frame) + // + // x_strip cos(-m_stereo) -sin(-m_stereo) x-R R + // ( ) = [ ]( ) + ( ) + // y_strip sin(-m_stereo) cos(-m_stereo) y 0 + const double x_strip = m_cos_minus_stereo * (x_beam - m_waferCentreR) - m_sin_minus_stereo * y_beam + m_waferCentreR; + const double y_strip = m_sin_minus_stereo * (x_beam - m_waferCentreR) + m_cos_minus_stereo * y_beam; + + const double phi_strip = std::atan2(y_strip, x_strip); + const double rad_strip = std::hypot(x_strip, y_strip); + + return {rad_strip, phi_strip}; +} + +/** + * @brief Version of StripStereoAnnulusDesign::beamToStripPC transform based exclusively in a polar system + * + * Not currently used. Requires debugging and profiling + * + * @param pos + * @return SiLocalPosition + */ +SiLocalPosition StripStereoAnnulusDesign::beamToStripPCpolar(const SiLocalPosition &pos) const { + const double phi_beam = pos.xPhi(); + const double rad_beam = pos.xEta(); + + // Exclusively-polar transform: + // Trig which can be precalculated in the future + const double m_stereo_2 = m_stereo*0.5; + const double m_cos_plus_stereo_2 = std::cos(m_stereo_2); + const double m_sin_plus_stereo_2 = std::sin(m_stereo_2); + + // calculation for strip-frame radius uses cosine law - see ATL-COM-ITK-2021-048 + const double rad_conv = 2.0*m_waferCentreR*std::abs(m_sin_plus_stereo_2); + const double rad_strip = std::sqrt( std::pow(rad_beam,2.0) + std::pow(rad_conv,2.0) + 2.0*rad_beam*rad_conv*m_cos_plus_stereo_2); + + // calculation for strip-frame angle uses sine law - see ATL-COM-ITK-2021-048 + const double phi_strip = M_PI_2 - m_stereo_2 - std::asin((rad_beam*std::sin(M_PI + phi_beam - m_stereo_2))/rad_strip); + + return {rad_strip, phi_strip}; +} + +SiLocalPosition StripStereoAnnulusDesign::stripToBeam(const SiLocalPosition &pos) const { + if (m_usePC) return stripToBeamPC(pos); + + const double x_strip = pos.xEta(); + const double y_strip = pos.xPhi(); + + // Transform to beam frame (eq. 36 in ver G, combined with eq. 2 since we are in strip frame) + // + // x_beam cos(m_stereo) -sin(m_stereo) x-R R + // ( ) = [ ]( ) + ( ) + // y_beam sin(m_stereo) cos(m_stereo) y 0 + const double x_beam = m_cos_plus_stereo * (x_strip - m_waferCentreR) - m_sin_plus_stereo * y_strip + m_waferCentreR; + const double y_beam = m_sin_plus_stereo * (x_strip - m_waferCentreR) + m_cos_plus_stereo * y_strip; + + return {x_beam, y_beam}; +} + +SiLocalPosition StripStereoAnnulusDesign::stripToBeamPC(const SiLocalPosition &pos) const { + const double phi_strip = pos.xPhi(); + const double rad_strip = pos.xEta(); + + // Convert to cart and use previous transform + const double x_strip = rad_strip * std::cos(phi_strip); + const double y_strip = rad_strip * std::sin(phi_strip); + + // Transform to beam frame (eq. 36 in ver G, combined with eq. 2 since we are in strip frame) + // + // x_beam cos(m_stereo) -sin(m_stereo) x-R R + // ( ) = [ ]( ) + ( ) + // y_beam sin(m_stereo) cos(m_stereo) y 0 + const double x_beam = m_cos_plus_stereo * (x_strip - m_waferCentreR) - m_sin_plus_stereo * y_strip + m_waferCentreR; + const double y_beam = m_sin_plus_stereo * (x_strip - m_waferCentreR) + m_cos_plus_stereo * y_strip; + + const double phi_beam = std::atan2(y_beam, x_beam); + const double rad_beam = std::hypot(x_beam, y_beam); + + return {rad_beam, phi_beam}; +} + +/** + * @brief Version of StripStereoAnnulusDesign::stripToBeamPC transform based exclusively in a polar system + * + * Not currently used. Requires debugging and profiling + * + * @param pos + * @return SiLocalPosition + */ +SiLocalPosition StripStereoAnnulusDesign::stripToBeamPCpolar(const SiLocalPosition &pos) const { + const double phi_strip = pos.xPhi(); + const double rad_strip = pos.xEta(); + + // Exclusively-polar transform: + // Trig which can be precalculated in the future + const double m_stereo_2 = m_stereo*0.5; + const double m_sin_plus_stereo_2 = std::sin(m_stereo_2); + + // calculation for beam-frame radius uses cosine law - see ATL-COM-ITK-2021-048 + const double rad_conv = 2.0*m_waferCentreR*std::abs(m_sin_plus_stereo_2); + const double rad_beam = std::sqrt( std::pow(rad_strip,2.0) + std::pow(rad_conv,2.0) + 2.0*rad_strip*rad_conv*std::cos(M_PI_2 - m_stereo_2 - phi_strip)); + + // calculation for beam-frame angle uses sine law - see ATL-COM-ITK-2021-048 + const double phi_beam = m_stereo_2 - M_PI_2 + std::asin((rad_strip*std::sin(M_PI_2 - m_stereo_2 - phi_strip))/rad_beam); + + return {rad_beam, phi_beam}; +} HepGeom::Point3D StripStereoAnnulusDesign::sensorCenter() const { return HepGeom::Point3D(m_R, 0., 0.); @@ -114,15 +248,13 @@ double StripStereoAnnulusDesign::sinStripAngleReco(double phiCoord, double etaCo // // Transform to strip frame SF (eq. 36 in ver G, combined with eq. 2 since we are in beam frame) // - double x = etaCoord; - double y = phiCoord; - double xSF = cos(-m_stereo) * (x - m_waferCentreR) - sin(-m_stereo) * y + m_waferCentreR; - double ySF = sin(-m_stereo) * (x - m_waferCentreR) + cos(-m_stereo) * y; - double phiPrime = atan2(ySF, xSF); + SiLocalPosition pos_strip = beamToStrip({etaCoord, phiCoord}); + + double phi_strip = (m_usePC) ? pos_strip.xPhi() : std::atan2(pos_strip.xPhi(), pos_strip.xEta()); // The minus sign below is because this routine is called by tracking software, which swaps x and y, then measures angles from y // to x - return -sin(phiPrime + m_stereo); + return -sin(phi_strip + m_stereo); } void StripStereoAnnulusDesign::getStripRow(SiCellId cellId, int *strip2D, int *rowNum) const { @@ -175,33 +307,27 @@ SiCellId StripStereoAnnulusDesign::cellIdOfPosition(SiLocalPosition const &pos) // // Find the row // - double r = pos.r(); - if (r < m_stripStartRadius[0] || r >= m_stripEndRadius.back()) { + double rad_beam = (m_usePC) ? pos.xEta() : pos.r(); + if (rad_beam < m_stripStartRadius[0] || rad_beam >= m_stripEndRadius.back()) { // Check r is in the module return SiCellId(); // return an invalid id } int row = 0; if(m_nRows>1){ //only do this if we have multiple rows... - vector::const_iterator endPtr = upper_bound(m_stripStartRadius.begin(), m_stripStartRadius.end(), r); + vector::const_iterator endPtr = upper_bound(m_stripStartRadius.begin(), m_stripStartRadius.end(), rad_beam); row = distance(m_stripStartRadius.begin(), endPtr) - 1; // Following should never happen, check is done on r above if (row < 0 || row >= m_nRows) { - REPORT_MESSAGE( MSG::DEBUG ) << "Invalid SiLocalPosition, returning invalid SiCellId: bad row = " << row << " for r = " << r << " \n"; + REPORT_MESSAGE( MSG::DEBUG ) << "Invalid SiLocalPosition, returning invalid SiCellId: bad row = " << row << " for r = " << rad_beam << " \n"; return SiCellId(); // return an invalid id } } // // Find the strip // - double x = pos.xEta(); - double y = pos.xPhi(); -// -// Transform to strip frame SF (eq. 36 in ver G, combined with eq. 2 since we are in beam frame) -// - double xSF = cos(-m_stereo) * (x - m_waferCentreR) - sin(-m_stereo) * y + m_waferCentreR; - double ySF = sin(-m_stereo) * (x - m_waferCentreR) + cos(-m_stereo) * y; - double phiPrime = atan2(ySF, xSF); - int strip = floor(phiPrime / m_pitch[row]) + m_nStrips[row] / 2.0; + SiLocalPosition pos_strip = beamToStrip(pos); + double phi_strip = (m_usePC) ? pos_strip.xPhi() : std::atan2(pos_strip.xPhi(), pos_strip.xEta()); + int strip = floor(phi_strip / m_pitch[row]) + m_nStrips[row] / 2.0; if (strip < 0 || strip >= m_nStrips[row]) { // Outside REPORT_MESSAGE( MSG::DEBUG ) << "Invalid SiLocalPosition, returning invalid SiCellId \n"; return SiCellId(); // return an invalid id @@ -212,16 +338,35 @@ SiCellId StripStereoAnnulusDesign::cellIdOfPosition(SiLocalPosition const &pos) } SiLocalPosition StripStereoAnnulusDesign::localPositionOfCell(SiCellId const &cellId) const { - if (m_usePC) { - return localPositionOfCellPC(cellId); - } else { - int strip, row; - getStripRow(cellId, &strip, &row); - double r = (m_stripEndRadius[row] + m_stripStartRadius[row]) / 2.; - return stripPosAtR(strip, row, r); + int strip, row; + getStripRow(cellId, &strip, &row); + // this is the radius in the module / radial system + double r = (m_stripEndRadius[row] + m_stripStartRadius[row]) / 2.; + + // get phi of strip in the strip system + double phi_strip = (strip - m_nStrips[row] / 2. + 0.5) * m_pitch[row]; + + double b = -2. * m_lengthBF * sin(m_stereo/2. + phi_strip); + double c = m_lengthBF * m_lengthBF - r * r; + // this is the radius in the strip system + double rad_strip = (-b + sqrt(b * b - 4. * c))/2.; + + if (m_usePC) return stripToBeam({rad_strip,phi_strip}); + else { + //else use cart + double x_strip = rad_strip * cos(phi_strip); + double y_strip = rad_strip * sin(phi_strip); + return stripToBeam({x_strip, y_strip}); } } +/** + * @brief Explicit polar version, no longer required. To be depreceated + * @deprecated + * + * @param cellId + * @return SiLocalPosition + */ SiLocalPosition StripStereoAnnulusDesign::localPositionOfCellPC(SiCellId const &cellId) const { int strip, row; @@ -246,18 +391,18 @@ SiLocalPosition StripStereoAnnulusDesign::localPositionOfCellPC(SiCellId const & SiLocalPosition StripStereoAnnulusDesign::stripPosAtR(int strip, int row, double r) const { - double phiPrime = (strip - m_nStrips[row] / 2. + 0.5) * m_pitch[row]; + double phi_strip = (strip - m_nStrips[row] / 2. + 0.5) * m_pitch[row]; - double b = -2. * m_lengthBF * sin(m_stereo/2. + phiPrime); + double b = -2. * m_lengthBF * sin(m_stereo/2. + phi_strip); double c = m_lengthBF * m_lengthBF - r * r; - double rPrime = (-b + sqrt(b * b - 4. * c))/2.; + double rad_strip = (-b + sqrt(b * b - 4. * c))/2.; - double xPrime = rPrime * cos(phiPrime); - double yPrime = rPrime * sin(phiPrime); - double x = cos(m_stereo) * (xPrime - m_waferCentreR) - sin(m_stereo) * yPrime + m_waferCentreR; - double y = sin(m_stereo) * (xPrime - m_waferCentreR) + cos(m_stereo) * yPrime; + if (m_usePC) return stripToBeam({rad_strip,phi_strip}); - return SiLocalPosition(x, y, 0.0); + //else use cart + double x_strip = rad_strip * cos(phi_strip); + double y_strip = rad_strip * sin(phi_strip); + return stripToBeam({x_strip, y_strip}); } SiLocalPosition StripStereoAnnulusDesign::localPositionOfCluster(SiCellId const &cellId, int clusterSize) const { @@ -283,7 +428,7 @@ SiLocalPosition StripStereoAnnulusDesign::localPositionOfCluster(SiCellId const /** * @brief This is for debugging only. Call to explicitly get PC clusters. * - * The method StripStereoAnnulusDesign::localPositionOfCluster() should detect the use of polar co-ordinates + * @deprecated method StripStereoAnnulusDesign::localPositionOfCluster() should detect the use of polar co-ordinates * automatically and return the cluster in the appropriate co-ordinate system. This is handled in the call to the * localPositionOfCell() function. Therefore, the only use of this method is to explicitly get a polar cluster when the * module was created with a cartesian co-ordinate system. After the integration of polar co-ordinates is complete, this @@ -311,9 +456,7 @@ SiLocalPosition StripStereoAnnulusDesign::localPositionOfClusterPC(SiCellId cons /// Give end points of the strip that covers the given position std::pair StripStereoAnnulusDesign::endsOfStrip(SiLocalPosition const &pos) const { - SiCellId cellId = cellIdOfPosition(pos); - int strip, row; getStripRow(cellId, &strip, &row); @@ -333,23 +476,21 @@ bool StripStereoAnnulusDesign::inActiveArea(SiLocalPosition const &pos, bool /*c // Used in surfaceChargesGenerator double StripStereoAnnulusDesign::scaledDistanceToNearestDiode(SiLocalPosition const &pos) const { + // Get phiPrime of pos + SiLocalPosition pos_stripframe = beamToStrip(pos); + double pos_phi_stripframe = (m_usePC) ? pos_stripframe.xPhi() : std::atan2(pos_stripframe.xPhi(),pos_stripframe.xEta()); -// Get phiPrime of pos -// - double posxP = cos(-m_stereo) * (pos.xEta() - m_waferCentreR) - sin(-m_stereo) * pos.xPhi() + m_waferCentreR; - double posyP = sin(-m_stereo) * (pos.xEta() - m_waferCentreR) + cos(-m_stereo) * pos.xPhi(); - double posphiP = atan2(posyP, posxP); // // Get phiPrime of strip // - SiCellId cellId = cellIdOfPosition(pos); - SiLocalPosition posStrip = localPositionOfCell(cellId); - double posStripxP = cos(-m_stereo) * (posStrip.xEta() - m_waferCentreR) - sin(-m_stereo) * posStrip.xPhi() + m_waferCentreR; - double posStripyP = sin(-m_stereo) * (posStrip.xEta() - m_waferCentreR) + cos(-m_stereo) * posStrip.xPhi(); - double posStripphiP = atan2(posStripyP, posStripxP); - int strip, row; - getStripRow(cellId, &strip, &row); - return fabs(posphiP - posStripphiP) / m_pitch[row]; + SiCellId cellId = cellIdOfPosition(pos); + SiLocalPosition stripPos_beamframe = localPositionOfCell(cellId); // This can be polar or cart + SiLocalPosition stripPos_stripframe = beamToStrip(stripPos_beamframe); // This should automatically work with polar or cart + double strip_phi_stripframe = (m_usePC) ? stripPos_stripframe.xPhi() : std::atan2(stripPos_stripframe.xPhi(),stripPos_stripframe.xEta()); + + int strip, row; + getStripRow(cellId, &strip, &row); + return std::abs(pos_phi_stripframe - strip_phi_stripframe) / m_pitch[row]; } /// Return strip width, centre, length etc. Hard to find if this is used or not. @@ -417,44 +558,44 @@ const { } void StripStereoAnnulusDesign::distanceToDetectorEdge(SiLocalPosition const & pos, double & etaDist, double & phiDist) const { + // For eta, we use the Strip frame. This is centred at the beamline, x along eta, y along phi, z along depth // Happens to coincide with SiLocalPosition; no transform needed. double rInner = m_stripStartRadius[0]; double rOuter = m_stripEndRadius[m_nRows - 1]; - double xEta = pos.xEta(); - double xPhi = pos.xPhi(); - double r = sqrt(xEta * xEta + xPhi * xPhi); - if (r < rInner) - etaDist = r - rInner; - else if (r > rOuter) - etaDist = rOuter - r; + double rad_beam = (m_usePC) ? pos.xEta() : std::hypot(pos.xEta(), pos.xPhi()); + + if (rad_beam < rInner) + etaDist = rad_beam - rInner; + else if (rad_beam > rOuter) + etaDist = rOuter - rad_beam; else - etaDist = min(rOuter - r, r - rInner); + etaDist = std::min(rOuter - rad_beam, rad_beam - rInner); // For phi, we use the Strip frame. Transform to Strip-frame: - double etaStrip = cos(-m_stereo) * (xEta - m_waferCentreR) - sin(-m_stereo) * xPhi + m_waferCentreR; - double phiStrip = sin(-m_stereo) * (xEta - m_waferCentreR) + cos(-m_stereo) * xPhi; -// Put these into polar coordinates - double rStrip = sqrt(etaStrip * etaStrip + phiStrip * phiStrip); - double phiAngleStrip = atan2(phiStrip, etaStrip); - + SiLocalPosition pos_strip = beamToStrip(pos); + + double rad_strip = (m_usePC) ? pos_strip.xEta() : std::hypot(pos_strip.xEta(), pos_strip.xPhi()); + double phi_strip = (m_usePC) ? pos_strip.xPhi() : std::atan2(pos_strip.xPhi(), pos_strip.xEta()); + double phiAngleMax = m_pitch[0] * m_nStrips[0] / 2.0; double phiAngleMin = -phiAngleMax; - if (phiAngleStrip < phiAngleMin) - phiDist = rStrip * (phiAngleStrip - phiAngleMin); - else if (phiAngleStrip > phiAngleMax) - phiDist = rStrip * (phiAngleMax - phiAngleStrip); + if (phi_strip < phiAngleMin) + phiDist = rad_strip * (phi_strip - phiAngleMin); + else if (phi_strip > phiAngleMax) + phiDist = rad_strip * (phiAngleMax - phi_strip); else - phiDist = rStrip * min(phiAngleMax - phiAngleStrip, phiAngleStrip - phiAngleMin); + phiDist = rad_strip * std::min(phiAngleMax - phi_strip, phi_strip - phiAngleMin); return; } DetectorShape StripStereoAnnulusDesign::shape() const - { - return InDetDD::Annulus; - } +{ + if (m_usePC) return InDetDD::PolarAnnulus; + else return InDetDD::Annulus; +} const HepGeom::Transform3D StripStereoAnnulusDesign::SiHitToGeoModel() const { return HepGeom::RotateY3D(90.*CLHEP::deg) ; diff --git a/InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD/python/InDetDxAODJobProperties.py b/InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD/python/InDetDxAODJobProperties.py index 98178326f0e57ee50f8f784e1670d3997835b8eb..40cf6367286865f0702b101e60528976431625d7 100644 --- a/InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD/python/InDetDxAODJobProperties.py +++ b/InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD/python/InDetDxAODJobProperties.py @@ -174,4 +174,11 @@ class PixelClusterThinningExpression(JobProperty): StoredValue = "" jobproperties.InDetDxAODJobPropertyContainer.add_JobProperty(PixelClusterThinningExpression) +class StoreExtendedHitDeco(JobProperty): + """Store extended hit decoration""" + statusOn = True + allowedTypes = ['bool'] + StoredValue = False +jobproperties.InDetDxAODJobPropertyContainer.add_JobProperty(StoreExtendedHitDeco) + InDetDxAODFlags = jobproperties.InDetDxAODJobPropertyContainer diff --git a/InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD/share/InDetDxAOD.py b/InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD/share/InDetDxAOD.py index 66fa6ff859bd2ba98902ce16cfb299a2349ca415..732ef3b4cb977313217a3ba82f4f791c19344c20 100644 --- a/InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD/share/InDetDxAOD.py +++ b/InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD/share/InDetDxAOD.py @@ -418,6 +418,7 @@ if dumpPixInfo: xAOD_PixelPrepDataToxAOD.UseTruthInfo = dumpTruthInfo xAOD_PixelPrepDataToxAOD.WriteRDOinformation = InDetDxAODFlags.DumpPixelRdoInfo() xAOD_PixelPrepDataToxAOD.WriteNNinformation = InDetDxAODFlags.DumpPixelNNInfo() + xAOD_PixelPrepDataToxAOD.StoreExtendedInfo = InDetDxAODFlags.StoreExtendedHitDeco() #xAOD_PixelPrepDataToxAOD.WriteSDOs = True #xAOD_PixelPrepDataToxAOD.WriteSiHits = True # if available diff --git a/InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD/src/PixelPrepDataToxAOD.cxx b/InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD/src/PixelPrepDataToxAOD.cxx index 3c1ac85e9412e46a50ba65a951a6e005f72653f5..1a60a2216c2e8035a0133a1bb20efe4e286e25ab 100644 --- a/InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD/src/PixelPrepDataToxAOD.cxx +++ b/InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD/src/PixelPrepDataToxAOD.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ /////////////////////////////////////////////////////////////////// @@ -60,6 +60,7 @@ PixelPrepDataToxAOD::PixelPrepDataToxAOD(const std::string &name, ISvcLocator *p declareProperty("WriteSiHits", m_writeSiHits = true); declareProperty("WriteNNinformation", m_writeNNinformation = true); declareProperty("WriteRDOinformation", m_writeRDOinformation = true); + declareProperty("StoreExtendedInfo", m_storeExtendedInfo = false); // --- Configuration keys declareProperty("SiClusterContainer", m_clustercontainer = "PixelClusters"); @@ -212,12 +213,34 @@ StatusCode PixelPrepDataToxAOD::execute() // Set vector of hit identifiers std::vector< uint64_t > rdoIdentifierList; + const InDetDD::SiDetectorElement* element = prd->detectorElement(); + const InDetDD::PixelModuleDesign* design = + dynamic_cast(&element->design()); + int rowmin=9999; int rowmax=-9999; + int colmin=9999; int colmax=-9999; for( const auto &hitIdentifier : prd->rdoList() ){ rdoIdentifierList.push_back( hitIdentifier.get_compact() ); //May want to addinformation about the individual hits here + int row = m_PixelHelper->phi_index(hitIdentifier); + int col = m_PixelHelper->eta_index(hitIdentifier); + if(rowmin > row) rowmin = row; + if(rowmax < row) rowmax = row; + if(colmin > col) colmin = col; + if(colmax < col) colmax = col; } xprd->setRdoIdentifierList(rdoIdentifierList); + InDetDD::SiLocalPosition pos1 = + design->positionFromColumnRow(colmin,rowmin); + InDetDD::SiLocalPosition pos2 = + design->positionFromColumnRow(colmax,rowmin); + InDetDD::SiLocalPosition pos3 = + design->positionFromColumnRow(colmin,rowmax); + InDetDD::SiLocalPosition pos4 = + design->positionFromColumnRow(colmax,rowmax); + + InDetDD::SiLocalPosition centroid = 0.25*(pos1+pos2+pos3+pos4); + //Add pixel cluster properties xprd->auxdata("bec") = m_PixelHelper->barrel_ec(clusterId) ; xprd->auxdata("layer") = m_PixelHelper->layer_disk(clusterId) ; @@ -228,11 +251,21 @@ StatusCode PixelPrepDataToxAOD::execute() //xprd->auxdata("row") = m_PixelHelper->phi_index(clusterId); xprd->auxdata("eta_pixel_index") = m_PixelHelper->eta_index(clusterId); xprd->auxdata("phi_pixel_index") = m_PixelHelper->phi_index(clusterId); - const InDet::SiWidth cw = prd->width(); xprd->auxdata("sizePhi") = (int)cw.colRow()[0]; xprd->auxdata("sizeZ") = (int)cw.colRow()[1]; + + if(m_storeExtendedInfo){ + xprd->auxdata("waferID") = m_PixelHelper->wafer_hash(element->identify()); + xprd->auxdata("isInclined") = int(prd->detectorElement()->isInclined()) ; + xprd->auxdata("centroid_xphi") = centroid.xPhi(); + xprd->auxdata("centroid_xeta") = centroid.xEta(); + xprd->auxdata("LorentzCorrection") = prd->detectorElement()->getLorentzCorrection(); + xprd->auxdata("omegax") = prd->omegax(); + xprd->auxdata("omegay") = prd->omegay(); + } + xprd->auxdata("nRDO") = (int)prd->rdoList().size(); xprd->auxdata("charge") = prd->totalCharge(); diff --git a/InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD/src/PixelPrepDataToxAOD.h b/InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD/src/PixelPrepDataToxAOD.h index 8751b32118d43aef091d0d5e8ae712eb1473e502..b82b0b9d49b3f2c510fc0f51f68ae7105dac8c38 100644 --- a/InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD/src/PixelPrepDataToxAOD.h +++ b/InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD/src/PixelPrepDataToxAOD.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ /////////////////////////////////////////////////////////////////// @@ -103,6 +103,7 @@ private: bool m_writeRDOinformation; bool m_useSiHitsGeometryMatching; bool m_decorateBrokenClusters; + bool m_storeExtendedInfo; ServiceHandle m_calibSvc; ServiceHandle m_pixelDCSSvc; diff --git a/InnerDetector/InDetExample/InDetSLHC_Example/share/preInclude.SLHC.Reco.py b/InnerDetector/InDetExample/InDetSLHC_Example/share/preInclude.SLHC.Reco.py index b827e0af220d72fb0dc7f360152b74575171d1f3..e9205fb93e4720a39418ec8e93e668c29fd4a803 100644 --- a/InnerDetector/InDetExample/InDetSLHC_Example/share/preInclude.SLHC.Reco.py +++ b/InnerDetector/InDetExample/InDetSLHC_Example/share/preInclude.SLHC.Reco.py @@ -36,7 +36,7 @@ if DetFlags.detdescr.Calo_on() and DetFlags.detdescr.SCT_on(): InDetFlags.doROIConv = True from BTagging.BTaggingFlags import BTaggingFlags -BTaggingFlags.CalibrationTag="BTagCalibITk-50_50-02-00" +BTaggingFlags.CalibrationTag="BTagCalibITk-23-00-03-v1" if rec.OutputFileNameForRecoStep() == 'RAWtoESD': InDetFlags.writeRDOs = True diff --git a/InnerDetector/InDetRecTools/SiClusterOnTrackTool/src/SCT_ClusterOnTrackTool.cxx b/InnerDetector/InDetRecTools/SiClusterOnTrackTool/src/SCT_ClusterOnTrackTool.cxx index e65a98636a92c8c8bbcb0333d02170635ae98851..1bc3b1950b2dcde77e3bc478d3b591b0a8569bf2 100755 --- a/InnerDetector/InDetRecTools/SiClusterOnTrackTool/src/SCT_ClusterOnTrackTool.cxx +++ b/InnerDetector/InDetRecTools/SiClusterOnTrackTool/src/SCT_ClusterOnTrackTool.cxx @@ -129,6 +129,7 @@ const InDet::SCT_ClusterOnTrack* InDet::SCT_ClusterOnTrackTool::correct // const InDetDD::SiDetectorElement* EL = SC->detectorElement(); if(!EL) return 0; + auto designShape = EL->design().shape(); IdentifierHash iH = EL->identifyHash(); @@ -233,7 +234,7 @@ if (boundsy>0 && distance*cosAlpha> boundsy){ //skip this for Annulus (which has break; } // rotation for endcap SCT - if(EL->design().shape() == InDetDD::Trapezoid || EL->design().shape() == InDetDD::Annulus){ + if(designShape == InDetDD::Trapezoid || designShape == InDetDD::Annulus){ double sn = EL->sinStereoLocal(SC->localPosition ()); double sn2 = sn*sn; double cs2 = 1.-sn2; @@ -244,12 +245,12 @@ if (boundsy>0 && distance*cosAlpha> boundsy){ //skip this for Annulus (which has mat(1,0) = (sn*std::sqrt(cs2)*(v0-v1)); mat(0,1) = mat(1,0); mat(1,1) = (sn2*v0+cs2*v1); - } + } // else if (designShape == InDetDD::PolarAnnulus) {} oldcov = mat; } Amg::MatrixX cov(oldcov); - if(EL->design().shape()!=InDetDD::Trapezoid && EL->design().shape()!=InDetDD::Annulus) { // barrel + if(designShape == InDetDD::Box) { // barrel Trk::DefinedParameter lpos1dim(SC->localPosition().x(),Trk::locX); locpar = (m_option_make2dimBarrelClusters) ? @@ -269,7 +270,9 @@ if (boundsy>0 && distance*cosAlpha> boundsy){ //skip this for Annulus (which has cov = *newCov; delete newCov; } - }else{ // endcap + } + // else if (designShape == InDetDD::PolarAnnulus) {//Space for polar verison if needed} + else{ // endcap locpar = Trk::LocalParameters(SC->localPosition ()); if( m_scaleSctCov ){ diff --git a/InnerDetector/InDetRecTools/SiClusterizationTool/src/ClusterMakerTool.cxx b/InnerDetector/InDetRecTools/SiClusterizationTool/src/ClusterMakerTool.cxx index 101272c23f63b570e66fa5e41978e8937bc97462..3d05d5c651a2ca60799e7bd80d5fd120384d2f4d 100755 --- a/InnerDetector/InDetRecTools/SiClusterizationTool/src/ClusterMakerTool.cxx +++ b/InnerDetector/InDetRecTools/SiClusterizationTool/src/ClusterMakerTool.cxx @@ -558,7 +558,8 @@ SCT_Cluster* ClusterMakerTool::sctCluster( } // rotation for endcap SCT/ITK Strip - NB this will no longer be needed once we go to disk surfaces and therefore true 1D measurements - if(element->design().shape() == InDetDD::Trapezoid || element->design().shape() == InDetDD::Annulus) { + auto designShape = element->design().shape(); + if(designShape == InDetDD::Trapezoid || designShape == InDetDD::Annulus) { double sn = element->sinStereoLocal(localPos); double sn2 = sn*sn; double cs2 = 1.-sn2; @@ -568,7 +569,7 @@ SCT_Cluster* ClusterMakerTool::sctCluster( errorMatrix->fillSymmetric(0,0,cs2*v0+sn2*v1); errorMatrix->fillSymmetric(0,1,sn*sqrt(cs2)*(v0-v1)); errorMatrix->fillSymmetric(1,1,sn2*v0+cs2*v1); - } + } // else if (designShape == InDetDD::PolarAnnulus) {//Space for polar verison if needed} // delete localPos; // localPos=0; diff --git a/InnerDetector/InDetRecTools/SiClusterizationTool/src/SCT_ClusteringTool.cxx b/InnerDetector/InDetRecTools/SiClusterizationTool/src/SCT_ClusteringTool.cxx index 7d4242590b90e2b7df153d5da82dd47a5f59e9d3..a10d1e394484b111d42c61f0d4ca3a1528d5b351 100755 --- a/InnerDetector/InDetRecTools/SiClusterizationTool/src/SCT_ClusteringTool.cxx +++ b/InnerDetector/InDetRecTools/SiClusterizationTool/src/SCT_ClusteringTool.cxx @@ -579,12 +579,13 @@ namespace InDet{ double shift = element->getLorentzCorrection(); double stripPitch = design->stripPitch(); bool badStripInClusterOnThisModuleSide = (idGroups.size() != tbinGroups.size()); - bool rotate = element->design().shape() == InDetDD::Trapezoid || element->design().shape() == InDetDD::Annulus; + auto designShape = design->shape(); + bool rotate = designShape == InDetDD::Trapezoid || designShape == InDetDD::Annulus; double stripL(0.),COV11(0.); if(!rotate) { stripL = design->etaPitch(); COV11 = stripL*stripL*(1./12.); - } + } //else if (designShape == InDetDD::PolarAnnulus) {} for (; pGroup!= lastGroup; ++pGroup) { @@ -639,7 +640,7 @@ namespace InDet{ V[0] = cs2*v0+sn2*v1; V[1] = V[2] = sn*sqrt(cs2)*(v0-v1); V[3] = sn2*v0+cs2*v1; - } + } //else if (designShape == InDetDD::PolarAnnulus) {} Amg::MatrixX* errorMatrix(new Amg::MatrixX(2,2)); *errorMatrix<isSCT() && (m_detelement->design().shape()==InDetDD::Trapezoid || m_detelement->design().shape()==InDetDD::Annulus) ) ? - m_stereo = true : m_stereo = false; + noiseInitiate(); + auto designShape = m_detelement->design().shape(); + bool rotate = (designShape==InDetDD::Trapezoid || designShape==InDetDD::Annulus || designShape==InDetDD::PolarAnnulus); + (m_detelement->isSCT() && rotate) ? m_stereo = true : m_stereo = false; if(!m_detstatus) { diff --git a/InnerDetector/InDetRecTools/SiSpacePointTool/src/SiSpacePointMakerTool.cxx b/InnerDetector/InDetRecTools/SiSpacePointTool/src/SiSpacePointMakerTool.cxx index b543d11d4b69f50b7ba075b8cf7daeb0e4493f10..ed94e94329113bfe5b06d506fd9ae696863367b3 100755 --- a/InnerDetector/InDetRecTools/SiSpacePointTool/src/SiSpacePointMakerTool.cxx +++ b/InnerDetector/InDetRecTools/SiSpacePointTool/src/SiSpacePointMakerTool.cxx @@ -330,8 +330,9 @@ namespace InDet{ double dm = (m_SCTgapParameter*r)*fabs(s*x12); double d; - if(element1->design().shape() == InDetDD::Trapezoid || element1->design().shape() == InDetDD::Annulus) - d = dm*(1./.04); + auto designShape1 = element1->design().shape(); + if(designShape1 == InDetDD::Trapezoid || designShape1 == InDetDD::Annulus || designShape1 == InDetDD::PolarAnnulus ) + d = dm*25.0; // 1.0 / 0.04 else d = dm/sqrt((1.-x12)*(1+x12)); diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPhysHitDecoratorTool.cxx b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPhysHitDecoratorTool.cxx index 1945ed452a80b11dfe422ccdabd0ed5ddb798efe..6c8d976eb10691681cf475588d763fa20b5a9292 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPhysHitDecoratorTool.cxx +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPhysHitDecoratorTool.cxx @@ -1,5 +1,5 @@ /* -Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ /** * @file InDetPhysHitDecoratorTool.cxx @@ -37,7 +37,7 @@ InDetPhysHitDecoratorTool::InDetPhysHitDecoratorTool(const std::string& type, co m_holeSearchTool("InDet::InDetTrackHoleSearchTool"), m_updatorHandle("Trk::KalmanUpdator/TrkKalmanUpdator"), m_residualPullCalculator("Trk::ResidualPullCalculator/ResidualPullCalculator"), - m_ptThreshold(0.8), m_isUnbiased(true), m_doUpgrade(false), m_useNewITkLayerNumbering(true), + m_ptThreshold(0.8), m_isUnbiased(true), m_doUpgrade(false), m_useNewITkLayerNumbering(true), m_storeExtendedInfo(false), m_idHelper(nullptr), m_pixelID(nullptr), m_sctID(nullptr), @@ -47,6 +47,7 @@ InDetPhysHitDecoratorTool::InDetPhysHitDecoratorTool(const std::string& type, co declareProperty("Updator", m_updatorHandle); declareProperty("ResidualPullCalculator", m_residualPullCalculator); declareProperty("UseNewITkLayerNumbering", m_useNewITkLayerNumbering); + declareProperty("StoreExtendedInfo", m_storeExtendedInfo); } InDetPhysHitDecoratorTool::~InDetPhysHitDecoratorTool () { @@ -97,7 +98,7 @@ bool InDetPhysHitDecoratorTool::decorateTrack(const xAOD::TrackParticle& particle, const std::string& prefix) { static int trackNumber(0); - typedef std::tuple SingleResult_t; + typedef std::tuple SingleResult_t; typedef std::vector TrackResult_t; //const float invalidFloat(std::numeric_limits::quiet_NaN()); // const float invalidDouble(std::numeric_limits::quiet_NaN()); @@ -108,12 +109,18 @@ InDetPhysHitDecoratorTool::decorateTrack(const xAOD::TrackParticle& particle, co const int invalidLayerType(-1); const int invalidWidth(-1); const int invalidMeasure(-1); + const uint64_t invalidID(0); const SingleResult_t invalidResult = std::make_tuple(invalidDetector, invalidRegion, invalidLayer, invalidLayerType, invalidRes, invalidPull, invalidRes, invalidPull, invalidWidth, invalidWidth, - invalidMeasure); + invalidMeasure, + invalidRes, invalidRes, + invalidRes, invalidRes, + invalidRes, invalidRes, + invalidRes, invalidRes, + invalidID); // get element link to the original track const ElementLink< TrackCollection >& trackLink = particle.trackLink();// using xAODTracking-00-03-09, interface has // changed later @@ -190,12 +197,17 @@ InDetPhysHitDecoratorTool::decorateTrack(const xAOD::TrackParticle& particle, co ATH_MSG_DEBUG("Could not identify surface"); continue; } + uint64_t ID = surfaceID.get_compact(); // Get residuals - old code, remains the same? // define residuals at -1 if no measurement (better way?) float residualLocY(-1), pullLocY(-1);// -1 by default float residualLocX = -1, pullLocX = -1; // what values? int phiWidth(-1); int etaWidth(-1); + float measurementLocX(-1), measurementLocY(-1); + float trackParamLocX(-1), trackParamLocY(-1); + float angle(0), etaloc(0); + float measurementLocCovX(-1), measurementLocCovY(-1); std::unique_ptr residualPull(nullptr); const Trk::TrackParameters* biasedTrackParameters = thisTrackState->trackParameters(); if (biasedTrackParameters) { @@ -230,9 +242,15 @@ InDetPhysHitDecoratorTool::decorateTrack(const xAOD::TrackParticle& particle, co // around line 4058 in original code residualLocX = 1000. * residualPull->residual()[Trk::loc1]; // residuals in microns pullLocX = residualPull->pull()[Trk::loc1]; + measurementLocX = hit->localParameters()[Trk::loc1]; + trackParamLocX = trackParameters->parameters()[Trk::loc1]; + measurementLocCovX = hit->localCovariance()(Trk::loc1,Trk::loc1); if (residualPull->dimension() > 1) { residualLocY = 1000. * residualPull->residual()[Trk::loc2]; pullLocY = residualPull->pull()[Trk::loc2]; + measurementLocY = hit->localParameters()[Trk::loc2]; + trackParamLocY = trackParameters->parameters()[Trk::loc2]; + measurementLocCovY = hit->localCovariance()(Trk::loc2,Trk::loc2); } // Unbiased residuals?! measureType = 4; @@ -247,6 +265,37 @@ InDetPhysHitDecoratorTool::decorateTrack(const xAOD::TrackParticle& particle, co InDet::SiWidth width = pCluster->width(); phiWidth = int(width.colRow().x()); etaWidth = int(width.colRow().y()); + + // get candidate track angle in module local frame + Amg::Vector3D my_track = trackParameters->momentum(); + const InDetDD::SiDetectorElement* element = pCluster->detectorElement(); + Amg::Vector3D my_normal = element->normal(); + Amg::Vector3D my_phiax = element->phiAxis(); + Amg::Vector3D my_etaax = element->etaAxis(); + float trkphicomp = my_track.dot(my_phiax); + float trketacomp = my_track.dot(my_etaax); + float trknormcomp = my_track.dot(my_normal); + double bowphi = atan2(trkphicomp,trknormcomp); + double boweta = atan2(trketacomp,trknormcomp); + + float tanl = element->getTanLorentzAnglePhi(); + int readoutside = element->design().readoutSide(); + + // map the angles of inward-going tracks onto [-PI/2, PI/2] + if(bowphi > M_PI/2) bowphi -= M_PI; + if(bowphi < -M_PI/2) bowphi += M_PI; + angle = atan(tan(bowphi)-readoutside*tanl); + + double thetaloc=-999.; + if(boweta > -0.5*M_PI && boweta < M_PI/2.){ + thetaloc = M_PI/2.-boweta; + }else if(boweta > M_PI/2. && boweta < M_PI){ + thetaloc = 1.5*M_PI-boweta; + } else{ // 3rd quadrant + thetaloc = -0.5*M_PI-boweta; + } + etaloc = -1*log(tan(thetaloc/2.)); + } } ATH_MSG_VERBOSE("hit and isUnbiased ok"); @@ -264,7 +313,12 @@ InDetPhysHitDecoratorTool::decorateTrack(const xAOD::TrackParticle& particle, co } thisResult = std::make_tuple(det, r, iLayer, lType, residualLocX, pullLocX, residualLocY, pullLocY, - phiWidth, etaWidth, measureType); + phiWidth, etaWidth, measureType, + measurementLocX, measurementLocY, + trackParamLocX, trackParamLocY, + angle, etaloc, + measurementLocCovX, measurementLocCovY, + ID); result.push_back(thisResult); }// end of for loop*/ ATH_MSG_DEBUG( @@ -295,6 +349,24 @@ InDetPhysHitDecoratorTool::decorateTrack(const xAOD::TrackParticle& particle, co result_etaWidth.reserve(arraySize); std::vector result_measureType; result_measureType.reserve(arraySize); + std::vector result_measurementLocX; + result_measurementLocX.reserve(arraySize); + std::vector result_measurementLocY; + result_measurementLocY.reserve(arraySize); + std::vector result_trackParamLocX; + result_trackParamLocX.reserve(arraySize); + std::vector result_trackParamLocY; + result_trackParamLocY.reserve(arraySize); + std::vector result_angle; + result_angle.reserve(arraySize); + std::vector result_etaloc; + result_etaloc.reserve(arraySize); + std::vector result_measurementLocCovX; + result_measurementLocCovX.reserve(arraySize); + std::vector result_measurementLocCovY; + result_measurementLocCovY.reserve(arraySize); + std::vector result_ID; + result_ID.reserve(arraySize); for (const SingleResult_t& single_result : result) { result_det.push_back(std::get<0>(single_result)); result_r.push_back(std::get<1>(single_result)); @@ -307,6 +379,15 @@ InDetPhysHitDecoratorTool::decorateTrack(const xAOD::TrackParticle& particle, co result_phiWidth.push_back(std::get<8>(single_result)); result_etaWidth.push_back(std::get<9>(single_result)); result_measureType.push_back(std::get<10>(single_result)); + result_measurementLocX.push_back(std::get<11>(single_result)); + result_measurementLocY.push_back(std::get<12>(single_result)); + result_trackParamLocX.push_back(std::get<13>(single_result)); + result_trackParamLocY.push_back(std::get<14>(single_result)); + result_angle.push_back(std::get<15>(single_result)); + result_etaloc.push_back(std::get<16>(single_result)); + result_measurementLocCovX.push_back(std::get<17>(single_result)); + result_measurementLocCovY.push_back(std::get<18>(single_result)); + result_ID.push_back(std::get<19>(single_result)); } particle.auxdecor >(prefix + "measurement_region") = result_r; particle.auxdecor >(prefix + "measurement_det") = result_det; @@ -319,6 +400,17 @@ InDetPhysHitDecoratorTool::decorateTrack(const xAOD::TrackParticle& particle, co particle.auxdecor >(prefix + "hitResiduals_phiWidth") = result_phiWidth; particle.auxdecor >(prefix + "hitResiduals_etaWidth") = result_etaWidth; particle.auxdecor >(prefix + "measurement_type") = result_measureType; + if(m_storeExtendedInfo){ + particle.auxdecor >(prefix + "measurementLocX") = result_measurementLocX; + particle.auxdecor >(prefix + "measurementLocY") = result_measurementLocY; + particle.auxdecor >(prefix + "trackParamLocX") = result_trackParamLocX; + particle.auxdecor >(prefix + "trackParamLocY") = result_trackParamLocY; + particle.auxdecor >(prefix + "angle") = result_angle; + particle.auxdecor >(prefix + "etaloc") = result_etaloc; + particle.auxdecor >(prefix + "measurementLocCovX") = result_measurementLocCovX; + particle.auxdecor >(prefix + "measurementLocCovY") = result_measurementLocCovY; + particle.auxdecor >(prefix + "pixelID") = result_ID; + } return true; } } diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPhysHitDecoratorTool.h b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPhysHitDecoratorTool.h index 3325158728acecae0928b5edfd6dd20f57049f62..6715a4aefaf93ad5e363378c6b038fa98c400ec2 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPhysHitDecoratorTool.h +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPhysHitDecoratorTool.h @@ -1,5 +1,5 @@ /* -Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ #ifndef INDETPHYSVALMONITORING_InDetPhysHitDecoratorTool_H #define INDETPHYSVALMONITORING_InDetPhysHitDecoratorTool_H @@ -59,6 +59,7 @@ private: bool m_isUnbiased; bool m_doUpgrade; bool m_useNewITkLayerNumbering; + bool m_storeExtendedInfo; // the following help identify a surface in the detector const AtlasDetectorID* m_idHelper; const PixelID* m_pixelID; diff --git a/PhysicsAnalysis/AnalysisCommon/CutBookkeeperUtils/CMakeLists.txt b/PhysicsAnalysis/AnalysisCommon/CutBookkeeperUtils/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..fc8b7676a1c6bac9bd4db6926479f1e7243af98f --- /dev/null +++ b/PhysicsAnalysis/AnalysisCommon/CutBookkeeperUtils/CMakeLists.txt @@ -0,0 +1,14 @@ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + +# Set the project's name and version. +atlas_subdir( CutBookkeeperUtils ) + +# External dependencies: +find_package( ROOT COMPONENTS Core RIO ) + +# Add the library +atlas_add_library(CutBookkeeperUtils + Root/OriginalAodCounts.cxx + PUBLIC_HEADERS CutBookkeeperUtils + PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} + PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} xAODCutFlow xAODRootAccess ) diff --git a/PhysicsAnalysis/AnalysisCommon/CutBookkeeperUtils/CutBookkeeperUtils/OriginalAodCounts.h b/PhysicsAnalysis/AnalysisCommon/CutBookkeeperUtils/CutBookkeeperUtils/OriginalAodCounts.h new file mode 100644 index 0000000000000000000000000000000000000000..4497f99eafd64e6b44cdf61b388fac087cbeaf1c --- /dev/null +++ b/PhysicsAnalysis/AnalysisCommon/CutBookkeeperUtils/CutBookkeeperUtils/OriginalAodCounts.h @@ -0,0 +1,34 @@ +/* + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef ORIGINALAODCOUNTS_H +#define ORIGINALAODCOUNTS_H + +namespace xAOD { + class TEvent; +} +class StatusCode; + +// configuration options +struct AodCountsConfig { + AodCountsConfig(); + // empty structure, can add configuration here +}; + +struct OriginalAodCounts { + OriginalAodCounts(); + unsigned long long nEventsProcessed; + double sumOfWeights; + double sumOfWeightsSquared; + int nIncomplete; + OriginalAodCounts& operator+=(const OriginalAodCounts& a); +}; +OriginalAodCounts operator+(const OriginalAodCounts& a, + const OriginalAodCounts& b); + +OriginalAodCounts getOriginalAodCounts( + xAOD::TEvent& event, + const AodCountsConfig& = AodCountsConfig()); + +#endif diff --git a/PhysicsAnalysis/AnalysisCommon/CutBookkeeperUtils/README.md b/PhysicsAnalysis/AnalysisCommon/CutBookkeeperUtils/README.md new file mode 100644 index 0000000000000000000000000000000000000000..fcbf1c75a011e53a179529bce764468f0c5858ce --- /dev/null +++ b/PhysicsAnalysis/AnalysisCommon/CutBookkeeperUtils/README.md @@ -0,0 +1,36 @@ +xAOD Event Counter Utilities +============================ + +This packages houses tools to keep track of the original number of +events that are in your AOD. You probably need this for things like +calculating appropriate scaling for simulation. + +High-level structure +-------------------- + +We provide a structure called `OriginalAodCounts` which contains +several fields: + +- `nEventsProcessed`: Total number of events in the original AOD. +- `sumOfWeights`: Sum of weights in the original AOD. +- `sumOfWeightsSquared`: Sum of weights squared. You might need this + to properly calculate statistical errors. +- `nIncomplete`: Number of incomplete CutBookkeepers objects. + +You can get this object from a given file by calling + +``` +OriginalAodCounts counts = getOriginalAodCounts(tevent) +``` + +or (recommended interface), instance a `OriginalAodCountsTool` and call + +``` +OriginalAodCounts counts; +ATH_CHECK(tool->incrementAodCounts(counts, tevent)); +``` + +where `tevent` is a the `TEvent` object for your job. + +The `OriginalAodCounts` struct has addition operators defined, so if +you loop over multiple files you can easily sum the numbers. diff --git a/PhysicsAnalysis/AnalysisCommon/CutBookkeeperUtils/Root/OriginalAodCounts.cxx b/PhysicsAnalysis/AnalysisCommon/CutBookkeeperUtils/Root/OriginalAodCounts.cxx new file mode 100644 index 0000000000000000000000000000000000000000..0be68d1ee66825a02c7d164dad6457cb94ecf4df --- /dev/null +++ b/PhysicsAnalysis/AnalysisCommon/CutBookkeeperUtils/Root/OriginalAodCounts.cxx @@ -0,0 +1,80 @@ +/* + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +*/ + +#include "CutBookkeeperUtils/OriginalAodCounts.h" + +#include +#include + +#include "xAODRootAccess/TEvent.h" + +#include "TFile.h" + +AodCountsConfig::AodCountsConfig() + // add default values here +{ +} + +OriginalAodCounts::OriginalAodCounts(): + nEventsProcessed(0), + sumOfWeights(0), + sumOfWeightsSquared(0), + nIncomplete(0) +{ +} + +OriginalAodCounts& OriginalAodCounts::operator+=(const OriginalAodCounts& a) { + nEventsProcessed += a.nEventsProcessed; + sumOfWeights += a.sumOfWeights; + sumOfWeightsSquared += a.sumOfWeightsSquared; + nIncomplete += a.nIncomplete; + return *this; +} + + +OriginalAodCounts operator+(const OriginalAodCounts& a, const OriginalAodCounts& b) { + OriginalAodCounts ret = a; + ret += b; + return ret; +} + +// this is copied from +// https://twiki.cern.ch/twiki/bin/view/AtlasProtected/AnalysisMetadata#Analysis_Metadata_Root_or_athena + + +OriginalAodCounts getOriginalAodCounts(xAOD::TEvent& event, + const AodCountsConfig&) { + + OriginalAodCounts counts; + + // check for corruption + const xAOD::CutBookkeeperContainer* incompleteCBC = nullptr; + if(!event.retrieveMetaInput(incompleteCBC, "IncompleteCutBookkeepers").isSuccess()){ + throw std::runtime_error("Failed to retrieve IncompleteCutBookkeepers from MetaData!"); + } + counts.nIncomplete = incompleteCBC->size(); + + // Now, let's find the actual information + const xAOD::CutBookkeeperContainer* completeCBC = 0; + if(!event.retrieveMetaInput(completeCBC, "CutBookkeepers").isSuccess()){ + throw std::runtime_error("Failed to retrieve CutBookkeepers from MetaData!"); + } + + // Now, let's actually find the right one that contains all the needed info... + const xAOD::CutBookkeeper* allEventsCBK = 0; + int maxCycle = -1; + for (const auto *cbk: *completeCBC) { + if (cbk->cycle() > maxCycle && + cbk->name() == "AllExecutedEvents" && + cbk->inputStream() == "StreamAOD") { + allEventsCBK = cbk; + maxCycle = cbk->cycle(); + } + } + counts.nEventsProcessed = allEventsCBK->nAcceptedEvents(); + counts.sumOfWeights = allEventsCBK->sumOfEventWeights(); + counts.sumOfWeightsSquared = allEventsCBK->sumOfEventWeightsSquared(); + return counts; +} + diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_IP2DTag.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_IP2DTag.py index 3bfa1ccc7562a862782512464add3426d62a581d..c6cb0e704606e07d6e1f9b81a9ed01b692161a8e 100644 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_IP2DTag.py +++ b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_IP2DTag.py @@ -7,7 +7,7 @@ from AtlasGeoModel.InDetGMJobProperties import InDetGeometryFlags as geoFlags from IOVDbSvc.CondDB import conddb btagrun1=False btagItk=False -btagItk_version=5 +btagItk_version=7 if conddb.dbdata == 'COMP200': btagrun1=True diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_IP3DTag.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_IP3DTag.py index b630dd6acea6e7593e2fed658005c226246efad4..6ce93410219016fa8f71bce1391a80ce7650cb1b 100644 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_IP3DTag.py +++ b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_IP3DTag.py @@ -8,7 +8,7 @@ from AtlasGeoModel.InDetGMJobProperties import InDetGeometryFlags as geoFlags from IOVDbSvc.CondDB import conddb btagrun1=False btagItk=False -btagItk_version=5 +btagItk_version=7 if conddb.dbdata == 'COMP200': btagrun1=True diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_InDetEtaDependentCutsSvc.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_InDetEtaDependentCutsSvc.py index 2a84dfa3766717bc0d5eb891ba9da8c45a1139fe..b7aae0d3cde335432f29d682bffaa0ecf8e4e4a7 100644 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_InDetEtaDependentCutsSvc.py +++ b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_InDetEtaDependentCutsSvc.py @@ -40,7 +40,7 @@ def IDEtaDepCutsSvc_InDetVKalVxInJetFinder(name): InDetEtaDependentCutsSvc.etaBins = [-1.0, 1.65, 2.0, 9999.] InDetEtaDependentCutsSvc.minPT = [0.7 * Units.GeV] InDetEtaDependentCutsSvc.maxPrimaryImpact = [5.0 * Units.mm] - InDetEtaDependentCutsSvc.maxZImpact = [25.0 * Units.mm] + InDetEtaDependentCutsSvc.maxZImpact = [3.0 * Units.mm] InDetEtaDependentCutsSvc.minPixelHits = [1, 1, 2] InDetEtaDependentCutsSvc.minStripHits = [4, 5, 6] InDetEtaDependentCutsSvc.minClusters = [7] diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_RNNIPTag.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_RNNIPTag.py index 7ab133768d8564ad15a0b72cb8ef9ff941087662..7ae8dde19ed907a55663923bc11998043378d560 100644 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_RNNIPTag.py +++ b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_RNNIPTag.py @@ -12,7 +12,7 @@ from IOVDbSvc.CondDB import conddb btagrun1=False btagItk=False -btagItk_version=5 +btagItk_version=7 if conddb.dbdata == 'COMP200': btagrun1=True diff --git a/Projects/Athena/version.txt b/Projects/Athena/version.txt index b6a5bf3515750a305a7d4221b449e301eb254120..5d994d7c8e4da8bebd065c614bbcd25218131497 100644 --- a/Projects/Athena/version.txt +++ b/Projects/Athena/version.txt @@ -1 +1 @@ -21.9.22 +21.9.24 diff --git a/Reconstruction/PFlow/PFlowTests/CMakeLists.txt b/Reconstruction/PFlow/PFlowTests/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..a8ea9a764671aa60acac6903b87cb6932e933979 --- /dev/null +++ b/Reconstruction/PFlow/PFlowTests/CMakeLists.txt @@ -0,0 +1,7 @@ +# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration +# Declare the package name: +atlas_subdir( PFlowTests ) + +#Make test scripts available +atlas_install_scripts( test/test*.sh ) + diff --git a/Reconstruction/PFlow/PFlowTests/test/test_pflow_EOverP_fromESD_noLinking.sh b/Reconstruction/PFlow/PFlowTests/test/test_pflow_EOverP_fromESD_noLinking.sh new file mode 100755 index 0000000000000000000000000000000000000000..59fe13de5c75a420311e12218e00f3316cd47725 --- /dev/null +++ b/Reconstruction/PFlow/PFlowTests/test/test_pflow_EOverP_fromESD_noLinking.sh @@ -0,0 +1,12 @@ +#!/bin/sh +# +# art-description: Athena runs EOverP ESD pflow reconstruction, PFO linking off +# art-type: grid +# art-include: 21.9/Athena +# art-output: AOD.pool.root + +athena.py eflowRec/run_ESDPFlowRecoR21_9_EOverP.py +rc1=$? + +echo "art-result: ${rc1}" + diff --git a/Reconstruction/RecExample/RecExCommon/share/SystemRec_config.py b/Reconstruction/RecExample/RecExCommon/share/SystemRec_config.py index caf3069a1369ac1230d5ec5ee905f897861f73aa..585e0b0e659a046cf6942a75c86377e214b65244 100755 --- a/Reconstruction/RecExample/RecExCommon/share/SystemRec_config.py +++ b/Reconstruction/RecExample/RecExCommon/share/SystemRec_config.py @@ -28,8 +28,12 @@ if DetFlags.detdescr.ID_on(): # functionality : FTK reconstruction if DetFlags.detdescr.FTK_on() : protectedInclude( "FTK_RecExample/FTKRec_jobOptions.py") - - + +pdr.flag_domain('hgtd') +if DetFlags.detdescr.HGTD_on() : + protectedInclude( "HGTD_TrackTimeExtension/HGTDRec_jobOptions.py") + + # functionality : Muon reconstruction pdr.flag_domain('muon') if DetFlags.detdescr.Muon_on() : @@ -39,7 +43,7 @@ if DetFlags.detdescr.Muon_on() : from MuonRecExample.MuonRecFlags import muonRecFlags muonRecFlags.applyResilience = athenaCommonFlags.AllowIgnoreConfigError() except Exception: - treatException("Could not set muonRecFlags.applyResilience") + treatException("Could not set muonRecFlags.applyResilience") # hack the merged jobo should test on rec.ScopingLevel=5 to run cosmic reco @@ -47,7 +51,7 @@ if DetFlags.detdescr.Muon_on() : - try: + try: include ("MuonRecExample/MuonRec_jobOptions.py") except Exception: treatException("Problem with MuonRecExample/MuonRec_jobOptions.py. Switching off Moore and Muonboy") @@ -59,7 +63,7 @@ else: muonRecFlags.doStandalone=False AODFix_postMuonRec() - + pdr.flag_domain('forward') if DetFlags.detdescr.Forward_on(): @@ -70,4 +74,3 @@ if DetFlags.detdescr.Forward_on(): treatException("Problem including ForwardRec/ForwardRec_jobOptions.py !!") AODFix_postForwardRec() - diff --git a/Reconstruction/eflowRec/share/run_ESDPFlowRecoR21_9_EOverP.py b/Reconstruction/eflowRec/share/run_ESDPFlowRecoR21_9_EOverP.py new file mode 100644 index 0000000000000000000000000000000000000000..89ad296a39a56eed922a6bd48b11da841f4f3dd3 --- /dev/null +++ b/Reconstruction/eflowRec/share/run_ESDPFlowRecoR21_9_EOverP.py @@ -0,0 +1,35 @@ +from AthenaCommon.AthenaCommonFlags import athenaCommonFlags +# #change the line below to your desired input file +athenaCommonFlags.FilesInput=["/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/PFlowTests/mc15_14TeV/ESD/mc15_14TeV.900327.PG_single_piminus_E0p4to2_etaFlatnp0_43.recon.ESD.e8373_s3735_s3738_r13118/ESD.27046140._000012.pool.root.1"] + +from RecExConfig.RecAlgsFlags import recAlgs +recAlgs.doEFlow.set_Value_and_Lock(True) +recAlgs.doMissingET.set_Value_and_Lock(False) + +from RecExConfig.RecFlags import rec +rec.doAODCaloCells.set_Value_and_Lock(False) +rec.doWriteTAG.set_Value_and_Lock(False) +#The ITK setup files disable calo, so lets stop them from doing that +rec.doCalo.set_Value_and_Lock(True) + +from eflowRec.eflowRecFlags import jobproperties +jobproperties.eflowRecFlags.eflowAlgType.set_Value_and_Lock("EOverP") +jobproperties.eflowRecFlags.CalType.set_Value_and_Lock("NoCal") + +from CaloRec.CaloRecFlags import jobproperties +jobproperties.CaloRecFlags.Enabled.set_Value_and_Lock(True) +jobproperties.CaloRecFlags.doCaloCluster.set_Value_and_Lock(True) +jobproperties.CaloRecFlags.doCaloTopoCluster.set_Value_and_Lock(True) +#change below to required number of events: +athenaCommonFlags.EvtMax=10 + +include("eflowRec/setupITKPFlow.py") + +include ("RecExCommon/RecExCommon_topOptions.py") +include('InDetSLHC_Example/postInclude.SLHC_Setup_ITK.py') + +import AthenaCommon.PropertiesManip as manip +manip.appendItemsToList(StreamAOD,'ItemList','xAOD::CaloClusterContainer#CaloTopoCluster') +manip.appendItemsToList(StreamAOD,'ItemList','xAOD::CaloClusterAuxContainer#CaloTopoClusterAux.') +manip.appendItemsToList(StreamAOD,'ItemList','xAOD::CaloClusterContainer#eflowCluster01') +manip.appendItemsToList(StreamAOD,'ItemList','xAOD::CaloClusterAuxContainer#eflowCluster01Aux.') diff --git a/Reconstruction/eflowRec/share/setupITKPFlow.py b/Reconstruction/eflowRec/share/setupITKPFlow.py new file mode 100644 index 0000000000000000000000000000000000000000..9cdb3d76ccd51f7f650ef5c898605051bddb9b4e --- /dev/null +++ b/Reconstruction/eflowRec/share/setupITKPFlow.py @@ -0,0 +1,49 @@ +from AthenaCommon.GlobalFlags import globalflags + +from RecExConfig.InputFilePeeker import inputFileSummary +globalflags.DataSource = 'data' if inputFileSummary['evt_type'][0] == "IS_DATA" else 'geant4' +globalflags.DetDescrVersion = inputFileSummary['geometry'] + +# New geotags do not need any special pre- and post-includes +# This xmlTags list is kept for backward compatibility and should not be updated +xmlTags = [ + # step 1.7 + ["ATLAS-P2-ITK-09","ExtBrl_4",""], + ["ATLAS-P2-ITK-10","InclBrl_4",""], + # step 1.8 and step 1.9, nominal (run4) beam-pipe + # step 1.9, run2 beam-pipe + ["ATLAS-P2-ITK-13","InclBrl_4_OptRing",""], + # step 3 + ["ATLAS-P2-ITK-17","InclBrl_4","InclinedAlternative"], + # step 2 + ["ATLAS-P2-ITK-19","InclBrl_4","InclinedQuads"], + ["ATLAS-P2-ITK-20","InclBrl_4","InclinedDuals"], + # step 3.1 + ["ATLAS-P2-ITK-22-00","InclBrl_4","InclinedAlternative"], + ["ATLAS-P2-ITK-22-01","InclBrl_4","InclinedAlternative"], + ["ATLAS-P2-ITK-22-02","",""], + ] + +from InDetSLHC_Example.SLHC_JobProperties import SLHC_Flags + +foundGeoTag = False +for geoTag, layoutDescr, layoutOption in xmlTags: + if (globalflags.DetDescrVersion().startswith(geoTag)): + foundGeoTag = True + print "preIncludes for ",layoutDescr, " layout" + if (layoutOption!=""): + SLHC_Flags.LayoutOption=layoutOption + from InDetRecExample.InDetJobProperties import InDetFlags + if (layoutDescr!=""): + include('InDetSLHC_Example/preInclude.SLHC_Setup_'+layoutDescr+'.py') + else: + include("InDetSLHC_Example/preInclude.SLHC_Setup.py") + include('InDetSLHC_Example/preInclude.SLHC_Setup_Strip_GMX.py') + include('InDetSLHC_Example/preInclude.SLHC.NoTRT_NoBCM_NoDBM.Reco.py') + break + +if(not foundGeoTag): + from InDetRecExample.InDetJobProperties import InDetFlags + include("InDetSLHC_Example/preInclude.SLHC_Setup.py") + include('InDetSLHC_Example/preInclude.SLHC_Setup_Strip_GMX.py') + include('InDetSLHC_Example/preInclude.SLHC.NoTRT_NoBCM_NoDBM.Reco.py') diff --git a/Simulation/Digitization/python/DigiOutput.py b/Simulation/Digitization/python/DigiOutput.py index d0139576f93f36f23a6a96579a2961e37b700e28..c6c13cfe47535fefdc3c6cc6587329d7621f67aa 100644 --- a/Simulation/Digitization/python/DigiOutput.py +++ b/Simulation/Digitization/python/DigiOutput.py @@ -132,10 +132,10 @@ def getStreamRDO_ItemList(log): if DetFlags.digitize.HGTD_on(): if 'doHGTD_FastDigi' in digitizationFlags.experimentalDigi(): - StreamRDO_ItemList+=["HGTD::HGTD_ClusterContainer#*"] + StreamRDO_ItemList+=["HGTD_ClusterContainer#*"] else: - StreamRDO_ItemList+=["HGTD::HGTD_RDOContainer#*"] - + StreamRDO_ItemList+=["HGTD_RDOContainer#*"] + # Calorimeter Output if DetFlags.digitize.LAr_on(): if DetFlags.writeRDOPool.LAr_on(): diff --git a/Trigger/TrigAnalysis/TrigInDetAnalysisExample/src/AnalysisConfig_Ntuple.cxx b/Trigger/TrigAnalysis/TrigInDetAnalysisExample/src/AnalysisConfig_Ntuple.cxx index 91c42e325a30c598d9f5dff31024bf3f827208ac..91f3622706fb793f34dcbc7a5df96f5008e4664a 100644 --- a/Trigger/TrigAnalysis/TrigInDetAnalysisExample/src/AnalysisConfig_Ntuple.cxx +++ b/Trigger/TrigAnalysis/TrigInDetAnalysisExample/src/AnalysisConfig_Ntuple.cxx @@ -600,6 +600,7 @@ void AnalysisConfig_Ntuple::loop() { selectorTruth.clear(); + static bool emptyContainerWarningGiven = false; // if container contains no events only print warning for first event m_provider->msg(MSG::INFO) << "MC Truth flag " << m_mcTruth << endmsg; const TrigInDetTrackTruthMap* truthMap = 0; bool foundTruth = false; @@ -620,8 +621,13 @@ void AnalysisConfig_Ntuple::loop() { } else if (m_provider->evtStore()->contains("SpclMC")) { /// AOD - selectTracks( &selectorTruth, "SpclMC"); - foundTruth = true; + if (selectTracksNotEmpty( &selectorTruth, "SpclMC")) { // added for muon sample bug + foundTruth = true; + m_provider->msg(MSG::DEBUG) << "SpclMC" << endmsg; + } else if (!emptyContainerWarningGiven) { + emptyContainerWarningGiven = true; + m_provider->msg(MSG::WARNING) << "SpclMC Container empty" << endmsg; + } } else if (m_provider->evtStore()->contains("")) { /// anything else? diff --git a/Trigger/TrigAnalysis/TrigInDetAnalysisUtils/TrigInDetAnalysisUtils/T_AnalysisConfig.h b/Trigger/TrigAnalysis/TrigInDetAnalysisUtils/TrigInDetAnalysisUtils/T_AnalysisConfig.h index 2cff0467a0482a6b8b5730928b7b234991f26fcd..0cb307b4e296aacf23e15170cf18eb78edaa41ba 100644 --- a/Trigger/TrigAnalysis/TrigInDetAnalysisUtils/TrigInDetAnalysisUtils/T_AnalysisConfig.h +++ b/Trigger/TrigAnalysis/TrigInDetAnalysisUtils/TrigInDetAnalysisUtils/T_AnalysisConfig.h @@ -406,7 +406,27 @@ protected: } + template + bool selectTracksNotEmpty( TrigTrackSelector* selector, const std::string& key ) { + const Collection* collection = nullptr; + if ( key.empty() ) return false; + if ( !m_provider->evtStore()->template contains( key ) ) return false; + + StatusCode sc = m_provider->evtStore()->retrieve( collection, key ); + m_provider->msg(MSG::DEBUG) << "SG Collection->size() " << collection->size() << " (" << key << ")" << endmsg; + if ( !( sc.isSuccess() && collection ) ) return false; + + // added to fix muon samples bug + if ( collection->size() == 0 ) { + m_provider->msg(MSG::WARNING) << "no particles in collection" << endmsg; + return false; + } + + selector->selectTracks( collection ); + return true; + } +