12 #include "CLHEP/Units/SystemOfUnits.h"
25 const IInterface*
p) :
27 m_trigDecisionTool(
"Trig::TrigDecisionTool/TrigDecisionTool"),
40 declareInterface<DerivationFramework::ISkimmingTool>(
this);
83 if(m_trigDecisionTool.retrieve(DisableTool{!m_reqTrigger}).isFailure()) {
84 ATH_MSG_FATAL(
"Failed to retrieve tool: " << m_trigDecisionTool);
85 return StatusCode::FAILURE;
87 if (!m_triggers.size()) m_triggers.push_back(m_defaultTrigger);
94 m_JESTool.setTypeAndName(
"JetCalibrationTool/m_JESTool");
95 CHECK( m_JESTool.retrieve() );
100 return StatusCode::SUCCESS;
106 ATH_MSG_INFO(
"Processed " << m_n_tot <<
" events, " << m_n_pass <<
" events passed filter ");
117 return StatusCode::SUCCESS;
127 bool writeEvent(
false);
132 if (!SubcutGoodRunList() && m_reqGRL )
return false;
133 if (!SubcutLArError() && m_reqLArError )
return false;
134 if (!SubcutTrigger() && m_reqTrigger )
return false;
136 const auto jets = SubcutPreselect();
137 if (!m_reqPreselection) writeEvent =
true;
143 bool passDiJets(
true);
144 if (!SubcutJetPts(
jets.value()) && m_reqJetPts ) passDiJets =
false;
145 if (!SubcutJetDEta(
jets.value()) && m_reqJetsDEta ) passDiJets =
false;
146 if (!SubcutDijetMass(
jets.value()) && m_reqDiJetMass) passDiJets =
false;
147 if (!SubcutJetDPhi(
jets.value()) && m_reqJetsDPhi ) passDiJets =
false;
148 if (passDiJets) writeEvent =
true;
151 if (!writeEvent)
return false;
175 if (passLArError) m_n_passLArError++;
186 bool passTrigger =
false;
188 for (
unsigned int i = 0;
i < m_triggers.size();
i++) {
189 bool thisTrig = m_trigDecisionTool->isPassed(m_triggers.at(
i));
191 acc(*eventInfo) = thisTrig;
193 passTrigger |= thisTrig;
199 if (passTrigger) m_n_passTrigger++;
204 std::optional<DerivationFramework::SkimmingToolEXOT14::LeadingJets_t>
216 TLorentzVector j1TLV, j2TLV;
219 while(jet_itr != jet_end) {
227 if(m_JESTool->applyCalibration(calibJets).isFailure())
230 jet_itr = calibJets.
begin();
231 jet_end = calibJets.
end();
232 while(jet_itr != jet_end) {
234 if (abs((*jet_itr)->eta()) > m_maxEta)
continue;
236 if ((*jet_itr)->pt() > j1TLV.Pt()) {
239 j1TLV.SetPtEtaPhiE((*jet_itr)->pt(), (*jet_itr)->eta(), (*jet_itr)->phi(), (*jet_itr)->e());
241 }
else if ((*jet_itr)->pt() > j2TLV.Pt()) {
243 j2TLV.SetPtEtaPhiE((*jet_itr)->pt(), (*jet_itr)->eta(), (*jet_itr)->phi(), (*jet_itr)->e());
250 if (j2TLV.Pt() > m_minJetPt) {
262 bool passJetPts = (!m_leadingJetPt ||
jets[0].Pt() > m_leadingJetPt);
263 passJetPts &= (!m_subleadingJetPt ||
jets[1].Pt() > m_subleadingJetPt);
265 if (passJetPts) m_n_passJetPts++;
273 const bool passJetsDEta = JetsDEta > m_etaSeparation;
275 if (passJetsDEta) m_n_passJetsDEta++;
283 const double DiJetMass = (
jets[0] +
jets[1]).M();
284 const bool passDiJetMass = DiJetMass > m_dijetMass;
286 if (passDiJetMass) m_n_passDiJetMass++;
287 return passDiJetMass;
293 const double JetsDPhi = fabs(
jets[0].DeltaPhi(
jets[1]));
294 const bool passJetsDPhi = JetsDPhi < m_jetDPhi;
296 if (passJetsDPhi) m_n_passJetsDPhi++;