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

Public Member Functions

 EfficiencyMethodBhadronPtEtaBasedClass (const nlohmann::json &jsonConfig)
double getPIneff (const std::vector< const xAOD::TruthParticle * > &accepted_truthBh, const std::vector< bool > &truthBh_to_SSV_matched, double SF_eff) const

Private Attributes

std::vector< doublem_ptbins {}
std::map< std::string, std::map< std::string, std::vector< double > > > m_BhadronPtEtaEfficiencyMap {}
double m_upperboundpT = -999

Detailed Description

Definition at line 110 of file SSVWeightsAlg.h.

Constructor & Destructor Documentation

◆ EfficiencyMethodBhadronPtEtaBasedClass()

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

Definition at line 547 of file SSVWeightsAlg.cxx.

548 : m_ptbins(jsonConfig["efficiency_Bhadron_pT_eta_based"]["pt_bins"].get<std::vector<double>>())
549 {
550 // Extract information from JSON file for EfficiencyMethod EfficiencyMethodBhadronPtEtaBased
551 for (size_t i = 0; i < m_ptbins.size() - 1; ++i) {
552 std::string pT_bin_key = "pt_bin_" + std::to_string((int)m_ptbins[i]) + "_" + std::to_string((int)m_ptbins[i+1]);
553 m_BhadronPtEtaEfficiencyMap[pT_bin_key] = jsonConfig["efficiency_Bhadron_pT_eta_based"][pT_bin_key];
554 }
555 m_upperboundpT = m_ptbins[m_ptbins.size()-1];
556 }
std::map< std::string, std::map< std::string, std::vector< double > > > m_BhadronPtEtaEfficiencyMap
T * get(TKey *tobj)
get a TObject* from a TKey* (why can't a TObject be a TKey?)
Definition hcg.cxx:132

Member Function Documentation

◆ getPIneff()

double CP::SSVWeightsAlg::EfficiencyMethodBhadronPtEtaBasedClass::getPIneff ( const std::vector< const xAOD::TruthParticle * > & accepted_truthBh,
const std::vector< bool > & truthBh_to_SSV_matched,
double SF_eff ) const

Definition at line 559 of file SSVWeightsAlg.cxx.

562 {
563 //construct missed truthBhs
564 const std::vector<const xAOD::TruthParticle*> missed_truthBhs = construct_not_matched_vectors(accepted_truthBhs, truthBh_to_SSV_matched);
565
566 //read off pt bins from JSON file
567 const std::vector<double> &ptbins = m_ptbins;
568
569 double P_ineff = 1;
570 for (size_t i = 0; i < missed_truthBhs.size(); ++i) {
571 //retrieve pt,eta of missed truthBh
572 double pt = missed_truthBhs[i]->pt();
573 double eta = std::abs(missed_truthBhs[i]->eta());
574 std::string pt_bin_of_truthBh = "";
575 // iterate pt bins to find appropriate efficiency bin for the truthBh pT
576 for (size_t j = 0; j < ptbins.size() - 1; ++j) {
577 if (pt >= ptbins[j] && pt < ptbins[j+1]) {
578 //construct pt bin name
579 pt_bin_of_truthBh = "pt_bin_" + std::to_string((int)ptbins[j]) + "_" + std::to_string((int)ptbins[j+1]);
580 }
581 else if (pt > m_upperboundpT){
582 pt_bin_of_truthBh = "pt_bin_" + std::to_string(m_upperboundpT) + "plus";
583 }
584 }
585 if (pt_bin_of_truthBh == ""){
586 //no pt bin found or no missed truthBh"
587 continue;
588 }
589 //retrieve eta and efficiency bins for the pT bin
590 const std::vector<double>& eta_bins = m_BhadronPtEtaEfficiencyMap.at(pt_bin_of_truthBh).at("eta");
591 const std::vector<double>& efficiencies = m_BhadronPtEtaEfficiencyMap.at(pt_bin_of_truthBh).at("efficiency");
592
593 double efficiency = 1;
594
595 //iterate eta bins to find appropriate eta bin for truthBh eta
596 for (size_t k = 0; k < eta_bins.size() - 1; ++k) {
597 double eta_low = eta_bins[k];
598 double eta_up = eta_bins[k+1];
599 if (eta >= eta_low && eta < eta_up) {
600 //eta bin found -> read off corresponding efficiency
602 }
603 }
604 //calculate P_ineff using the found efficiency
605 P_ineff = P_ineff*(1-SF_eff*efficiency)/(1-efficiency);
606 }
607 return P_ineff;
608 }
Scalar eta() const
pseudorapidity method
TEfficiency * efficiency(const std::string &effName, const std::string &tDir="", const std::string &stream="")
Simplify the retrieval of registered TEfficiency.
static const std::vector< const xAOD::TruthParticle * > construct_not_matched_vectors(const std::vector< const xAOD::TruthParticle * > &truthBhs, const std::vector< bool > &matched_vector)
float j(const xAOD::IParticle &, const xAOD::TrackMeasurementValidation &hit, const Eigen::Matrix3d &jab_inv)
list efficiencies
translate the station name indices into the string staiton name
setRcore setEtHad setFside pt

Member Data Documentation

◆ m_BhadronPtEtaEfficiencyMap

std::map<std::string, std::map<std::string, std::vector<double> > > CP::SSVWeightsAlg::EfficiencyMethodBhadronPtEtaBasedClass::m_BhadronPtEtaEfficiencyMap {}
private

Definition at line 119 of file SSVWeightsAlg.h.

119{};

◆ m_ptbins

std::vector<double> CP::SSVWeightsAlg::EfficiencyMethodBhadronPtEtaBasedClass::m_ptbins {}
private

Definition at line 118 of file SSVWeightsAlg.h.

118{};

◆ m_upperboundpT

double CP::SSVWeightsAlg::EfficiencyMethodBhadronPtEtaBasedClass::m_upperboundpT = -999
private

Definition at line 120 of file SSVWeightsAlg.h.


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