Skip to content
Snippets Groups Projects
Commit ff7d91b7 authored by Frank Winklmeier's avatar Frank Winklmeier
Browse files

TrigDecisionTool: various const fixes

parent 77a1db9c
5 merge requests!69091Fix correlated smearing bug in JER in JetUncertainties in 22.0,!58791DataQualityConfigurations: Modify L1Calo config for web display,!51674Fixing hotSpotInHIST for Run3 HIST,!50012RecExConfig: Adjust log message levels from GetRunNumber and GetLBNumber,!49861TrigDecisionTool: various const and thread-safety fixes
......@@ -37,7 +37,7 @@ HLT::TrigNavStructure* Trig::Combination::navigation() const
return const_cast<HLT::TrigNavStructure*>(m_cgm->navigation());
}
const std::vector<Trig::TypelessFeature> Trig::Combination::typelessGet(HLT::class_id_type clid, const std::string& label, unsigned int condition, const std::string & /*teName*/) const {
std::vector<Trig::TypelessFeature> Trig::Combination::typelessGet(HLT::class_id_type clid, const std::string& label, unsigned int condition, const std::string & /*teName*/) const {
//we will query the navigation for all features of this CLID, starting from the TE's in the combination and going up the navigation recursively.
std::vector<Trig::TypelessFeature> features;
......
......@@ -41,8 +41,8 @@ Trig::FeatureContainer::navigation() const {
bool
Trig::FeatureContainer::ordering_by_objects_attached2::weakOrder(const HLT::TriggerElement* a, const HLT::TriggerElement* b,
void* obj_a, void* obj_b) const {
Trig::FeatureContainer::ordering_by_objects_attached::weakOrder(const HLT::TriggerElement* a, const HLT::TriggerElement* b,
const void* obj_a, const void* obj_b) const {
// returning False -> no insertion into set
// returning True -> insertion into set
// each pair of candidates is tested twice (if test returns False twice, then no insertion into set)
......
......@@ -68,7 +68,7 @@ namespace Trig {
* @param clid must be clid of type as stored. No flattening supported
*/
const std::vector<Trig::TypelessFeature> typelessGet(HLT::class_id_type clid, const std::string& label = "", unsigned int condition = TrigDefs::Physics, const std::string & teName = "" ) const;
std::vector<Trig::TypelessFeature> typelessGet(HLT::class_id_type clid, const std::string& label = "", unsigned int condition = TrigDefs::Physics, const std::string & teName = "" ) const;
/**
* @brief Method used to get objects.
......@@ -78,7 +78,7 @@ namespace Trig {
* @param teName to get features from TEs of specific TEs (it is to be used in combination with switch alsoDeactivateTEs or composite triggers) super-expert usecase
**/
template<class T>
const std::vector<Trig::Feature<T> > get(const std::string& label = "", unsigned int condition=TrigDefs::Physics, const std::string& teName = "") const;
std::vector<Trig::Feature<T> > get(const std::string& label = "", unsigned int condition=TrigDefs::Physics, const std::string& teName = "") const;
template<typename CONTAINER> using ELEMENT_OF = typename CONTAINER::base_value_type;
......@@ -167,7 +167,7 @@ namespace Trig {
template <class T>
const std::vector<Trig::Feature<T> > Trig::Combination::get(const std::string& label, unsigned int condition, const std::string& teName) const
std::vector<Trig::Feature<T> > Trig::Combination::get(const std::string& label, unsigned int condition, const std::string& teName) const
{
std::vector<Feature<T> > data;
......
// -*- c++ -*-
/*
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
*/
#ifndef TRIGGER_DECISION_TOOL_DecisionAccess_H
......@@ -229,7 +229,7 @@ namespace Trig {
* Feature object can be given here as well
**/
template<class T>
const Feature<T> ancestor(const HLT::TriggerElement* te, std::string label = "") const;
Feature<T> ancestor(const HLT::TriggerElement* te, std::string label = "") const;
/**
* @brief gives back features matching (by seeding relation) - will also flatten
......@@ -238,7 +238,7 @@ namespace Trig {
* Feature object can be given here as well
**/
template<class T>
const std::vector<Trig::Feature<T> > ancestors(const HLT::TriggerElement* te, std::string label = "", unsigned int condition=TrigDefs::Physics, const std::string& teName = "") const;
std::vector<Trig::Feature<T> > ancestors(const HLT::TriggerElement* te, std::string label = "", unsigned int condition=TrigDefs::Physics, const std::string& teName = "") const;
protected:
......
#if !defined(XAOD_STANDALONE) && !defined(XAOD_ANALYSIS) // Full athena
template<class T>
const Trig::Feature<T> Trig::DecisionAccess::ancestor(const HLT::TriggerElement* te, std::string label) const {
Trig::Feature<T> Trig::DecisionAccess::ancestor(const HLT::TriggerElement* te, std::string label) const {
Trig::Feature<T> f;
std::vector<Trig::Feature<T> > data;
FeatureAccessImpl::collect<T>(te, data, label, TrigDefs::alsoDeactivateTEs, "", const_cast<HLT::TrigNavStructure*>(cgm()->navigation()));
......@@ -19,7 +19,7 @@ const Trig::Feature<T> Trig::DecisionAccess::ancestor(const HLT::TriggerElement*
template<class T>
const std::vector<Trig::Feature<T> > Trig::DecisionAccess::ancestors(const HLT::TriggerElement* te, std::string label, unsigned int condition, const std::string& teName) const {
std::vector<Trig::Feature<T> > Trig::DecisionAccess::ancestors(const HLT::TriggerElement* te, std::string label, unsigned int condition, const std::string& teName) const {
std::vector<Trig::Feature<T> > data;
FeatureAccessImpl::collect<T>(te, data, label, condition, teName, const_cast<HLT::TrigNavStructure*>(cgm()->navigation()));
for( Feature<T>& f : data ) {
......@@ -33,13 +33,13 @@ const std::vector<Trig::Feature<T> > Trig::DecisionAccess::ancestors(const HLT::
#else // AnalysisBase
template<class T>
const Trig::Feature<T> Trig::DecisionAccess::ancestor(const HLT::TriggerElement* /*te*/, std::string /*label*/) const {
Trig::Feature<T> Trig::DecisionAccess::ancestor(const HLT::TriggerElement* /*te*/, std::string /*label*/) const {
ATH_MSG_WARNING("DecisionAccess::ancestor not implemented in Standalone mode, since it needs compile-time type information. Returning empty Feature");
return Trig::Feature<T>();
}
template<class T>
const std::vector<Trig::Feature<T> > Trig::DecisionAccess::ancestors(const HLT::TriggerElement* /*te*/, std::string /*label*/, unsigned int /*condition*/, const std::string& /*teName*/) const {
std::vector<Trig::Feature<T> > Trig::DecisionAccess::ancestors(const HLT::TriggerElement* /*te*/, std::string /*label*/, unsigned int /*condition*/, const std::string& /*teName*/) const {
ATH_MSG_WARNING("DecisionAccess::ancestor not implemented in Standalone mode, since it needs compile-time type information. Returning empty vector");
return std::vector<Trig::Feature<T> >();
}
......
......@@ -127,18 +127,13 @@ namespace Trig {
const Trig::CacheGlobalMemory* m_cgm{nullptr};
// helper class to support ordered set of features
// class ordering_by_objects_attached {
// public:
// bool operator()(const HLT::TriggerElement* a, const HLT::TriggerElement* b);
// };
// helper function for
class ordering_by_objects_attached2 {
/// helper class to support ordered set of features
class ordering_by_objects_attached {
public:
template<class T>
bool operator()(Feature<T> a, Feature<T> b) const;
bool weakOrder(const HLT::TriggerElement* te_a, const HLT::TriggerElement* te_b, void* obj_a, void* obj_b) const;
bool operator()(const Feature<T>& a, const Feature<T>& b) const;
bool weakOrder(const HLT::TriggerElement* te_a, const HLT::TriggerElement* te_b,
const void* obj_a, const void* obj_b) const;
};
};
......@@ -148,10 +143,8 @@ namespace Trig {
template<class T>
bool
Trig::FeatureContainer::ordering_by_objects_attached2::operator()(Feature<T> a, Feature<T> b) const {
bool ret = weakOrder(a.te(), b.te(), (void*) a.cptr(), (void*) b.cptr());
//std::cout << " ==> " << (ret?"TRUE":"FALSE") << std::endl;
return ret;
Trig::FeatureContainer::ordering_by_objects_attached::operator()(const Feature<T>& a, const Feature<T>& b) const {
return weakOrder(a.te(), b.te(), a.cptr(), b.cptr());
}
template<class T> const std::vector<Trig::Feature<T> >
......@@ -163,7 +156,7 @@ Trig::FeatureContainer::get(const std::string& label, unsigned int condition, co
//std::cout << " in FC::get, after call to getCombinations(), now looping over them" << std::endl;
std::set<Trig::Feature<T>, Trig::FeatureContainer::ordering_by_objects_attached2 > uniqnessHelper;
std::set<Trig::Feature<T>, Trig::FeatureContainer::ordering_by_objects_attached > uniqnessHelper;
for(const Trig::Combination& comb : m_combinations ) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment