ATLAS Offline Software
TopEventSelectionToolsLoader.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3  */
4 
6 
8 
9 
62 
64 
65 #include <iostream>
66 
67 #include "TFile.h"
68 
69 namespace top {
71  TFile* outputFile,
72  std::shared_ptr<top::TopConfig> config,
73  EL::Worker* wk) {
74  //get the first bit of the string and store it in toolname
75  std::istringstream iss(line);
76  std::string toolname;
77  getline(iss, toolname, ' ');
78 
79  //any parameters?
80  std::string param;
81  if (line.size() > toolname.size()) param = line.substr(toolname.size() + 1);
82 
83  if (toolname == "JET_N") return new top::NJetSelector(param);
84  else if (toolname == "JET_N_BTAG") return new top::NJetBtagSelector(param, config, false);
85  else if (toolname == "TJET_N_BTAG") return new top::NJetBtagSelector(param, config, true);
86  else if (toolname == "LJET_N") return new top::NLargeJetSelector(param);
87  else if (toolname == "RCJET_N") return new top::NRCJetSelector(param);
88  else if (toolname == "VRCJET_N") {
89  std::istringstream is(param);
90  std::string name;
91  getline(is, name, ' ');
92  return new top::NVarRCJetSelector(name, param.substr(name.size() + 1));
93  }
94  else if (toolname == "EL_N_OR_MU_N") return new top::NElectronNMuonSelector(param);
95  else if (toolname == "EL_N_OR_MU_N_TIGHT") return new top::NElectronNMuonTightSelector(param);
96  else if (toolname == "EL_N") return new top::NElectronSelector(param);
97  else if (toolname == "EL_N_TIGHT") return new top::NElectronTightSelector(param);
98  else if (toolname == "FWDEL_N") return new top::NFwdElectronSelector(param);
99  else if (toolname == "FWDEL_N_TIGHT") return new top::NFwdElectronTightSelector(param);
100  else if (toolname == "MU_N") return new top::NMuonSelector(param);
101  else if (toolname == "SOFTMU_N") return new top::NSoftMuonSelector(param);
102  else if (toolname == "MU_N_TIGHT") return new top::NMuonTightSelector(param);
103  else if (toolname == "PH_N") return new top::NPhotonSelector(param);
104  else if (toolname == "TAU_N") return new top::NTauSelector(param);
105  else if (toolname == "TAU_N_TIGHT") return new top::NTauTightSelector(param);
106  else if (toolname == "MET+MWT") return new top::METMWTSelector(param);
107  else if (toolname == "MET") return new top::METSelector(param);
108  else if (toolname == "MWT") return new top::MWTSelector(param);
109  else if (toolname == "MLLWIN") return new top::MLLWindow(param);
110  else if (toolname == "MLL") return new top::MLLSelector(param);
111  else if (toolname == "HT") return new top::HTSelector(param);
112  else if (toolname == "NOBADMUON")
113  {
114  if(!config->useMuons())
115  {
116  asg::msgUserCode::ATH_MSG_ERROR("NOBADMUON selection cannot be used if the muon collection is not defined");
117  return 0;
118  }
119  return new top::NoBadMuonSelector(config);
120  }
121  else if (toolname == "OS") return new top::OSLeptonSelector();
122  else if (toolname == "OS_TIGHT") return new top::OSLeptonTightSelector();
123  else if (toolname == "SS") return new top::SSLeptonSelector();
124  else if (toolname == "SS_TIGHT") return new top::SSLeptonTightSelector();
125  else if (toolname == "INITIAL") return new top::InitialSelector;
126  else if (toolname == "SAVE") return new top::SaveEventSelector;
127  else if (toolname == "PRINT") return new top::PrintEventSelector;
128  else if (toolname == "EXAMPLEPLOTS") return new top::ExamplePlots(name, outputFile, wk, config);
129  else if (toolname == "JETFLAVORPLOTS") return new top::JetFlavorPlots(name, outputFile, param, config, wk);
130  else if (toolname == "JETRESPONSEPLOTS") return new top::JetResponsePlots(name, outputFile, param, config, wk);
131  else if (toolname == "JETFTAGEFFPLOTS") return new top::JetFtagEffPlots(name, outputFile, param, config, wk);
132  else if (toolname == "GRL") return new top::GRLSelector();
133  else if (toolname == "GTRIGDEC") return new top::GlobalTrigDecisionSelector();
134  else if (toolname == "GTRIGMATCH") return new top::GlobalTrigMatchSelector();
135  else if (toolname == "TRIGDEC") return new top::TrigDecisionSelector(name, config);
136  else if (toolname == "TRIGDEC_LOOSE") return new top::TrigDecisionLooseSelector(name, config);
137  else if (toolname == "TRIGDEC_TIGHT") return new top::TrigDecisionTightSelector(name, config);
138  else if (toolname == "TRIGMATCH") return new top::TrigMatchSelector(name, config);
139  else if (toolname == "JETCLEAN") return new top::JetCleaningSelector(param, config);
140  else if (toolname == "TRACKJETCLEAN") return new top::TrackJetCleaningSelector(config);
141  else if (toolname == "KLFITTER") return new top::KLFitterSelector(param);
142  else if (toolname == "JET_N_GHOST") return new top::JetNGhostSelector(param);
143  else if (toolname == "GOODCALO") return new top::GoodCaloSelector();
144  else if (toolname == "PRIVTX") return new top::PrimaryVertexSelector();
145  else if (toolname == "RECO_LEVEL") return new top::RecoLevelSelector();
146  else if (toolname == "PARTICLE_LEVEL") return new top::ParticleLevelSelector();
147  else if (toolname == "FAKESMMCONFIGS") return new top::FakesMMConfigs(param);
148  else if (toolname == "RUN_NUMBER") return new top::RunNumberSelector(param, config);
149 
150 
151  return nullptr;
152  }
153 }
GlobalTrigDecisionSelector.h
TrigDecisionTightSelector.h
top::NTauSelector
A tool that selects events with a certain number of good taus.
Definition: NTauSelector.h:14
top::MLLSelector
Put a cut on the invariant mass of two same flavour leptons.
Definition: MLLSelector.h:15
checkFileSG.line
line
Definition: checkFileSG.py:75
top::NJetBtagSelector
A tool that selects events with a certain number of good jets.
Definition: NJetBtagSelector.h:16
top::TrigDecisionLooseSelector
Sometimes you may want to select events that pass a certain trigger, or triggers.
Definition: TrigDecisionLooseSelector.h:33
top
TopConfig A simple configuration that is NOT a singleton.
Definition: AnalysisTrackingHelper.cxx:58
top::JetNGhostSelector
Definition: JetNGhostSelector.h:16
NMuonSelector.h
NMuonTightSelector.h
GlobalTrigMatchSelector.h
JetNGhostSelector.h
ExamplePlots.h
PrimaryVertexSelector.h
top::NFwdElectronSelector
A tool that selects events with a certain number of good forward electrons.
Definition: NFwdElectronSelector.h:18
TopEventSelectionToolsLoader.h
MLLWindowSelector.h
NJetSelector.h
top::RunNumberSelector
Apply a cut on the (random) run number.
Definition: RunNumberSelector.h:17
top::NMuonTightSelector
A tool that selects events with a certain number of good tight muons.
Definition: NMuonTightSelector.h:15
ParticleLevelSelector.h
top::NTauTightSelector
A tool that selects events with a certain number of good taus.
Definition: NTauTightSelector.h:14
METMWTSelector.h
NLargeJetSelector.h
NoBadMuonSelector.h
TrigDecisionLooseSelector.h
RunNumberSelector.h
top::TrigDecisionSelector
Sometimes you may want to select events that pass a certain trigger, or triggers.
Definition: TrigDecisionSelector.h:31
top::NElectronTightSelector
A tool that selects events with a certain number of good tight electrons.
Definition: NElectronTightSelector.h:15
top::NRCJetSelector
Definition: NRCJetSelector.h:12
MLLSelector.h
top::GRLSelector
Select events if they are on a GRL specified by the parameter GRLFilename in the configuration file.
Definition: GRLSelector.h:16
NTauTightSelector.h
TrigMatchSelector.h
top::JetFtagEffPlots
An example of how to quickly make some plots at a certain point in the cutflow.
Definition: JetFtagEffPlots.h:38
top::OSLeptonSelector
Keep only events that have at least one opposite sign lepton pair.
Definition: OSLeptonSelector.h:17
top::SaveEventSelector
Save this event in the output file.
Definition: SaveEventSelector.h:18
top::TopEventSelectionToolsLoader::initTool
top::EventSelectorBase * initTool(const std::string &name, const std::string &line, TFile *outputFile, std::shared_ptr< top::TopConfig > config, EL::Worker *wk=nullptr)
Convert the string name into a tool-object.
Definition: TopEventSelectionToolsLoader.cxx:70
config
Definition: PhysicsAnalysis/AnalysisCommon/AssociationUtils/python/config.py:1
top::JetFlavorPlots
An example of how to quickly make some plots at a certain point in the cutflow.
Definition: JetFlavorPlots.h:27
HTSelector.h
OSLeptonTightSelector.h
compareGeometries.outputFile
string outputFile
Definition: compareGeometries.py:25
NFwdElectronSelector.h
JetResponsePlots.h
top::NFwdElectronTightSelector
A tool that selects events with a certain number of good tight electrons.
Definition: NFwdElectronTightSelector.h:15
JetFtagEffPlots.h
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
EL::Worker
Definition: Worker.h:25
NElectronNMuonSelector.h
InitialSelector.h
NSoftMuonSelector.h
top::NLargeJetSelector
Definition: NLargeJetSelector.h:12
top::METSelector
Apply a cut on the event MET.
Definition: METSelector.h:14
NJetBtagSelector.h
top::RecoLevelSelector
An event selector that accepts all reco level events and rejects all particle level events.
Definition: RecoLevelSelector.h:23
top::ParticleLevelSelector
An event selector that accepts all particle level events and rejects all reco level events.
Definition: ParticleLevelSelector.h:23
MessageCheck.h
macros for messaging and checking status codes
top::TrackJetCleaningSelector
Definition: TrackJetCleaningSelector.h:18
NFwdElectronTightSelector.h
TrackJetCleaningSelector.h
NVarRCJetSelector.h
top::KLFitterSelector
Definition: KLFitterSelector.h:19
SSLeptonTightSelector.h
top::NJetSelector
A tool that selects events with a certain number of good jets.
Definition: NJetSelector.h:14
TrigDecisionSelector.h
OSLeptonSelector.h
FakesMMConfigs.h
NRCJetSelector.h
top::MLLWindow
Reject events in the invariant mass (of two charged leptons) window.
Definition: MLLWindowSelector.h:14
top::SSLeptonSelector
Keep only events that have at least one same sign lepton pair.
Definition: SSLeptonSelector.h:15
top::NVarRCJetSelector
Definition: NVarRCJetSelector.h:12
python.hypoToolDisplay.toolname
def toolname(tool)
Definition: hypoToolDisplay.py:13
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
top::EventSelectorBase
This should apply event-level cuts and perform simple plotting on top::Event objects.
Definition: EventSelectorBase.h:20
top::HTSelector
Apply a cut on the event HT.
Definition: HTSelector.h:16
NTauSelector.h
GRLSelector.h
TopConfig.h
NElectronTightSelector.h
top::NSoftMuonSelector
A tool that selects events with a certain number of good muons.
Definition: NSoftMuonSelector.h:14
top::OSLeptonTightSelector
Keep only events that have at least one opposite sign tight lepton pair.
Definition: OSLeptonTightSelector.h:18
METSelector.h
PrimaryVertexSelector
const Trk::VxCandidate * PrimaryVertexSelector(const VxContainer &vxContainer)
Simple Global Function to wrap around the VxCandidate container.
Definition: Tracking/TrkEvent/VxVertex/VxVertex/PrimaryVertexSelector.h:20
SSLeptonSelector.h
top::NMuonSelector
A tool that selects events with a certain number of good muons.
Definition: NMuonSelector.h:14
top::NElectronNMuonTightSelector
To accept an event based on a check of tight electrons and muons.
Definition: NElectronNMuonTightSelector.h:15
SaveEventSelector.h
top::GlobalTrigDecisionSelector
Definition: GlobalTrigDecisionSelector.h:22
top::GoodCaloSelector
Select data events with good Tile and LAr calorimeters.
Definition: GoodCaloSelector.h:15
PrintEventSelector.h
JetFlavorPlots.h
top::SSLeptonTightSelector
Keep only events that have at least one same sign tight lepton pair.
Definition: SSLeptonTightSelector.h:16
MWTSelector.h
top::GlobalTrigMatchSelector
Definition: GlobalTrigMatchSelector.h:21
RecoLevelSelector.h
top::ExamplePlots
An example of how to quickly make some plots at a certain point in the cutflow.
Definition: ExamplePlots.h:25
top::TrigDecisionTightSelector
Sometimes you may want to select events that pass a certain trigger, or triggers.
Definition: TrigDecisionTightSelector.h:33
top::NElectronSelector
A tool that selects events with a certain number of good electrons.
Definition: NElectronSelector.h:14
top::METMWTSelector
Allows a cut on the sum of MET and MWT.
Definition: METMWTSelector.h:14
top::NPhotonSelector
A tool that selects events with a certain number of good photons.
Definition: NPhotonSelector.h:14
top::NoBadMuonSelector
A tool that selects events containing no bad muons https://twiki.cern.ch/twiki/bin/view/Atlas/MuonSel...
Definition: NoBadMuonSelector.h:21
top::NElectronNMuonSelector
To accept an event based on a check of electrons and muons.
Definition: NElectronNMuonSelector.h:14
KLFitterSelector.h
NPhotonSelector.h
top::InitialSelector
A cut that accepts all events, more useful than you might think.
Definition: InitialSelector.h:17
top::JetCleaningSelector
Event selection using the official jet cleaning tool.
Definition: JetCleaningSelector.h:28
top::MWTSelector
Apply a cut on the transverse W mass (taken from the electron or muon and MET).
Definition: MWTSelector.h:15
top::JetResponsePlots
An example of how to quickly make some plots at a certain point in the cutflow.
Definition: JetResponsePlots.h:31
top::TrigMatchSelector
Match offline object to trigger.
Definition: TrigMatchSelector.h:20
top::FakesMMConfigs
An example of how to quickly make some plots at a certain point in the cutflow.
Definition: FakesMMConfigs.h:17
GoodCaloSelector.h
top::PrintEventSelector
Print some information about the event to the screen.
Definition: PrintEventSelector.h:17
JetCleaningSelector.h
NElectronSelector.h
NElectronNMuonTightSelector.h