Loading [MathJax]/extensions/tex2jax.js
 |
ATLAS Offline Software
|
Go to the documentation of this file.
13 std::tuple<HLT::class_id_type, xAOD::Type::ObjectType, std::string>;
15 template <std::
size_t FROM, std::
size_t TO>
20 static const std::vector<CLIDTuple_t> CLIDVector {
27 auto itr = std::find_if(CLIDVector.begin(), CLIDVector.end(),
28 [from] (
const CLIDTuple_t& tup) {
29 return std::get<FROM>(tup) == from;
31 if (itr == CLIDVector.end() )
34 to = std::get<TO>(*itr);
40 return CLIDLookUp<0, 1>(
type, clid);
44 return CLIDLookUp<1, 0>(clid,
type);
48 return CLIDLookUp<0, 2>(
name, clid);
58 "The trigger decision tool to use.");
60 "Only spit a warning on a navigation error, don't cause a job failure.");
70 return StatusCode::SUCCESS;
74 std::vector<std::vector<const xAOD::IParticle*>>&
combinations,
75 const std::string&
chain,
86 <<
" is empty! This means that no matching chains were found!");
87 return StatusCode::FAILURE;
89 unsigned int condition = TrigDefs::Physics;
91 condition |= TrigDefs::allowResurrectedDecision;
94 return StatusCode::SUCCESS;
103 std::vector<const xAOD::IParticle*> currentCombination;
104 bool navFailure =
false;
109 return StatusCode::FAILURE;
117 <<
" due to navigation failure");
121 return StatusCode::SUCCESS;
125 std::vector<const xAOD::IParticle*>& combination,
127 bool& navFailure)
const
134 if (!CLIDToObjectType(
type, feature.getCLID() ) )
141 if (egType == xAOD::Type::Other) {
147 return StatusCode::SUCCESS;
151 return StatusCode::FAILURE;
156 ObjectTypeToCLID(clid, egType);
161 m_tdt->ExperimentalAndExpertMethods().getNavigation();
165 std::ostringstream
os;
166 os <<
"Unable to retrieve feature of type " << egType
171 return StatusCode::SUCCESS;
175 return StatusCode::FAILURE;
180 return StatusCode::SUCCESS;
185 else if (egType !=
type) {
195 "'final' particles attached to it! This breaks this tool's asumptions!";
199 return StatusCode::SUCCESS;
203 return StatusCode::FAILURE;
208 return StatusCode::SUCCESS;
214 combination.push_back(
part);
215 return StatusCode::SUCCESS;
223 return StatusCode::SUCCESS;
231 if (
teName.find(
"etcut") != std::string::npos &&
232 teName.find(
"trkcut") == std::string::npos)
234 else if (
teName.starts_with(
"EF_e"))
236 else if (
teName.starts_with(
"EF_g"))
239 return xAOD::Type::Other;
246 bool& navFailure)
const
249 std::string containerType;
250 if (!CLIDToContainerType(containerType, feature.
getCLID() ) ) {
254 return StatusCode::FAILURE;
259 m_tdt->ExperimentalAndExpertMethods().getNavigation();
263 auto typelessHolder = navigation->
getHolder(feature);
265 if (!typelessHolder) {
266 std::string
message =
"Typeless holder for feature not present!";
270 return StatusCode::SUCCESS;
274 return StatusCode::FAILURE;
280 "HLT", containerType, typelessHolder->label() );
282 if (!
evtStore()->contains<xAOD::IParticleContainer>(
key) ) {
283 std::string
message =
"Store does not contain " +
key +
"!";
287 return StatusCode::SUCCESS;
291 return StatusCode::FAILURE;
296 if (cont->
size() <
idx.objectsEnd() ) {
297 std::ostringstream
os;
298 os <<
"Featured object end " <<
idx.objectsEnd()
299 <<
" is *after* the end of container " <<
key;
303 return StatusCode::SUCCESS;
307 return StatusCode::FAILURE;
310 std::vector<const xAOD::IParticle*> particleFeatures;
311 particleFeatures.reserve(
idx.objectsEnd() -
idx.objectsBegin() );
314 std::advance(
begin,
idx.objectsBegin() );
315 std::advance(
end,
idx.objectsEnd() );
316 particleFeatures.insert(particleFeatures.end(),
begin,
end);
319 std::ostringstream
os;
320 switch (particleFeatures.size() ) {
322 os <<
"No particles retrieved from feature "
328 return StatusCode::SUCCESS;
332 return StatusCode::FAILURE;
336 particle = particleFeatures.at(0);
344 particle = *(std::max_element(
345 particleFeatures.begin(), particleFeatures.end(),
347 { return lhs->pt() < rhs->pt(); }) );
349 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.
Electron_v1 Electron
Definition of the current "egamma version".
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.
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.