ATLAS Offline Software
Loading...
Searching...
No Matches
CP::SSVWeightsAlg::nFMethodPileupBJetBasedClass Class Reference
Collaboration diagram for CP::SSVWeightsAlg::nFMethodPileupBJetBasedClass:

Public Member Functions

 nFMethodPileupBJetBasedClass (const nlohmann::json &jsonConfig)
double getPFake (const double muactual, const int b_jet_count, const int N_fake, const double SF_fake_low, const double SF_fake_high) const

Private Attributes

std::map< std::string, std::map< std::string, double > > m_nFPileupBJetMap {}
int m_upperboundNbjets = -999
double m_lowMuHighMuThreshold = -999

Detailed Description

Definition at line 97 of file SSVWeightsAlg.h.

Constructor & Destructor Documentation

◆ nFMethodPileupBJetBasedClass()

CP::SSVWeightsAlg::nFMethodPileupBJetBasedClass::nFMethodPileupBJetBasedClass ( const nlohmann::json & jsonConfig)

Definition at line 648 of file SSVWeightsAlg.cxx.

649 : m_nFPileupBJetMap(jsonConfig["nF_pileup_bjet_based"])
650 {
651 // Extract information from JSON file for nFMethodPileupBJetBased
652 std::map<std::string, double>::iterator lastItem = std::prev(m_nFPileupBJetMap.at("high_muactual").end());
653 std::string lastItemKey = lastItem->first;
654 m_upperboundNbjets = std::stoi(lastItemKey);
655 m_lowMuHighMuThreshold = jsonConfig["CalibrationInformation"]["lowMuHighMuThreshold"];
656 }
std::map< std::string, std::map< std::string, double > > m_nFPileupBJetMap

Member Function Documentation

◆ getPFake()

double CP::SSVWeightsAlg::nFMethodPileupBJetBasedClass::getPFake ( const double muactual,
const int b_jet_count,
const int N_fake,
const double SF_fake_low,
const double SF_fake_high ) const

Definition at line 659 of file SSVWeightsAlg.cxx.

664 {
665
666 double P_fake = 1;
667 // 2D map muactual and Nbjets
668 std::string mu_key = (muactual >= m_lowMuHighMuThreshold) ? "high_muactual" : "low_muactual";
669
670 // Get the value
671 double n_F_value = 0;
672
673 if (b_jet_count < m_upperboundNbjets){
674 // Build the bjets key string
675 std::string bjets_key = std::to_string(b_jet_count) + "_bjets";
676 n_F_value = m_nFPileupBJetMap.at(mu_key).at(bjets_key);
677 }
678 else{
679 // Build the bjets key string
680 std::string bjets_key = std::to_string(m_upperboundNbjets) + "p_bjets";
681 n_F_value = m_nFPileupBJetMap.at(mu_key).at(bjets_key);
682 }
683
684 if (muactual >= m_lowMuHighMuThreshold){
685 P_fake = (poisson_pmf(N_fake, SF_fake_high*n_F_value))/poisson_pmf(N_fake, n_F_value);
686 }
687 else {
688 P_fake = (poisson_pmf(N_fake, SF_fake_low*n_F_value))/poisson_pmf(N_fake, n_F_value);
689 }
690
691 return P_fake;
692 }
static double poisson_pmf(const int k, const double lambda)

Member Data Documentation

◆ m_lowMuHighMuThreshold

double CP::SSVWeightsAlg::nFMethodPileupBJetBasedClass::m_lowMuHighMuThreshold = -999
private

Definition at line 109 of file SSVWeightsAlg.h.

◆ m_nFPileupBJetMap

std::map<std::string, std::map<std::string, double> > CP::SSVWeightsAlg::nFMethodPileupBJetBasedClass::m_nFPileupBJetMap {}
private

Definition at line 107 of file SSVWeightsAlg.h.

107{};

◆ m_upperboundNbjets

int CP::SSVWeightsAlg::nFMethodPileupBJetBasedClass::m_upperboundNbjets = -999
private

Definition at line 108 of file SSVWeightsAlg.h.


The documentation for this class was generated from the following files: