ATLAS Offline Software
RCJet.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3  */
4 
5 #ifndef RCJET_H_
6 #define RCJET_H_
7 
8 #include "TopEvent/Event.h"
9 #include "TopEvent/EventTools.h"
10 #include "TopEvent/TopEventMaker.h"
13 
14 #include "AsgTools/AsgTool.h"
15 #include "AsgTools/ToolHandle.h"
16 #include "xAODRootAccess/TEvent.h"
17 #include "xAODRootAccess/TStore.h"
19 #include "xAODCore/ShallowCopy.h"
20 #include "xAODJet/JetContainer.h"
22 
24 #include <unordered_map>
25 #include <unordered_set>
26 #include <memory>
27 #include <set>
28 #include <list>
29 #include <vector>
30 
31 // Forward declaration(s):
32 namespace xAOD {
33  class SystematicEvent;
34 }
35 
36 namespace top {
37  class TopConfig;
38  class Event;
39 }
40 
41 namespace fastjet {
42  class JetDefinition;
43  namespace contrib {
44  class Nsubjettiness;
45  class EnergyCorrelator;
46  }
47 }
48 
50  class KtSplittingScale;
51  class Qw;
53 }
54 
55 class RCJet final: public asg::AsgTool {
56 public:
57  //Default - so root can load based on a name
58  explicit RCJet(const std::string& name);
59 
60  //Default - so we can clean up
61  ~RCJet();
62 
63  // Delete Standard constructors
64  RCJet(const RCJet& rhs) = delete;
65  RCJet(RCJet&& rhs) = delete;
66  RCJet& operator = (const RCJet& rhs) = delete;
67 
68  //Run once at the start of the job
70 
71  //Run for every event (in every systematic) that needs saving
73 
74  //Clean-up remaining things
76 
77  //Check if systematic needs a unique container
78  bool isUniqueSyst(std::string syst_name);
79 
80  //Access all of the container names from the Event Saver
81  std::string inputContainerName(std::size_t hash_value, bool isLooseEvent);
82  std::string rcjetContainerName(std::size_t hash_value, bool isLooseEvent);
83 
84  bool passSelection(const xAOD::Jet& jet) const;
85 
86  void getEMTopoClusters(std::vector<fastjet::PseudoJet>& clusters, const xAOD::Jet* rcjet);
87  void getLCTopoClusters(std::vector<fastjet::PseudoJet>& clusters, const xAOD::Jet* rcjet);
88 
89  void getPflowConstituent(std::vector<fastjet::PseudoJet>& clusters, const xAOD::Jet* rcjet, const top::Event& event);
90 private:
91  std::string m_name;
92 
93  std::shared_ptr<top::TopConfig> m_config;
95  std::string m_VarRCjets_rho;
97  float m_ptcut; // in GeV
98  float m_etamax;
101  float m_trim;
102  float m_radius;
103  float m_minradius;
104  float m_massscale;
105  bool m_useJSS;
107 
108  std::string m_egamma;
109  std::string m_jetsyst;
110  std::string m_muonsyst;
111  std::string m_tracksyst;
112 
113  std::string m_InJetContainerBase;
115  std::string m_InputJetContainer;
116  std::string m_OutputJetContainer;
118 
119  //Substructure tool definitions
120  std::shared_ptr<fastjet::JetDefinition> m_jet_def_rebuild;
121  std::shared_ptr<fastjet::contrib::Nsubjettiness> m_nSub1_beta1;
122  std::shared_ptr<fastjet::contrib::Nsubjettiness> m_nSub2_beta1;
123  std::shared_ptr<fastjet::contrib::Nsubjettiness> m_nSub3_beta1;
124  std::shared_ptr<fastjet::contrib::EnergyCorrelator> m_ECF1;
125  std::shared_ptr<fastjet::contrib::EnergyCorrelator> m_ECF2;
126  std::shared_ptr<fastjet::contrib::EnergyCorrelator> m_ECF3;
127  std::shared_ptr<JetSubStructureUtils::KtSplittingScale> m_split12;
128  std::shared_ptr<JetSubStructureUtils::KtSplittingScale> m_split23;
129  std::shared_ptr<JetSubStructureUtils::Qw> m_qw;
130  std::shared_ptr<JetSubStructureUtils::EnergyCorrelatorGeneralized> m_gECF332;
131  std::shared_ptr<JetSubStructureUtils::EnergyCorrelatorGeneralized> m_gECF461;
132  std::shared_ptr<JetSubStructureUtils::EnergyCorrelatorGeneralized> m_gECF322;
133  std::shared_ptr<JetSubStructureUtils::EnergyCorrelatorGeneralized> m_gECF331;
134  std::shared_ptr<JetSubStructureUtils::EnergyCorrelatorGeneralized> m_gECF422;
135  std::shared_ptr<JetSubStructureUtils::EnergyCorrelatorGeneralized> m_gECF441;
136  std::shared_ptr<JetSubStructureUtils::EnergyCorrelatorGeneralized> m_gECF212;
137  std::shared_ptr<JetSubStructureUtils::EnergyCorrelatorGeneralized> m_gECF321;
138  std::shared_ptr<JetSubStructureUtils::EnergyCorrelatorGeneralized> m_gECF311;
139 
141 
143  std::map<std::size_t, std::string> m_inputContainerNames;
144  std::map<std::size_t, std::string> m_outputContainerNames;
145 
146  std::map<std::string, float> mass_scales = {
147  {"m_t", 172500.},
148  {"m_w", 80385.},
149  {"m_z", 91188.},
150  {"m_h", 125090.}
151  };
152 
153  //re-clustered jets
154  // -> need unordered map for systematics
155  std::unordered_map<std::size_t, std::shared_ptr<JetReclusteringTool> > m_jetReclusteringTool;
156  typedef std::unordered_map<std::size_t, std::shared_ptr<JetReclusteringTool> >::iterator m_tool_iterator;
157 
158 };
159 
160 #endif
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
ShallowCopy.h
RCJet::m_gECF331
std::shared_ptr< JetSubStructureUtils::EnergyCorrelatorGeneralized > m_gECF331
Definition: RCJet.h:133
RCJet::m_ECF2
std::shared_ptr< fastjet::contrib::EnergyCorrelator > m_ECF2
Definition: RCJet.h:125
RCJet::m_qw
std::shared_ptr< JetSubStructureUtils::Qw > m_qw
Definition: RCJet.h:129
RCJet::m_split12
std::shared_ptr< JetSubStructureUtils::KtSplittingScale > m_split12
Definition: RCJet.h:127
RCJet::isUniqueSyst
bool isUniqueSyst(std::string syst_name)
Definition: RCJetMC.cxx:472
RCJet::m_tracksyst
std::string m_tracksyst
Definition: RCJet.h:111
asg::AsgTool
Base class for the dual-use tool implementation classes.
Definition: AsgTool.h:47
RCJet::m_name
std::string m_name
Definition: RCJet.h:91
RCJet::m_gECF461
std::shared_ptr< JetSubStructureUtils::EnergyCorrelatorGeneralized > m_gECF461
Definition: RCJet.h:131
RCJet::getPflowConstituent
void getPflowConstituent(std::vector< fastjet::PseudoJet > &clusters, const xAOD::Jet *rcjet, const top::Event &event)
Definition: RCJetMC.cxx:607
top
TopConfig A simple configuration that is NOT a singleton.
Definition: AnalysisTrackingHelper.cxx:58
JetSubStructureUtils::KtSplittingScale
Definition: KtSplittingScale.h:11
RCJet::m_InputJetContainer
std::string m_InputJetContainer
Definition: RCJet.h:115
RCJet::m_loose_hashValue
int m_loose_hashValue
Definition: RCJet.h:117
fastjet
Definition: FastJetLinkBase.h:22
RCJet::m_useAdditionalJSS
bool m_useAdditionalJSS
Definition: RCJet.h:106
RCJet::m_minradius
float m_minradius
Definition: RCJet.h:103
RCJet::~RCJet
~RCJet()
Definition: RCJetMC.cxx:87
Event
Definition: trigbs_orderedMerge.cxx:42
RCJet::m_jet_def_rebuild
std::shared_ptr< fastjet::JetDefinition > m_jet_def_rebuild
Definition: RCJet.h:120
RCJet::m_inputContainerNames
std::map< std::size_t, std::string > m_inputContainerNames
Definition: RCJet.h:143
RCJet
Definition: RCJet.h:55
JetReclusteringTool.h
xAOD
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
Definition: ICaloAffectedTool.h:24
RCJet::m_gECF441
std::shared_ptr< JetSubStructureUtils::EnergyCorrelatorGeneralized > m_gECF441
Definition: RCJet.h:135
RCJet::m_VarRCjets_rho
std::string m_VarRCjets_rho
Definition: RCJet.h:95
RCJet::m_ECF1
std::shared_ptr< fastjet::contrib::EnergyCorrelator > m_ECF1
Definition: RCJet.h:124
RCJet::m_muonsyst
std::string m_muonsyst
Definition: RCJet.h:110
RCJet::inputContainerName
std::string inputContainerName(std::size_t hash_value, bool isLooseEvent)
Definition: RCJetMC.cxx:499
SystematicEvent.h
RCJet::m_useJSS
bool m_useJSS
Definition: RCJet.h:105
RCJet::m_inputJetPtMin
float m_inputJetPtMin
Definition: RCJet.h:99
EventTools.h
A few functions for doing operations on particles / events. Currently holds code for dR,...
RCJet::RCJet
RCJet(RCJet &&rhs)=delete
JetSubStructureUtils
Definition: RCJet.h:49
RCJet::RCJet
RCJet(const std::string &name)
Definition: RCJetMC.cxx:38
RCJet::getLCTopoClusters
void getLCTopoClusters(std::vector< fastjet::PseudoJet > &clusters, const xAOD::Jet *rcjet)
Definition: RCJetMC.cxx:579
RCJet::m_tool_iterator
std::unordered_map< std::size_t, std::shared_ptr< JetReclusteringTool > >::iterator m_tool_iterator
Definition: RCJet.h:156
RCJet::getEMTopoClusters
void getEMTopoClusters(std::vector< fastjet::PseudoJet > &clusters, const xAOD::Jet *rcjet)
Definition: RCJetMC.cxx:545
jet
Definition: JetCalibTools_PlotJESFactors.cxx:23
RCJet::finalize
StatusCode finalize()
Definition: RCJetMC.cxx:466
event
POOL::TEvent event(POOL::TEvent::kClassAccess)
RCJet::RCJet
RCJet(const RCJet &rhs)=delete
RCJet::initialize
StatusCode initialize()
Dummy implementation of the initialisation function.
Definition: RCJetMC.cxx:90
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
RCJet::m_gECF332
std::shared_ptr< JetSubStructureUtils::EnergyCorrelatorGeneralized > m_gECF332
Definition: RCJet.h:130
RCJet::rcjetContainerName
std::string rcjetContainerName(std::size_t hash_value, bool isLooseEvent)
Definition: RCJetMC.cxx:513
RCJet::mass_scales
std::map< std::string, float > mass_scales
Definition: RCJet.h:146
TEvent.h
RCJet::m_VarRCjets
bool m_VarRCjets
Definition: RCJet.h:94
RCJet::m_gECF212
std::shared_ptr< JetSubStructureUtils::EnergyCorrelatorGeneralized > m_gECF212
Definition: RCJet.h:136
TopEventMaker.h
RCJet::m_gECF311
std::shared_ptr< JetSubStructureUtils::EnergyCorrelatorGeneralized > m_gECF311
Definition: RCJet.h:138
Event.h
RCJet::passSelection
bool passSelection(const xAOD::Jet &jet) const
Definition: RCJetMC.cxx:526
JetSubStructureUtils::EnergyCorrelatorGeneralized
Definition: EnergyCorrelatorGeneralized.h:14
RCJet::m_gECF322
std::shared_ptr< JetSubStructureUtils::EnergyCorrelatorGeneralized > m_gECF322
Definition: RCJet.h:132
RCJet::execute
StatusCode execute(const top::Event &event)
Definition: RCJetMC.cxx:267
RCJet::m_VarRCjets_mass_scale
std::string m_VarRCjets_mass_scale
Definition: RCJet.h:96
ConfigurationSettings.h
RCJet::m_gECF321
std::shared_ptr< JetSubStructureUtils::EnergyCorrelatorGeneralized > m_gECF321
Definition: RCJet.h:137
RCJet::m_OutJetContainerBase
std::string m_OutJetContainerBase
Definition: RCJet.h:114
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
RCJet::m_gECF422
std::shared_ptr< JetSubStructureUtils::EnergyCorrelatorGeneralized > m_gECF422
Definition: RCJet.h:134
RCJet::m_config
std::shared_ptr< top::TopConfig > m_config
Definition: RCJet.h:93
RCJet::m_inputJetEtaMax
float m_inputJetEtaMax
Definition: RCJet.h:100
RCJet::m_iterator
std::map< std::size_t, std::string >::iterator m_iterator
Definition: RCJet.h:142
RCJet::m_OutputJetContainer
std::string m_OutputJetContainer
Definition: RCJet.h:116
xAOD::Jet_v1
Class describing a jet.
Definition: Jet_v1.h:57
RCJet::m_nSub1_beta1
std::shared_ptr< fastjet::contrib::Nsubjettiness > m_nSub1_beta1
Definition: RCJet.h:121
JetContainer.h
RCJet::m_egamma
std::string m_egamma
Definition: RCJet.h:108
RCJet::m_jetsyst
std::string m_jetsyst
Definition: RCJet.h:109
RCJet::m_radius
float m_radius
Definition: RCJet.h:102
RCJet::m_massscale
float m_massscale
Definition: RCJet.h:104
RCJet::m_unique_syst
bool m_unique_syst
Definition: RCJet.h:140
RunTileMonitoring.clusters
clusters
Definition: RunTileMonitoring.py:133
RCJet::m_etamax
float m_etamax
Definition: RCJet.h:98
RCJet::m_trim
float m_trim
Definition: RCJet.h:101
JetAuxContainer.h
JetSubStructureUtils::Qw
Definition: Qw.h:34
RCJet::m_nSub2_beta1
std::shared_ptr< fastjet::contrib::Nsubjettiness > m_nSub2_beta1
Definition: RCJet.h:122
top::Event
Very simple class to hold event data after reading from a file.
Definition: Event.h:49
RCJet::m_ECF3
std::shared_ptr< fastjet::contrib::EnergyCorrelator > m_ECF3
Definition: RCJet.h:126
RCJet::m_nSub3_beta1
std::shared_ptr< fastjet::contrib::Nsubjettiness > m_nSub3_beta1
Definition: RCJet.h:123
ToolHandle.h
AsgTool.h
RCJet::m_outputContainerNames
std::map< std::size_t, std::string > m_outputContainerNames
Definition: RCJet.h:144
TActiveStore.h
TStore.h
RCJet::operator=
RCJet & operator=(const RCJet &rhs)=delete
RCJet::m_jetReclusteringTool
std::unordered_map< std::size_t, std::shared_ptr< JetReclusteringTool > > m_jetReclusteringTool
Definition: RCJet.h:155
RCJet::m_split23
std::shared_ptr< JetSubStructureUtils::KtSplittingScale > m_split23
Definition: RCJet.h:128
RCJet::m_InJetContainerBase
std::string m_InJetContainerBase
Definition: RCJet.h:113
RCJet::m_ptcut
float m_ptcut
Definition: RCJet.h:97
CP::hash_value
std::size_t hash_value(const SystematicSet &)
Hash function specifically for boost::hash.
Definition: SystematicSet.cxx:321