Implement new Region Selector conditions algorithm and flesh out the new RegSelTool class
The new approach to provide an individual RegSelTool for each subdetector makes use of the detector cabling information becoming conditions data.
The new RegSelCondAlg is a conditions algorithm that depends - in the first instance - on the pixel cabling conditions data, as a proof of concept, and adds the RS lookup table as conditions data.
The new RegSelTool that has a dependence on the RS lookup table conditions data. This is all to effectively replicate the Run 2 begin run functionality but with the new conditions handling in MT.
A subsequent request consisting of the configuration code needed to use these classes is currently being developed.
This is a first proof of principle implementation - once it is all working correctly any remaining issues will be fixed - remove redundant comments, add tables for other detector subcomponents etc, rather than allow these issues to act as a distraction at this point.
Merge request reports
Activity
added Geometry InnerDetector Trigger master review-pending-level-1 labels
added 1 commit
- 95b87da0 - Some minor changes to some variable names and comments
CI Result SUCCESS (hash 5a009596)Athena AthSimulation externals cmake make required tests optional tests Full details available on this CI monitor view
Athena: number of compilation errors 0, warnings 0
AthSimulation: number of compilation errors 0, warnings 0
For experts only: Jenkins output [CI-MERGE-REQUEST-CC7 9318] CI Result SUCCESS (hash 95b87da0)Athena AthSimulation externals cmake make required tests optional tests Full details available on this CI monitor view
Athena: number of compilation errors 0, warnings 0
AthSimulation: number of compilation errors 0, warnings 0
For experts only: Jenkins output [CI-MERGE-REQUEST-CC7 9322]35 35 PrintHashId = True, 36 36 PrintTable = False) 37 37 ToolSvc += PixelRegionSelectorTable This line, which creates a public tool, can be deleted.
As for the comment just below, since the
RegSelTool
only contains a few bytes of private data, the overhead of instantiating many of them is very small. The actual payload is stored in the conditions store and shared by all instances.
13 14 #include "InDetReadoutGeometry/SiDetectorElementCollection.h" 15 #include "InDetReadoutGeometry/SiDetectorElement.h" 16 17 #include "InDetIdentifier/SCT_ID.h" 18 #include "InDetIdentifier/PixelID.h" 19 20 21 22 SiRegSelCondAlg::SiRegSelCondAlg(const std::string& name, ISvcLocator* pSvcLocator): 23 AthReentrantAlgorithm( name, pSvcLocator ), 24 m_managerName(""), 25 m_printTable(false), 26 m_sctCablingToolInc("SCT_CablingToolInc") 27 { 28 declareProperty("PrintTable", m_printTable=false); I suppose this code has been copied from elsewhere, but I will still make some comments with regards to coding style/recommendations.
For new code, it's much easier to declare the properties in the header file. E.g.
Gaudi::Property<bool> m_printTable{this, "PrintTable", false};
This also has the advantage that they appear in the same place as the
Handle
property declarations.Edited by Frank Winklmeier
22 SiRegSelCondAlg::SiRegSelCondAlg(const std::string& name, ISvcLocator* pSvcLocator): 23 AthReentrantAlgorithm( name, pSvcLocator ), 24 m_managerName(""), 25 m_printTable(false), 26 m_sctCablingToolInc("SCT_CablingToolInc") 27 { 28 declareProperty("PrintTable", m_printTable=false); 29 declareProperty("ManagerName", m_managerName); 30 } 31 32 33 34 35 StatusCode SiRegSelCondAlg::initialize() 36 { 37 ATH_MSG_INFO("SiRegSelCondAlg::initialize() -- enter -- "); 39 ATH_MSG_INFO("SiRegSelCondAlg::initialize() -- exit -- "); 40 41 return StatusCode::SUCCESS; 42 } 43 44 45 46 47 StatusCode SiRegSelCondAlg::execute(const EventContext& ctx) const 48 { 49 ATH_MSG_DEBUG("SiRegSelCondAlg::execute() -- enter -- "); 50 51 52 /// do stuff here ... 53 54 if ( msgLvl(MSG::DEBUG) ) msg(MSG::DEBUG) << "Creating region selector table" << endmsg; Use the messaging macros (
ATH_MSG_XYZ
) instead of the manualif
-check here and everywhere else in this file.Edited by Frank Winklmeier
47 StatusCode SiRegSelCondAlg::execute(const EventContext& ctx) const 48 { 49 ATH_MSG_DEBUG("SiRegSelCondAlg::execute() -- enter -- "); 50 51 52 /// do stuff here ... 53 54 if ( msgLvl(MSG::DEBUG) ) msg(MSG::DEBUG) << "Creating region selector table" << endmsg; 55 56 StatusCode sc; 57 58 // Retrieve manager 59 const InDetDD::SiDetectorManager* manager; 60 sc=detStore()->retrieve( manager, m_managerName ); 61 62 if ( sc.isFailure() ) { 65 } else { 66 if ( msgLvl(MSG::DEBUG) ) msg(MSG::DEBUG) << "Manager found" << endmsg; 67 } 68 69 70 /// only really want this if this is the pixel setup 71 /// as such, if we want to set this up inside an if statment, 72 /// as we need it outside, we will nee to create it via a 73 /// pointer - how unpleasant. Will leave it as is here 74 75 SG::ReadCondHandle<PixelCablingCondData> pixCabling( m_condCablingKey, ctx ); 76 77 EventIDRange id_range; 78 79 if (!manager->isPixel()) { // SCT 80 if (m_sctCablingToolInc.retrieve().isFailure()) { 169 } 170 } 171 172 msg(MSG::INFO) << " initialising new map " << endmsg; 173 174 rd->initialise(); 175 176 // write out new new LUT to a file if need be 177 if ( m_printTable ) { 178 if ( manager->isPixel() ) rd->write("RegSelLUT_Pixel"); 179 else rd->write("RegSelLUT_SCT"); 180 } 181 182 /// record LUT cond data 183 184 if (!manager->isPixel()) { added review-user-action-required label and removed review-pending-level-1 label