Skip to content
Snippets Groups Projects
Commit d71d5964 authored by scott snyder's avatar scott snyder Committed by scott snyder
Browse files

TrigAnalysisExamples: Fix gcc11 warnings.

Avoid spurious copies in for loops.
parent 1cadeef5
No related branches found
No related tags found
No related merge requests found
...@@ -124,7 +124,7 @@ namespace Trig{ ...@@ -124,7 +124,7 @@ namespace Trig{
std::vector<Feature<T> > vectorOfFeatures = features.get<T>(key); std::vector<Feature<T> > vectorOfFeatures = features.get<T>(key);
ATH_MSG_INFO(chainName << " has " << features.get<T>().size() << " T features "); ATH_MSG_INFO(chainName << " has " << features.get<T>().size() << " T features ");
// Loop over the features of type T // Loop over the features of type T
for( const Trig::Feature<T> feature : vectorOfFeatures ) { for( const Trig::Feature<T>& feature : vectorOfFeatures ) {
printFeatureAndTEInfo<T>(feature); printFeatureAndTEInfo<T>(feature);
} // End loop over the features } // End loop over the features
} }
...@@ -146,13 +146,13 @@ namespace Trig{ ...@@ -146,13 +146,13 @@ namespace Trig{
std::vector< Trig::Feature <T1> > feature1 = comb.get<T1>(key1); std::vector< Trig::Feature <T1> > feature1 = comb.get<T1>(key1);
ATH_MSG_INFO("COMB Combination has " << feature1.size() << " T1 features "); ATH_MSG_INFO("COMB Combination has " << feature1.size() << " T1 features ");
for(const Trig::Feature<T1> feat1:feature1){ for(const Trig::Feature<T1>& feat1:feature1){
printFeatureAndTEInfo<T1>(feat1); printFeatureAndTEInfo<T1>(feat1);
} }
std::vector< Trig::Feature <T2> > feature2 = comb.get<T2>(key2); std::vector< Trig::Feature <T2> > feature2 = comb.get<T2>(key2);
ATH_MSG_INFO("COMB Combination has " << feature2.size() << " T2 features "); ATH_MSG_INFO("COMB Combination has " << feature2.size() << " T2 features ");
for(const Trig::Feature<T2> feat2:feature2){ for(const Trig::Feature<T2>& feat2:feature2){
printFeatureAndTEInfo<T2>(feat2); printFeatureAndTEInfo<T2>(feat2);
} }
} }
...@@ -165,7 +165,7 @@ namespace Trig{ ...@@ -165,7 +165,7 @@ namespace Trig{
FeatureContainer features = m_trigDecisionTool->features( chainName, condition); FeatureContainer features = m_trigDecisionTool->features( chainName, condition);
std::vector<Feature<T> > vectorOfFeatures = features.get<T>(key); std::vector<Feature<T> > vectorOfFeatures = features.get<T>(key);
// Loop over the features of type T // Loop over the features of type T
for( const Trig::Feature<T> feature : vectorOfFeatures ) { for( const Trig::Feature<T>& feature : vectorOfFeatures ) {
const T *cont=feature.cptr(); //Get pointer to container of type T const T *cont=feature.cptr(); //Get pointer to container of type T
const xAOD::TrigPassBits *bits=(m_trigDecisionTool->ancestor<xAOD::TrigPassBits>(feature.te())).cptr(); const xAOD::TrigPassBits *bits=(m_trigDecisionTool->ancestor<xAOD::TrigPassBits>(feature.te())).cptr();
if(!bits) if(!bits)
......
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