5#ifndef FAKEBKGTOOLS_FAKEBKGINTERNALS_H
6#define FAKEBKGTOOLS_FAKEBKGINTERNALS_H
65 inline float syst()
const;
77 inline float stat()
const;
80 inline float syst()
const;
102 FinalState(
size_t h,
const unsigned nparticles,
const std::string& strSelection,
const std::string& strProc, std::string&
error);
106 if(!
selection[tights.to_ulong()])
return false;
107 auto nT = tights.count();
108 if(
hasSS() && nT==2 && (tights&charges).
count()==1)
return false;
109 if(
hasOS() && nT>=2 && ((tights&charges).
count()%nT)==0)
return false;
114 auto nT = tights.count();
115 auto nR = reals.count(), nRT = (reals&tights).
count(), nRL = nR - nRT;
116 auto nF = nparticles - nR, nFT = nT - nRT, nFL = nF - nFT;
117 uint32_t w = nRT | (nRL<<5) | (nR<<10) | (nFT<<15) | (nFL<<20) | (nF<<25);
118 if((
m_wmax-w)&0x21084210 || (w-
m_wmin)&0x21084210)
return false;
124 for(
unsigned i=0;i<particles.size();++i) charges.set(i, particles[i].charge>0);
137 bool parseSelection(
const unsigned short nparticles, std::string strSelection, std::string&
error);
169 for(
auto& kv :
uncertainties) syst2 += std::pow(0.5*(kv.second.up+kv.second.down), 2);
179 if(
r.second)
r.first->second *= weight;
180 else r.first->second += weight * kv.second;
197 if(
r.second)
r.first->second *= weight;
198 else r.first->second += weight * kv.second;
214 if(
r.second)
r.first->second *= weight;
215 else r.first->second += weight * kv.second;
230 r.first->second =
nominal*kv.second;
231 r.first->second += (rhs.
nominal*u_init);
232 r.first->second += (u_init*=kv.second);
270 kv.second.up = -kv.second.up;
271 kv.second.down = -kv.second.down;
281 return 0.5f*sqrt(
stat2.up) + 0.5f*sqrt(
stat2.down);
287 for(
auto& kv :
uncertainties) syst2 += std::pow(0.5*(kv.second.up+kv.second.down), 2);
constexpr int pow(int base, int exp) noexcept
Header file for AthHistogramAlgorithm.
const std::string process
int count(std::string s, const std::string ®x)
count how many occurances of a regx are in a string
Select isolated Photons, Electrons and Muons.
ObjectType
Type of objects that have a representation in the xAOD EDM.
Efficiency real_efficiency
xAOD::Type::ObjectType type
Efficiency fake_efficiency