33 const Cut &cut)
const{
58 cout <<
"Using known yield for " << key << endl;
63 cout <<
"No entries found for " << key << endl;
68 cout <<
"Computing yield for " << key << endl;
73 (
Contains(process.
Name(),
"sig")?
Cut(oss.str()+
"*weight*eff_trig"):
Cut(oss.str()+
"*weight*eff_trig"));
76 cuts.at(0) = lumi_weight*(cut && bin.
Cut() && process.
Cut());
77 cuts.at(1) = lumi_weight*(cut && process.
Cut());
78 cuts.at(2) = lumi_weight*(process.
Cut());
79 cuts.at(3) = lumi_weight;
82 for(
size_t icut = 0; icut < cuts.size() && gps.
Weight()<=0.; ++icut){
87 Cut &this_cut = cuts.at(icut);
89 cout <<
"Trying cut " << this_cut << endl;
95 string mettru_s = this_cut.
GetCut();
96 ReplaceAll(mettru_s,
"met_calo",
"XXXYYYZZZ_calo");
98 ReplaceAll(mettru_s,
"XXXYYYZZZ_calo",
"met_calo");
99 Cut mettru_cut(mettru_s);
101 if(
verbose_) cout<<
"Yields: met "<<temp_gps.
Yield()<<
", met_tru "<<mettru_gps.
Yield();
104 if(
verbose_) cout<<
", average "<<temp_gps.
Yield()<<
" for bin "<<bin.
Name()<<endl;
106 if(icut == 0) gps = temp_gps;
112 cout <<
"Found yield=" << gps <<
'\n' << endl;
115 if(process.
IsData()) factor = 1.;
const std::string & Name() const
void ComputeYield(const YieldKey &key) const
void SetYieldAndUncertainty(double yield, double uncertainty)
void ReplaceAll(std::string &str, const std::string &orig, const std::string &rep)
bool Contains(const std::string &str, const std::string &pat)
YieldManager(double lumi=4.)
const Cut & GetCut(const YieldKey &yk)
const bool & IsData() const
std::tuple< Bin, Process, Cut > YieldKey
const bool & CountZeros() const
GammaParams GetYield(const class Cut &cut=::Cut("1")) const
const Bin & GetBin(const YieldKey &yk)
const class Cut & Cut() const
const class Cut & Cut() const
static const double store_lumi_
bool HaveYield(const YieldKey &key) const
const Process & GetProcess(const YieldKey &yk)
const std::string & Name() const
GammaParams GetYield(const YieldKey &key) const
double Uncertainty() const
const double & Luminosity() const
static std::map< YieldKey, GammaParams > yields_
void SetNEffectiveAndWeight(double n_effective, double weight)