|
ATLAS Offline Software
|
#include <TrigMultiTrkComboHypoTool.h>
|
Gaudi::Property< unsigned int > | m_nTrk {this, "nTrk", 2, "number of tracks in the vertex"} |
|
Gaudi::Property< std::vector< double > > | m_trkPt {this, "trackPtThresholds", {-1., 3000.}, "minimum track transverse momenta (as they appear in TrigBphys)"} |
|
Gaudi::Property< int > | m_totalCharge {this, "totalCharge", 0, "magnitude of the total charge to accept, negative is none" } |
|
Gaudi::Property< std::pair< double, double > > | m_massRange {this, "massRange", {-99., -9.}, "range for the fitted mass, no selection applied if negative"} |
|
Gaudi::Property< float > | m_chi2 {this, "chi2", -99. , "Chi2 cut for vertex (0 < chi2 < cut), no selection applied if negative" } |
|
Gaudi::Property< bool > | m_acceptAll {this, "AcceptAll", false, "if AcceptAll flag is set to true, no selection will be applied for xAOD::TrigBphys object"} |
|
Gaudi::Property< float > | m_LxyCut {this, "LxyCut", -99., "Applies an Lxy Cut if set >= 0"} |
|
Gaudi::Property< float > | m_sigmaLxyCut {this, "sigmaLxyCut", -99., "Applies an Lxy/LxyError Cut if set >= 0"} |
|
Gaudi::Property< float > | m_deltaRMax |
|
Gaudi::Property< float > | m_deltaRMin |
|
Gaudi::Property< bool > | m_isCombinedChain {this, "isCombinedChain", false, "true for chains with different signatures, e.g. HLT_e9_mu6"} |
|
Gaudi::Property< bool > | m_isMergedElectronChain {this, "isMergedElectronChain", false, "true for close-by electrons, e.g. HLT_e5_lhvloose_L1BPH-0DR3-EM7J15"} |
|
Gaudi::Property< bool > | m_isMuonTrkPEB {this, "isMuonTrkPEB", false, "chains like HLT_mu6_bJpsimutrk_MuonTrkPEB_L1MU5VF"} |
|
Gaudi::Property< std::vector< unsigned int > > | m_legMultiplicities {this, "legMultiplicities", {2}, "taken from dict[chainMultiplicities]"} |
|
ToolHandle< GenericMonitoringTool > | m_monTool {this, "MonTool", "", "Monitoring tool" } |
|
std::vector< TrigCompositeUtils::DecisionID > | m_legDecisionIDs |
|
HLT::Identifier | m_decisionId |
| The DecisionID of the chain, obtained from the Tool's name. More...
|
|
std::vector< HLT::Identifier > | m_legDecisionIds |
| The DecisionIDs of the individual legs, derived from both m_decisionId and m_legMultiplicities. More...
|
|
Definition at line 34 of file TrigMultiTrkComboHypoTool.h.
◆ TrigMultiTrkComboHypoTool()
TrigMultiTrkComboHypoTool::TrigMultiTrkComboHypoTool |
( |
const std::string & |
type, |
|
|
const std::string & |
name, |
|
|
const IInterface * |
parent |
|
) |
| |
◆ checkPreviousDecisionIDs()
Definition at line 146 of file TrigMultiTrkComboHypoTool.cxx.
163 ATH_MSG_DEBUG(
"Trigger with symmetric legs didn't pass previous decision" );
167 ATH_MSG_DEBUG(
"Trigger with symmetric legs passed previous decision" );
173 std::iota(
a.begin(),
a.end(), 0);
182 msg() <<
"combination #" <<
i++ <<
": { ";
187 }
while (std::next_permutation(
a.begin(),
a.end()));
188 ATH_MSG_DEBUG(
"Trigger with asymmetric legs " << (
result ?
"passed" :
"didn't pass") <<
" previous decision" );
◆ decide()
retrieves the decisions associated to this decId, make their combinations and apply the algorithm
- Parameters
-
[in] | LegDecisionsMap | that lists all the passing decisions, to be updated by the tool depending on the outcome of executeAlg |
[in] | Event | Context, currently unused |
Reimplemented in DisplacedJetRankComboHypoTool.
Definition at line 48 of file ComboHypoToolBase.cxx.
50 ATH_MSG_ERROR(
"ComboHypoTool for " <<
m_decisionId <<
" has not been properly configured. setLegMultiplicity should be called by the parent alg in initalize");
51 return StatusCode::FAILURE;
55 if (passingLegs.size() == 0) {
56 return StatusCode::SUCCESS;
59 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.");
62 std::vector<std::vector<Combo::LegDecision>> legDecisions;
67 if (legDecisions.at(legIndex).size() <
static_cast<size_t>(
m_legMultiplicities.at(legIndex))) {
69 ATH_MSG_DEBUG(
"This ComboHypoTool cannot run in this event, this chain **REJECTS** this event.");
72 return StatusCode::SUCCESS;
80 const size_t out_of = legDecisions.at(legIndex).size();
81 nucg.
add({out_of, choose_any});
82 ATH_MSG_DEBUG(
"For leg " << legIndex <<
" we will be choosing any " << choose_any <<
" Decision Objects out of " << out_of);
85 std::vector<std::vector<Combo::LegDecision>> passingCombinations;
87 size_t warnings = 0, iterations = 0;
90 const std::vector<size_t> combination = nucg();
92 std::vector<Combo::LegDecision> combinationToCheck;
94 size_t location_in_combination = 0;
99 const size_t objectIndex = combination.at(location_in_combination++);
100 combinationToCheck.push_back( legDecisions.at(legIndex).at(objectIndex) );
108 ATH_MSG_DEBUG(
"Combination " << (iterations - 1) <<
" decided to be passing");
109 passingCombinations.push_back(combinationToCheck);
120 return StatusCode::FAILURE;
124 ATH_MSG_WARNING(
"Have so far processed " << iterations <<
" combinations for " <<
m_decisionId <<
" in this event, " << passingCombinations.size() <<
" passing.");
127 ATH_MSG_WARNING(
"Too many combinations! Breaking the loop at this point.");
137 ATH_MSG_DEBUG(
"Passing " << passingCombinations.size() <<
" combinations out of " << iterations <<
", "
138 <<
m_decisionId << (passingCombinations.size() ?
" **ACCEPTS**" :
" **REJECTS**") <<
" this event based on OR logic.");
141 ATH_MSG_DEBUG(
"Note: stopped after the first successful combination due to the EnableOverride flag.");
146 const bool passAll = (passingCombinations.size() == iterations);
148 ATH_MSG_DEBUG(
"Passing " << passingCombinations.size() <<
" combinations out of " << iterations <<
", "
149 <<
m_decisionId << (passAll ?
" **ACCEPTS**" :
" **REJECTS**") <<
" this event based on AND logic.");
152 ATH_MSG_DEBUG(
"Note: stopped after the first failed combination due to the EnableOverride flag.");
156 passingCombinations.clear();
161 if (not passingCombinations.empty()) {
168 return StatusCode::SUCCESS;
◆ decideOnSingleObject()
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 from ComboHypoToolBase.
Definition at line 118 of file TrigMultiTrkComboHypoTool.cxx.
126 return StatusCode::SUCCESS;
130 return StatusCode::SUCCESS;
142 return StatusCode::SUCCESS;
◆ decisionId()
◆ eraseFromLegDecisionsMap()
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.
254 for (
auto&
it : passingLegs) {
257 const size_t nDecisionObjects =
it.second.size();
◆ executeAlg()
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 from ComboHypoToolBase.
Definition at line 239 of file TrigMultiTrkComboHypoTool.cxx.
240 ATH_MSG_ERROR(
"executeAlg() is not supported by TrigMultiTrkComboHypoTool" );
◆ initialize()
StatusCode TrigMultiTrkComboHypoTool::initialize |
( |
| ) |
|
|
overridevirtual |
Definition at line 31 of file TrigMultiTrkComboHypoTool.cxx.
38 " " << (
m_totalCharge < 0 ?
"total charge cut is disabled" :
"total charge cut: only right charge combinations") <<
endmsg <<
68 ATH_MSG_DEBUG(
"No GenericMonitoringTool configured: no monitoring histograms will be available" );
71 return StatusCode::SUCCESS;
◆ isInMassRange()
bool TrigMultiTrkComboHypoTool::isInMassRange |
( |
double |
mass | ) |
const |
|
private |
◆ legDecisionId()
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.
◆ legDecisionIds()
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.
◆ 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.
◆ passed()
Definition at line 75 of file TrigMultiTrkComboHypoTool.cxx.
89 auto mon =
Monitored::Group(
m_monTool, mon_totalCharge, mon_chi2, mon_mass, mon_pT_trk1, mon_pT_trk2, mon_Lxy, mon_D0_trk1, mon_D0_trk2, mon_Eta1, mon_Eta2);
95 (m_LxyCut < 0. || trigBphys->lxy() >
m_LxyCut) &&
99 mon_Lxy = trigBphys->
lxy();
101 mon_chi2 = trigBphys->
fitchi2();
102 mon_mass = 0.001 * trigBphys->
mass();
◆ passedChargeCut()
bool TrigMultiTrkComboHypoTool::passedChargeCut |
( |
int |
charge | ) |
const |
|
inlineprivate |
◆ passedChi2Cut()
bool TrigMultiTrkComboHypoTool::passedChi2Cut |
( |
int |
chi2 | ) |
const |
|
inlineprivate |
Definition at line 56 of file TrigMultiTrkComboHypoTool.h.
56 {
this,
"AcceptAll",
false,
"if AcceptAll flag is set to true, no selection will be applied for xAOD::TrigBphys object"};
◆ passedDeltaRcut()
◆ passedPtCut()
◆ printDebugInformation()
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.
266 for (
const auto& [
id, ELV] : passingLegs) {
270 for (
const auto&
EL : ELV) {
275 return StatusCode::SUCCESS;
◆ selectLegs()
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.
189 std::vector<Combo::LegDecision> decisionObjectsOnLeg;
192 const Combo::LegDecisionsMap::const_iterator
it = IDCombMap.find(legIdentifier.
numeric());
194 if (
it != IDCombMap.end()) {
196 decisionObjectsOnLeg.emplace_back(legIdentifier,
el);
200 legDecisions.push_back(std::move(decisionObjectsOnLeg));
206 for (
const auto&
leg : legDecisions) {
208 for (
const auto& dEL :
leg) {
213 return StatusCode::SUCCESS;
◆ setLegMultiplicity()
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.
18 const Combo::MultiplicityReqMap::const_iterator
it = multiplicityRequiredMap.find(nameOfToolsChain);
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;
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;
35 return StatusCode::FAILURE;
45 return StatusCode::SUCCESS;
◆ totalCharge()
◆ updateLegDecisionsMap()
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.
219 for (
const std::vector<Combo::LegDecision>& comb : passingComb) {
221 for (
const auto& [
id,
EL] : comb) {
228 for (
auto&
it : passingLegs) {
233 std::vector<ElementLink<DecisionContainer>> updatedDecisionObjectsOnLeg;
236 for (
const std::vector<Combo::LegDecision>& comb : passingComb) {
237 for (
const auto& [
id,
EL] : comb) {
239 if (
id == legId and
std::find(updatedDecisionObjectsOnLeg.begin(), updatedDecisionObjectsOnLeg.end(),
EL) == updatedDecisionObjectsOnLeg.end()) {
241 updatedDecisionObjectsOnLeg.push_back(
EL);
248 it.second = updatedDecisionObjectsOnLeg;
◆ m_acceptAll
Gaudi::Property<bool> TrigMultiTrkComboHypoTool::m_acceptAll {this, "AcceptAll", false, "if AcceptAll flag is set to true, no selection will be applied for xAOD::TrigBphys object"} |
|
private |
◆ m_chi2
Gaudi::Property<float> TrigMultiTrkComboHypoTool::m_chi2 {this, "chi2", -99. , "Chi2 cut for vertex (0 < chi2 < cut), no selection applied if negative" } |
|
private |
◆ 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
◆ m_deltaRMax
Gaudi::Property<float> TrigMultiTrkComboHypoTool::m_deltaRMax |
|
private |
◆ m_deltaRMin
Gaudi::Property<float> TrigMultiTrkComboHypoTool::m_deltaRMin |
|
private |
Initial value:{this, "deltaRMin", std::numeric_limits<float>::lowest(),
"maximum deltaR between tracks in a candidate"}
Definition at line 69 of file TrigMultiTrkComboHypoTool.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_isCombinedChain
Gaudi::Property<bool> TrigMultiTrkComboHypoTool::m_isCombinedChain {this, "isCombinedChain", false, "true for chains with different signatures, e.g. HLT_e9_mu6"} |
|
private |
◆ m_isMergedElectronChain
Gaudi::Property<bool> TrigMultiTrkComboHypoTool::m_isMergedElectronChain {this, "isMergedElectronChain", false, "true for close-by electrons, e.g. HLT_e5_lhvloose_L1BPH-0DR3-EM7J15"} |
|
private |
◆ m_isMuonTrkPEB
Gaudi::Property<bool> TrigMultiTrkComboHypoTool::m_isMuonTrkPEB {this, "isMuonTrkPEB", false, "chains like HLT_mu6_bJpsimutrk_MuonTrkPEB_L1MU5VF"} |
|
private |
◆ m_legDecisionIDs
◆ m_legDecisionIds
The DecisionIDs of the individual legs, derived from both m_decisionId and m_legMultiplicities.
Definition at line 123 of file ComboHypoToolBase.h.
◆ m_legMultiplicities
Gaudi::Property<std::vector<unsigned int> > TrigMultiTrkComboHypoTool::m_legMultiplicities {this, "legMultiplicities", {2}, "taken from dict[chainMultiplicities]"} |
|
private |
◆ m_LxyCut
Gaudi::Property<float> TrigMultiTrkComboHypoTool::m_LxyCut {this, "LxyCut", -99., "Applies an Lxy Cut if set >= 0"} |
|
private |
◆ m_massRange
Gaudi::Property<std::pair<double, double> > TrigMultiTrkComboHypoTool::m_massRange {this, "massRange", {-99., -9.}, "range for the fitted mass, no selection applied if negative"} |
|
private |
◆ 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
◆ m_nTrk
Gaudi::Property<unsigned int> TrigMultiTrkComboHypoTool::m_nTrk {this, "nTrk", 2, "number of tracks in the vertex"} |
|
private |
◆ m_sigmaLxyCut
Gaudi::Property<float> TrigMultiTrkComboHypoTool::m_sigmaLxyCut {this, "sigmaLxyCut", -99., "Applies an Lxy/LxyError Cut if set >= 0"} |
|
private |
◆ m_totalCharge
Gaudi::Property<int> TrigMultiTrkComboHypoTool::m_totalCharge {this, "totalCharge", 0, "magnitude of the total charge to accept, negative is none" } |
|
private |
◆ m_trkPt
Gaudi::Property<std::vector<double> > TrigMultiTrkComboHypoTool::m_trkPt {this, "trackPtThresholds", {-1., 3000.}, "minimum track transverse momenta (as they appear in TrigBphys)"} |
|
private |
The documentation for this class was generated from the following files:
virtual double pt() const override final
The transverse momentum ( ) of the particle.
Group
Properties of a chain group.
bool passed(DecisionID id, const DecisionIDContainer &idSet)
checks if required decision ID is in the set of IDs in the container
std::string find(const std::string &s)
return a remapped string
TrigCompositeUtils::DecisionID numeric() const
numeric ID
float charge() const
Returns the charge.
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
void addDecisionID(DecisionID id, Decision *d)
Appends the decision (given as ID) to the decision object.
An ensemble of UniqueCombinationGenerator API description.
float mass() const
accessor method: mass
#define ATH_MSG_VERBOSE(x)
float d0() const
Returns the parameter.
float lxyError() const
accessor method: lxy uncertainty
void add(const UniqueCombinationGenerator &gen)
This module defines the arguments passed from the BATCH driver to the BATCH worker.
float fitchi2() const
accessor method: chi2 from vertex fit
GenVecFourMom_t genvecP4() const
The full 4-momentum of the particle : GenVector form.
const xAOD::TrackParticle * trackParticle(size_t i) const
Get the Nth track's pointer.
ElementLink implementation for ROOT usage.
const std::string & featureString()
double charge(const T &p)
HLT::Identifier createLegName(const HLT::Identifier &chainIdentifier, size_t counter)
Generate the HLT::Identifier which corresponds to a specific leg of a given chain.
#define ATH_MSG_WARNING(x)
std::string name() const
reports human redable name if it is enabled or, empty string
HLT::Identifier getIDFromLeg(const HLT::Identifier &legIdentifier)
Generate the HLT::Identifier which corresponds to the chain name from the leg name.
Declare a monitored scalar variable.
float lxy() const
accessor method: lxy
size_t nTrackParticles() const
Number of tracks used to make particle.