Commit c5671be3 authored by Jonathan Jamieson's avatar Jonathan Jamieson
Browse files

Add fJVT options into config, set up fJVT SFs for EMTopo and PFlow, add fJVT...

Add fJVT options into config, set up fJVT SFs for EMTopo and PFlow, add fJVT decision to OR priority
parent 1cf34916
......@@ -484,6 +484,7 @@ namespace top {
systematicTree->makeOutputVariable(m_weight_jvt, "weight_jvt");
if (m_config->getfJVTWP() != "Default") systematicTree->makeOutputVariable(m_weight_forwardjvt, "weight_forwardjvt");
if (m_config->isSherpa22Vjets()) systematicTree->makeOutputVariable(m_weight_sherpa_22_vjets,
"weight_sherpa_22_vjets");
......@@ -674,6 +675,10 @@ namespace top {
systematicTree->makeOutputVariable(m_weight_jvt_up, "weight_jvt_UP");
systematicTree->makeOutputVariable(m_weight_jvt_down, "weight_jvt_DOWN");
if (m_config->getfJVTWP() != "Default") {
systematicTree->makeOutputVariable(m_weight_forwardjvt_up, "weight_forwardjvt_UP");
systematicTree->makeOutputVariable(m_weight_forwardjvt_down, "weight_forwardjvt_DOWN");
}
}
// for b-tagging SFs, can also have systematic-shifted in systematics trees
......@@ -936,7 +941,11 @@ namespace top {
systematicTree->makeOutputVariable(m_jet_e, "jet_e");
systematicTree->makeOutputVariable(m_jet_mv2c10, "jet_mv2c10");
systematicTree->makeOutputVariable(m_jet_jvt, "jet_jvt");
systematicTree->makeOutputVariable(m_jet_passfjvt, "jet_passfjvt");
if (m_config->doForwardJVTinMET() || m_config->getfJVTWP() != "Default") {
systematicTree->makeOutputVariable(m_jet_fjvt, "jet_forwardjvt");
systematicTree->makeOutputVariable(m_jet_passfjvt, "jet_passforwardjvt");
}
systematicTree->makeOutputVariable(m_jet_passjvt, "jet_passjvt");
if (m_config->isMC() && m_config->jetStoreTruthLabels()) {
systematicTree->makeOutputVariable(m_jet_truthflav, "jet_truthflav");
systematicTree->makeOutputVariable(m_jet_truthPartonLabel, "jet_truthPartonLabel");
......@@ -982,7 +991,11 @@ namespace top {
systematicTree->makeOutputVariable(m_failJvt_jet_phi, "failJvt_jet_phi");
systematicTree->makeOutputVariable(m_failJvt_jet_e, "failJvt_jet_e");
systematicTree->makeOutputVariable(m_failJvt_jet_jvt, "failJvt_jet_jvt");
systematicTree->makeOutputVariable(m_failJvt_jet_passfjvt, "failJvt_jet_passfjvt");
if (m_config->doForwardJVTinMET() || m_config->getfJVTWP() != "Default") {
systematicTree->makeOutputVariable(m_failJvt_jet_fjvt, "failJvt_jet_forwardjvt");
systematicTree->makeOutputVariable(m_failJvt_jet_passfjvt, "failJvt_jet_passforwardjvt");
}
systematicTree->makeOutputVariable(m_failJvt_jet_passjvt, "failJvt_jet_passjvt"); //JJJJJJJJJJJ
if (m_config->isMC() && m_config->jetStoreTruthLabels()) {
systematicTree->makeOutputVariable(m_failJvt_jet_truthflav, "failJvt_jet_truthflav");
systematicTree->makeOutputVariable(m_failJvt_jet_truthPartonLabel, "failJvt_jet_truthPartonLabel");
......@@ -1002,6 +1015,37 @@ namespace top {
}
}
// fail-FJVT jets JJJJJJJJJJJJ
if ((m_config->doForwardJVTinMET() || m_config->getfJVTWP() != "Default") && m_config->saveFailForwardJVTJets()) {
systematicTree->makeOutputVariable(m_failFJvt_jet_pt, "failforwardJvt_jet_pt");
systematicTree->makeOutputVariable(m_failFJvt_jet_eta, "failforwardJvt_jet_eta");
systematicTree->makeOutputVariable(m_failFJvt_jet_phi, "failforwardJvt_jet_phi");
systematicTree->makeOutputVariable(m_failFJvt_jet_e, "failforwardJvt_jet_e");
systematicTree->makeOutputVariable(m_failFJvt_jet_jvt, "failforwardJvt_jet_jvt");
if (m_config->doForwardJVTinMET() || m_config->getfJVTWP() != "Default") {
systematicTree->makeOutputVariable(m_failFJvt_jet_fjvt, "failforwardJvt_jet_forwardjvt");
systematicTree->makeOutputVariable(m_failFJvt_jet_passfjvt, "failforwardJvt_jet_passforwardjvt");
}
systematicTree->makeOutputVariable(m_failFJvt_jet_passjvt, "failforwardJvt_jet_passjvt"); //JJJJJJJJJJJ
if (m_config->isMC() && m_config->jetStoreTruthLabels()) {
systematicTree->makeOutputVariable(m_failFJvt_jet_truthflav, "failforwardJvt_jet_truthflav");
systematicTree->makeOutputVariable(m_failFJvt_jet_truthPartonLabel, "failforwardJvt_jet_truthPartonLabel");
systematicTree->makeOutputVariable(m_failFJvt_jet_isTrueHS, "failforwardJvt_jet_isTrueHS");
systematicTree->makeOutputVariable(m_failFJvt_jet_HadronConeExclExtendedTruthLabelID,
"failforwardJvt_jet_truthflavExtended");
}
if (m_config->useJetGhostTrack()) {
systematicTree->makeOutputVariable(m_failFJvt_jet_ghostTrack_pt, "failforwardJvt_jet_ghostTrack_pt");
systematicTree->makeOutputVariable(m_failFJvt_jet_ghostTrack_eta, "failforwardJvt_jet_ghostTrack_eta");
systematicTree->makeOutputVariable(m_failFJvt_jet_ghostTrack_phi, "failforwardJvt_jet_ghostTrack_phi");
systematicTree->makeOutputVariable(m_failFJvt_jet_ghostTrack_e, "failforwardJvt_jet_ghostTrack_e");
systematicTree->makeOutputVariable(m_failFJvt_jet_ghostTrack_d0, "failforwardJvt_jet_ghostTrack_d0");
systematicTree->makeOutputVariable(m_failFJvt_jet_ghostTrack_z0, "failforwardJvt_jet_ghostTrack_z0");
systematicTree->makeOutputVariable(m_failFJvt_jet_ghostTrack_qOverP, "failforwardJvt_jet_ghostTrack_qOverP");
}
}
//large-R jets
if (m_config->useLargeRJets()) {
systematicTree->makeOutputVariable(m_ljet_pt, "ljet_pt");
......@@ -1847,6 +1891,7 @@ namespace top {
}
m_weight_jvt = m_sfRetriever->jvtSF(event, top::topSFSyst::nominal);
if (m_config->getfJVTWP() != "Default") m_weight_forwardjvt = m_sfRetriever->fjvtSF(event, top::topSFSyst::nominal);
if (m_config->isSherpa22Vjets()) {
if (event.m_info->isAvailable<double>("Sherpa22VJetsWeight")) {
......@@ -1986,6 +2031,10 @@ namespace top {
m_weight_jvt_up = m_sfRetriever->jvtSF(event, top::topSFSyst::JVT_UP);
m_weight_jvt_down = m_sfRetriever->jvtSF(event, top::topSFSyst::JVT_DOWN);
if (m_config->getfJVTWP() != "Default"){
m_weight_forwardjvt_up = m_sfRetriever->fjvtSF(event, top::topSFSyst::FJVT_UP);
m_weight_forwardjvt_down = m_sfRetriever->fjvtSF(event, top::topSFSyst::FJVT_DOWN);
}
}
// for b-tagging SFs, can also have systematic-shifted in systematics trees
......@@ -2529,7 +2578,9 @@ namespace top {
m_jet_e.resize(event.m_jets.size());
m_jet_mv2c10.resize(event.m_jets.size());
m_jet_jvt.resize(event.m_jets.size());
m_jet_fjvt.resize(event.m_jets.size());
m_jet_passfjvt.resize(event.m_jets.size());
m_jet_passjvt.resize(event.m_jets.size()); //JJJJJJJJJ
// ghost tracks
if (m_config->useJetGhostTrack()) {
......@@ -2692,10 +2743,18 @@ namespace top {
if (jetPtr->isAvailable<float>("AnalysisTop_JVT")) {
m_jet_jvt[i] = jetPtr->auxdataConst<float>("AnalysisTop_JVT");
}
m_jet_passfjvt[i] = -1;
if (jetPtr->isAvailable<char>("passFJVT")) {
m_jet_passfjvt[i] = jetPtr->getAttribute<char>("passFJVT");
m_jet_passjvt[i] = -1;
if (jetPtr->isAvailable<char>("passJVT")) {
m_jet_passjvt[i] = jetPtr->getAttribute<char>("passJVT");
}
m_jet_fjvt[i] = -1;
if (jetPtr->isAvailable<float>("fJvt")){// && (jetPtr->eta() < -2.5 || jetPtr->eta() > 2.5) && jetPtr->pt() < 60000) {
m_jet_fjvt[i] = jetPtr->auxdataConst<float>("fJvt");
}
m_jet_passfjvt[i] = -1;
if (jetPtr->isAvailable<char>("AnalysisTop_fJVTdecision")){// && (jetPtr->eta() < -2.5 || jetPtr->eta() > 2.5) && jetPtr->pt() < 60000) {
m_jet_passfjvt[i] = jetPtr->getAttribute<char>("AnalysisTop_fJVTdecision");
}
// DL1 can now be provided by btagging selector tool (see TopCorrections/BTagScaleFactorCalculator)
m_jet_DL1[i] = jetPtr->auxdataConst<float>("AnalysisTop_DL1");
......@@ -2744,7 +2803,7 @@ namespace top {
}
// fail-JVT jets
// btagging info is removed since btagging calibration is available for fail-JVT jets
// btagging info is removed since btagging calibration isn't available for fail-JVT jets
if (m_config->saveFailJVTJets()) {
unsigned int i(0);
m_failJvt_jet_pt.resize(event.m_failJvt_jets.size());
......@@ -2752,7 +2811,9 @@ namespace top {
m_failJvt_jet_phi.resize(event.m_failJvt_jets.size());
m_failJvt_jet_e.resize(event.m_failJvt_jets.size());
m_failJvt_jet_jvt.resize(event.m_failJvt_jets.size());
m_failJvt_jet_fjvt.resize(event.m_failJvt_jets.size());
m_failJvt_jet_passfjvt.resize(event.m_failJvt_jets.size());
m_failJvt_jet_passjvt.resize(event.m_failJvt_jets.size());
// ghost tracks
// fail-JVT jet could still have some ghost tracks, so these variables are kept
......@@ -2839,14 +2900,138 @@ namespace top {
if (jetPtr->isAvailable<float>("AnalysisTop_JVT")) {
m_failJvt_jet_jvt[i] = jetPtr->auxdataConst<float>("AnalysisTop_JVT");
}
m_failJvt_jet_passjvt[i] = -1;
if (jetPtr->isAvailable<char>("passJVT")) {
m_failJvt_jet_passjvt[i] = jetPtr->getAttribute<char>("passJVT");
}
m_failJvt_jet_fjvt[i] = -1;
if (jetPtr->isAvailable<float>("fJvt")) { // && (jetPtr->eta() < -2.5 || jetPtr->eta() > 2.5) && jetPtr->pt() < 60000) {
m_failJvt_jet_fjvt[i] = jetPtr->auxdataConst<float>("fJvt");
}
m_failJvt_jet_passfjvt[i] = -1;
if (jetPtr->isAvailable<char>("passFJVT")) {
m_failJvt_jet_passfjvt[i] = jetPtr->getAttribute<char>("passFJVT");
if (jetPtr->isAvailable<char>("AnalysisTop_fJVTdecision")) {
m_failJvt_jet_passfjvt[i] = jetPtr->getAttribute<char>("AnalysisTop_fJVTdecision");
}
++i;
}
}
}//ifSaveJVT
// fail-FJVT jets
// btagging info removed as this is only looking at forward jets
if (m_config->saveFailForwardJVTJets()) {
unsigned int i(0);
m_failFJvt_jet_pt.resize(event.m_failFJvt_jets.size());
m_failFJvt_jet_eta.resize(event.m_failFJvt_jets.size());
m_failFJvt_jet_phi.resize(event.m_failFJvt_jets.size());
m_failFJvt_jet_e.resize(event.m_failFJvt_jets.size());
m_failFJvt_jet_jvt.resize(event.m_failFJvt_jets.size());
m_failFJvt_jet_fjvt.resize(event.m_failFJvt_jets.size());
m_failFJvt_jet_passfjvt.resize(event.m_failFJvt_jets.size());
m_failFJvt_jet_passjvt.resize(event.m_failFJvt_jets.size());
// ghost tracks
// fail-FJVT jet could still have some ghost tracks... I think?, so these variables are kept JJJJJJJJJJJJJ
if (m_config->useJetGhostTrack()) {
m_failFJvt_jet_ghostTrack_pt.clear();
m_failFJvt_jet_ghostTrack_eta.clear();
m_failFJvt_jet_ghostTrack_phi.clear();
m_failFJvt_jet_ghostTrack_e.clear();
m_failFJvt_jet_ghostTrack_d0.clear();
m_failFJvt_jet_ghostTrack_z0.clear();
m_failFJvt_jet_ghostTrack_qOverP.clear();
m_failFJvt_jet_ghostTrack_pt.resize(event.m_failFJvt_jets.size());
m_failFJvt_jet_ghostTrack_eta.resize(event.m_failFJvt_jets.size());
m_failFJvt_jet_ghostTrack_phi.resize(event.m_failFJvt_jets.size());
m_failFJvt_jet_ghostTrack_e.resize(event.m_failFJvt_jets.size());
m_failFJvt_jet_ghostTrack_d0.resize(event.m_failFJvt_jets.size());
m_failFJvt_jet_ghostTrack_z0.resize(event.m_failFJvt_jets.size());
m_failFJvt_jet_ghostTrack_qOverP.resize(event.m_failFJvt_jets.size());
}
if (m_config->isMC()) {
m_failFJvt_jet_truthflav.resize(event.m_failFJvt_jets.size());
m_failFJvt_jet_truthPartonLabel.resize(event.m_failFJvt_jets.size());
m_failFJvt_jet_isTrueHS.resize(event.m_failFJvt_jets.size());
m_failFJvt_jet_HadronConeExclExtendedTruthLabelID.resize(event.m_failFJvt_jets.size());
}
for (const auto* const jetPtr : event.m_failFJvt_jets) {
m_failFJvt_jet_pt[i] = jetPtr->pt();
m_failFJvt_jet_eta[i] = jetPtr->eta();
m_failFJvt_jet_phi[i] = jetPtr->phi();
m_failFJvt_jet_e[i] = jetPtr->e();
if (m_config->isMC()) {
m_failFJvt_jet_truthflav[i] = -99;
if (jetPtr->isAvailable<int>("HadronConeExclTruthLabelID")) {
jetPtr->getAttribute("HadronConeExclTruthLabelID", m_failFJvt_jet_truthflav[i]);
}
m_failFJvt_jet_truthPartonLabel[i] = -99;
if (jetPtr->isAvailable<int>("PartonTruthLabelID")) {
jetPtr->getAttribute("PartonTruthLabelID", m_failFJvt_jet_truthPartonLabel[i]);
}
m_failFJvt_jet_isTrueHS[i] = false;
if (jetPtr->isAvailable<char>("AnalysisTop_isHS")) {
jetPtr->getAttribute("AnalysisTop_isHS", m_failFJvt_jet_isTrueHS[i]);
}
m_failFJvt_jet_HadronConeExclExtendedTruthLabelID[i] = -99;
if (jetPtr->isAvailable<int>("HadronConeExclExtendedTruthLabelID")) {
jetPtr->getAttribute("HadronConeExclExtendedTruthLabelID", m_failFJvt_jet_HadronConeExclExtendedTruthLabelID[i]);
}
}
if (m_config->useJetGhostTrack()) {
static const SG::AuxElement::Accessor< float > accD0("d0");
static const SG::AuxElement::Accessor< float > accZ0("z0");
static const SG::AuxElement::Accessor< float > accQOverP("qOverP");
const auto& ghostTracks = jetPtr->getAssociatedObjects<xAOD::TrackParticle>(m_config->decoKeyJetGhostTrack(event.m_hashValue));
const unsigned int nghostTracks = ghostTracks.size();
m_failFJvt_jet_ghostTrack_pt[i].resize(nghostTracks);
m_failFJvt_jet_ghostTrack_eta[i].resize(nghostTracks);
m_failFJvt_jet_ghostTrack_phi[i].resize(nghostTracks);
m_failFJvt_jet_ghostTrack_e[i].resize(nghostTracks);
m_failFJvt_jet_ghostTrack_d0[i].resize(nghostTracks);
m_failFJvt_jet_ghostTrack_z0[i].resize(nghostTracks);
m_failFJvt_jet_ghostTrack_qOverP[i].resize(nghostTracks);
for (unsigned int iGhost = 0; iGhost < nghostTracks; ++iGhost) {
top::check(ghostTracks.at(iGhost), "Error in EventSaverFlatNtuple: Found jet with null pointer in ghost track vector.");
m_failFJvt_jet_ghostTrack_pt[i][iGhost] = ghostTracks.at(iGhost)->pt();
m_failFJvt_jet_ghostTrack_eta[i][iGhost] = ghostTracks.at(iGhost)->eta();
m_failFJvt_jet_ghostTrack_phi[i][iGhost] = ghostTracks.at(iGhost)->phi();
m_failFJvt_jet_ghostTrack_e[i][iGhost] = ghostTracks.at(iGhost)->e();
m_failFJvt_jet_ghostTrack_d0[i][iGhost] = accD0(*ghostTracks.at(iGhost));
m_failFJvt_jet_ghostTrack_z0[i][iGhost] = accZ0(*ghostTracks.at(iGhost));
m_failFJvt_jet_ghostTrack_qOverP[i][iGhost] = accQOverP(*ghostTracks.at(iGhost));
}
}
m_failFJvt_jet_jvt[i] = -1;
if (jetPtr->isAvailable<float>("AnalysisTop_JVT")) {
m_failFJvt_jet_jvt[i] = jetPtr->auxdataConst<float>("AnalysisTop_JVT");
}
m_failFJvt_jet_passjvt[i] = -1;
if (jetPtr->isAvailable<char>("passJVT")) {
m_failFJvt_jet_passjvt[i] = jetPtr->getAttribute<char>("passJVT");
}
m_failFJvt_jet_fjvt[i] = -1;
if (jetPtr->isAvailable<float>("fJvt")) { // && (jetPtr->eta() < -2.5 || jetPtr->eta() > 2.5) && jetPtr->pt() < 60000) {
m_failFJvt_jet_fjvt[i] = jetPtr->auxdataConst<float>("fJvt");
}
m_failFJvt_jet_passfjvt[i] = -1;
if (jetPtr->isAvailable<char>("AnalysisTop_fJVTdecision")) {
m_failFJvt_jet_passfjvt[i] = jetPtr->getAttribute<char>("AnalysisTop_fJVTdecision");
}
++i;
}
}//ifSaveFJVT
//large-R jets
if (m_config->useLargeRJets()) {
......
......@@ -113,8 +113,9 @@ namespace top {
///-- Jets --///
if (topConfig->useJets()) {
objectSelection->jetSelection(new top::JetMC15(topConfig->jetPtcut(), topConfig->jetEtacut(),
topConfig->fwdJetAndMET()));
// objectSelection->jetSelection(new top::JetMC15(topConfig->jetPtcut(), topConfig->jetEtacut(),
// topConfig->fwdJetAndMET()));
objectSelection->jetSelection(new top::JetMC15(topConfig->jetPtcut(), topConfig->jetEtacut()));
}
///-- Large R Jets --///
......
......@@ -411,6 +411,10 @@ namespace top {
float m_weight_jvt = 0.0;
float m_weight_jvt_up = 0.0;
float m_weight_jvt_down = 0.0;
// fJVT
float m_weight_forwardjvt = 0.0;
float m_weight_forwardjvt_up = 0.0;
float m_weight_forwardjvt_down = 0.0;
// Sherpa 2.2 weight
float m_weight_sherpa_22_vjets = 0.;
......@@ -629,7 +633,9 @@ namespace top {
std::vector<float> m_jet_mv2c10;
std::vector<float> m_jet_mv2c20;
std::vector<float> m_jet_jvt;
std::vector<char> m_jet_passfjvt;
std::vector<float> m_jet_fjvt;
std::vector<char> m_jet_passfjvt; //JJJJJJJJJJJJ leaving to check fJVT cut is applied properly
std::vector<char> m_jet_passjvt; //JJJJJJJJJJJJ leaving to check JVT cut is applied properly
std::vector<float> m_jet_ip3dsv1;
std::vector<int> m_jet_truthflav;
std::vector<int> m_jet_truthPartonLabel;
......@@ -668,7 +674,9 @@ namespace top {
std::vector<float> m_failJvt_jet_phi;
std::vector<float> m_failJvt_jet_e;
std::vector<float> m_failJvt_jet_jvt;
std::vector<float> m_failJvt_jet_fjvt;
std::vector<char> m_failJvt_jet_passfjvt;
std::vector<char> m_failJvt_jet_passjvt;
std::vector<int> m_failJvt_jet_truthflav;
std::vector<int> m_failJvt_jet_truthPartonLabel;
std::vector<char> m_failJvt_jet_isTrueHS;
......@@ -681,6 +689,27 @@ namespace top {
std::vector<std::vector<float> > m_failJvt_jet_ghostTrack_z0;
std::vector<std::vector<float> > m_failJvt_jet_ghostTrack_qOverP;
// fail-FJVT jets
std::vector<float> m_failFJvt_jet_pt;
std::vector<float> m_failFJvt_jet_eta;
std::vector<float> m_failFJvt_jet_phi;
std::vector<float> m_failFJvt_jet_e;
std::vector<float> m_failFJvt_jet_jvt;
std::vector<float> m_failFJvt_jet_fjvt;
std::vector<char> m_failFJvt_jet_passfjvt;
std::vector<char> m_failFJvt_jet_passjvt;
std::vector<int> m_failFJvt_jet_truthflav;
std::vector<int> m_failFJvt_jet_truthPartonLabel;
std::vector<char> m_failFJvt_jet_isTrueHS;
std::vector<int> m_failFJvt_jet_HadronConeExclExtendedTruthLabelID; // Newer jet truth flavour label
std::vector<std::vector<float> > m_failFJvt_jet_ghostTrack_pt;
std::vector<std::vector<float> > m_failFJvt_jet_ghostTrack_eta;
std::vector<std::vector<float> > m_failFJvt_jet_ghostTrack_phi;
std::vector<std::vector<float> > m_failFJvt_jet_ghostTrack_e;
std::vector<std::vector<float> > m_failFJvt_jet_ghostTrack_d0;
std::vector<std::vector<float> > m_failFJvt_jet_ghostTrack_z0;
std::vector<std::vector<float> > m_failFJvt_jet_ghostTrack_qOverP;
// for upgrade, we store the tagging efficiency per jet & whether it is from pileup
std::vector<float> m_jet_mv1eff;
std::vector<float> m_jet_isPileup;
......@@ -1148,6 +1177,11 @@ namespace top {
const float& weight_jvt_up() const {return m_weight_jvt_up;}
const float& weight_jvt_down() const {return m_weight_jvt_down;}
// FJVT
const float& weight_forwardjvt() const {return m_weight_forwardjvt;}
const float& weight_forwardjvt_up() const {return m_weight_forwardjvt_up;}
const float& weight_forwardjvt_down() const {return m_weight_forwardjvt_down;}
// Sherpa 2.2 weight
const float& weight_sherpa_22_vjets() const {return m_weight_sherpa_22_vjets;}
......@@ -1293,7 +1327,9 @@ namespace top {
const std::vector<float>& jet_mv2c10() const {return m_jet_mv2c10;}
const std::vector<float>& jet_mv2c20() const {return m_jet_mv2c20;}
const std::vector<float>& jet_jvt() const {return m_jet_jvt;}
const std::vector<char>& jet_passfjvt() const {return m_jet_passfjvt;}
const std::vector<float>& jet_forwardjvt() const {return m_jet_fjvt;}
const std::vector<char>& jet_passforwardjvt() const {return m_jet_passfjvt;}
const std::vector<char>& jet_passjvt() const {return m_jet_passjvt;}
const std::vector<int>& jet_truthflav() const {return m_jet_truthflav;}
const std::vector<int>& jet_truthPartonLabel() const {return m_jet_truthPartonLabel;}
const std::vector<char>& jet_isTrueHS() const {return m_jet_isTrueHS;}
......@@ -1324,12 +1360,28 @@ namespace top {
const std::vector<float>& failJvt_jet_phi() const {return m_failJvt_jet_phi;}
const std::vector<float>& failJvt_jet_e() const {return m_failJvt_jet_e;}
const std::vector<float>& failJvt_jet_jvt() const {return m_failJvt_jet_jvt;}
const std::vector<char>& failJvt_jet_passfjvt() const {return m_failJvt_jet_passfjvt;}
const std::vector<float>& failJvt_jet_forwardjvt() const {return m_failJvt_jet_fjvt;}
const std::vector<char>& failJvt_jet_passforwardjvt() const {return m_failJvt_jet_passfjvt;}
const std::vector<char>& failJvt_jet_passjvt() const {return m_failJvt_jet_passjvt;}
const std::vector<int>& failJvt_jet_truthflav() const {return m_failJvt_jet_truthflav;}
const std::vector<int>& failJvt_jet_truthPartonLabel() const {return m_failJvt_jet_truthPartonLabel;}
const std::vector<char>& failJvt_jet_isTrueHS() const {return m_failJvt_jet_isTrueHS;}
const std::vector<int>& failJvt_jet_truthflavExtended() const {return m_failJvt_jet_HadronConeExclExtendedTruthLabelID;}
// fail-FJVT jets
const std::vector<float>& failFJvt_jet_pt() const {return m_failFJvt_jet_pt;}
const std::vector<float>& failFJvt_jet_eta() const {return m_failFJvt_jet_eta;}
const std::vector<float>& failFJvt_jet_phi() const {return m_failFJvt_jet_phi;}
const std::vector<float>& failFJvt_jet_e() const {return m_failFJvt_jet_e;}
const std::vector<float>& failFJvt_jet_jvt() const {return m_failFJvt_jet_jvt;}
const std::vector<float>& failFJvt_jet_forwardjvt() const {return m_failFJvt_jet_fjvt;}
const std::vector<char>& failFJvt_jet_passforwardjvt() const {return m_failFJvt_jet_passfjvt;}
const std::vector<char>& failFJvt_jet_passjvt() const {return m_failFJvt_jet_passjvt;}
const std::vector<int>& failFJvt_jet_truthflav() const {return m_failFJvt_jet_truthflav;}
const std::vector<int>& failFJvt_jet_truthPartonLabel() const {return m_failFJvt_jet_truthPartonLabel;}
const std::vector<char>& failFJvt_jet_isTrueHS() const {return m_failFJvt_jet_isTrueHS;}
const std::vector<int>& failFJvt_jet_truthflavExtended() const {return m_failFJvt_jet_HadronConeExclExtendedTruthLabelID;}
//large-R jets
const std::vector<float>& ljet_pt() const {return m_ljet_pt;}
const std::vector<float>& ljet_eta() const {return m_ljet_eta;}
......
......@@ -70,6 +70,7 @@ namespace top {
declareProperty("JetEventCleaningToolTightBad", m_jetEventCleaningToolTightBad);
declareProperty("JetUpdateJvtTool", m_jetUpdateJvtTool);
declareProperty("JetSelectfJvtTool", m_jetSelectfJvtTool);
declareProperty("JES_data2016_data2015_Recommendation_Dec2016.config", m_jetAntiKt4_MCFS_ConfigFile);
declareProperty("JetCalibrationSequenceFS", m_jetAntiKt4_MCFS_CalibSequence);
......@@ -199,28 +200,48 @@ namespace top {
m_jetUpdateJvtTool = jetUpdateJvtTool;
}
///-- Update fJVT --///
const std::string fjvt_tool_name = "fJVTTool";
if (asg::ToolStore::contains<IJetModifier>(fjvt_tool_name)) {
m_fjvtTool = asg::ToolStore::get<IJetModifier>(fjvt_tool_name);
} else {
IJetModifier* fJVTTool = new JetForwardJvtTool(fjvt_tool_name);
top::check(asg::setProperty(fJVTTool, "JvtMomentName", "AnalysisTop_JVT"),
"Failed to set JvtMomentName for JetForwardJvtTool");
// following instructions from:
// https://twiki.cern.ch/twiki/bin/view/AtlasProtected/METUtilities#MET_with_forward_JVT
if (m_config->fwdJetAndMET() == "fJVT") {
top::check(asg::setProperty(fJVTTool, "CentralMaxPt", 60e3),
"Failed to set CentralMaxPt for JetForwardJvtTool");
}
if (m_config->fwdJetAndMET() == "fJVTTight") {
top::check(asg::setProperty(fJVTTool, "OutputDec", "passFJVTTight"),
"Failed to set OutputDec for JetForwardJvtTool");
top::check(asg::setProperty(fJVTTool, "UseTightOP", true),
"Failed to set UseTightOP for JetForwardJvtTool");
///-- Calculate fJVT --///
//Only setup fJVT tool if user actually wants it
if (m_config->doForwardJVTinMET() || m_config->getfJVTWP() != "Default") {
const std::string fjvt_tool_name = "JetSelectfJvtTool";
if (asg::ToolStore::contains<IJetModifier>(fjvt_tool_name)) {
m_jetSelectfJvtTool = asg::ToolStore::get<IJetModifier>(fjvt_tool_name);
} else {
IJetModifier* JetSelectfJvtTool = new JetForwardJvtTool(fjvt_tool_name);
top::check(asg::setProperty(JetSelectfJvtTool, "JvtMomentName", "AnalysisTop_JVT"), //fJVT uses JVT decision
"Failed to set JvtMomentName for JetForwardJvtTool");
//Default fJVT WP is medium but this can't be used with default Tight MET WP
//MET WP takes precidence so making ATop default fJVT=Tight
if (m_config->getfJVTWP() != "Medium"){
// top::check(asg::setProperty(JetSelectfJvtTool, "OutputDec", "passFJVTTight"),
// "Failed to set OutputDec for JetForwardJvtTool");
top::check(asg::setProperty(JetSelectfJvtTool, "UseTightOP", true),
"Failed to set UseTightOP for JetForwardJvtTool");
}
// else{
// top::check(asg::setProperty(JetSelectfJvtTool, "OutputDec", "passFJVTMedium"),
// "Failed to set OutputDec for JetForwardJvtTool");
//}
top::check(asg::setProperty(JetSelectfJvtTool, "OutputDec", "AnalysisTop_fJVTdecision"),
"Failed to set OutputDec for JetForwardJvtTool");
// following updated instructions from: JJJJJJJJJJJJJ
// https://twiki.cern.ch/twiki/bin/view/AtlasProtected/EtmissRecommendationsRel21p2#Working_Points
// if (m_config->fwdJetAndMET() == "fJVT") {
// top::check(asg::setProperty(fJVTTool, "CentralMaxPt", 60e3),
// "Failed to set CentralMaxPt for JetForwardJvtTool");
// }
// if (m_config->fwdJetAndMET() == "fJVTTight") {
// top::check(asg::setProperty(fJVTTool, "OutputDec", "passFJVTTight"),
// "Failed to set OutputDec for JetForwardJvtTool");
// top::check(asg::setProperty(fJVTTool, "UseTightOP", true),
// "Failed to set UseTightOP for JetForwardJvtTool");
// }
top::check(JetSelectfJvtTool->initialize(), "Failed to initialize " + fjvt_tool_name);
m_jetSelectfJvtTool = JetSelectfJvtTool;
}
top::check(fJVTTool->initialize(), "Failed to initialize " + fjvt_tool_name);
m_fjvtTool = fJVTTool;
}
///-- Jet Cleaning Tools --///
......@@ -248,7 +269,7 @@ namespace top {
// JER string option configuration
bool JERisMC = m_config->isMC();
std::string JERSmearModel = m_config->jetJERSmearingModel();
// Any PseudoData option (smear MC as data)
// Any PseudoData Option (Smear MC as data)
if (JERSmearModel == "Full_PseudoData") {
if (JERisMC) JERisMC = false;
JERSmearModel = "Full";
......@@ -470,6 +491,44 @@ namespace top {
top::check(jetJvtTool->initialize(), "Failed to initialize JVT tool");
m_jetJvtTool = jetJvtTool;
}
// <jonathan.jamieson@cern.ch> Added 9th June 2020.
// Jet fJVT tool - uses same tool as for JVT, can be used for both selection and for SFs
// Only setup fJVT Efficiency tool if user actually wants it
if (m_config->getfJVTWP() != "Default") {
const std::string fjvt_tool_name = "JetForwardJvtEfficiencyTool";
const std::string fJVT_SFFile =
(m_config->useParticleFlowJets()) ?
"JetJvtEfficiency/May2020/fJvtSFFile.EMPFlow.root" : // pflow jets JJJJJJJJJJJJJJ
"JetJvtEfficiency/May2020/fJvtSFFile.EMtopo.root"; // default is EM jets
std::string fJVT_WP = m_config->getfJVTWP();
if (fJVT_WP == "Medium"){
fJVT_WP = "Loose";
}
if (asg::ToolStore::contains<CP::IJetJvtEfficiency>(fjvt_tool_name)) {
m_jetfJvtTool = asg::ToolStore::get<CP::IJetJvtEfficiency>(fjvt_tool_name);
} else {
CP::JetJvtEfficiency* jetfJvtTool = new CP::JetJvtEfficiency(fjvt_tool_name);
top::check(jetfJvtTool->setProperty("WorkingPoint", fJVT_WP),
"Failed to set fJVT WP");
top::check(jetfJvtTool->setProperty("SFFile", fJVT_SFFile),
"Failed to set fJVT SFFile name");
top::check(jetfJvtTool->setProperty("UseMuSFFormat", true),
"Failed to set fJVT SFFile to updated mu binning");
top::check(jetfJvtTool->setProperty("ScaleFactorDecorationName", "fJVTSF"),
"Failed to set fJVT SF decoration name");
top::check(jetfJvtTool->setProperty("JetfJvtMomentName", "AnalysisTop_fJVTdecision"),
"Failed to set fJVT pass/fail decoration name");
top::check(jetfJvtTool->setProperty("TruthLabel", "AnalysisTop_isHS"),
"Failed to set fJVT TruthLabel decoration name");
top::check(jetfJvtTool->setProperty("TruthJetContainerName", m_config->sgKeyTruthJets()),
"Failed to set fJVT TruthJetContainerName decoration name");
top::check(jetfJvtTool->initialize(), "Failed to initialize fJVT Efficiency tool");
m_jetfJvtTool = jetfJvtTool;
}
}
return StatusCode::SUCCESS;
}
......@@ -486,20 +545,31 @@ namespace top {
if (m_config->useParticleFlowJets()) {
top::check(metMaker->setProperty("DoPFlow", true), "Failed to set METMaker DoPFlow to true");
}
if (m_config->fwdJetAndMET() == "Tight") {
top::check(metMaker->setProperty("JetSelection", "Tight"), "Failed to set METMaker JetSelection to Tight");
} else if (m_config->fwdJetAndMET() == "fJVT") {
ATH_MSG_WARNING(" option fJVT no longer recommended, please use fJVTTight. Option to be removed.");
top::check(metMaker->setProperty("JetRejectionDec",
"passFJVT"), "Failed to set METMaker JetRejectionDec to passFJVT");
} else