ATLAS Offline Software
Classes | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Private Types | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
TrigComboHypoTool Class Reference

TrigComboHypoTool is a ComboHypoTool that calculates topological quantities between two particles and apply cuts on it (upper and lower cut) accepting the event if the required condition is satisfied. More...

#include <TrigComboHypoTool.h>

Inheritance diagram for TrigComboHypoTool:
Collaboration diagram for TrigComboHypoTool:

Classes

struct  VarInfo
 Organise info per var selection in a struct. More...
 

Public Types

enum  ComboHypoVars {
  UNDEF =-1, DR =0, DPHI, INVM,
  MT, DETA
}
 

Public Member Functions

 TrigComboHypoTool (const std::string &type, const std::string &name, const IInterface *parent)
 
virtual ~TrigComboHypoTool ()
 
virtual StatusCode initialize () override
 
virtual HLT::Identifier decisionId () const
 retrieves this ComboHypoTool's chain's decision ID More...
 
StatusCode setLegMultiplicity (const Combo::MultiplicityReqMap &multiplicityRequiredMap)
 Sets the number of legs and the multiplicity required on each leg. More...
 
const std::vector< int > & legMultiplicity () const
 Gets the number of legs and the multiplicity required on each leg. More...
 
HLT::Identifier legDecisionId (size_t i) const
 Retrieves this ComboHypoTool's chain's decision ID for a given leg. More...
 
const std::vector< HLT::Identifier > & legDecisionIds () const
 Retrieves this ComboHypoTool's chain's decision IDs for all legs. More...
 
virtual StatusCode decideOnSingleObject (TrigCompositeUtils::Decision *, const std::vector< const TrigCompositeUtils::DecisionIDContainer * > &) const
 Alternate method called by BPhysics ComboHypoAlgs instead of the base method decide(...). More...
 

Protected Member Functions

virtual bool executeAlg (const std::vector< Combo::LegDecision > &combination, const EventContext &ctx) const
 Only a dummy implementation exists in ComboHypoToolBase. More...
 
StatusCode selectLegs (const Combo::LegDecisionsMap &IDCombMap, std::vector< std::vector< Combo::LegDecision >> &leg_decisions) const
 Creates the per-leg vectors of Decision objects starting from the initial LegDecision map, storing only those concerning this HypoTool's chain Pack the Decision objects in std::pair<DecisionID, ElementLink<Decision>> so the derived class' executeAlg function knows which leg each object is on. More...
 
void updateLegDecisionsMap (const std::vector< std::vector< Combo::LegDecision >> &passing_comb, Combo::LegDecisionsMap &passingLegs) const
 For when the tool accepts some/all combinations. More...
 
void eraseFromLegDecisionsMap (Combo::LegDecisionsMap &passingLegs) const
 For when the tool rejects all combinations. More...
 
void printDebugInformation (const Combo::LegDecisionsMap &passingLegs) const
 Print the output of the tool, after having removed failed Decision Objects. More...
 

Protected Attributes

Gaudi::Property< size_t > m_combinationsThresholdWarn
 
Gaudi::Property< size_t > m_combinationsThresholdBreak
 
Gaudi::Property< bool > m_modeOR
 
Gaudi::Property< bool > m_enableOverride
 

Private Types

typedef std::tuple< float, float, float > KineInfo
 Typedef for convenience, will contain eta/phi/pt info. More...
 
typedef std::vector< Combo::LegDecisionCombination
 

Private Member Functions

StatusCode decide (Combo::LegDecisionsMap &passingLegs, const EventContext &) const final
 Override the ComboHypoToolBase::decide in order to optimise combination generation This is to avoid excessive combinatorics for complex multileg chains. More...
 
bool executeAlgStep (const Combination &combination, const VarInfo &, std::vector< float > &values) const
 Implementation of selection on individual variables. More...
 
float compute (const std::pair< KineInfo, KineInfo > &kinepair, ComboHypoVars var) const
 Computation of the variables from the specified kinematics. More...
 
bool fillLegDecisions_sameLeg (std::pair< Combo::LegDecision, Combo::LegDecision > &legpair, const Combination &combination, uint32_t leg) const
 Helpers to extract kinematics from the specified legs of the chain Specialised for two cases – exactly two objects from the same leg or exactly one object each from two legs. More...
 
bool fillLegDecisions_diffLeg (std::pair< Combo::LegDecision, Combo::LegDecision > &legpair, const Combination &combination, uint32_t legA, uint32_t legB) const
 
bool fillPairKinematics (std::pair< KineInfo, KineInfo > &kinepair, const Combination &combination, const VarInfo &varInfo) const
 
bool fillKineInfo (KineInfo &kinematics, Combo::LegDecision decision, bool isMET) const
 

Private Attributes

Gaudi::Property< std::vector< std::string > > m_varTag_vec {this, "Variables" , {""}, "Variables to cut on"}
 Gaudi configuration hooks. More...
 
Gaudi::Property< std::vector< bool > > m_useMin_vec {this, "UseMinVec" , {false}, "Array with the apply_min_cut setting"}
 
Gaudi::Property< std::vector< bool > > m_useMax_vec {this, "UseMaxVec" , {false}, "Array with the apply_max_cut setting"}
 
Gaudi::Property< std::vector< uint32_t > > m_legA_vec {this, "LegAVec" , {0}, "Array with the first Leg ID"}
 
Gaudi::Property< std::vector< uint32_t > > m_legB_vec {this, "LegBVec" , {0}, "Array with the second Leg ID"}
 
Gaudi::Property< std::vector< bool > > m_isLegA_MET_vec {this, "IsLegA_METVec", {false}, "Array with the first Leg MET identifier"}
 
Gaudi::Property< std::vector< bool > > m_isLegB_MET_vec {this, "IsLegB_METVec", {false}, "Array with the second Leg MET identifier"}
 
Gaudi::Property< bool > m_skipLegCheck {this, "SkipLegCheck" , {false}, "Ignore leg IDs for chains with only one leg"}
 
Gaudi::Property< std::vector< float > > m_varMin_vec {this, "LowerCutVec", {FLOATDEFAULT}, "Array with the lower cut for legs pair"}
 
Gaudi::Property< std::vector< float > > m_varMax_vec {this, "UpperCutVec", {FLOATDEFAULT}, "Array with the upper cut for legs pair"}
 
ToolHandleArray< GenericMonitoringToolm_monTool_vec {this, "MonTools", {}, "Monitoring tools" }
 
std::vector< VarInfom_varInfo_vec
 Internal variables for more efficient config lookup. More...
 
HLT::Identifier m_decisionId
 The DecisionID of the chain, obtained from the Tool's name. More...
 
std::vector< HLT::Identifierm_legDecisionIds
 The DecisionIDs of the individual legs, derived from both m_decisionId and m_legMultiplicities. More...
 
std::vector< int > m_legMultiplicities
 The number of legs, and the required multiplicity on each leg. More...
 

Static Private Attributes

static constexpr float FLOATDEFAULT = std::numeric_limits<float>::lowest()
 

Detailed Description

TrigComboHypoTool is a ComboHypoTool that calculates topological quantities between two particles and apply cuts on it (upper and lower cut) accepting the event if the required condition is satisfied.

Definition at line 34 of file TrigComboHypoTool.h.

Member Typedef Documentation

◆ Combination

typedef std::vector<Combo::LegDecision> TrigComboHypoTool::Combination
private

Definition at line 82 of file TrigComboHypoTool.h.

◆ KineInfo

typedef std::tuple<float,float,float> TrigComboHypoTool::KineInfo
private

Typedef for convenience, will contain eta/phi/pt info.

Definition at line 81 of file TrigComboHypoTool.h.

Member Enumeration Documentation

◆ ComboHypoVars

Enumerator
UNDEF 
DR 
DPHI 
INVM 
MT 
DETA 

Definition at line 37 of file TrigComboHypoTool.h.

37 { UNDEF=-1, DR=0, DPHI, INVM, MT, DETA};

Constructor & Destructor Documentation

◆ TrigComboHypoTool()

TrigComboHypoTool::TrigComboHypoTool ( const std::string &  type,
const std::string &  name,
const IInterface *  parent 
)

Definition at line 34 of file TrigComboHypoTool.cxx.

38 {}

◆ ~TrigComboHypoTool()

virtual TrigComboHypoTool::~TrigComboHypoTool ( )
inlinevirtual

Definition at line 43 of file TrigComboHypoTool.h.

43 {};

Member Function Documentation

◆ compute()

float TrigComboHypoTool::compute ( const std::pair< KineInfo, KineInfo > &  kinepair,
ComboHypoVars  var 
) const
private

Computation of the variables from the specified kinematics.

Definition at line 498 of file TrigComboHypoTool.cxx.

498  {
499  const auto& [legA_kine,legB_kine] = kinepair;
500  const auto& [eta1,phi1,pt1] = legA_kine;
501  const auto& [eta2,phi2,pt2] = legB_kine;
502 
503  ATH_MSG_DEBUG(" Leg A has pt " << pt1*invGeV << ", eta " << eta1 << ", phi " << phi1);
504  ATH_MSG_DEBUG(" Leg B has pt " << pt2*invGeV << ", eta " << eta2 << ", phi " << phi2);
505 
506  float value(0);
507  switch(var) {
508  case ComboHypoVars::DR:
509  {
510  value = xAOD::P4Helpers::deltaR(eta1,phi1,eta2,phi2);
511  break;
512  }
513  case ComboHypoVars::DPHI:
514  {
515  value = std::fabs(xAOD::P4Helpers::deltaPhi(phi1,phi2));
516  break;
517  }
518  case ComboHypoVars::INVM:
519  {
520  ROOT::Math::PtEtaPhiMVector p1(pt1,eta1,phi1,0.), p2(pt2,eta2,phi2,0.);
521  value = (p1+p2).M()*invGeV; // Convert to GeV
522  break;
523  }
524  case ComboHypoVars::MT:
525  {
526  //Transverse mass defined for semi-visible decays in hadron colliders. See PDG 49.6, section on kinematics
527  value = std::sqrt(2*pt1*pt2*(1-std::cos(xAOD::P4Helpers::deltaPhi(phi1,phi2) ) ) )*invGeV; // Convert to GeV
528  break;
529  }
530  case ComboHypoVars::DETA:
531  {
532  value = std::fabs(eta2-eta1);
533  break;
534  }
535  default:
536  {
537  ATH_MSG_ERROR("Undefined variable requested -- should never happen!");
538  }
539  }
540  return value;
541 }

◆ decide()

StatusCode TrigComboHypoTool::decide ( Combo::LegDecisionsMap passingLegs,
const EventContext &   
) const
finalprivatevirtual

Override the ComboHypoToolBase::decide in order to optimise combination generation This is to avoid excessive combinatorics for complex multileg chains.

Reimplemented from ComboHypoToolBase.

Definition at line 129 of file TrigComboHypoTool.cxx.

129  {
130 
131  // if no combinations passed, then exit
132  if (passingLegs.empty()) {
133  return StatusCode::SUCCESS;
134  }
135 
136  ATH_MSG_DEBUG("Looking for legs from " << decisionId() << " in the map. Map contains features for " << passingLegs.size() << " legs, which may be data for many chains.");
137  for(const auto& legpair : passingLegs) {
138  ATH_MSG_DEBUG(" Leg " << legpair.first << " has " << legpair.second.size() << " features");
139  }
140 
141  // select the leg decisions from the map with this ID:
142  std::vector<Combination> legDecisions;
143  ATH_CHECK(selectLegs(passingLegs, legDecisions));
144 
145  // Track if we have at least 2 objects on the target legs that can be used for variable computation
146  bool hasViableLegs{true};
147  // Determine the functional leg multiplicities for combinations to generate
148  std::vector<size_t> legMultiplicityForComputation(legMultiplicity().size(),0);
149  if (m_skipLegCheck) {
150  // Handle the case where there is exactly one leg and hence the chain ID is used
151  // This implies a multiplicity of 2
152  legMultiplicityForComputation[0] = 2;
153  hasViableLegs = legDecisions[0].size() >= 2;
154  } else {
155  for (const VarInfo& varInfo : m_varInfo_vec){
156  ATH_MSG_DEBUG("Var " << varInfo.varTag << " needs legs " << varInfo.legA << ", " << varInfo.legB);
157 
158  // Assess the leg decisions and extract the relevant ones
159  if (passingLegs.contains(varInfo.legA) && passingLegs.contains(varInfo.legB)) {
160  size_t goodLegA{false}, goodLegB{false};
161  int32_t iLegA = getIndexFromLeg(varInfo.legA);
162  int32_t iLegB = getIndexFromLeg(varInfo.legB);
163  if ((iLegA<0) or (iLegB<0)){
164  ATH_MSG_ERROR("TrigComboHypoTool::decide: Index into array is negative");
165  return StatusCode::FAILURE;
166  }
167  goodLegA = !passingLegs[varInfo.legA].empty();
168  legMultiplicityForComputation[iLegA] = std::max<size_t>(1,legMultiplicityForComputation[iLegA]);
169  ATH_MSG_DEBUG("Leg " << varInfo.legA << " has " << passingLegs[varInfo.legA].size() << " features --> " << (goodLegA ? "pass" : "fail"));
170  if(varInfo.legB != varInfo.legA) {
171  goodLegB = !passingLegs[varInfo.legB].empty();
172  ATH_MSG_DEBUG("Leg " << varInfo.legB << " has " << passingLegs[varInfo.legB].size() << " features --> " << (goodLegB ? "pass" : "fail"));
173  legMultiplicityForComputation[iLegB] = std::max<size_t>(1,legMultiplicityForComputation[iLegB]);
174  } else {
175  goodLegB = goodLegA = passingLegs[varInfo.legA].size() >= 2;
176  ATH_MSG_DEBUG("Leg " << varInfo.legA << " has " << passingLegs[varInfo.legA].size() << " features --> " << (goodLegB ? "pass" : "fail"));
177  // If we do a computation on the same leg, we need to generate a pair of objects here
178  legMultiplicityForComputation[iLegA] = std::max<size_t>(2,legMultiplicityForComputation[iLegA]);
179  }
180  hasViableLegs &= (goodLegA && goodLegB);
181  if (!hasViableLegs) {
182  ATH_MSG_DEBUG("Did not find at least 2 features on the target legs to compute " << varInfo.varTag);
183  }
184  } else {
186  "Insufficient passing legs to compute " << varInfo.varTag
187  << ", intended on (" << varInfo.legA << ", " << varInfo.legB << ")"
188  );
189  hasViableLegs = false;
190  }
191  }
192  }
193 
194  if (!hasViableLegs) {
195  ATH_MSG_DEBUG("This ComboHypoTool cannot run in this event, this chain **REJECTS** this event.");
196  eraseFromLegDecisionsMap(passingLegs);
197  if (msgLvl(MSG::DEBUG)) printDebugInformation(passingLegs);
198  return StatusCode::SUCCESS;
199  }
200 
201  // Create and initialise the combinations generator for the requirements of this chain, given the objects available in this event.
202  // Extract the features on legs not used for the decision, so they stay in the navigation
203  Combination extraLegs;
205  for (size_t legindex = 0; size_t legmult : legMultiplicityForComputation){
206  size_t out_of = legDecisions[legindex].size();
207  if(legmult==0) {
208  extraLegs.insert(extraLegs.end(),legDecisions[legindex].cbegin(),legDecisions[legindex].cend());
209  } else {
210  nucg.add({out_of, legmult});
211  ATH_MSG_DEBUG("For leg index " << legindex << " we will be choosing any " << legmult << " Decision Objects out of " << out_of);
212  }
213  ++legindex;
214  }
215 
216  // Iterate over all variable computations
217  std::vector<Combination> passingCombinations;
218  std::vector<float> values;
219  values.reserve(m_varInfo_vec.size());
220  size_t warnings = 0, iterations = 0;
221  // Correct for the legs on which we compute with 2 features
222  auto get_index_offset = [&legMultiplicityForComputation](size_t legindex) {
223  size_t offset{0};
224  for (auto iLeg=legMultiplicityForComputation.cbegin(); iLeg!=legMultiplicityForComputation.cbegin()+legindex; ++iLeg) {
225  offset += (*iLeg)-1;
226  }
227  return offset;
228  };
229  do {
230  bool lastDecision(true);
231  const std::vector<size_t> combination = nucg();
232  ++nucg;
233  ++iterations;
234  values.clear();
235 
236  // This collects all the features contributing to any variable computation
237  Combination combinationToRecord;
238  for (auto iVarInfo = m_varInfo_vec.cbegin(); iVarInfo!=m_varInfo_vec.cend() && lastDecision; ++iVarInfo){
239  // Just the features for the current variable evaluation
240  Combination combinationToCheck;
241 
242  size_t legA_index = 0;
243  size_t legB_index = 0;
244 
245  // For 1-leg chain, the legID is invalid
246  if (!m_skipLegCheck) {
247  legA_index = getIndexFromLeg(iVarInfo->legA);
248  legB_index = getIndexFromLeg(iVarInfo->legB);
249  }
250 
252  "Computing " << iVarInfo->varTag << " on legs "
253  << iVarInfo->legA << " (" << legA_index << "), "
254  << iVarInfo->legB << " (" << legB_index << ")"
255  );
256  if(iVarInfo->legA==iVarInfo->legB) {
257  // 2 objects on 1 leg
258  // Due to multiplicity checks, a computation like 'dRAA' never overlaps with one like 'dRAB'
259  Combination featurePair = {legDecisions[legA_index][combination.at(legA_index+get_index_offset(legA_index))],legDecisions[legA_index][combination.at(legA_index+get_index_offset(legA_index)+1)]};
260  combinationToCheck.insert(combinationToCheck.end(),featurePair.cbegin(),featurePair.cend());
261  combinationToRecord.insert(combinationToRecord.end(),featurePair.cbegin(),featurePair.cend());
262  } else {
263  // 1 object each on 2 legs
264  Combination featurePair = {legDecisions[legA_index][combination.at(legA_index+get_index_offset(legA_index))],legDecisions[legB_index][combination.at(legB_index+get_index_offset(legB_index))]};
265  combinationToCheck.insert(combinationToCheck.end(),featurePair.cbegin(),featurePair.cend());
266  combinationToRecord.insert(combinationToRecord.end(),featurePair.cbegin(),featurePair.cend());
267  }
268 
269  try {
270  lastDecision = executeAlgStep(combinationToCheck, *iVarInfo, values);
271  ATH_MSG_DEBUG("Combination " << (iterations - 1) << " decided to be " << (lastDecision ? "passing" : "failing") << " " << iVarInfo->varTag);
272  } catch (std::exception& e) {
273  ATH_MSG_ERROR(e.what());
274  return StatusCode::FAILURE;
275  }
276 
277  if ((iterations >= m_combinationsThresholdWarn && warnings == 0) or (iterations >= m_combinationsThresholdBreak)) {
278  ATH_MSG_WARNING("Have so far processed " << iterations << " combinations for " << decisionId() << " in this event, " << passingCombinations.size() << " passing.");
279  ++warnings;
280  if (iterations >= m_combinationsThresholdBreak) {
281  ATH_MSG_WARNING("Too many combinations! Breaking the loop at this point.");
282  break;
283  }
284  }
285  }
286 
287  // Assess the collective decision on the combination
288  if (lastDecision) {
289  combinationToRecord.insert(combinationToRecord.end(),extraLegs.cbegin(),extraLegs.cend());
290  passingCombinations.push_back(std::move(combinationToRecord));
291  if (m_modeOR == true and m_enableOverride) {
292  break;
293  }
294  } else { // the combination failed
295  if (m_modeOR == false and m_enableOverride) {
296  break;
297  }
298  }
299 
300  // Monitoring of variables for only accepted events
301  if(lastDecision && !m_monTool_vec.empty()) {
302  for (const VarInfo& varInfo : m_varInfo_vec) {
303  float value = values[varInfo.index];
304  auto varOfAccepted = Monitored::Scalar(m_varTag_vec[varInfo.index]+"OfAccepted", value );//varInfo->monToolName+"OfAccepted", value );
305  auto monitorIt = Monitored::Group (m_monTool_vec[varInfo.index], varOfAccepted);
306  ATH_MSG_VERBOSE( varInfo.varTag << " = " << value << " is in range " << varInfo.rangeStr() << ".");
307  ATH_MSG_VERBOSE("m_varTag_vec = "<< m_varTag_vec<<", values = "<<values << ", valIndex = "<< varInfo.index <<", monToolName = " << varInfo.monToolName << ", monToolVec = "<< m_monTool_vec);
308  }
309  }
310  } while (nucg);
311 
312  if (m_modeOR) {
313 
314  ATH_MSG_DEBUG("Passing " << passingCombinations.size() << " combinations out of " << iterations << ", "
315  << decisionId() << (passingCombinations.size() ? " **ACCEPTS**" : " **REJECTS**") << " this event based on OR logic.");
316 
317  if (m_enableOverride) {
318  ATH_MSG_DEBUG("Note: stopped after the first successful combination due to the EnableOverride flag.");
319  }
320 
321  } else { // modeAND
322 
323  const bool passAll = (passingCombinations.size() == iterations);
324 
325  ATH_MSG_DEBUG("Passing " << passingCombinations.size() << " combinations out of " << iterations << ", "
326  << decisionId() << (passAll ? " **ACCEPTS**" : " **REJECTS**") << " this event based on AND logic.");
327 
328  if (m_enableOverride) {
329  ATH_MSG_DEBUG("Note: stopped after the first failed combination due to the EnableOverride flag.");
330  }
331 
332  if (not passAll) {
333  passingCombinations.clear();
334  }
335 
336  }
337 
338  if (not passingCombinations.empty()) { // need partial erasure of the decsions (only those not present in any combination)
339  updateLegDecisionsMap(passingCombinations, passingLegs);
340  } else { // need complete erasure of input decisions
341  eraseFromLegDecisionsMap(passingLegs);
342  }
343 
344  if (msgLvl(MSG::DEBUG)) printDebugInformation(passingLegs);
345  return StatusCode::SUCCESS;
346 }

◆ decideOnSingleObject()

StatusCode ComboHypoToolBase::decideOnSingleObject ( TrigCompositeUtils::Decision ,
const std::vector< const TrigCompositeUtils::DecisionIDContainer * > &   
) const
virtualinherited

Alternate method called by BPhysics ComboHypoAlgs instead of the base method decide(...).

This function should be considered a specialist use-case only. It must be over-ridden to do anything useful.

Reimplemented in TrigMultiTrkComboHypoTool, and TrigBmumuxComboHypoTool.

Definition at line 283 of file ComboHypoToolBase.cxx.

283  {
284  ATH_MSG_ERROR("Do not use ComboHypoToolBase on its own, inherit this class and override decideOnSingleObject.");
285  ATH_MSG_ERROR("NOTE: Only if you are also supplying your own decide(...) implimentation, or similar.");
286  ATH_MSG_ERROR("NOTE: Most uses cases should only need to override executeAlg(...).");
287  return StatusCode::FAILURE;
288 }

◆ decisionId()

virtual HLT::Identifier ComboHypoToolBase::decisionId ( ) const
inlinevirtualinherited

retrieves this ComboHypoTool's chain's decision ID

Definition at line 41 of file ComboHypoToolBase.h.

41 { return m_decisionId; }

◆ eraseFromLegDecisionsMap()

void ComboHypoToolBase::eraseFromLegDecisionsMap ( Combo::LegDecisionsMap passingLegs) const
protectedinherited

For when the tool rejects all combinations.

Remove all Decision Objects from all the legs of this HypoTool's chain.

Definition at line 253 of file ComboHypoToolBase.cxx.

253  {
254  for (auto& it : passingLegs) {
255  DecisionID id = it.first;
256  if (id == m_decisionId or (isLegId(id) and getIDFromLeg(id) == m_decisionId)) {
257  const size_t nDecisionObjects = it.second.size();
258  it.second.clear();
259  ATH_MSG_VERBOSE("-- Removed " << nDecisionObjects << " from " << id);
260  }
261  }
262 }

◆ executeAlg()

bool ComboHypoToolBase::executeAlg ( const std::vector< Combo::LegDecision > &  combination,
const EventContext &  ctx 
) const
protectedvirtualinherited

Only a dummy implementation exists in ComboHypoToolBase.

This should be over-ridden by a derived class. The derived class should return a boolean pass/fail for each possible combination in the event. param[in] combination A single combination of objects to be discriminated against. Vector contains the required number of objects over all legs. Use the pair.first to tell which leg a given pair.second decision object belongs to in the current combination.

Reimplemented in TrigEgammaTopoHypoTool, TrigAFPDijetComboHypoTool, DebugComboHypoTool, DeltaRRoIComboHypoTool, TrigMuonEFInvMassHypoTool, TrigMuonEFIdtpInvMassHypoTool, TrigBmumuxComboHypoTool, and TrigMultiTrkComboHypoTool.

Definition at line 278 of file ComboHypoToolBase.cxx.

278  {
279  ATH_MSG_ERROR("Do not use ComboHypoToolBase on its own, inherit this class and override executeAlg.");
280  return false;
281 }

◆ executeAlgStep()

bool TrigComboHypoTool::executeAlgStep ( const Combination combination,
const VarInfo varInfo,
std::vector< float > &  values 
) const
private

Implementation of selection on individual variables.

Definition at line 349 of file TrigComboHypoTool.cxx.

349  {
350  ATH_MSG_DEBUG("Executing selection " << varInfo.index << " of " << m_varInfo_vec.size() << ": " << varInfo.rangeStr());
351 
352  std::pair<KineInfo,KineInfo> kinepair;
353  if(!fillPairKinematics(kinepair, combination, varInfo)) {
354  ATH_MSG_ERROR("Failed to extract kinematics of feature pair!");
355  return false;
356  }
357 
358  if(msgLvl(MSG::VERBOSE)) {
359  float eta_check, phi_check, pt_check;
360  std::tie(eta_check,phi_check,pt_check) = kinepair.first;
361  msg() << MSG::VERBOSE << " Test filled legA kinematics: pt " << pt_check*invGeV << ", eta " << eta_check << ", phi " << phi_check << endmsg;
362 
363  std::tie(eta_check,phi_check,pt_check) = kinepair.second;
364  msg() << MSG::VERBOSE << " Test filled legB kinematics: pt " << pt_check*invGeV << ", eta " << eta_check << ", phi " << phi_check << endmsg;
365  }
366 
367  // apply the cut
368  float value = compute(kinepair,varInfo.var);
369  if(!m_monTool_vec.empty()) {
370  auto varOfProcessed = Monitored::Scalar(m_varTag_vec[varInfo.index]+"OfProcessed" , value );
371  auto monitorIt = Monitored::Group (m_monTool_vec[varInfo.index], varOfProcessed);
372  }
373  vals.push_back(value);
374  bool pass = varInfo.test(value);
375 
376  ATH_MSG_DEBUG(" Found a combination with " << value);
377  if(!pass) {
378  ATH_MSG_DEBUG(" Combination failed var cut: " << varInfo.varTag << " = " << value << " not in range " << varInfo.rangeStr());
379  }
380  return pass;
381 }

◆ fillKineInfo()

bool TrigComboHypoTool::fillKineInfo ( TrigComboHypoTool::KineInfo kinematics,
Combo::LegDecision  decision,
bool  isMET 
) const
private

Definition at line 470 of file TrigComboHypoTool.cxx.

470  {
471  float eta, phi, pt;
472  if (isMET) {
473  auto pLink = TrigCompositeUtils::findLink<xAOD::TrigMissingETContainer>( *decision.second, featureString() ).link;
474  if (!pLink.isValid()){
475  ATH_MSG_ERROR("link for MET not valid");
476  return false;
477  }
478  ROOT::Math::XYVectorF metv((*pLink)->ex(),(*pLink)->ey());
479  eta = FLOATDEFAULT;
480  phi = metv.phi();
481  pt = metv.r();
482  } else {
483  auto pLink = TrigCompositeUtils::findLink<xAOD::IParticleContainer>( *decision.second, featureString() ).link;
484  if (!pLink.isValid()){
485  ATH_MSG_ERROR("link for IParticle not valid");
486  return false;
487  }
488  eta = (*pLink)->p4().Eta();
489  phi = (*pLink)->p4().Phi();
490  pt = (*pLink)->p4().Pt();
491  }
492  ATH_MSG_VERBOSE(" Filled kinematics with pt " << pt*invGeV << ", eta " << eta << ", phi " << phi);
493  kinematics = std::make_tuple(eta,phi,pt);
494  return true;
495 }

◆ fillLegDecisions_diffLeg()

bool TrigComboHypoTool::fillLegDecisions_diffLeg ( std::pair< Combo::LegDecision, Combo::LegDecision > &  legpair,
const Combination combination,
uint32_t  legA,
uint32_t  legB 
) const
private

Definition at line 417 of file TrigComboHypoTool.cxx.

417  {
418  // Extract the features matching the legs
419  // We take all of them, so as to be able to check if there is any ambiguity
420  auto isLegA = [&legA](const Combo::LegDecision& d) { return testLegId(d,legA); };
421  auto isLegB = [&legB](const Combo::LegDecision& d) { return testLegId(d,legB); };
422  Combination legA_features, legB_features;
423 
424  std::copy_if(combination.begin(),combination.end(),std::back_inserter(legA_features),isLegA);
425  if(legA_features.size()!=1) {
426  ATH_MSG_ERROR(legA_features.size() << " Decision Objects supplied on leg " << legA
427  << ", must be 1 for different-leg topo selection!");
428  return false;
429  }
430 
431  std::copy_if(combination.begin(),combination.end(),std::back_inserter(legB_features),isLegB);
432  if (legB_features.size()!=1) {
433  ATH_MSG_ERROR(legB_features.size() << " Decision Objects supplied on leg " << legB
434  << ", must be 1 for different-leg topo selection!");
435  return false;
436  }
437 
438  legpair.first = legA_features[0];
439  legpair.second = legB_features[0];
440 
441  return true;
442 }

◆ fillLegDecisions_sameLeg()

bool TrigComboHypoTool::fillLegDecisions_sameLeg ( std::pair< Combo::LegDecision, Combo::LegDecision > &  legpair,
const Combination combination,
uint32_t  leg 
) const
private

Helpers to extract kinematics from the specified legs of the chain Specialised for two cases – exactly two objects from the same leg or exactly one object each from two legs.

Definition at line 392 of file TrigComboHypoTool.cxx.

392  {
393  Combination leg_features;
394  if(m_skipLegCheck) {
395  // If there is only one leg, the decision IDs don't have a leg ID
396  std::copy(combination.begin(),combination.end(),std::back_inserter(leg_features));
397  } else {
398  // Extract the features matching the legs
399  // We take all of them, so as to be able to check if there is any ambiguity
400  auto isMyLeg = [&leg](const Combo::LegDecision& d) { return testLegId(d,leg); };
401  std::copy_if(combination.begin(),combination.end(),std::back_inserter(leg_features),isMyLeg);
402  }
403 
404  if (leg_features.size()==2) {
405  legpair.first = leg_features[0];
406  legpair.second = leg_features[1];
407  } else {
408  ATH_MSG_ERROR(leg_features.size() << " Decision Objects supplied on leg " << leg
409  << ", must be 2 for same-leg topo selection!");
410  return false;
411  }
412 
413  return true;
414 }

◆ fillPairKinematics()

bool TrigComboHypoTool::fillPairKinematics ( std::pair< KineInfo, KineInfo > &  kinepair,
const Combination combination,
const VarInfo varInfo 
) const
private

Definition at line 445 of file TrigComboHypoTool.cxx.

445  {
446  ATH_MSG_VERBOSE(" Decision objects available = "<< combination);
447  // Check that there are enough features
448  size_t nFeatures(combination.size());
449  if (nFeatures < 2){
450  ATH_MSG_ERROR("Number of Decision Objects passed is less than 2! Sum over decision objects on all legs = " << combination.size() );
451  return false;
452  }
453  std::pair<Combo::LegDecision,Combo::LegDecision> legpair;
454  if (varInfo.legsAreEqual) {fillLegDecisions_sameLeg(legpair,combination,varInfo.legA);}
455  else {fillLegDecisions_diffLeg(legpair,combination,varInfo.legA,varInfo.legB);}
456  ATH_MSG_VERBOSE(" Fill leg A kinematics");
457  if(!fillKineInfo(kinepair.first,legpair.first,varInfo.legA_is_MET)) {
458  ATH_MSG_ERROR("Failed to extract requisite kinematic info from leg " << varInfo.legA << "!");
459  return false;
460  }
461  ATH_MSG_VERBOSE(" Fill leg B kinematics");
462  if(!fillKineInfo(kinepair.second,legpair.second,varInfo.legB_is_MET)) {
463  ATH_MSG_ERROR("Failed to extract requisite kinematic info from leg " << varInfo.legB << "!");
464  return false;
465  }
466  return true;
467  }

◆ initialize()

StatusCode TrigComboHypoTool::initialize ( )
overridevirtual

Definition at line 62 of file TrigComboHypoTool.cxx.

63 {
64  ATH_MSG_DEBUG("Variable = " << m_varTag_vec );
65  ATH_MSG_DEBUG("UseCut min = " << m_useMin_vec );
66  ATH_MSG_DEBUG("UseCut max = " << m_useMax_vec );
67  ATH_MSG_DEBUG("varCut min = " << m_varMin_vec );
68  ATH_MSG_DEBUG("varCut max = " << m_varMax_vec );
69  ATH_MSG_DEBUG("LegA = " << m_legA_vec );
70  ATH_MSG_DEBUG("LegB = " << m_legB_vec );
71 
72  ATH_CHECK( m_monTool_vec.retrieve() );
73 
74  if (m_legA_vec.size() != m_legB_vec.size()) {
75  ATH_MSG_ERROR("Trying to configure the Tool with legA and legB vectors of different size!");
76  return StatusCode::FAILURE;
77  }
78  if (m_useMin_vec.size() != m_useMax_vec.size()) {
79  ATH_MSG_ERROR("Trying to configure the Tool with UseMin and UseMax vectors of different size!");
80  return StatusCode::FAILURE;
81  }
82  if (m_legA_vec.size() != m_useMax_vec.size()) {
83  ATH_MSG_ERROR("Trying to configure the Tool with legA/B and UseMax/Min vectors of different size!");
84  return StatusCode::FAILURE;
85  }
86  if (m_varTag_vec.size() != m_useMax_vec.size()) {
87  ATH_MSG_ERROR("Trying to configure the Tool with varTag and UseMax/Min(LegA/B) vectors of different size!");
88  return StatusCode::FAILURE;
89  }
90 
91  for (size_t i=0; i<m_varTag_vec.size(); ++i){
92  VarInfo info;
93  info.index = i;
94  if(!m_monTool_vec.empty()) {
95  info.monToolName = m_monTool_vec[i].name();
96  }
97  if (VarMap.find(m_varTag_vec[i]) == VarMap.end()){
98  ATH_MSG_ERROR("The variable is not present in the ComboHypoVars list");
99  return StatusCode::FAILURE;
100  }
101  info.varTag = (m_varTag_vec[i]);
102  info.var = VarMap.at(m_varTag_vec[i]);
103  //
104  info.useMin = m_useMin_vec[i];
105  if(info.useMin) {info.varMin=m_varMin_vec[i];}
106  info.useMax = m_useMax_vec[i];
107  if(info.useMax) {info.varMax=m_varMax_vec[i];}
108  //
109  info.legA = m_legA_vec[i];
110  info.legA_is_MET = m_isLegA_MET_vec[i];
111  info.legB = m_legB_vec[i];
112  info.legB_is_MET = m_isLegB_MET_vec[i];
113  info.legsAreEqual = info.legA==info.legB;
114 
115  std::string validmsg{""};
116  if(!info.validate(validmsg)) {
117  ATH_MSG_ERROR(validmsg);
118  return StatusCode::FAILURE;
119  }
120 
121  m_varInfo_vec.push_back(std::move(info));
122  }
123  ATH_MSG_DEBUG("Initialization completed successfully");
124 
125  return StatusCode::SUCCESS;
126 }

◆ legDecisionId()

HLT::Identifier ComboHypoToolBase::legDecisionId ( size_t  i) const
inlineinherited

Retrieves this ComboHypoTool's chain's decision ID for a given leg.

Only populated for chains with more than one leg. For chains with one leg, use decisionId()

Definition at line 60 of file ComboHypoToolBase.h.

60 { return m_legDecisionIds.at(i); }

◆ legDecisionIds()

const std::vector<HLT::Identifier>& ComboHypoToolBase::legDecisionIds ( ) const
inlineinherited

Retrieves this ComboHypoTool's chain's decision IDs for all legs.

Only populated for chains with more than one leg. For chains with one leg, use decisionId()

Definition at line 66 of file ComboHypoToolBase.h.

66 { return m_legDecisionIds; }

◆ legMultiplicity()

const std::vector<int>& ComboHypoToolBase::legMultiplicity ( ) const
inlineinherited

Gets the number of legs and the multiplicity required on each leg.

Definition at line 54 of file ComboHypoToolBase.h.

54 { return m_legMultiplicities; }

◆ printDebugInformation()

void ComboHypoToolBase::printDebugInformation ( const Combo::LegDecisionsMap passingLegs) const
protectedinherited

Print the output of the tool, after having removed failed Decision Objects.

Restricted to the ComboHypoTool's chain's legs.

Definition at line 264 of file ComboHypoToolBase.cxx.

264  {
265  ATH_MSG_DEBUG("ComboHypoToolBase: End of " << m_decisionId << ", passing elements are: ");
266  for (const auto& [id, ELV] : passingLegs) {
267  // Only print for this chain
268  if (id == m_decisionId or (isLegId(id) and m_decisionId == getIDFromLeg(id))) {
269  ATH_MSG_DEBUG("-- " << HLT::Identifier(id) << " with " << ELV.size() << " elements");
270  for (const auto& EL : ELV) {
271  ATH_MSG_DEBUG("-- -- container:" << EL.dataID() << ", index:" << EL.index());
272  }
273  }
274  }
275 }

◆ selectLegs()

StatusCode ComboHypoToolBase::selectLegs ( const Combo::LegDecisionsMap IDCombMap,
std::vector< std::vector< Combo::LegDecision >> &  leg_decisions 
) const
protectedinherited

Creates the per-leg vectors of Decision objects starting from the initial LegDecision map, storing only those concerning this HypoTool's chain Pack the Decision objects in std::pair<DecisionID, ElementLink<Decision>> so the derived class' executeAlg function knows which leg each object is on.

Definition at line 172 of file ComboHypoToolBase.cxx.

173 {
174  /*
175  legDecisions: nested vector like:
176  [(leg0, el0), (leg0, el1), (leg0, el2), (leg0, el3)], <-- All leg0 objects are in legDecisions[0][X]
177  [(leg1, mu0), (leg1, mu1)] <-- All leg1 objects are in legDecisions[1][X]
178  We keep the legID in the std::pair inside the inner vector as these pairs will be flattened into a single vector
179  when individual combinations of objects are passed to executeAlg, pair.first then contains the leg, with pair.second containing the Decision Object.
180  */
181 
182  // Extract from IDCombMap the features for this chain. Wrap the features up in a pair along with their leg ID
183  for (size_t legIndex = 0; legIndex < m_legMultiplicities.size(); ++ legIndex) {
184 
185  // If the chain has more than one leg, then we have per-leg IDs. Otherwise we just use the chain's ID
186  const HLT::Identifier& legIdentifier = (m_legMultiplicities.size() > 1 ? m_legDecisionIds.at(legIndex) : m_decisionId);
187 
188  // Combo::LegDecision is a pair of <DecisionID, ElementLink<Decision>>
189  std::vector<Combo::LegDecision> decisionObjectsOnLeg;
190 
191  // Find physics objects on this leg. May be zero.
192  const Combo::LegDecisionsMap::const_iterator it = IDCombMap.find(legIdentifier.numeric());
193 
194  if (it != IDCombMap.end()) {
195  for (const ElementLink<DecisionContainer>& el : it->second) {
196  decisionObjectsOnLeg.emplace_back(legIdentifier, el);
197  }
198  }
199 
200  legDecisions.push_back(std::move(decisionObjectsOnLeg));
201  }
202 
203  if (msgLvl(MSG::DEBUG)) {
204  ATH_MSG_DEBUG("Getting " << legDecisions.size() << " legs to combine, for ID: " << decisionId());
205  size_t count = 0;
206  for (const auto& leg : legDecisions) {
207  ATH_MSG_DEBUG("Leg " << count++ << " --");
208  for (const auto& dEL : leg) {
209  ATH_MSG_DEBUG("-- " << HLT::Identifier(dEL.first) << " container:" << dEL.second.dataID() << ", index:" << dEL.second.index());
210  }
211  }
212  }
213  return StatusCode::SUCCESS;
214 }

◆ setLegMultiplicity()

StatusCode ComboHypoToolBase::setLegMultiplicity ( const Combo::MultiplicityReqMap multiplicityRequiredMap)
inherited

Sets the number of legs and the multiplicity required on each leg.

This should be called when the Tool is retrieved by its parent ComboHypo alg. This also sets the leg Decision IDs at the same time param[in] multiplicityRequiredMap: Mapping of chains to required multiplicity per leg.

Definition at line 16 of file ComboHypoToolBase.cxx.

16  {
17  const std::string nameOfToolsChain = m_decisionId.name();
18  const Combo::MultiplicityReqMap::const_iterator it = multiplicityRequiredMap.find(nameOfToolsChain);
19 
20  if (it == multiplicityRequiredMap.end()) {
21  ATH_MSG_ERROR("ComboHypoTool for " << m_decisionId << " could not find its required multiplcity data in the map supplied by its parent alg.");
22  return StatusCode::FAILURE;
23  }
24 
25  m_legMultiplicities = it->second;
26  if (m_legMultiplicities.size() == 0) {
27  ATH_MSG_ERROR("ComboHypoTool for " << m_decisionId << " was listed in the supplied multiplicityRequiredMap, but data was not supplied for any legs.");
28  return StatusCode::FAILURE;
29  }
30 
31  m_legDecisionIds.clear();
32  for (size_t i = 0; i < m_legMultiplicities.size(); ++i) {
33  if(m_legMultiplicities.at(i) < 0) {
34  ATH_MSG_ERROR("ComboHypoTool for " << m_decisionId << " has been configured with an impossible multiplicity requirement of " << m_legMultiplicities.at(i) << " on leg " << i);
35  return StatusCode::FAILURE;
36  }
37  ATH_MSG_DEBUG("ComboHypoTool for " << m_decisionId << " will require multiplicity " << m_legMultiplicities.at(i) << " on leg " << i);
38  if (m_legMultiplicities.size() > 1) { // We only have per-leg IDs when there is more than one leg
40  } else { // For one leg, just repete the chain's ID
41  m_legDecisionIds.push_back(m_decisionId);
42  }
43  }
44 
45  return StatusCode::SUCCESS;
46 }

◆ updateLegDecisionsMap()

void ComboHypoToolBase::updateLegDecisionsMap ( const std::vector< std::vector< Combo::LegDecision >> &  passing_comb,
Combo::LegDecisionsMap passingLegs 
) const
protectedinherited

For when the tool accepts some/all combinations.

Remove Decision Objects from legs of this HypoTool's chain which participated in NONE of combinations which were flagged as accepting the event.

Definition at line 216 of file ComboHypoToolBase.cxx.

216  {
217  if (msgLvl(MSG::DEBUG)) {
218  size_t count = 0;
219  for (const std::vector<Combo::LegDecision>& comb : passingComb) {
220  ATH_MSG_DEBUG("-- Passing combination " << count++ << " of " << passingComb.size());
221  for (const auto& [id, EL] : comb) {
222  ATH_MSG_DEBUG("-- -- " << HLT::Identifier(id) << " container:" << EL.dataID() << ", index:" << EL.index());
223  }
224  }
225  }
226 
227  // remove combinations that didn't pass from the final map passingLegs
228  for (auto& it : passingLegs) {
229  DecisionID legId = it.first;
230  if (not(legId == m_decisionId or (isLegId(legId) and getIDFromLeg(legId) == m_decisionId))) {
231  continue; // Some other chain, ignore it to get faster execution.
232  }
233  std::vector<ElementLink<DecisionContainer>> updatedDecisionObjectsOnLeg;
234  bool update = false;
235  // Loop over all passing combinations, and all Decision Objects in each passing combination. Find Decision Objects on this leg.
236  for (const std::vector<Combo::LegDecision>& comb : passingComb) {
237  for (const auto& [id, EL] : comb) {
238  // Check that this Decision Object is on the correct leg, and that we haven't collated it already from another combination.
239  if (id == legId and std::find(updatedDecisionObjectsOnLeg.begin(), updatedDecisionObjectsOnLeg.end(), EL) == updatedDecisionObjectsOnLeg.end()) {
240  ATH_MSG_VERBOSE("Keeping on leg " << HLT::Identifier(id) << " the Decision Object container:" << EL.dataID() << ", index:" << EL.index());
241  updatedDecisionObjectsOnLeg.push_back(EL);
242  update = true;
243  }
244  }
245  }
246  // only update those concerning this tool ID
247  if (update){
248  it.second = std::move(updatedDecisionObjectsOnLeg);
249  }
250  }
251 }

Member Data Documentation

◆ FLOATDEFAULT

constexpr float TrigComboHypoTool::FLOATDEFAULT = std::numeric_limits<float>::lowest()
staticconstexprprivate

Definition at line 48 of file TrigComboHypoTool.h.

◆ m_combinationsThresholdBreak

Gaudi::Property<size_t> ComboHypoToolBase::m_combinationsThresholdBreak
protectedinherited
Initial value:
{this, "CombinationsThresholdBreak", 10000,
"Events processing this many combinations will generate a second WARNING message, and the loop over combinations will be terminated at this point."}

Definition at line 109 of file ComboHypoToolBase.h.

◆ m_combinationsThresholdWarn

Gaudi::Property<size_t> ComboHypoToolBase::m_combinationsThresholdWarn
protectedinherited
Initial value:
{this, "CombinationsThresholdWarn", 1000,
"Events processing this many combinations will generate a WARNING message."}

Definition at line 106 of file ComboHypoToolBase.h.

◆ m_decisionId

HLT::Identifier ComboHypoToolBase::m_decisionId
privateinherited

The DecisionID of the chain, obtained from the Tool's name.

Definition at line 122 of file ComboHypoToolBase.h.

◆ m_enableOverride

Gaudi::Property<bool> ComboHypoToolBase::m_enableOverride
protectedinherited
Initial value:
{this, "EnableOverride", false,
"Stops processing combinations as soon as a valid combination is found in OR mode, or as soon as an invalid combination is found in AND mode. This is to save CPU."}

Definition at line 115 of file ComboHypoToolBase.h.

◆ m_isLegA_MET_vec

Gaudi::Property<std::vector< bool > > TrigComboHypoTool::m_isLegA_MET_vec {this, "IsLegA_METVec", {false}, "Array with the first Leg MET identifier"}
private

Definition at line 110 of file TrigComboHypoTool.h.

◆ m_isLegB_MET_vec

Gaudi::Property<std::vector< bool > > TrigComboHypoTool::m_isLegB_MET_vec {this, "IsLegB_METVec", {false}, "Array with the second Leg MET identifier"}
private

Definition at line 111 of file TrigComboHypoTool.h.

◆ m_legA_vec

Gaudi::Property<std::vector<uint32_t> > TrigComboHypoTool::m_legA_vec {this, "LegAVec" , {0}, "Array with the first Leg ID"}
private

Definition at line 108 of file TrigComboHypoTool.h.

◆ m_legB_vec

Gaudi::Property<std::vector<uint32_t> > TrigComboHypoTool::m_legB_vec {this, "LegBVec" , {0}, "Array with the second Leg ID"}
private

Definition at line 109 of file TrigComboHypoTool.h.

◆ m_legDecisionIds

std::vector<HLT::Identifier> ComboHypoToolBase::m_legDecisionIds
privateinherited

The DecisionIDs of the individual legs, derived from both m_decisionId and m_legMultiplicities.

Definition at line 123 of file ComboHypoToolBase.h.

◆ m_legMultiplicities

std::vector<int> ComboHypoToolBase::m_legMultiplicities
privateinherited

The number of legs, and the required multiplicity on each leg.

Definition at line 124 of file ComboHypoToolBase.h.

◆ m_modeOR

Gaudi::Property<bool> ComboHypoToolBase::m_modeOR
protectedinherited
Initial value:
{this, "ModeOR", true,
"Accepts based on the logical OR over all calls to executeAlg. If this flag is set to false then the logical AND is required instead."}

Definition at line 112 of file ComboHypoToolBase.h.

◆ m_monTool_vec

ToolHandleArray<GenericMonitoringTool> TrigComboHypoTool::m_monTool_vec {this, "MonTools", {}, "Monitoring tools" }
private

Definition at line 119 of file TrigComboHypoTool.h.

◆ m_skipLegCheck

Gaudi::Property<bool> TrigComboHypoTool::m_skipLegCheck {this, "SkipLegCheck" , {false}, "Ignore leg IDs for chains with only one leg"}
private

Definition at line 112 of file TrigComboHypoTool.h.

◆ m_useMax_vec

Gaudi::Property<std::vector<bool> > TrigComboHypoTool::m_useMax_vec {this, "UseMaxVec" , {false}, "Array with the apply_max_cut setting"}
private

Definition at line 105 of file TrigComboHypoTool.h.

◆ m_useMin_vec

Gaudi::Property<std::vector<bool> > TrigComboHypoTool::m_useMin_vec {this, "UseMinVec" , {false}, "Array with the apply_min_cut setting"}
private

Definition at line 104 of file TrigComboHypoTool.h.

◆ m_varInfo_vec

std::vector<VarInfo> TrigComboHypoTool::m_varInfo_vec
private

Internal variables for more efficient config lookup.

Definition at line 122 of file TrigComboHypoTool.h.

◆ m_varMax_vec

Gaudi::Property<std::vector<float> > TrigComboHypoTool::m_varMax_vec {this, "UpperCutVec", {FLOATDEFAULT}, "Array with the upper cut for legs pair"}
private

Definition at line 116 of file TrigComboHypoTool.h.

◆ m_varMin_vec

Gaudi::Property<std::vector<float> > TrigComboHypoTool::m_varMin_vec {this, "LowerCutVec", {FLOATDEFAULT}, "Array with the lower cut for legs pair"}
private

Definition at line 115 of file TrigComboHypoTool.h.

◆ m_varTag_vec

Gaudi::Property<std::vector<std::string> > TrigComboHypoTool::m_varTag_vec {this, "Variables" , {""}, "Variables to cut on"}
private

Gaudi configuration hooks.

Definition at line 103 of file TrigComboHypoTool.h.


The documentation for this class was generated from the following files:
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
TrigComboHypoTool::m_legB_vec
Gaudi::Property< std::vector< uint32_t > > m_legB_vec
Definition: TrigComboHypoTool.h:109
TrigCompositeUtils::featureString
const std::string & featureString()
Definition: TrigCompositeUtils.h:421
WriteBchToCrest.update
update
Definition: WriteBchToCrest.py:66
beamspotnt.var
var
Definition: bin/beamspotnt.py:1393
TrigComboHypoTool::m_monTool_vec
ToolHandleArray< GenericMonitoringTool > m_monTool_vec
Definition: TrigComboHypoTool.h:119
TrigDefs::Group
Group
Properties of a chain group.
Definition: GroupProperties.h:13
TrigComboHypoTool::m_varMax_vec
Gaudi::Property< std::vector< float > > m_varMax_vec
Definition: TrigComboHypoTool.h:116
ComboHypoToolBase::printDebugInformation
void printDebugInformation(const Combo::LegDecisionsMap &passingLegs) const
Print the output of the tool, after having removed failed Decision Objects.
Definition: ComboHypoToolBase.cxx:264
TrigCompositeUtils::DecisionID
unsigned int DecisionID
Definition: TrigComposite_v1.h:27
ParticleGun_SamplingFraction.eta2
eta2
Definition: ParticleGun_SamplingFraction.py:96
ComboHypoToolBase::eraseFromLegDecisionsMap
void eraseFromLegDecisionsMap(Combo::LegDecisionsMap &passingLegs) const
For when the tool rejects all combinations.
Definition: ComboHypoToolBase.cxx:253
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:67
find
std::string find(const std::string &s)
return a remapped string
Definition: hcg.cxx:138
HLT::Identifier::numeric
TrigCompositeUtils::DecisionID numeric() const
numeric ID
Definition: TrigCompositeUtils/TrigCompositeUtils/HLTIdentifier.h:41
TrigComboHypoTool::UNDEF
@ UNDEF
Definition: TrigComboHypoTool.h:37
TrigComboHypoTool::fillPairKinematics
bool fillPairKinematics(std::pair< KineInfo, KineInfo > &kinepair, const Combination &combination, const VarInfo &varInfo) const
Definition: TrigComboHypoTool.cxx:445
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
hist_file_dump.d
d
Definition: hist_file_dump.py:142
ComboHypoToolBase::updateLegDecisionsMap
void updateLegDecisionsMap(const std::vector< std::vector< Combo::LegDecision >> &passing_comb, Combo::LegDecisionsMap &passingLegs) const
For when the tool accepts some/all combinations.
Definition: ComboHypoToolBase.cxx:216
invGeV
constexpr float invGeV
Definition: TrigComboHypoTool.cxx:21
TRTCalib_cfilter.p1
p1
Definition: TRTCalib_cfilter.py:130
HLT::NestedUniqueCombinationGenerator
An ensemble of UniqueCombinationGenerator API description.
Definition: TrigCompositeUtils/TrigCompositeUtils/Combinators.h:72
TrigComboHypoTool::MT
@ MT
Definition: TrigComboHypoTool.h:37
python.TrigCompositeUtils.isLegId
def isLegId(chainName)
Definition: DecisionHandling/python/TrigCompositeUtils.py:18
skel.it
it
Definition: skel.GENtoEVGEN.py:407
TrigComboHypoTool::DPHI
@ DPHI
Definition: TrigComboHypoTool.h:37
TrigComboHypoTool::m_isLegB_MET_vec
Gaudi::Property< std::vector< bool > > m_isLegB_MET_vec
Definition: TrigComboHypoTool.h:111
test_pyathena.pt
pt
Definition: test_pyathena.py:11
xAOD::P4Helpers::deltaPhi
double deltaPhi(double phiA, double phiB)
delta Phi in range [-pi,pi[
Definition: xAODP4Helpers.h:69
athena.value
value
Definition: athena.py:124
xAOD::eta1
setEt setPhi setE277 setWeta2 eta1
Definition: TrigEMCluster_v1.cxx:41
TrigComboHypoTool::m_varTag_vec
Gaudi::Property< std::vector< std::string > > m_varTag_vec
Gaudi configuration hooks.
Definition: TrigComboHypoTool.h:103
ComboHypoToolBase::m_combinationsThresholdBreak
Gaudi::Property< size_t > m_combinationsThresholdBreak
Definition: ComboHypoToolBase.h:109
drawFromPickle.cos
cos
Definition: drawFromPickle.py:36
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
python.CaloAddPedShiftConfig.type
type
Definition: CaloAddPedShiftConfig.py:42
ComboHypoToolBase::m_modeOR
Gaudi::Property< bool > m_modeOR
Definition: ComboHypoToolBase.h:112
XMLtoHeader.count
count
Definition: XMLtoHeader.py:84
TrigComboHypoTool::INVM
@ INVM
Definition: TrigComboHypoTool.h:37
python.Bindings.values
values
Definition: Control/AthenaPython/python/Bindings.py:808
ComboHypoToolBase::decisionId
virtual HLT::Identifier decisionId() const
retrieves this ComboHypoTool's chain's decision ID
Definition: ComboHypoToolBase.h:41
LVL1::MT
LVL1::L1CaloFcal23Cells2RxMappingTool::mapType MT
Definition: L1CaloFcal23Cells2RxMappingTool.cxx:14
ComboHypoToolBase::m_legDecisionIds
std::vector< HLT::Identifier > m_legDecisionIds
The DecisionIDs of the individual legs, derived from both m_decisionId and m_legMultiplicities.
Definition: ComboHypoToolBase.h:123
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
TRTCalib_cfilter.p2
p2
Definition: TRTCalib_cfilter.py:131
ComboHypoToolBase::m_enableOverride
Gaudi::Property< bool > m_enableOverride
Definition: ComboHypoToolBase.h:115
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
TrigComboHypoTool::fillKineInfo
bool fillKineInfo(KineInfo &kinematics, Combo::LegDecision decision, bool isMET) const
Definition: TrigComboHypoTool.cxx:470
TrigComboHypoTool::fillLegDecisions_sameLeg
bool fillLegDecisions_sameLeg(std::pair< Combo::LegDecision, Combo::LegDecision > &legpair, const Combination &combination, uint32_t leg) const
Helpers to extract kinematics from the specified legs of the chain Specialised for two cases – exactl...
Definition: TrigComboHypoTool.cxx:392
lumiFormat.i
int i
Definition: lumiFormat.py:85
ComboHypoToolBase::legMultiplicity
const std::vector< int > & legMultiplicity() const
Gets the number of legs and the multiplicity required on each leg.
Definition: ComboHypoToolBase.h:54
xAOD::P4Helpers::deltaR
double deltaR(double rapidity1, double phi1, double rapidity2, double phi2)
from bare bare rapidity,phi
Definition: xAODP4Helpers.h:150
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
ComboHypoToolBase::m_combinationsThresholdWarn
Gaudi::Property< size_t > m_combinationsThresholdWarn
Definition: ComboHypoToolBase.h:106
calibdata.exception
exception
Definition: calibdata.py:495
TrigComboHypoTool::m_isLegA_MET_vec
Gaudi::Property< std::vector< bool > > m_isLegA_MET_vec
Definition: TrigComboHypoTool.h:110
test_pyathena.parent
parent
Definition: test_pyathena.py:15
TrigComboHypoTool::FLOATDEFAULT
static constexpr float FLOATDEFAULT
Definition: TrigComboHypoTool.h:48
HLT::NestedUniqueCombinationGenerator::add
void add(const UniqueCombinationGenerator &gen)
Definition: Combinators.cxx:83
AnalysisUtils::copy_if
Out copy_if(In first, const In &last, Out res, const Pred &p)
Definition: IFilterUtils.h:30
compute_lumi.leg
leg
Definition: compute_lumi.py:95
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
EL
This module defines the arguments passed from the BATCH driver to the BATCH worker.
Definition: AsgComponentFactories.h:16
python.getProblemFolderFromLogs.el
dictionary el
Definition: getProblemFolderFromLogs.py:48
Combination
TrigComboHypoTool::executeAlgStep
bool executeAlgStep(const Combination &combination, const VarInfo &, std::vector< float > &values) const
Implementation of selection on individual variables.
Definition: TrigComboHypoTool.cxx:349
HLT::Identifier
Definition: TrigCompositeUtils/TrigCompositeUtils/HLTIdentifier.h:19
TrigComboHypoTool::DR
@ DR
Definition: TrigComboHypoTool.h:37
ComboHypoToolBase::m_decisionId
HLT::Identifier m_decisionId
The DecisionID of the chain, obtained from the Tool's name.
Definition: ComboHypoToolBase.h:122
TrigComboHypoTool::m_varInfo_vec
std::vector< VarInfo > m_varInfo_vec
Internal variables for more efficient config lookup.
Definition: TrigComboHypoTool.h:122
ComboHypoToolBase::selectLegs
StatusCode selectLegs(const Combo::LegDecisionsMap &IDCombMap, std::vector< std::vector< Combo::LegDecision >> &leg_decisions) const
Creates the per-leg vectors of Decision objects starting from the initial LegDecision map,...
Definition: ComboHypoToolBase.cxx:172
TrigComboHypoTool::compute
float compute(const std::pair< KineInfo, KineInfo > &kinepair, ComboHypoVars var) const
Computation of the variables from the specified kinematics.
Definition: TrigComboHypoTool.cxx:498
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
TrigComboHypoTool::m_useMax_vec
Gaudi::Property< std::vector< bool > > m_useMax_vec
Definition: TrigComboHypoTool.h:105
TrigCompositeUtils::createLegName
HLT::Identifier createLegName(const HLT::Identifier &chainIdentifier, size_t counter)
Generate the HLT::Identifier which corresponds to a specific leg of a given chain.
Definition: TrigCompositeUtilsRoot.cxx:166
ComboHypoToolBase::ComboHypoToolBase
ComboHypoToolBase(const std::string &type, const std::string &name, const IInterface *parent)
Definition: ComboHypoToolBase.cxx:10
TrigCompositeUtils::getIndexFromLeg
int32_t getIndexFromLeg(const HLT::Identifier &legIdentifier)
Extract the numeric index of a leg identifier.
Definition: TrigCompositeUtilsRoot.cxx:191
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
TrigComboHypoTool::m_varMin_vec
Gaudi::Property< std::vector< float > > m_varMin_vec
Definition: TrigComboHypoTool.h:115
TrigComboHypoTool::fillLegDecisions_diffLeg
bool fillLegDecisions_diffLeg(std::pair< Combo::LegDecision, Combo::LegDecision > &legpair, const Combination &combination, uint32_t legA, uint32_t legB) const
Definition: TrigComboHypoTool.cxx:417
DEBUG
#define DEBUG
Definition: page_access.h:11
HLT::Identifier::name
std::string name() const
reports human redable name
Definition: HLTIdentifier.cxx:12
convertTimingResiduals.offset
offset
Definition: convertTimingResiduals.py:71
TrigComboHypoTool::m_skipLegCheck
Gaudi::Property< bool > m_skipLegCheck
Definition: TrigComboHypoTool.h:112
TrigCompositeUtils::getIDFromLeg
HLT::Identifier getIDFromLeg(const HLT::Identifier &legIdentifier)
Generate the HLT::Identifier which corresponds to the chain name from the leg name.
Definition: TrigCompositeUtilsRoot.cxx:180
calibdata.copy
bool copy
Definition: calibdata.py:26
ComboHypoToolBase::m_legMultiplicities
std::vector< int > m_legMultiplicities
The number of legs, and the required multiplicity on each leg.
Definition: ComboHypoToolBase.h:124
python.Constants.VERBOSE
int VERBOSE
Definition: Control/AthenaCommon/python/Constants.py:13
VarMap
const std::map< std::string, TrigComboHypoTool::ComboHypoVars > VarMap
Definition: TrigComboHypoTool.cxx:26
Monitored::Scalar
Declare a monitored scalar variable.
Definition: MonitoredScalar.h:34
testLegId
bool testLegId(const Combo::LegDecision &d, uint32_t targetleg)
Test function to compare decision ID with the legs to be used in var computation.
Definition: TrigComboHypoTool.cxx:385
TrigComboHypoTool::m_useMin_vec
Gaudi::Property< std::vector< bool > > m_useMin_vec
Definition: TrigComboHypoTool.h:104
python.ParticleTypeUtil.info
def info
Definition: ParticleTypeUtil.py:87
TrigComboHypoTool::DETA
@ DETA
Definition: TrigComboHypoTool.h:37
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7
Combo::LegDecision
std::pair< TrigCompositeUtils::DecisionID, ElementLink< TrigCompositeUtils::DecisionContainer > > LegDecision
LegDecision keeps a given Decision Object associated with a specific leg when being used inside a sin...
Definition: IComboHypoTool.h:33
PlotCalibFromCool.vals
vals
Definition: PlotCalibFromCool.py:474
TrigComboHypoTool::m_legA_vec
Gaudi::Property< std::vector< uint32_t > > m_legA_vec
Definition: TrigComboHypoTool.h:108