![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
ATLAS Offline Software
|
Go to the documentation of this file.
14 std::tuple<HLT::class_id_type, xAOD::Type::ObjectType, std::string>;
16 template <std::
size_t FROM, std::
size_t TO>
21 static const std::vector<CLIDTuple_t> CLIDVector {
28 auto itr = std::find_if(CLIDVector.begin(), CLIDVector.end(),
29 [from] (
const CLIDTuple_t& tup) {
30 return std::get<FROM>(tup) == from;
32 if (itr == CLIDVector.end() )
35 to = std::get<TO>(*itr);
41 return CLIDLookUp<0, 1>(
type, clid);
45 return CLIDLookUp<1, 0>(clid,
type);
49 return CLIDLookUp<0, 2>(
name, clid);
59 "The trigger decision tool to use.");
61 "Only spit a warning on a navigation error, don't cause a job failure.");
71 return StatusCode::SUCCESS;
75 std::vector<std::vector<const xAOD::IParticle*>>&
combinations,
76 const std::string&
chain,
87 <<
" is empty! This means that no matching chains were found!");
88 return StatusCode::FAILURE;
90 unsigned int condition = TrigDefs::Physics;
92 condition |= TrigDefs::allowResurrectedDecision;
95 return StatusCode::SUCCESS;
104 std::vector<const xAOD::IParticle*> currentCombination;
105 bool navFailure =
false;
110 return StatusCode::FAILURE;
118 <<
" due to navigation failure");
122 return StatusCode::SUCCESS;
126 std::vector<const xAOD::IParticle*>& combination,
128 bool& navFailure)
const
135 if (!CLIDToObjectType(
type, feature.getCLID() ) )
142 if (egType == xAOD::Type::Other) {
148 return StatusCode::SUCCESS;
152 return StatusCode::FAILURE;
157 ObjectTypeToCLID(clid, egType);
162 m_tdt->ExperimentalAndExpertMethods().getNavigation();
166 std::ostringstream
os;
167 os <<
"Unable to retrieve feature of type " << egType
172 return StatusCode::SUCCESS;
176 return StatusCode::FAILURE;
181 return StatusCode::SUCCESS;
186 else if (egType !=
type) {
196 "'final' particles attached to it! This breaks this tool's asumptions!";
200 return StatusCode::SUCCESS;
204 return StatusCode::FAILURE;
209 return StatusCode::SUCCESS;
215 combination.push_back(
part);
216 return StatusCode::SUCCESS;
224 return StatusCode::SUCCESS;
232 if (
teName.find(
"etcut") != std::string::npos &&
233 teName.find(
"trkcut") == std::string::npos)
240 return xAOD::Type::Other;
247 bool& navFailure)
const
250 std::string containerType;
251 if (!CLIDToContainerType(containerType, feature.
getCLID() ) ) {
255 return StatusCode::FAILURE;
260 m_tdt->ExperimentalAndExpertMethods().getNavigation();
264 auto typelessHolder = navigation->
getHolder(feature);
266 if (!typelessHolder) {
267 std::string
message =
"Typeless holder for feature not present!";
271 return StatusCode::SUCCESS;
275 return StatusCode::FAILURE;
281 "HLT", containerType, typelessHolder->label() );
283 if (!
evtStore()->contains<xAOD::IParticleContainer>(
key) ) {
284 std::string
message =
"Store does not contain " +
key +
"!";
288 return StatusCode::SUCCESS;
292 return StatusCode::FAILURE;
297 if (cont->
size() <
idx.objectsEnd() ) {
298 std::ostringstream
os;
299 os <<
"Featured object end " <<
idx.objectsEnd()
300 <<
" is *after* the end of container " <<
key;
304 return StatusCode::SUCCESS;
308 return StatusCode::FAILURE;
311 std::vector<const xAOD::IParticle*> particleFeatures;
312 particleFeatures.reserve(
idx.objectsEnd() -
idx.objectsBegin() );
315 std::advance(
begin,
idx.objectsBegin() );
316 std::advance(
end,
idx.objectsEnd() );
317 particleFeatures.insert(particleFeatures.end(),
begin,
end);
320 std::ostringstream
os;
321 switch (particleFeatures.size() ) {
323 os <<
"No particles retrieved from feature "
329 return StatusCode::SUCCESS;
333 return StatusCode::FAILURE;
346 particleFeatures.begin(), particleFeatures.end(),
348 { return lhs->pt() < rhs->pt(); }) );
350 return StatusCode::SUCCESS;
def retrieve(aClass, aKey=None)
xAOD::Type::ObjectType getEGammaTEType(const HLT::TriggerElement *te) const
Get the type of particle that should be retrieved from this TE.
Helper class for conversion from/to int stored in TE and pair of ints used in Navigation Object point...
std::string getTEName(const HLT::TriggerElement &te)
converts TEid to TE name (this may not always work, it depends on the availability of config)
ToolHandle< Trig::TrigDecisionTool > m_tdt
The TrigDecisionTool that will be used to get the navigation.
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
Electron_v1 Electron
Definition of the current "egamma version".
bool starts_with(const char *s, const char *prefix)
Test whether one null-terminated byte string starts with another.
bool m_warnOnNavigationFailure
Be forgiving about the navigation not matching our expectations.
std::string label(class_id_type clid, const index_or_label_type &sti_or_label) const
The common trigger namespace for trigger analysis tools.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
class_id_type getCLID() const
Class ID of object.
IParticleRetrievalTool(const std::string &name)
Standard constructor.
std::string formatSGkey(const std::string &prefix, const std::string &containername, const std::string &label)
declaration of formatting function.
Class providing the definition of the 4-vector interface.
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.
const FeatureContainer features(unsigned int condition=TrigDefs::Physics) const
returns all features related to given chain group of HLT chains or L1 items Note: This does not yet w...
~IParticleRetrievalTool() override
Default destructor.
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
sub_index_type subTypeIndex() const
to get collection index
static const std::vector< TriggerElement * > & getDirectPredecessors(const TriggerElement *te)
returns list of direct predecessors (nodes seeding me)
::StatusCode StatusCode
StatusCode definition for legacy code.
TriggerElement is the basic ingreedient of the interface between HLT algorithms and the navigation It...
StatusCode retrieveFeatureParticle(const xAOD::IParticle *&particle, const HLT::TriggerElement::FeatureAccessHelper &feature, const HLT::TriggerElement *te, bool &navFailure) const
Retrieve an IParticle from a feature.
C++20-like starts_with/ends_with for strings.
bool isPassed(unsigned int condition=TrigDefs::Physics) const
tells if chain group passed
TriggerElement::FeatureAccessHelper getFeatureRecursively(const TriggerElement *startTE, class_id_type clid, const index_or_label_type &index_or_label, const TriggerElement *&sourceTE) const
recursive search for features the function is similar to the above butif th features is not found at ...
Photon_v1 Photon
Definition of the current "egamma version".
def combinations(items, n)
struct TBPatternUnitContext Muon
const ObjectIndex & getIndex() const
index in the external ojects array
the FeatureAccessHelper is a class used to keep track of features attached to this TE.
#define ATH_MSG_WARNING(x)
@ Tau
The object is a tau (jet)
const std::vector< FeatureAccessHelper > & getFeatureAccessHelpers() const
returns all features which ara attached to this TE
const std::vector< Trig::Combination > & getCombinations() const
gives back reference to combinations collected through append
std::vector< std::string > getListOfTriggers() const
size_type size() const noexcept
Returns the number of elements in the collection.
StatusCode retrieveParticles(std::vector< std::vector< const xAOD::IParticle * >> &combinations, const std::string &chain, bool rerun=false) const override
Retrieve the particles that caused this trigger to fire.
StatusCode initialize() override
Initialise the tool.
const BaseHolder * getHolder(const TriggerElement::FeatureAccessHelper &fea) const
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.