ATLAS Offline Software
GlobalTrigMatchSelector.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
3  */
4 
6 #include "TopEvent/Event.h"
7 #include "TopEvent/EventTools.h"
8 
9 #include "xAODBase/IParticle.h"
11 #include "xAODMuon/MuonContainer.h"
12 
13 #include <iostream>
14 #include <vector>
15 
16 
17 namespace top {
19  : m_globalTriggerSF("TrigGlobalEfficiencyCorrectionTool::TrigGlobal")
20  , m_globalTriggerSFLoose("TrigGlobalEfficiencyCorrectionTool::TrigGlobalLoose") {
21  }
22 
24  auto&& tool = (event.m_isLoose ? m_globalTriggerSFLoose : m_globalTriggerSF);
25  bool result = false;
26 
27  std::vector<xAOD::IParticle const*> particles;
28  particles.insert(particles.end(), event.m_electrons.begin(), event.m_electrons.end());
29  particles.insert(particles.end(), event.m_muons.begin(), event.m_muons.end());
30  particles.insert(particles.end(), event.m_photons.begin(), event.m_photons.end());
31  top::check(tool->checkTriggerMatching(result,
32  particles),
33  "TrigGlobalEfficiencyCorrectionTool::checkTriggerMatching failed");
34  return result;
35  }
36 
37  std::string GlobalTrigMatchSelector::name() const {
38  return "GTRIGMATCH";
39  }
40 }
get_generator_info.result
result
Definition: get_generator_info.py:21
top
TopConfig A simple configuration that is NOT a singleton.
Definition: AnalysisTrackingHelper.cxx:58
top::GlobalTrigMatchSelector::m_globalTriggerSF
ToolHandle< ITrigGlobalEfficiencyCorrectionTool > m_globalTriggerSF
Definition: GlobalTrigMatchSelector.h:29
IParticle.h
GlobalTrigMatchSelector.h
top::GlobalTrigMatchSelector::m_globalTriggerSFLoose
ToolHandle< ITrigGlobalEfficiencyCorrectionTool > m_globalTriggerSFLoose
Definition: GlobalTrigMatchSelector.h:30
EventTools.h
A few functions for doing operations on particles / events. Currently holds code for dR,...
event
POOL::TEvent event(POOL::TEvent::kClassAccess)
ElectronContainer.h
top::check
void check(bool thingToCheck, const std::string &usefulFailureMessage)
Print an error message and terminate if thingToCheck is false.
Definition: EventTools.cxx:15
Event.h
top::GlobalTrigMatchSelector::name
std::string name() const override
A human readable name.
Definition: GlobalTrigMatchSelector.cxx:37
AtlCoolConsole.tool
tool
Definition: AtlCoolConsole.py:453
MuonContainer.h
top::GlobalTrigMatchSelector::GlobalTrigMatchSelector
GlobalTrigMatchSelector()
Definition: GlobalTrigMatchSelector.cxx:18
LArG4FSStartPointFilter.particles
list particles
Definition: LArG4FSStartPointFilter.py:84
top::GlobalTrigMatchSelector::apply
bool apply(top::Event const &event) const override
This does stuff based on the information in an event.
Definition: GlobalTrigMatchSelector.cxx:23
top::Event
Very simple class to hold event data after reading from a file.
Definition: Event.h:49