From b22b9b48be90bee0bfb5b26b62ccecb093318faf Mon Sep 17 00:00:00 2001 From: Noemi Calace <noemi.calace@cern.ch> Date: Wed, 24 Feb 2021 15:20:16 +0100 Subject: [PATCH 1/4] Adding HGTD detector element to detector manager for three-ring layout --- .../HGTD_GeoModel/src/HGTD_DetectorFactory.cxx | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/HighGranularityTimingDetector/HGTD_DetDescr/HGTD_GeoModel/src/HGTD_DetectorFactory.cxx b/HighGranularityTimingDetector/HGTD_DetDescr/HGTD_GeoModel/src/HGTD_DetectorFactory.cxx index a50b49cfd07e..e1292cb01d5e 100644 --- a/HighGranularityTimingDetector/HGTD_DetDescr/HGTD_GeoModel/src/HGTD_DetectorFactory.cxx +++ b/HighGranularityTimingDetector/HGTD_DetDescr/HGTD_GeoModel/src/HGTD_DetectorFactory.cxx @@ -626,11 +626,9 @@ GeoVPhysVol* HGTD_DetectorFactory::build( const GeoLogVol* logicalEnvelope, bool ATH_MSG_DEBUG( " HGTD Module: " << m_boxVolPars[c].name+module_string << ", posX: " << myx << ", posY: " << myy << ", rot: " << quadrot + myrot ); } - - if (m_geomVersion == 0) { // for now identifiers do not support 3-ring layout, protecting this part for testing purposes /CO - InDetDD::HGTD_DetectorElement* detElement = new InDetDD::HGTD_DetectorElement(idwafer, moduleDesign, sensorCompPhysicalVol, m_commonItems); - m_detectorManager->addDetectorElement( detElement ); - } + + InDetDD::HGTD_DetectorElement* detElement = new InDetDD::HGTD_DetectorElement(idwafer, moduleDesign, sensorCompPhysicalVol, m_commonItems); + m_detectorManager->addDetectorElement( detElement ); HepGeom::Transform3D sensorTransform = HepGeom::TranslateZ3D(m_boxVolPars[c].zOffsetLocal)*HepGeom::TranslateX3D(xOffsetLocal); GeoAlignableTransform* xform = new GeoAlignableTransform(sensorTransform); -- GitLab From b71e0c297c5d4fbe26821f8aedcc1f8f3e7e13a8 Mon Sep 17 00:00:00 2001 From: Noemi Calace <noemi.calace@cern.ch> Date: Wed, 24 Feb 2021 18:48:05 +0100 Subject: [PATCH 2/4] Correcting axis in HGTD_ModuleDesign class constructor --- .../src/HGTD_DetectorFactory.cxx | 42 ++++++++++--------- .../HGTD_ReadoutGeometry/HGTD_ModuleDesign.h | 4 +- .../src/HGTD_ModuleDesign.cxx | 8 ++-- 3 files changed, 30 insertions(+), 24 deletions(-) diff --git a/HighGranularityTimingDetector/HGTD_DetDescr/HGTD_GeoModel/src/HGTD_DetectorFactory.cxx b/HighGranularityTimingDetector/HGTD_DetDescr/HGTD_GeoModel/src/HGTD_DetectorFactory.cxx index e1292cb01d5e..2c3e2bd459c2 100644 --- a/HighGranularityTimingDetector/HGTD_DetDescr/HGTD_GeoModel/src/HGTD_DetectorFactory.cxx +++ b/HighGranularityTimingDetector/HGTD_DetDescr/HGTD_GeoModel/src/HGTD_DetectorFactory.cxx @@ -571,8 +571,7 @@ GeoVPhysVol* HGTD_DetectorFactory::build( const GeoLogVol* logicalEnvelope, bool std::string module_string = formModuleName( layer, q, maxRows, row, mod, module, myx, myy, myrot, myphi, myeta ); if ( module_string == "" || myrot == -9999999.9 || myeta == -1 ) - ATH_MSG_WARNING ( " Please check the module at layer "<< layer <<" quadrant " << q - <<" row "<< row <<" mod " << mod <<" not well retrieved ! " ); + ATH_MSG_WARNING ( " Please check the module at layer "<< layer <<" quadrant " << q <<" row "<< row <<" mod " << mod <<" not well retrieved ! " ); // an hgtd module defined in the form of ( X, Y, Z ) GeoBox* moduleSolid = new GeoBox( moduleHalfWidth, moduleHalfHeight, modulePackageHalfZ); @@ -581,7 +580,7 @@ GeoVPhysVol* HGTD_DetectorFactory::build( const GeoLogVol* logicalEnvelope, bool // print out one module per layer if ( q == 0 && row == 0 && mod == 0 ) - ATH_MSG_DEBUG( "Will now build up an individual HGTD module of layer " << layer << " and quadrant " << q << " (" << module_string << ")" ); + ATH_MSG_DEBUG( "Will now build up an individual HGTD module of layer " << layer << " and quadrant " << q << " (" << module_string << ")" ); // loop over components in module for (size_t comp = 0; comp < volumes.size(); comp++) { @@ -620,11 +619,10 @@ GeoVPhysVol* HGTD_DetectorFactory::build( const GeoLogVol* logicalEnvelope, bool // print only the first and last module of each row in the first quadrant if ( q == 0 && ( mod == 0 || mod == ( ModsPerRow.size() - 1 ) ) && !m_outputIdfr ) { - ATH_MSG_DEBUG( " waferHash : " << hgtdId->wafer_hash( idwafer ) - << " upon HGTD_ID => ec: " << endcap << ", layer: " << layer << ", quadrant: " << q - << ", row: " << myphi <<", module: "<< myeta ); - ATH_MSG_DEBUG( " HGTD Module: " << m_boxVolPars[c].name+module_string << ", posX: " << myx - << ", posY: " << myy << ", rot: " << quadrot + myrot ); + ATH_MSG_DEBUG( " waferHash : " << hgtdId->wafer_hash( idwafer ) + << " upon HGTD_ID => ec: " << endcap << ", layer: " << layer << ", quadrant: " << q + << ", row: " << myphi <<", module: "<< myeta ); + ATH_MSG_DEBUG( " HGTD Module: " << m_boxVolPars[c].name+module_string << ", posX: " << myx << ", posY: " << myy << ", rot: " << quadrot + myrot ); } InDetDD::HGTD_DetectorElement* detElement = new InDetDD::HGTD_DetectorElement(idwafer, moduleDesign, sensorCompPhysicalVol, m_commonItems); @@ -645,11 +643,11 @@ GeoVPhysVol* HGTD_DetectorFactory::build( const GeoLogVol* logicalEnvelope, bool // print out each module component if ( mod == 0 && q == 0 && volumes[comp] != sensorName ) - ATH_MSG_DEBUG( std::setw(20) << m_boxVolPars[c].name << " ( " << std::setw(15) << m_boxVolPars[c].material - << " ), in-sensor-layer local z = " << std::setw(7) << m_boxVolPars[c].zOffsetLocal << " mm" - << ", DX = " << std::setw(5) << m_boxVolPars[c].xHalf << " mm" - << ", DY = " << std::setw(5) << m_boxVolPars[c].yHalf << " mm" - << ", DZ = " << std::setw(5) << m_boxVolPars[c].zHalf << " mm" ); + ATH_MSG_DEBUG( std::setw(20) << m_boxVolPars[c].name << " ( " << std::setw(15) << m_boxVolPars[c].material + << " ), in-sensor-layer local z = " << std::setw(7) << m_boxVolPars[c].zOffsetLocal << " mm" + << ", DX = " << std::setw(5) << m_boxVolPars[c].xHalf << " mm" + << ", DY = " << std::setw(5) << m_boxVolPars[c].yHalf << " mm" + << ", DZ = " << std::setw(5) << m_boxVolPars[c].zHalf << " mm" ); } // end of components loop double zModule = ( Lside == 0 ? zModuleLayerF : zModuleLayerB ); @@ -710,8 +708,8 @@ std::array< PositionsInQuadrant, 4 > HGTD_DetectorFactory::prepareLayersFromQuad // backward compatibility to pre-TDR two-ring layouts // 3-ring layout differ from 2-ring here. std::string HGTD_DetectorFactory::formModuleName( int layer, int quadrant, unsigned int maxrows, int row, int mod, - ModulePosition module, - double& myx, double& myy, double& myrot, int& phi, int& eta ) { + ModulePosition module, + double& myx, double& myy, double& myrot, int& phi, int& eta ) { std::string module_string = ""; @@ -922,9 +920,9 @@ std::vector< ModulePosition > HGTD_DetectorFactory::prepareModulePositionsInRowT // the spreadsheet gave the center of bottom edge of a module, so an adjustment by halfHeight is needed if ( m_outputIdfr ) ATH_MSG_DEBUG( " Row " << ( row <= index_XYcoord_change ? effectiveRow + 1 : 36 - row ) - << " Module " << moduleCounter + 1 <<" at (x,y) : " - << ( row > index_XYcoord_change ? rowModulePositions.back().x - halfHeight : rowModulePositions.back().x ) << ", " - << ( row > index_XYcoord_change ? rowModulePositions.back().y : rowModulePositions.back().y - halfHeight ) ); + << " Module " << moduleCounter + 1 <<" at (x,y) : " + << ( row > index_XYcoord_change ? rowModulePositions.back().x - halfHeight : rowModulePositions.back().x ) << ", " + << ( row > index_XYcoord_change ? rowModulePositions.back().y : rowModulePositions.back().y - halfHeight ) ); posOfLastPlacedModule = modPos_row; moduleCounter ++; @@ -982,13 +980,17 @@ InDetDD::HGTD_ModuleDesign* HGTD_DetectorFactory::createHgtdDesign( double thick normalCell, diodeColumnsPerCircuit, 0); InDetDD::PixelDiodeMatrix* fullMatrix = new InDetDD::PixelDiodeMatrix(InDetDD::PixelDiodeMatrix::phiDir, 0, singleRow, 2*diodeRowsPerCircuit, 0); // note 30 = 2*15 rows adopted - + + DetectorDesign::Axis yDirection = InDetDD::DetectorDesign::xAxis; + if (m_geomVersion == 0 ) + yDirection = InDetDD::DetectorDesign::yAxis; + InDetDD::HGTD_ModuleDesign* design = new InDetDD::HGTD_ModuleDesign(thickness, circuitsPerColumn, circuitsPerRow, cellColumnsPerCircuit, cellRowsPerCircuit, diodeColumnsPerCircuit, diodeRowsPerCircuit, fullMatrix, - InDetDD::CarrierType::electrons, 1 ); + InDetDD::CarrierType::electrons, 1, yDirection ); return design; } diff --git a/HighGranularityTimingDetector/HGTD_DetDescr/HGTD_ReadoutGeometry/HGTD_ReadoutGeometry/HGTD_ModuleDesign.h b/HighGranularityTimingDetector/HGTD_DetDescr/HGTD_ReadoutGeometry/HGTD_ReadoutGeometry/HGTD_ModuleDesign.h index 902aeee4abce..0dc5b38e379f 100644 --- a/HighGranularityTimingDetector/HGTD_DetDescr/HGTD_ReadoutGeometry/HGTD_ReadoutGeometry/HGTD_ModuleDesign.h +++ b/HighGranularityTimingDetector/HGTD_DetDescr/HGTD_ReadoutGeometry/HGTD_ReadoutGeometry/HGTD_ModuleDesign.h @@ -72,7 +72,9 @@ public: const int diodeRowsPerCircuit, const InDetDD::PixelDiodeMatrix * matrix, InDetDD::CarrierType carrierType, - int readoutSide); + int readoutSide, + DetectorDesign::Axis yDirection = InDetDD::DetectorDesign::xAxis, + DetectorDesign::Axis depthDirection = InDetDD::DetectorDesign::zAxis); // Destructor: virtual ~HGTD_ModuleDesign(); diff --git a/HighGranularityTimingDetector/HGTD_DetDescr/HGTD_ReadoutGeometry/src/HGTD_ModuleDesign.cxx b/HighGranularityTimingDetector/HGTD_DetDescr/HGTD_ReadoutGeometry/src/HGTD_ModuleDesign.cxx index fcb55a64bfeb..01e69de41bdf 100644 --- a/HighGranularityTimingDetector/HGTD_DetDescr/HGTD_ReadoutGeometry/src/HGTD_ModuleDesign.cxx +++ b/HighGranularityTimingDetector/HGTD_DetDescr/HGTD_ReadoutGeometry/src/HGTD_ModuleDesign.cxx @@ -19,13 +19,15 @@ HGTD_ModuleDesign::HGTD_ModuleDesign(const double thickness, const int diodeRowsPerCircuit, const PixelDiodeMatrix * matrix, InDetDD::CarrierType carrierType, - int readoutSide): + int readoutSide, + DetectorDesign::Axis yDirection, + DetectorDesign::Axis depthDirection): DetectorDesign(thickness, true, true, true, // phi,eta,depth axes symmetric carrierType, readoutSide, - InDetDD::DetectorDesign::yAxis, - InDetDD::DetectorDesign::zAxis), + yDirection, + depthDirection), m_diodeMap(matrix), m_readoutScheme(circuitsPerColumn,circuitsPerRow, cellColumnsPerCircuit,cellRowsPerCircuit, -- GitLab From dd8137891c0d72eed5c7b957ef8fdf2ae02f8ce1 Mon Sep 17 00:00:00 2001 From: Noemi Calace <noemi.calace@cern.ch> Date: Thu, 25 Feb 2021 17:53:21 +0100 Subject: [PATCH 3/4] Allowing SiHitAnalysis to handle HGTD_Hits --- .../share/postInclude.SiHitAnalysis.py | 8 +++++ .../Tools/HitAnalysis/src/SiHitAnalysis.cxx | 30 ++++++++++++++----- .../Tools/HitAnalysis/src/SiHitAnalysis.h | 1 + 3 files changed, 32 insertions(+), 7 deletions(-) diff --git a/InnerDetector/InDetExample/InDetSLHC_Example/share/postInclude.SiHitAnalysis.py b/InnerDetector/InDetExample/InDetSLHC_Example/share/postInclude.SiHitAnalysis.py index 64077d9fe920..ed4f392938b7 100644 --- a/InnerDetector/InDetExample/InDetSLHC_Example/share/postInclude.SiHitAnalysis.py +++ b/InnerDetector/InDetExample/InDetSLHC_Example/share/postInclude.SiHitAnalysis.py @@ -13,6 +13,14 @@ if InDetGeometryFlags.isSLHC(): topSequence.PixelHitAnalysis.ExpertMode= "off" topSequence.SCTHitAnalysis.ExpertMode= "off" +from AthenaCommon.DetFlags import DetFlags +if DetFlags.HGTD_on(): + topSequence += SiHitAnalysis('HGTDHitAnalysis') + topSequence.HGTDHitAnalysis.CollectionName='HGTD_Hits' + topSequence.HGTDHitAnalysis.HistPath='/SiHitAnalysis/' + topSequence.HGTDHitAnalysis.isITK = True + topSequence.HGTDHitAnalysis.ExpertMode= "off" + if not hasattr(ServiceMgr, 'THistSvc'): from GaudiSvc.GaudiSvcConf import THistSvc ServiceMgr += THistSvc() diff --git a/Simulation/Tools/HitAnalysis/src/SiHitAnalysis.cxx b/Simulation/Tools/HitAnalysis/src/SiHitAnalysis.cxx index 2951ccff02ea..98772e840677 100644 --- a/Simulation/Tools/HitAnalysis/src/SiHitAnalysis.cxx +++ b/Simulation/Tools/HitAnalysis/src/SiHitAnalysis.cxx @@ -51,12 +51,14 @@ SiHitAnalysis::SiHitAnalysis(const std::string& name, ISvcLocator* pSvcLocator) , m_path("/SiHitAnalysis/") , m_thistSvc("THistSvc", name) , m_isITK(false) + , m_isHGTD(false) { declareProperty("CollectionName", m_collection="BCMHits"); declareProperty("ExpertMode", m_expert = "off"); declareProperty("NtupleFileName", m_ntupleFileName); declareProperty("HistPath", m_path); declareProperty("isITK", m_isITK); + declareProperty("isHGTD", m_isHGTD); } StatusCode SiHitAnalysis::initialize() { @@ -81,6 +83,10 @@ StatusCode SiHitAnalysis::initialize() { detName = "BLM"; ntupName = "SiBLM"; } + else if (m_collection=="HGTD_Hits") { + detName = "HGTD"; + ntupName = "SiHGTD"; + } else { ATH_MSG_ERROR("SiHitsAnalysis for "<< name()<<"not supported!!! \n"); return StatusCode::FAILURE; @@ -109,7 +115,16 @@ StatusCode SiHitAnalysis::initialize() { radius_up = 350; radius_down = 0; } + } + if (m_isHGTD) { + bin_down = -1000; + bin_up = 1000; + radius_up = 1000; + radius_down = 350; + z_min = -3600; + z_max = 3600; } + else if (detName=="Pixel") { bin_down = -170; bin_up = 170; @@ -216,6 +231,7 @@ StatusCode SiHitAnalysis::execute() { for (SiHitConstIterator i_hit = p_collection->begin(); i_hit != p_collection->end() ;++i_hit) { GeoSiHit ghit(*i_hit); HepGeom::Point3D<double> p = ghit.getGlobalPosition(); + m_h_hits_x->Fill(p.x()); m_h_hits_y->Fill(p.y()); m_h_hits_z->Fill(p.z()); @@ -229,13 +245,13 @@ StatusCode SiHitAnalysis::execute() { m_h_hits_barcode->Fill(i_hit->particleLink().barcode()); if (m_expert == "on") { - m_h_time_eloss->Fill(i_hit->meanTime(), i_hit->energyLoss()); - if (i_hit->getBarrelEndcap()==0) { - m_h_z_eloss->Fill(p.z(), i_hit->energyLoss()); - } - else { - m_h_r_eloss->Fill(p.perp(), i_hit->energyLoss()); - } + m_h_time_eloss->Fill(i_hit->meanTime(), i_hit->energyLoss()); + if (i_hit->getBarrelEndcap()==0) { + m_h_z_eloss->Fill(p.z(), i_hit->energyLoss()); + } + else { + m_h_r_eloss->Fill(p.perp(), i_hit->energyLoss()); + } } m_hits_x->push_back(p.x()); diff --git a/Simulation/Tools/HitAnalysis/src/SiHitAnalysis.h b/Simulation/Tools/HitAnalysis/src/SiHitAnalysis.h index effe3d909dbf..4b72efb8f5a0 100755 --- a/Simulation/Tools/HitAnalysis/src/SiHitAnalysis.h +++ b/Simulation/Tools/HitAnalysis/src/SiHitAnalysis.h @@ -64,6 +64,7 @@ class SiHitAnalysis : public AthAlgorithm { std::string m_path; ServiceHandle<ITHistSvc> m_thistSvc; bool m_isITK; + bool m_isHGTD; }; -- GitLab From 8a98c2503a473fa6376c663a9a21cfba0ea71c79 Mon Sep 17 00:00:00 2001 From: Noemi Calace <noemi.calace@cern.ch> Date: Thu, 25 Feb 2021 17:58:32 +0100 Subject: [PATCH 4/4] fixing one flag --- .../InDetSLHC_Example/share/postInclude.SiHitAnalysis.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/InnerDetector/InDetExample/InDetSLHC_Example/share/postInclude.SiHitAnalysis.py b/InnerDetector/InDetExample/InDetSLHC_Example/share/postInclude.SiHitAnalysis.py index ed4f392938b7..f8160494af34 100644 --- a/InnerDetector/InDetExample/InDetSLHC_Example/share/postInclude.SiHitAnalysis.py +++ b/InnerDetector/InDetExample/InDetSLHC_Example/share/postInclude.SiHitAnalysis.py @@ -18,7 +18,7 @@ if DetFlags.HGTD_on(): topSequence += SiHitAnalysis('HGTDHitAnalysis') topSequence.HGTDHitAnalysis.CollectionName='HGTD_Hits' topSequence.HGTDHitAnalysis.HistPath='/SiHitAnalysis/' - topSequence.HGTDHitAnalysis.isITK = True + topSequence.HGTDHitAnalysis.isHGTD = True topSequence.HGTDHitAnalysis.ExpertMode= "off" if not hasattr(ServiceMgr, 'THistSvc'): -- GitLab