|
ATLAS Offline Software
|
Go to the documentation of this file.
26 return StatusCode::SUCCESS;
39 if (
chain.name() ==
"HLT_noalg_eb_L1All")
continue;
48 return StatusCode::SUCCESS;
54 if (!m_outputFilename.empty()){
57 outputStream <<
"<?xml version=\"1.0\" encoding=\"us-ascii\"?>" << std::endl;
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;
68 for (
const auto&
event : m_eventToWeight){
69 outputStream <<
"<e n=\"" <<
event.first <<
"\" w=\"" <<
event.second <<
"\"/>" << std::endl;
77 return StatusCode::SUCCESS;
85 ATH_MSG_DEBUG(
"Number of eb chains that passed int this event: " << EBChains.size());
88 if (EBChains.empty()) {
90 return StatusCode::SUCCESS;
101 if ( context.evt() == 0 ){
103 filename <<
"EnhancedBiasWeights_" << context.eventID().run_number() <<
".xml";
105 ATH_MSG_INFO(
"The output file name is " << m_outputFilename);
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));
115 m_eventToWeight[context.eventID().event_number()] =
std::distance(m_ebWeights.begin(), newPair);
119 return StatusCode::SUCCESS;
133 chain.setTotalPrescale(-1);
138 double L1Prescale = 1.0;
139 if (!
chain.getIsNoPS()) {
145 chain.setTotalPrescale(HLTPrescale * L1Prescale);
148 return StatusCode::SUCCESS;
157 if (
chain.getIsDisabled()){
176 std::vector<EBChainInfo> passedEBChains;
181 bool ebChainIsSeeded =
false;
185 if (
m_tdt->isPassedBits(l1Item) & TrigDefs::L1_isPassedBeforePrescale) {
186 ebChainIsSeeded =
true;
190 }
else if (
chainName.find(
"L1RD3") != std::string::npos){
195 if (
m_tdt->isPassedBits(l1Item) & TrigDefs::L1_isPassedBeforePrescale) {
196 ebChainIsSeeded =
true;
201 if (ebChainIsSeeded) {
206 return passedEBChains;
212 return std::find_if (EBChains.begin(), EBChains.end(),
213 [](
const EBChainInfo&
chain) ->
bool { return chain.getIsRandom(); }) != EBChains.end();
218 std::vector<std::string>
items;
220 std::stringstream itemStream (itemStr);
223 while (std::getline(itemStream,
item,
',')) {
std::vector< EBChainInfo > getPassedEBChains() const
Get list of Enhanced Bias chains that cound have passed.
std::vector< std::string > parseItems(const std::string &itemStr)
Parse list of l1 items.
std::vector< HLT::Identifier > m_EBChainIds
Available EB chains' IDs from HLT Menu.
std::string find(const std::string &s)
return a remapped string
std::map< HLT::Identifier, std::vector< std::string > > m_EBChainIdToItem
L1 items for EB chains from HLT Menu.
SG::ReadHandleKey< TrigConf::HLTMenu > m_HLTMenuKey
virtual StatusCode start() override
bool checkIfTriggeredByRandomChain(const std::vector< EBChainInfo > &EBChain) const
Check if any of random chains passed.
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.
An algorithm that can be simultaneously executed in multiple threads.
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
POOL::TEvent event(POOL::TEvent::kClassAccess)
const HLTPrescale & prescale(const std::string &chainName) const
HLT prescales by chain names.
::StatusCode StatusCode
StatusCode definition for legacy code.
Gaudi::Property< std::map< std::string, std::vector< std::string > > > m_chainToHLTSeed
Store result of EB weight calculation.
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
SG::ReadCondHandleKey< TrigConf::L1PrescalesSet > m_L1PrescaleSetInputKey
virtual bool isValid() override final
Can the handle be successfully dereferenced?
const L1Prescale & prescale(const std::string &itemName) const
Store necessary information for weight computing for Enhanced Bias chain.
StatusCode initialize(bool used=true)
PublicToolHandle< Trig::TrigDecisionTool > m_tdt
virtual StatusCode stop() override
virtual StatusCode initialize() override
std::string name() const
reports human redable name if it is enabled or, empty string
SG::ReadCondHandleKey< TrigConf::HLTPrescalesSet > m_HLTPrescaleSetInputKey
float distance(const Amg::Vector3D &p1, const Amg::Vector3D &p2)
calculates the distance between two point in 3D space
SG::ReadHandleKey< TrigCompositeUtils::DecisionContainer > m_finalDecisionKey
virtual StatusCode execute(const EventContext &context) const override
EnhancedBiasWeightCompAlg(const std::string &name, ISvcLocator *svcLoc)