Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Public Member Functions | Private Attributes | List of all members
DerivationFramework::SkimmingToolEXOT5 Class Reference

#include <SkimmingToolEXOT5.h>

Inheritance diagram for DerivationFramework::SkimmingToolEXOT5:
Collaboration diagram for DerivationFramework::SkimmingToolEXOT5:

Public Member Functions

 SkimmingToolEXOT5 (const std::string &t, const std::string &n, const IInterface *p)
 
 ~SkimmingToolEXOT5 ()
 
virtual StatusCode initialize () override
 
virtual StatusCode finalize () override
 
virtual bool eventPassesFilter () const override
 

Private Attributes

ToolHandle< IJetCalibrationToolm_jetCalibrationTool
 
std::string m_jetSGKey
 
double m_uncalibMonoJetPt
 
double m_monoJetPt
 
double m_leadingJetPt
 
double m_subleadingJetPt
 
double m_Mjj
 
std::atomic< unsigned int > m_ntot
 
std::atomic< unsigned int > m_npass
 

Detailed Description

Definition at line 22 of file SkimmingToolEXOT5.h.

Constructor & Destructor Documentation

◆ SkimmingToolEXOT5()

DerivationFramework::SkimmingToolEXOT5::SkimmingToolEXOT5 ( const std::string &  t,
const std::string &  n,
const IInterface *  p 
)

Definition at line 27 of file SkimmingToolEXOT5.cxx.

29  :
30  base_class(t, n, p),
31  m_ntot(0),
32  m_npass(0)
33 {
34 
35 
36  declareProperty("JetContainer", m_jetSGKey = "AntiKt4EMTopoJets");
37 
38  declareProperty("UncalibMonoJetPtCut", m_uncalibMonoJetPt = 100000.);
39  declareProperty("MonoJetPtCut", m_monoJetPt = 100000.);
40  declareProperty("LeadingJetPtCut", m_leadingJetPt = 40000.);
41  declareProperty("SubleadingJetPtCut", m_subleadingJetPt = 40000.);
42  declareProperty("DiJetMassCut", m_Mjj = 150000.);
43 }

◆ ~SkimmingToolEXOT5()

DerivationFramework::SkimmingToolEXOT5::~SkimmingToolEXOT5 ( )

Definition at line 45 of file SkimmingToolEXOT5.cxx.

45  {
46 }

Member Function Documentation

◆ eventPassesFilter()

bool DerivationFramework::SkimmingToolEXOT5::eventPassesFilter ( ) const
overridevirtual

Definition at line 68 of file SkimmingToolEXOT5.cxx.

69 {
70 
71  m_ntot++;
72 
73  const xAOD::EventInfo* eventInfo = nullptr;
74  ATH_CHECK(evtStore()->retrieve(eventInfo), false);
75 
76  const xAOD::JetContainer* jets = nullptr;
77  ATH_CHECK(evtStore()->retrieve(jets, m_jetSGKey), false);
78 
79  bool passUncalibMonojetCut = false;
80  bool passRecoJetCuts = false;
81  bool passTruthJetCuts = false;
82 
83  std::unique_ptr<xAOD::JetContainer> recoJets = make_unique<xAOD::JetContainer>();
84  std::unique_ptr<xAOD::JetAuxContainer> recoJetsAux = make_unique<xAOD::JetAuxContainer>();
85  recoJets->setStore(recoJetsAux.get());
86 
87  std::pair<xAOD::JetContainer*, xAOD::ShallowAuxContainer*> jets_shallowCopy = xAOD::shallowCopyContainer(*jets);
88  for (const auto jet : *jets_shallowCopy.first) {
89  if (jet->pt() > 100000.) passUncalibMonojetCut = true;
90  }
91  if (m_jetCalibrationTool->applyCalibration(*jets_shallowCopy.first).isFailure()) {
92  ATH_MSG_ERROR("Problem applying jet calibration");
93  return false;
94  }
95  for (const auto jet : *jets_shallowCopy.first) {
96  xAOD::Jet* newJet = new xAOD::Jet();
97  newJet->makePrivateStore(*jet);
98  recoJets->push_back(newJet);
99  }
100  delete jets_shallowCopy.first;
101  delete jets_shallowCopy.second;
102 
103  if (recoJets->size() > 1) std::partial_sort(recoJets->begin(), recoJets->begin()+2, recoJets->end(), DescendingPt());
104  float mjj = 0;
105  if (recoJets->size() > 1) {
106  TLorentzVector jet1 = recoJets->at(0)->p4();
107  TLorentzVector jet2 = recoJets->at(1)->p4();
108  auto dijet = jet1 + jet2;
109  mjj = dijet.M();
110  }
111  if ((recoJets->size() > 0 && recoJets->at(0)->pt() > m_monoJetPt) || (recoJets->size() > 1 && recoJets->at(0)->pt() > m_leadingJetPt && recoJets->at(1)->pt() > m_subleadingJetPt && mjj > m_Mjj)) passRecoJetCuts = true;
112 
113  if (eventInfo->eventType(xAOD::EventInfo::IS_SIMULATION)) {
114  const xAOD::JetContainer* truthJetContainer = nullptr;
115  ATH_CHECK(evtStore()->retrieve(truthJetContainer, "AntiKt4TruthJets"), false);
116 
117  std::unique_ptr<xAOD::JetContainer> truthJets = make_unique<xAOD::JetContainer>();
118  std::unique_ptr<xAOD::JetAuxContainer> truthJetsAux = make_unique<xAOD::JetAuxContainer>();
119  truthJets->setStore(truthJetsAux.get());
120 
121  for (const auto truthJet : *truthJetContainer) {
122  xAOD::Jet* newTruthJet = new xAOD::Jet();
123  newTruthJet->makePrivateStore(*truthJet);
124  truthJets->push_back(newTruthJet);
125  }
126 
127  if (truthJets->size() > 1) std::partial_sort(truthJets->begin(), truthJets->begin()+2, truthJets->end(), DescendingPt());
128  float truthMjj = 0;
129  if (truthJets->size() > 1) {
130  TLorentzVector truthJet1 = truthJets->at(0)->p4();
131  TLorentzVector truthJet2 = truthJets->at(1)->p4();
132  auto truthDijet = truthJet1 + truthJet2;
133  truthMjj = truthDijet.M();
134  }
135  if ((truthJets->size() > 0 && truthJets->at(0)->pt() > m_monoJetPt) || (truthJets->size() > 1 && truthJets->at(0)->pt() > m_leadingJetPt && truthJets->at(1)->pt() > m_subleadingJetPt && truthMjj > m_Mjj)) passTruthJetCuts = true;
136  }
137 
138  bool acceptEvent = passUncalibMonojetCut || passRecoJetCuts || passTruthJetCuts;
139 
140  m_npass++;
141  return acceptEvent;
142 
143 }

◆ finalize()

StatusCode DerivationFramework::SkimmingToolEXOT5::finalize ( )
overridevirtual

Definition at line 59 of file SkimmingToolEXOT5.cxx.

60 {
61  ATH_MSG_VERBOSE("finalize() ...");
62  ATH_MSG_INFO("Processed " << m_ntot << " events, " << m_npass << " events passed filter ");
63 
64  return StatusCode::SUCCESS;
65 
66 }

◆ initialize()

StatusCode DerivationFramework::SkimmingToolEXOT5::initialize ( )
overridevirtual

Definition at line 48 of file SkimmingToolEXOT5.cxx.

49 {
50  ATH_MSG_VERBOSE("initialize() ..");
51 
52  m_jetCalibrationTool.setTypeAndName("JetCalibrationTool/EXOT5JESTool");
53  CHECK(m_jetCalibrationTool.retrieve());
54  ATH_MSG_INFO("Retrieved tool: " << m_jetCalibrationTool);
55 
56  return StatusCode::SUCCESS;
57 }

Member Data Documentation

◆ m_jetCalibrationTool

ToolHandle<IJetCalibrationTool> DerivationFramework::SkimmingToolEXOT5::m_jetCalibrationTool
private

Definition at line 36 of file SkimmingToolEXOT5.h.

◆ m_jetSGKey

std::string DerivationFramework::SkimmingToolEXOT5::m_jetSGKey
private

Definition at line 37 of file SkimmingToolEXOT5.h.

◆ m_leadingJetPt

double DerivationFramework::SkimmingToolEXOT5::m_leadingJetPt
private

Definition at line 41 of file SkimmingToolEXOT5.h.

◆ m_Mjj

double DerivationFramework::SkimmingToolEXOT5::m_Mjj
private

Definition at line 43 of file SkimmingToolEXOT5.h.

◆ m_monoJetPt

double DerivationFramework::SkimmingToolEXOT5::m_monoJetPt
private

Definition at line 40 of file SkimmingToolEXOT5.h.

◆ m_npass

std::atomic<unsigned int> DerivationFramework::SkimmingToolEXOT5::m_npass
mutableprivate

Definition at line 46 of file SkimmingToolEXOT5.h.

◆ m_ntot

std::atomic<unsigned int> DerivationFramework::SkimmingToolEXOT5::m_ntot
mutableprivate

Definition at line 45 of file SkimmingToolEXOT5.h.

◆ m_subleadingJetPt

double DerivationFramework::SkimmingToolEXOT5::m_subleadingJetPt
private

Definition at line 42 of file SkimmingToolEXOT5.h.

◆ m_uncalibMonoJetPt

double DerivationFramework::SkimmingToolEXOT5::m_uncalibMonoJetPt
private

Definition at line 39 of file SkimmingToolEXOT5.h.


The documentation for this class was generated from the following files:
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
DerivationFramework::SkimmingToolEXOT5::m_Mjj
double m_Mjj
Definition: SkimmingToolEXOT5.h:43
defineDB.jets
jets
Definition: JetTagCalibration/share/defineDB.py:24
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
DescendingPt
Definition: SkimmingToolEXOT5.cxx:16
xAOD::EventInfo_v1::IS_SIMULATION
@ IS_SIMULATION
true: simulation, false: data
Definition: EventInfo_v1.h:151
DerivationFramework::SkimmingToolEXOT5::m_subleadingJetPt
double m_subleadingJetPt
Definition: SkimmingToolEXOT5.h:42
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
jet
Definition: JetCalibTools_PlotJESFactors.cxx:23
DerivationFramework::SkimmingToolEXOT5::m_npass
std::atomic< unsigned int > m_npass
Definition: SkimmingToolEXOT5.h:46
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
beamspotman.n
n
Definition: beamspotman.py:731
DerivationFramework::SkimmingToolEXOT5::m_monoJetPt
double m_monoJetPt
Definition: SkimmingToolEXOT5.h:40
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:422
DerivationFramework::SkimmingToolEXOT5::m_jetSGKey
std::string m_jetSGKey
Definition: SkimmingToolEXOT5.h:37
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
SG::AuxElement::makePrivateStore
void makePrivateStore()
Create a new (empty) private store for this object.
Definition: AuxElement.cxx:192
DerivationFramework::SkimmingToolEXOT5::m_uncalibMonoJetPt
double m_uncalibMonoJetPt
Definition: SkimmingToolEXOT5.h:39
columnar::ContainerId::eventInfo
@ eventInfo
xAOD::shallowCopyContainer
std::pair< std::unique_ptr< T >, std::unique_ptr< ShallowAuxContainer > > shallowCopyContainer(const T &cont, [[maybe_unused]] const EventContext &ctx)
Function making a shallow copy of a constant container.
Definition: ShallowCopy.h:110
xAOD::EventInfo_v1
Class describing the basic event information.
Definition: EventInfo_v1.h:43
DataVector::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
xAOD::Jet_v1
Class describing a jet.
Definition: Jet_v1.h:57
std::partial_sort
void partial_sort(std::reverse_iterator< DataModel_detail::iterator< DVL > > beg, std::reverse_iterator< DataModel_detail::iterator< DVL > > mid, std::reverse_iterator< DataModel_detail::iterator< DVL > > end, Compare comp)
Specialization of partial_sort for DataVector/List.
Definition: DVL_algorithms.h:811
DerivationFramework::SkimmingToolEXOT5::m_leadingJetPt
double m_leadingJetPt
Definition: SkimmingToolEXOT5.h:41
DerivationFramework::SkimmingToolEXOT5::m_jetCalibrationTool
ToolHandle< IJetCalibrationTool > m_jetCalibrationTool
Definition: SkimmingToolEXOT5.h:36
DerivationFramework::SkimmingToolEXOT5::m_ntot
std::atomic< unsigned int > m_ntot
Definition: SkimmingToolEXOT5.h:45
DataVector::at
const T * at(size_type n) const
Access an element, as an rvalue.
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
xAOD::Jet
Jet_v1 Jet
Definition of the current "jet version".
Definition: Event/xAOD/xAODJet/xAODJet/Jet.h:17
DataVector::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.