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 95 of file SSVWeightsAlg.h.

Constructor & Destructor Documentation

◆ nFMethodPileupBJetBasedClass()

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

Definition at line 647 of file SSVWeightsAlg.cxx.

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

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

◆ m_nFPileupBJetMap

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

Definition at line 105 of file SSVWeightsAlg.h.

105{};

◆ m_upperboundNbjets

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

Definition at line 106 of file SSVWeightsAlg.h.


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