Resolve creation of many instances of config files for electron Ringer tunes and LH tunes
As mentioned in ATR-22476 this MR will call Ringertool from TrigEgammaFastCaloHypoAlgMT instead of TrigEgammaFastCaloHypoTool. Similarly, LHTool will be called from TrigEgammaPrecisionElectronHypoAlg instead of TrigEgammaPrecisionElectronHypoTool. Adding @fernando , @cjmeyer , @jodafons , @tamartin , @fwinkl
Merge request reports
Activity
- Resolved by Debottam Bakshi Gupta
- Resolved by Debottam Bakshi Gupta
- Resolved by Debottam Bakshi Gupta
added 1 commit
- 2a5db9fc - Remodelling LH selector tools to resolve many instances of config file
34 52 TrigCompositeUtils::Decision* decision; 35 53 const TrigRoiDescriptor* roi; 36 54 const xAOD::Electron_v1* electron; 55 bool accept_vl; Hi, if you use an std::map to hold these accepts will be better since we will have more and more "strategies" arising (for example DNN).
You can try something like:
std::map<std::string,bool> m_accept; // decorate all WP here using pidnames LHLoose, Medium, DNNTight for example std::map<std::string,float> m_values; // decorate this map with LH values (and DNN values for future)```
Edited by Joao Victor Da Fonseca Pinto
100 101 SG::ReadDecorHandle<xAOD::EventInfo,float> eventInfoDecor(m_avgMuKey, context); 102 if(eventInfoDecor.isPresent()) { 103 avg_mu = eventInfoDecor(0); 104 ATH_MSG_DEBUG("Average mu " << avg_mu); 105 asg::AcceptData accept_vloose = m_egammaElectronLHTool_vloose->accept(context, electronHandle.cptr()->at(cl),avg_mu); 106 asg::AcceptData accept_loose = m_egammaElectronLHTool_loose->accept(context, electronHandle.cptr()->at(cl),avg_mu); 107 asg::AcceptData accept_medium = m_egammaElectronLHTool_medium->accept(context, electronHandle.cptr()->at(cl),avg_mu); 108 asg::AcceptData accept_tight = m_egammaElectronLHTool_tight->accept(context, electronHandle.cptr()->at(cl),avg_mu); 109 pass_vloose = (bool) accept_vloose; 110 pass_loose = (bool) accept_loose; 111 pass_medium = (bool) accept_medium; 112 pass_tight = (bool) accept_tight; 113 114 // Monitor the LH value 115 lhval_vloose = m_egammaElectronLHTool_vloose->calculate(context, electronHandle.cptr()->at(cl),avg_mu); Follow the map strategy in each "info struct" you can just do:
PS: the order matter here: usually [Tight,Medium,Loose and VLoose]
int idx=0; for (auto& pidname : m_lhPidNames){ lhvalue = m_lhtools[idx]->calculate(context, ... ); info.values[pidname] = lhvalue; bool accept = bool(m_lhtools[idx]->accept( lhvalue, ... ) ); info.accept[pidname] = accept; idx++; } int idx=0; for (auto& pidname : m_isEMPidNames){ bool accept = bool(m_isEmTools[idx]->accept( ... ) ); info.accept[pidname] = accept; idx++; } // the same thing for DNN for future... int idx=0; for (auto& pidname : m_dnnPidNames){ bool accept = bool(m_dnnTools[idx]->accept( ... ) ); info.accept[pidname] = accept; idx++; }
Edited by Joao Victor Da Fonseca Pinto
266 246 ATH_MSG_DEBUG("relptcone20 = " <<relptcone20 ); 267 247 mon_relptcone20 = relptcone20; 268 248 ATH_MSG_DEBUG("m_RelPtConeCut = " << m_RelPtConeCut ); 249 follow the proposed strategy, you can just write:
pass = input.accept[m_pidSelection]; // get the correct pid decision: LHLoose, Tight, ... if (boost::contains(m_pidSelection, "LH"){ mon_lhval = input.values[m_pidSelection]; }
Edited by Joao Victor Da Fonseca Pinto
37 37 Gaudi::Property< float > m_detacluster { this, "dETACLUSTERthr", 0. , "" }; 38 38 Gaudi::Property< float > m_dphicluster { this, "dPHICLUSTERthr", 0. , "" }; 39 39 Gaudi::Property< float > m_RelPtConeCut { this, "RelPtConeCut", -999., "Track isolation cut" }; 40 Gaudi::Property<bool> m_loose{this,"Loose", false, "Decision for Loose tune"}; 41 41 (electronPrecisionAthSequence, precisionElectronViewsMaker, sequenceOut) = RecoFragmentsPool.retrieve(precisionElectronSequence_GSF, ConfigFlags) 42 42 43 43 # make the Hypo 44 from TriggerMenuMT.HLTMenuConfig.Egamma.EgammaDefs import TrigElectronSelectors 45 SelectorTool_vloose, SelectorTool_loose, SelectorTool_medium, SelectorTool_tight = TrigElectronSelectors() 44 46 from TrigEgammaHypo.TrigEgammaHypoConf import TrigEgammaPrecisionElectronHypoAlgMT 45 47 thePrecisionElectronHypo = TrigEgammaPrecisionElectronHypoAlgMT("TrigEgammaPrecisionElectronHypoAlgMT_GSF") 46 48 thePrecisionElectronHypo.Electrons = sequenceOut 47 49 thePrecisionElectronHypo.RunInView = True 50 thePrecisionElectronHypo.ElectronLHSelector_vLoose = SelectorTool_vloose for all configuration you can just implement:
thePrecisionElectronHypo.LHTools = [ SelectorTool_tight, SelectorTool, medium, ...] thePrecisionElectronHypo.isEMTools = [...] thePrecisionElectronHypo.DNNTools = [...] # for future...
Edited by Joao Victor Da Fonseca Pinto
111 else: 112 self.nominal() 113 114 self.addMonitoring() 115 116 def __setupLHConfiguration(self): 117 118 possibleSel = { 'tight':'Tight', 'medium':'Medium', 'loose':'Loose', 'vloose':'vLoose', 119 'lhtight':'Tight', 'lhmedium':'Medium', 'lhloose':'Loose', 'lhvloose':'vLoose'} 120 121 possibleTune = { 'Tight':False, 'Medium':False, 'Loose':False, 'vLoose':False} 122 if not self.pidname() in possibleSel.keys(): 123 raise RuntimeError( "Bad selection name: %s" % self.pidname() ) 124 possibleTune[possibleSel[self.pidname()]] = True 125 126 self.tool().vLoose = possibleTune['vLoose'] and here something like:
self.tool().PidSelection = possibleSel[self.pidname]
and of course, the same thing for the fast part.
Edited by Joao Victor Da Fonseca Pinto
added 1 commit
- 0be2e401 - Removing eventcontext from the arguments of PrecisionElectronHypoTool because remains unused
added Egamma Trigger TriggerMenu master review-pending-level-1 labels
CI Result SUCCESS (hash 0be2e401)Athena AthSimulation AthGeneration AnalysisBase AthAnalysis DetCommon 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
AthGeneration: number of compilation errors 0, warnings 0
AnalysisBase: number of compilation errors 0, warnings 0
AthAnalysis: number of compilation errors 0, warnings 0
DetCommon: number of compilation errors 0, warnings 0
For experts only: Jenkins output [CI-MERGE-REQUEST-CC7 30921]added review-approved label and removed review-pending-level-1 label
Dear shifters,
Can it be merged?
thanks, Debo.
Edited by Debottam Bakshi Gupta