ATLAS Offline Software
EventCleaningSelection.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
3  */
4 
5 #ifndef ANALYSISTOP_TOPOBJECTSELECTIONTOOLS_EVENTCLEANINGSELECTION_H
6 #define ANALYSISTOP_TOPOBJECTSELECTIONTOOLS_EVENTCLEANINGSELECTION_H
7 
8 #include <string>
9 #include <unordered_set>
10 #include <vector>
11 
12 // Framework include(s):
13 #include "AsgTools/AsgTool.h"
14 #include "AsgTools/ToolHandle.h"
15 
16 // GRL include(s):
18 
19 // Trigger include(s):
25 
26 // Top include(s):
28 
29 namespace top {
30  class TopConfig;
31 
32  class EventCleaningSelection final: public asg::AsgTool {
33  public:
34  explicit EventCleaningSelection(const std::string& name);
36 
38 
39  void setEventSelections(const std::vector<top::SelectionConfigurationData>& selections);
40  bool applyGRL() const;
41  bool applyTrigger();
42  bool applyGoodCalo() const;
43  bool applyPrimaryVertex() const;
44 
45  // Print trigger configuration - very verbose, but tells you which triggers are included for an event
46  void printTriggers() const;
47 
48  // helper to allow us to added trigger decisions to our output files
49  void addExtraBranches(std::vector<std::string>& extraBranchList);
50 
51  // Delete Standard constructors
55 
56  bool isElectronTrigger(std::string const& trigger) const;
57  bool isMuonTrigger(std::string const& trigger) const;
58  bool isPhotonTrigger(std::string const& trigger) const;
59  static std::vector<std::pair<std::string, int> > getIndividualFromGlobalTriggers(std::vector<std::pair<std::string, int> > const& triggers);
60  private:
62  void matchElectrons();
63 
65  void matchMuons();
66 
68  void matchTaus();
69 
71  void matchPhotons();
72 
74  std::shared_ptr<top::TopConfig> m_config;
75 
77  ToolHandle<IGoodRunsListSelectionTool> m_grlTool;
78 
80  ToolHandle<TrigConf::ITrigConfigTool> m_trigConfTool;
81 
83  ToolHandle<Trig::TrigDecisionTool> m_trigDecisionTool;
84 
85  // Trigger matching tool
86  ToolHandle<Trig::IMatchingTool> m_trigMatchTool;
87 
88  //Tau trigger matching
89  ToolHandle<Trig::ITrigTauMatchingTool> m_trigMatchTauTool;
90 
91  //Global trigger efficiency tool
92  ToolHandle<ITrigGlobalEfficiencyCorrectionTool> m_globalTriggerSF;
93  ToolHandle<ITrigGlobalEfficiencyCorrectionTool> m_globalTriggerSFLoose;
94 
96  std::vector<std::pair<std::string, int> > m_allTriggers_Tight;
97  std::vector<std::pair<std::string, int> > m_electronTriggers_Tight;
98  std::vector<std::pair<std::string, int> > m_muonTriggers_Tight;
99  std::vector<std::pair<std::string, int> > m_tauTriggers_Tight;
100  std::vector<std::pair<std::string, int> > m_photonTriggers_Tight;
101  std::vector<std::pair<std::string, int> > m_allTriggers_Loose;
102  std::vector<std::pair<std::string, int> > m_electronTriggers_Loose;
103  std::vector<std::pair<std::string, int> > m_muonTriggers_Loose;
104  std::vector<std::pair<std::string, int> > m_tauTriggers_Loose;
105  std::vector<std::pair<std::string, int> > m_photonTriggers_Loose;
106 
114 
118 
122 
125  };
126 }
127 #endif
top::EventCleaningSelection::isPhotonTrigger
bool isPhotonTrigger(std::string const &trigger) const
Definition: EventCleaningSelection.cxx:849
top::EventCleaningSelection::m_tauTriggers_Loose
std::vector< std::pair< std::string, int > > m_tauTriggers_Loose
Definition: EventCleaningSelection.h:104
IGoodRunsListSelectionTool.h
asg::AsgTool
Base class for the dual-use tool implementation classes.
Definition: AsgTool.h:47
top::EventCleaningSelection::m_vetoEventsGRL
bool m_vetoEventsGRL
If ALL selections request GRL, then we can veto events and not run the systematics,...
Definition: EventCleaningSelection.h:117
top
TopConfig A simple configuration that is NOT a singleton.
Definition: AnalysisTrackingHelper.cxx:58
top::EventCleaningSelection::printTriggers
void printTriggers() const
Definition: EventCleaningSelection.cxx:814
top::EventCleaningSelection::m_vetoEventsPriVtx
bool m_vetoEventsPriVtx
If ALL selections request PRIVTX, then we can veto events.
Definition: EventCleaningSelection.h:124
top::EventCleaningSelection::~EventCleaningSelection
virtual ~EventCleaningSelection()
Definition: EventCleaningSelection.h:35
top::EventCleaningSelection::setEventSelections
void setEventSelections(const std::vector< top::SelectionConfigurationData > &selections)
Definition: EventCleaningSelection.cxx:72
ITrigConfigTool.h
ITrigGlobalEfficiencyCorrectionTool.h
top::EventCleaningSelection::isElectronTrigger
bool isElectronTrigger(std::string const &trigger) const
Definition: EventCleaningSelection.cxx:837
top::EventCleaningSelection::m_vetoEventsGoodCalo
bool m_vetoEventsGoodCalo
If ALL selections request GOODCALO, then we can veto events Data only.
Definition: EventCleaningSelection.h:121
TrigDecisionTool.h
top::EventCleaningSelection::initialize
StatusCode initialize()
Dummy implementation of the initialisation function.
Definition: EventCleaningSelection.cxx:51
top::EventCleaningSelection::m_trigMatchTauTool
ToolHandle< Trig::ITrigTauMatchingTool > m_trigMatchTauTool
Definition: EventCleaningSelection.h:89
top::EventCleaningSelection::m_allTriggers_Tight
std::vector< std::pair< std::string, int > > m_allTriggers_Tight
List of triggers to 'or' together for each event. If any one passes, the event passes.
Definition: EventCleaningSelection.h:96
python.TrigTLAMonitorAlgorithm.triggers
triggers
Definition: TrigTLAMonitorAlgorithm.py:196
SelectionConfigurationData.h
top::EventCleaningSelection::getIndividualFromGlobalTriggers
static std::vector< std::pair< std::string, int > > getIndividualFromGlobalTriggers(std::vector< std::pair< std::string, int > > const &triggers)
Definition: EventCleaningSelection.cxx:820
top::EventCleaningSelection::matchElectrons
void matchElectrons()
Match offline electrons to the trigger.
Definition: EventCleaningSelection.cxx:668
top::EventCleaningSelection::m_photonTriggers_Loose
std::vector< std::pair< std::string, int > > m_photonTriggers_Loose
Definition: EventCleaningSelection.h:105
top::EventCleaningSelection::m_allTriggers_Loose
std::vector< std::pair< std::string, int > > m_allTriggers_Loose
Definition: EventCleaningSelection.h:101
top::EventCleaningSelection::matchMuons
void matchMuons()
Match offline muons to the trigger.
Definition: EventCleaningSelection.cxx:697
top::EventCleaningSelection::m_globalTriggerSF
ToolHandle< ITrigGlobalEfficiencyCorrectionTool > m_globalTriggerSF
Definition: EventCleaningSelection.h:92
top::EventCleaningSelection::isMuonTrigger
bool isMuonTrigger(std::string const &trigger) const
Definition: EventCleaningSelection.cxx:843
top::EventCleaningSelection::m_grlTool
ToolHandle< IGoodRunsListSelectionTool > m_grlTool
GoodRunsLists.
Definition: EventCleaningSelection.h:77
top::EventCleaningSelection::EventCleaningSelection
EventCleaningSelection(const EventCleaningSelection &rhs)=delete
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
top::EventCleaningSelection::EventCleaningSelection
EventCleaningSelection(EventCleaningSelection &&rhs)=delete
top::EventCleaningSelection::applyPrimaryVertex
bool applyPrimaryVertex() const
Definition: EventCleaningSelection.cxx:593
top::EventCleaningSelection::addExtraBranches
void addExtraBranches(std::vector< std::string > &extraBranchList)
Definition: EventCleaningSelection.cxx:803
top::EventCleaningSelection::m_muonTriggers_Loose
std::vector< std::pair< std::string, int > > m_muonTriggers_Loose
Definition: EventCleaningSelection.h:103
top::EventCleaningSelection::EventCleaningSelection
EventCleaningSelection(const std::string &name)
Definition: EventCleaningSelection.cxx:24
top::EventCleaningSelection::matchPhotons
void matchPhotons()
Match offline photon to the trigger.
Definition: EventCleaningSelection.cxx:771
top::EventCleaningSelection::m_electronTriggers_Tight
std::vector< std::pair< std::string, int > > m_electronTriggers_Tight
Definition: EventCleaningSelection.h:97
top::EventCleaningSelection::applyGoodCalo
bool applyGoodCalo() const
Definition: EventCleaningSelection.cxx:542
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
ITrigTauMatching.h
python.combo.selections
def selections(items, n)
Definition: combo.py:104
top::EventCleaningSelection::matchTaus
void matchTaus()
Match offline taus to the trigger.
Definition: EventCleaningSelection.cxx:726
top::EventCleaningSelection::applyTrigger
bool applyTrigger()
Definition: EventCleaningSelection.cxx:629
top::EventCleaningSelection::m_trigConfTool
ToolHandle< TrigConf::ITrigConfigTool > m_trigConfTool
Trigger configuration tool.
Definition: EventCleaningSelection.h:80
top::EventCleaningSelection::m_vetoEventsTrigger
bool m_vetoEventsTrigger
Apply a logical OR cut to all supplied triggers If ANY selection does not request the trigger,...
Definition: EventCleaningSelection.h:113
top::EventCleaningSelection::m_electronTriggers_Loose
std::vector< std::pair< std::string, int > > m_electronTriggers_Loose
Definition: EventCleaningSelection.h:102
IMatchingTool.h
top::EventCleaningSelection::m_photonTriggers_Tight
std::vector< std::pair< std::string, int > > m_photonTriggers_Tight
Definition: EventCleaningSelection.h:100
top::EventCleaningSelection::m_trigMatchTool
ToolHandle< Trig::IMatchingTool > m_trigMatchTool
Definition: EventCleaningSelection.h:86
top::EventCleaningSelection::operator=
EventCleaningSelection & operator=(const EventCleaningSelection &rhs)=delete
top::EventCleaningSelection::m_config
std::shared_ptr< top::TopConfig > m_config
Top config.
Definition: EventCleaningSelection.h:74
top::EventCleaningSelection::m_tauTriggers_Tight
std::vector< std::pair< std::string, int > > m_tauTriggers_Tight
Definition: EventCleaningSelection.h:99
ToolHandle.h
top::EventCleaningSelection::m_muonTriggers_Tight
std::vector< std::pair< std::string, int > > m_muonTriggers_Tight
Definition: EventCleaningSelection.h:98
AsgTool.h
top::EventCleaningSelection
Definition: EventCleaningSelection.h:32
PhysDESDM_Quirks.trigger
trigger
Definition: PhysDESDM_Quirks.py:27
top::EventCleaningSelection::m_trigDecisionTool
ToolHandle< Trig::TrigDecisionTool > m_trigDecisionTool
Trigger decision tool.
Definition: EventCleaningSelection.h:83
top::EventCleaningSelection::m_globalTriggerSFLoose
ToolHandle< ITrigGlobalEfficiencyCorrectionTool > m_globalTriggerSFLoose
Definition: EventCleaningSelection.h:93
top::EventCleaningSelection::applyGRL
bool applyGRL() const
Definition: EventCleaningSelection.cxx:514