ATLAS Offline Software
Loading...
Searching...
No Matches
EnhancedBiasWeightCompAlg Class Reference

Compute Enhanced Bias weights for the events. More...

#include <EnhancedBiasWeightCompAlg.h>

Inheritance diagram for EnhancedBiasWeightCompAlg:
Collaboration diagram for EnhancedBiasWeightCompAlg:

Classes

class  EBChainInfo
 Store necessary information for weight computing for Enhanced Bias chain. More...
class  EBResult
 Store result of EB weight calculation. More...

Public Member Functions

 EnhancedBiasWeightCompAlg (const std::string &name, ISvcLocator *svcLoc)
virtual StatusCode initialize () override
virtual StatusCode start () override
virtual StatusCode execute (const EventContext &context) const override
virtual StatusCode stop () override
virtual StatusCode sysInitialize () override
 Override sysInitialize.
virtual bool isClonable () const override
 Specify if the algorithm is clonable.
virtual unsigned int cardinality () const override
 Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant.
virtual StatusCode sysExecute (const EventContext &ctx) override
 Execute an algorithm.
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies.
virtual bool filterPassed (const EventContext &ctx) const
virtual void setFilterPassed (bool state, const EventContext &ctx) const
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

EBResult calculateEBWeight (const std::vector< EBChainInfo > &EBChains) const
 Calculate EB result based on total prescales of chains.
StatusCode fillTotalPrescaleForChains (const EventContext &context, std::vector< EBChainInfo > &EBChains) const
 Retrieve total prescales (L1 * HLT) for chains into map.
std::vector< EBChainInfogetPassedEBChains () const
 Get list of Enhanced Bias chains that cound have passed.
bool checkIfTriggeredByRandomChain (const std::vector< EBChainInfo > &EBChain) const
 Check if any of random chains passed.
std::vector< std::string > parseItems (const std::string &itemStr)
 Parse list of l1 items.
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

SG::ReadHandleKey< TrigConf::HLTMenum_HLTMenuKey {this, "HLTTriggerMenu", "DetectorStore+HLTTriggerMenu", "HLT Menu"}
PublicToolHandle< Trig::TrigDecisionToolm_tdt {this, "TrigDecisionTool", "Trig::TrigDecisionTool/TrigDecisionTool", "TrigDecisionTool"}
SG::ReadHandleKey< TrigCompositeUtils::DecisionContainerm_finalDecisionKey { this, "FinalDecisionKey", "", "Final stage of all decisions" }
SG::ReadCondHandleKey< TrigConf::HLTPrescalesSetm_HLTPrescaleSetInputKey {this, "HLTPrescales", "HLTPrescales", "HLT prescales set"}
SG::ReadCondHandleKey< TrigConf::L1PrescalesSetm_L1PrescaleSetInputKey {this, "L1Prescales", "L1Prescales", "L1 prescales set"}
Gaudi::Property< std::map< std::string, std::vector< std::string > > > m_chainToHLTSeed {this, "ChainToItemMap", {}, "Map for HLT seeded chains" }
std::vector< HLT::Identifierm_EBChainIds
 Available EB chains' IDs from HLT Menu.
std::map< HLT::Identifier, std::vector< std::string > > m_EBChainIdToItem
 L1 items for EB chains from HLT Menu.
std::string m_outputFilename ATLAS_THREAD_SAFE
 Name of xml output file.
tbb::concurrent_vector< std::pair< double, bool > > m_ebWeights ATLAS_THREAD_SAFE
 List of calculated weight + unbiased flag pairs to be saved in xml.
tbb::concurrent_unordered_map< int, double > m_eventToWeight ATLAS_THREAD_SAFE
 Map of event number to index in m_ebWeights vector to be saved in xml.
DataObjIDColl m_extendedExtraObjects
 Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default)
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

Compute Enhanced Bias weights for the events.

Definition at line 28 of file EnhancedBiasWeightCompAlg.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ EnhancedBiasWeightCompAlg()

EnhancedBiasWeightCompAlg::EnhancedBiasWeightCompAlg ( const std::string & name,
ISvcLocator * svcLoc )

Definition at line 11 of file EnhancedBiasWeightCompAlg.cxx.

12 : AthReentrantAlgorithm(name, svcLoc) {}

Member Function Documentation

◆ calculateEBWeight()

EnhancedBiasWeightCompAlg::EBResult EnhancedBiasWeightCompAlg::calculateEBWeight ( const std::vector< EBChainInfo > & EBChains) const
private

Calculate EB result based on total prescales of chains.

Definition at line 152 of file EnhancedBiasWeightCompAlg.cxx.

152 {
153
154 double weight = 1.;
155
156 for (const EBChainInfo& chain : EBChains){
157 if (chain.getIsDisabled()){
158 ATH_MSG_DEBUG("Chain " << chain.getName() << " disabled");
159 continue;
160 }
161 ATH_MSG_DEBUG("Chain " << chain.getName() << " total prescale " << chain.getTotalPrescale());
162 weight *= 1. - ( 1. / chain.getTotalPrescale() );
163 }
164
165 weight = (std::fabs(1.0 - weight) < 1e-10) ? 0. : (1. / (1. - weight));
166
167 // Check if the event was triggered by EB noalg random chain
168 bool isUnbiased = checkIfTriggeredByRandomChain(EBChains);
169
170 return {double(weight), isUnbiased};
171}
#define ATH_MSG_DEBUG(x)
Store necessary information for weight computing for Enhanced Bias chain.
bool checkIfTriggeredByRandomChain(const std::vector< EBChainInfo > &EBChain) const
Check if any of random chains passed.

◆ cardinality()

unsigned int AthCommonReentrantAlgorithm< Gaudi::Algorithm >::cardinality ( ) const
overridevirtualinherited

Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant.

Override this to return 0 for reentrant algorithms.

Definition at line 75 of file AthCommonReentrantAlgorithm.cxx.

64{
65 return 0;
66}

◆ checkIfTriggeredByRandomChain()

bool EnhancedBiasWeightCompAlg::checkIfTriggeredByRandomChain ( const std::vector< EBChainInfo > & EBChain) const
private

Check if any of random chains passed.

Definition at line 210 of file EnhancedBiasWeightCompAlg.cxx.

210 {
211
212 return std::find_if (EBChains.begin(), EBChains.end(),
213 [](const EBChainInfo& chain) -> bool { return chain.getIsRandom(); }) != EBChains.end();
214}

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ execute()

StatusCode EnhancedBiasWeightCompAlg::execute ( const EventContext & context) const
overridevirtual

Definition at line 80 of file EnhancedBiasWeightCompAlg.cxx.

80 {
81
82 // Retrieve information about EB chains that could have passed
83 std::vector<EBChainInfo> EBChains = getPassedEBChains();
84
85 ATH_MSG_DEBUG("Number of eb chains that passed int this event: " << EBChains.size());
86
87 // None of EB chains passed the algorithm
88 if (EBChains.empty()) {
89 ATH_MSG_DEBUG("Empty event!");
90 return StatusCode::SUCCESS;
91 }
92
93 // Retrieve L1 and HLT prescales
94 ATH_CHECK( fillTotalPrescaleForChains(context, EBChains) );
95
96 // Calculate EB weight
98
99 // Save output values: EBWeight and EBUnbiased to xml file
100 // Create filename (run number necessary)
101 if ( context.evt() == 0 ){
102 std::stringstream filename;
103 filename << "EnhancedBiasWeights_" << context.eventID().run_number() << ".xml";
104 m_outputFilename = filename.str();
105 ATH_MSG_INFO("The output file name is " << m_outputFilename);
106 }
107
108 // Save to containers to be saved to xml
109 auto resultPair = std::pair<double, bool>(result.weight, result.isUnbiased);
110 auto newPair = std::find(m_ebWeights.begin(), m_ebWeights.end(), resultPair);
111 if (newPair == m_ebWeights.end()){
112 newPair = m_ebWeights.push_back(resultPair);
113 ATH_MSG_DEBUG("New weight value: " << result.weight << " with id " << (m_ebWeights.size()-1));
114 }
115 m_eventToWeight[context.eventID().event_number()] = std::distance(m_ebWeights.begin(), newPair);
116
117 ATH_MSG_DEBUG("EnhacedBias EBWeight: " << result.weight << " EnhacedBias isUnbiased: " << (bool) result.isUnbiased );
118
119 return StatusCode::SUCCESS;
120}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_INFO(x)
StatusCode fillTotalPrescaleForChains(const EventContext &context, std::vector< EBChainInfo > &EBChains) const
Retrieve total prescales (L1 * HLT) for chains into map.
EBResult calculateEBWeight(const std::vector< EBChainInfo > &EBChains) const
Calculate EB result based on total prescales of chains.
std::vector< EBChainInfo > getPassedEBChains() const
Get list of Enhanced Bias chains that cound have passed.
Store result of EB weight calculation.

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ extraOutputDeps()

const DataObjIDColl & AthCommonReentrantAlgorithm< Gaudi::Algorithm >::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

This list is extended to include symlinks implied by inheritance relations.

Definition at line 94 of file AthCommonReentrantAlgorithm.cxx.

90{
91 // If we didn't find any symlinks to add, just return the collection
92 // from the base class. Otherwise, return the extended collection.
93 if (!m_extendedExtraObjects.empty()) {
95 }
97}
An algorithm that can be simultaneously executed in multiple threads.

◆ fillTotalPrescaleForChains()

StatusCode EnhancedBiasWeightCompAlg::fillTotalPrescaleForChains ( const EventContext & context,
std::vector< EBChainInfo > & EBChains ) const
private

Retrieve total prescales (L1 * HLT) for chains into map.

Definition at line 123 of file EnhancedBiasWeightCompAlg.cxx.

123 {
124
125 SG::ReadCondHandle<TrigConf::HLTPrescalesSet> HLTPrescalesSet (m_HLTPrescaleSetInputKey, context);
126 ATH_CHECK( HLTPrescalesSet.isValid() );
127
128 SG::ReadCondHandle<TrigConf::L1PrescalesSet> L1PrescalesSet (m_L1PrescaleSetInputKey, context);
129 ATH_CHECK( L1PrescalesSet.isValid() );
130
131 for (EBChainInfo& chain : EBChains) {
132 if ( not HLTPrescalesSet->prescale(chain.getId()).enabled ){
133 chain.setTotalPrescale(-1);
134 continue;
135 }
136
137 double HLTPrescale = HLTPrescalesSet->prescale(chain.getId()).prescale;
138 double L1Prescale = 1.0;
139 if (!chain.getIsNoPS()) {
140 for (const std::string& item : m_EBChainIdToItem.at(chain.getId())){
141 L1Prescale *= L1PrescalesSet->prescale(item).prescale;
142 }
143 }
144
145 chain.setTotalPrescale(HLTPrescale * L1Prescale);
146 }
147
148 return StatusCode::SUCCESS;
149}
std::map< HLT::Identifier, std::vector< std::string > > m_EBChainIdToItem
L1 items for EB chains from HLT Menu.
SG::ReadCondHandleKey< TrigConf::L1PrescalesSet > m_L1PrescaleSetInputKey
SG::ReadCondHandleKey< TrigConf::HLTPrescalesSet > m_HLTPrescaleSetInputKey

◆ filterPassed()

virtual bool AthCommonReentrantAlgorithm< Gaudi::Algorithm >::filterPassed ( const EventContext & ctx) const
inlinevirtualinherited

Definition at line 96 of file AthCommonReentrantAlgorithm.h.

96 {
97 return execState( ctx ).filterPassed();
98 }
virtual bool filterPassed(const EventContext &ctx) const

◆ getPassedEBChains()

std::vector< EnhancedBiasWeightCompAlg::EBChainInfo > EnhancedBiasWeightCompAlg::getPassedEBChains ( ) const
private

Get list of Enhanced Bias chains that cound have passed.

Definition at line 174 of file EnhancedBiasWeightCompAlg.cxx.

174 {
175
176 std::vector<EBChainInfo> passedEBChains;
177
178 for (const HLT::Identifier& chainId : m_EBChainIds) {
179 std::string chainName = HLT::Identifier(chainId).name();
180
181 bool ebChainIsSeeded = false;
182 // For chains with HLT seed discrimintaion check if one of the seeds could pass
183 if ((chainName.find("_eb_") != std::string::npos) && (!m_chainToHLTSeed.empty())){
184 for (const std::string& l1Item : m_chainToHLTSeed.value().at(chainName)) {
185 if (m_tdt->isPassedBits(l1Item) & TrigDefs::L1_isPassedBeforePrescale) {
186 ebChainIsSeeded = true;
187 break;
188 }
189 }
190 } else if (chainName.find("L1RD3") != std::string::npos){
191 // For the random items, we need to look at HLT decision
192 ebChainIsSeeded = m_tdt->isPassed(chainName);
193 } else {
194 for (const std::string& l1Item : m_EBChainIdToItem.at(chainId)) {
195 if (m_tdt->isPassedBits(l1Item) & TrigDefs::L1_isPassedBeforePrescale) {
196 ebChainIsSeeded = true;
197 break;
198 }
199 }
200 }
201 if (ebChainIsSeeded) {
202 passedEBChains.push_back(EBChainInfo(HLT::Identifier(chainId)));
203 }
204 }
205
206 return passedEBChains;
207}
std::vector< HLT::Identifier > m_EBChainIds
Available EB chains' IDs from HLT Menu.
Gaudi::Property< std::map< std::string, std::vector< std::string > > > m_chainToHLTSeed
PublicToolHandle< Trig::TrigDecisionTool > m_tdt

◆ initialize()

StatusCode EnhancedBiasWeightCompAlg::initialize ( )
overridevirtual

Definition at line 14 of file EnhancedBiasWeightCompAlg.cxx.

14 {
15
16 ATH_CHECK( m_HLTMenuKey.initialize() );
17 if (!m_finalDecisionKey.empty()) {
18 ATH_CHECK( m_finalDecisionKey.initialize() );
19 }
20
21 ATH_CHECK( m_HLTPrescaleSetInputKey.initialize() );
22 ATH_CHECK( m_L1PrescaleSetInputKey.initialize() );
23
24 ATH_CHECK( m_tdt.retrieve() );
25
26 return StatusCode::SUCCESS;
27}
SG::ReadHandleKey< TrigCompositeUtils::DecisionContainer > m_finalDecisionKey
SG::ReadHandleKey< TrigConf::HLTMenu > m_HLTMenuKey

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ isClonable()

◆ msg()

MsgStream & AthCommonMsg< Gaudi::Algorithm >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ msgLvl()

bool AthCommonMsg< Gaudi::Algorithm >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ parseItems()

std::vector< std::string > EnhancedBiasWeightCompAlg::parseItems ( const std::string & itemStr)
private

Parse list of l1 items.

Definition at line 216 of file EnhancedBiasWeightCompAlg.cxx.

216 {
217
218 std::vector<std::string> items;
219
220 std::stringstream itemStream (itemStr);
221 std::string item;
222
223 while (std::getline(itemStream, item, ',')) {
224 items.push_back(item);
225 }
226
227 return items;
228}

◆ renounce()

std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ setFilterPassed()

virtual void AthCommonReentrantAlgorithm< Gaudi::Algorithm >::setFilterPassed ( bool state,
const EventContext & ctx ) const
inlinevirtualinherited

Definition at line 100 of file AthCommonReentrantAlgorithm.h.

100 {
102 }
virtual void setFilterPassed(bool state, const EventContext &ctx) const

◆ start()

StatusCode EnhancedBiasWeightCompAlg::start ( )
overridevirtual

Definition at line 30 of file EnhancedBiasWeightCompAlg.cxx.

30 {
31
32 SG::ReadHandle<TrigConf::HLTMenu> hltMenuHandle = SG::makeHandle( m_HLTMenuKey );
33 ATH_CHECK( hltMenuHandle.isValid() );
34
35 // Save ids of EB chains - that contain "_eb_"
36 m_EBChainIds = std::vector<HLT::Identifier>();
37 m_EBChainIds = std::vector<HLT::Identifier>();
38 for (const TrigConf::Chain& chain : *hltMenuHandle){
39 if (chain.name() == "HLT_noalg_eb_L1All") continue; // this is a special chain
40 std::vector<std::string> streams = chain.streams();
41 if (std::find(streams.begin(), streams.end(), "EnhancedBias") != streams.end()){
42 auto chainId = HLT::Identifier(chain.name());
43 m_EBChainIds.push_back(chainId);
44 m_EBChainIdToItem[chainId] = parseItems(chain.l1item());
45 }
46 }
47
48 return StatusCode::SUCCESS;
49}
std::vector< std::string > parseItems(const std::string &itemStr)
Parse list of l1 items.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())

◆ stop()

StatusCode EnhancedBiasWeightCompAlg::stop ( )
overridevirtual

Definition at line 51 of file EnhancedBiasWeightCompAlg.cxx.

51 {
52
53 // Save weights and events mapping to xml
54 if (!m_outputFilename.empty()){
55 std::ofstream outputStream;
56 outputStream.open(m_outputFilename);
57 outputStream << "<?xml version=\"1.0\" encoding=\"us-ascii\"?>" << std::endl;
58 outputStream << "<run>" << std::endl;
59 outputStream << "<weights>" << std::endl;
60
61 for (size_t i = 0; i < m_ebWeights.size(); ++i){
62 outputStream << "<weight id=\"" << i << "\" value=\"" << m_ebWeights[i].first << "\" unbiased=\"" << m_ebWeights[i].second << "\"/>" << std::endl;
63 }
64
65 outputStream << "</weights>" << std::endl;
66 outputStream << "<events>" << std::endl;
67
68 for (const auto& event : m_eventToWeight){
69 outputStream << "<e n=\"" << event.first << "\" w=\"" << event.second << "\"/>" << std::endl;
70 }
71
72 outputStream << "</events>" << std::endl;
73 outputStream << "</run>" << std::endl;
74 outputStream.close();
75 }
76
77 return StatusCode::SUCCESS;
78}

◆ sysExecute()

StatusCode AthCommonReentrantAlgorithm< Gaudi::Algorithm >::sysExecute ( const EventContext & ctx)
overridevirtualinherited

Execute an algorithm.

We override this in order to work around an issue with the Algorithm base class storing the event context in a member variable that can cause crashes in MT jobs.

Definition at line 85 of file AthCommonReentrantAlgorithm.cxx.

77{
78 return BaseAlg::sysExecute (ctx);
79}

◆ sysInitialize()

StatusCode AthCommonReentrantAlgorithm< Gaudi::Algorithm >::sysInitialize ( )
overridevirtualinherited

Override sysInitialize.

Override sysInitialize from the base class.

Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc

Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc

Reimplemented from AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >.

Reimplemented in HypoBase, and InputMakerBase.

Definition at line 61 of file AthCommonReentrantAlgorithm.cxx.

107 {
109
110 if (sc.isFailure()) {
111 return sc;
112 }
113
114 ServiceHandle<ICondSvc> cs("CondSvc",name());
115 for (auto h : outputHandles()) {
116 if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
117 // do this inside the loop so we don't create the CondSvc until needed
118 if ( cs.retrieve().isFailure() ) {
119 ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
120 return StatusCode::SUCCESS;
121 }
122 if (cs->regHandle(this,*h).isFailure()) {
124 ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
125 << " with CondSvc");
126 }
127 }
128 }
129 return sc;
130}
#define ATH_MSG_ERROR(x)
#define ATH_MSG_WARNING(x)
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308 {
309 // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310 // << " size: " << m_vhka.size() << endmsg;
311 for (auto &a : m_vhka) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }

Member Data Documentation

◆ ATLAS_THREAD_SAFE [1/3]

std::string m_outputFilename EnhancedBiasWeightCompAlg::ATLAS_THREAD_SAFE
mutableprivate

Name of xml output file.

Definition at line 105 of file EnhancedBiasWeightCompAlg.h.

◆ ATLAS_THREAD_SAFE [2/3]

tbb::concurrent_vector<std::pair<double, bool> > m_ebWeights EnhancedBiasWeightCompAlg::ATLAS_THREAD_SAFE
mutableprivate

List of calculated weight + unbiased flag pairs to be saved in xml.

Definition at line 108 of file EnhancedBiasWeightCompAlg.h.

◆ ATLAS_THREAD_SAFE [3/3]

tbb::concurrent_unordered_map<int, double> m_eventToWeight EnhancedBiasWeightCompAlg::ATLAS_THREAD_SAFE
mutableprivate

Map of event number to index in m_ebWeights vector to be saved in xml.

Definition at line 111 of file EnhancedBiasWeightCompAlg.h.

◆ m_chainToHLTSeed

Gaudi::Property<std::map<std::string, std::vector<std::string> > > EnhancedBiasWeightCompAlg::m_chainToHLTSeed {this, "ChainToItemMap", {}, "Map for HLT seeded chains" }
private

Definition at line 81 of file EnhancedBiasWeightCompAlg.h.

81{this, "ChainToItemMap", {}, "Map for HLT seeded chains" };

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_EBChainIds

std::vector<HLT::Identifier> EnhancedBiasWeightCompAlg::m_EBChainIds
private

Available EB chains' IDs from HLT Menu.

Definition at line 99 of file EnhancedBiasWeightCompAlg.h.

◆ m_EBChainIdToItem

std::map<HLT::Identifier, std::vector<std::string> > EnhancedBiasWeightCompAlg::m_EBChainIdToItem
private

L1 items for EB chains from HLT Menu.

Definition at line 102 of file EnhancedBiasWeightCompAlg.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthCommonReentrantAlgorithm< Gaudi::Algorithm >::m_extendedExtraObjects
privateinherited

Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.

Empty if no symlinks were found.

Definition at line 114 of file AthCommonReentrantAlgorithm.h.

◆ m_finalDecisionKey

SG::ReadHandleKey<TrigCompositeUtils::DecisionContainer> EnhancedBiasWeightCompAlg::m_finalDecisionKey { this, "FinalDecisionKey", "", "Final stage of all decisions" }
private

Definition at line 76 of file EnhancedBiasWeightCompAlg.h.

76{ this, "FinalDecisionKey", "", "Final stage of all decisions" };

◆ m_HLTMenuKey

SG::ReadHandleKey<TrigConf::HLTMenu> EnhancedBiasWeightCompAlg::m_HLTMenuKey {this, "HLTTriggerMenu", "DetectorStore+HLTTriggerMenu", "HLT Menu"}
private

Definition at line 74 of file EnhancedBiasWeightCompAlg.h.

74{this, "HLTTriggerMenu", "DetectorStore+HLTTriggerMenu", "HLT Menu"};

◆ m_HLTPrescaleSetInputKey

SG::ReadCondHandleKey<TrigConf::HLTPrescalesSet> EnhancedBiasWeightCompAlg::m_HLTPrescaleSetInputKey {this, "HLTPrescales", "HLTPrescales", "HLT prescales set"}
private

Definition at line 78 of file EnhancedBiasWeightCompAlg.h.

78{this, "HLTPrescales", "HLTPrescales", "HLT prescales set"};

◆ m_L1PrescaleSetInputKey

SG::ReadCondHandleKey<TrigConf::L1PrescalesSet> EnhancedBiasWeightCompAlg::m_L1PrescaleSetInputKey {this, "L1Prescales", "L1Prescales", "L1 prescales set"}
private

Definition at line 79 of file EnhancedBiasWeightCompAlg.h.

79{this, "L1Prescales", "L1Prescales", "L1 prescales set"};

◆ m_tdt

PublicToolHandle<Trig::TrigDecisionTool> EnhancedBiasWeightCompAlg::m_tdt {this, "TrigDecisionTool", "Trig::TrigDecisionTool/TrigDecisionTool", "TrigDecisionTool"}
private

Definition at line 75 of file EnhancedBiasWeightCompAlg.h.

75{this, "TrigDecisionTool", "Trig::TrigDecisionTool/TrigDecisionTool", "TrigDecisionTool"};

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files: