44 , m_jetCleaningTool(
"JetCleaningTool/JetCleaningTool")
46 m_jetCleaningTool.declarePropertyFor(
this,
"JetCleaningTool");
53 EventCleaningTool::~EventCleaningTool() {}
60 if(m_passJvtKey.key() ==
"" || m_passORKey.key() ==
""){
61 ATH_MSG_ERROR(
"Tool initialized with unknown decorator names." );
62 return StatusCode::FAILURE;
64 if (m_cleaningLevel ==
""){
66 return StatusCode::FAILURE;
68 if(m_jetContainerName ==
""){
69 ATH_MSG_ERROR(
"Tool initialized with no jet container name." );
70 return StatusCode::FAILURE;
74 ATH_CHECK(m_jetCleaningTool.setProperty(
"JetContainer", m_jetContainerName ));
75 ATH_CHECK(m_jetCleaningTool.setProperty(
"CutLevel", m_cleaningLevel ));
76 ATH_CHECK(m_jetCleaningTool.setProperty(
"UseDecorations", m_useDecorations ));
78 ATH_MSG_INFO(
"Event cleaning tool configured with cut level " << m_cleaningLevel );
80 m_passJvtKey = m_jetContainerName +
"." + m_prefix + m_passJvtKey.key();
81 m_passORKey = m_jetContainerName +
"." + m_prefix + m_passORKey.key();
82 m_jetCleanKey = m_jetContainerName +
"." + m_prefix +
"jetClean_" + m_cleaningLevel;
86 ATH_CHECK(m_jetCleanKey.initialize(m_decorate));
88 #ifndef XAOD_STANDALONE
89 if(m_suppressInputDeps){
92 renounce(m_passJvtKey);
93 renounce(m_passORKey);
95 if(m_suppressOutputDeps) {
96 renounce(m_jetCleanKey);
100 return StatusCode::SUCCESS;
107 bool pass_accept = 0;
110 bool isThisJetGood = 0;
111 bool isEventAllGood = 1;
117 for (
auto thisJet : *
jets){
118 pass_pt = thisJet->pt() > m_pt;
119 pass_eta = fabs(thisJet->eta()) < m_eta;
120 pass_accept = keepJet(*thisJet);
121 jvtDecision = jvtHandle(*thisJet);
122 orDecision = !(orHandle(*thisJet));
124 ATH_MSG_DEBUG(
"Jet info: pT: " << pass_pt <<
", eta: " << pass_eta <<
", accept? " << pass_accept <<
", jvt: " << jvtDecision <<
", or: " << orDecision);
125 if(pass_pt && pass_eta && jvtDecision && orDecision){
126 isThisJetGood = pass_accept;
127 isEventAllGood = isEventAllGood && isThisJetGood;
129 else isThisJetGood = pass_accept;
131 if(m_decorate) jetCleanHandle(*thisJet) = isThisJetGood;
134 return isEventAllGood;
137 int EventCleaningTool::keepJet(
const xAOD::Jet&
jet)
const
139 return m_jetCleaningTool->keep(
jet);