#include <FakeBkgInternals.h>
Definition at line 97 of file FakeBkgInternals.h.
◆ FinalState() [1/2]
FakeBkgTools::FinalState::FinalState |
( |
size_t |
h | ) |
|
|
inline |
◆ FinalState() [2/2]
FinalState::FinalState |
( |
size_t |
h, |
|
|
const unsigned |
nparticles, |
|
|
const std::string & |
strSelection, |
|
|
const std::string & |
strProc, |
|
|
std::string & |
error |
|
) |
| |
◆ accept_process()
4 bits per number + extra bit for carry
Definition at line 112 of file FakeBkgInternals.h.
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);
◆ accept_selection()
Important: the accept() function doesn't check the selection (for speed reason), this has to be done separately.
SS tight
OS tight
Definition at line 104 of file FakeBkgInternals.h.
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;
◆ hasChargeRequirement()
bool FakeBkgTools::FinalState::hasChargeRequirement |
( |
| ) |
const |
|
inline |
◆ hasOS()
bool FakeBkgTools::FinalState::hasOS |
( |
| ) |
const |
|
inline |
◆ hasSS()
bool FakeBkgTools::FinalState::hasSS |
( |
| ) |
const |
|
inline |
◆ operator<()
◆ parseProcess()
bool FinalState::parseProcess |
( |
std::string |
process, |
|
|
std::string & |
error |
|
) |
| |
|
private |
needs to be kept consistent with format used by acceptCombination() and parseSelection(); said format is the following: uint32_t w = nRT | (nRL<<5) | (nR<<10) | (nFT<<15) | (nFL<<20) | (nF<<25); // 4 bits per number + extra bit for carry
Replace the 4-bits digit at position 'offset' by the new value (nmin/nmax):
clear carry bits
clear carry bits
Definition at line 38 of file FakeBkgInternals.cxx.
40 strProc.erase(std::remove_if(strProc.begin(), strProc.end(),
41 [](
char c){ return std::isspace(c); }), strProc.end());
42 std::stringstream
ss(strProc);
44 std::regex rx0(
"([<>]=?)([0-9])([FR])(?:\\[(L|!?T)\\])?");
50 while(std::getline(
ss,token,
','))
54 if(std::regex_match(token, sm, rx0))
56 bool strict = (sm[1].str()[1] !=
'=');
57 if(sm[1].
str()[0]==
'>') nmin = sm[2].
str()[0] -
'0' +
strict*1;
60 nmax = sm[2].str()[0] -
'0';
63 error =
"number of leptons constrained to be negative in the 'process' argument: \"" + strProc +
"\"";
68 else if(std::regex_match(token, sm,
rx1))
70 nmin = sm[1].str()[0] -
'0';
76 error =
"unable to understand the specified 'process' argument: \"" + strProc +
"\"";
81 unsigned char offset = ((sm[3]==
"F")? 15 : 0);
82 if(sm[4] ==
"!T")
offset += 5;
83 else if(sm[4] ==
"L")
offset += 10;
91 error =
"unexpected error (nmin>nmax) while parsing the specified 'process' argument: \"" + strProc +
"\"";
97 error =
"the 'process' argument is empty";
◆ parseSelection()
bool FinalState::parseSelection |
( |
const unsigned short |
nparticles, |
|
|
std::string |
strSelection, |
|
|
std::string & |
error |
|
) |
| |
|
private |
Note: it is important that parseProcess() is called before this function!
replace all "!T" by "A"
Partial check that the selection and process arguments are consistent
Definition at line 105 of file FakeBkgInternals.cxx.
108 const unsigned nc = (1 << nparticles);
110 strSelection.erase(std::remove_if(strSelection.begin(), strSelection.end(),
111 [](
char c){ return std::isspace(c); }), strSelection.end());
112 std::stringstream
ss(strSelection);
116 if(std::regex_match(strSelection,
std::regex(word)))
118 while(std::getline(
ss, word,
'+'))
120 if(!word.length())
continue;
122 while((
pos=word.find(
"!T")) != std::string::npos) word.replace(
pos, 2, 1,
'A');
136 uint8_t maxT=15, maxL=15, minT=0, minL=0;
137 while(std::getline(
ss, word,
','))
140 if(std::regex_match(word, sm, rx0))
142 uint8_t o = (sm[1].length()<=1)? 1 : 0;
143 if(sm[1].
str()[0]==
'>') nmin = sm[2].
str()[0] -
'0' + o;
146 nmax = sm[2].str()[0] -
'0';
149 error =
"number of leptons constrained to be negative in the 'selection' argument: \"" + strSelection +
"\"";
156 else if(std::regex_match(word, sm,
rx1))
158 nmin = sm[1].str()[0] -
'0';
162 else if(std::regex_match(word, sm, rx2))
166 error =
"both OS and SS requirements were specifed in the 'selection' argument: \"" + strSelection +
"\"; this is not allowed";
176 error =
"unable to understand the specified 'selection' argument: \"" + strSelection +
"\"";
182 error =
"unexpected error (nmin>nmax) while parsing the specified 'selection' argument: \"" + strSelection +
"\"";
186 bool count_loose = sm[sm.size()-1] ==
"!T";
197 for(
unsigned i=0;
i<
nc;++
i)
200 if(count_loose)
n = nparticles -
n;
207 error =
"the 'selection' argument is empty";
220 error =
"the specified 'selection' and 'process' arguments are not consistent";
◆ retrieveCharges()
◆ setOS()
void FakeBkgTools::FinalState::setOS |
( |
bool |
set = true | ) |
|
|
inline |
◆ setSS()
void FakeBkgTools::FinalState::setSS |
( |
bool |
set = true | ) |
|
|
inline |
◆ m_hash
size_t FakeBkgTools::FinalState::m_hash |
|
private |
◆ m_wmax
uint32_t FakeBkgTools::FinalState::m_wmax =0x3FFFFFFF |
|
private |
◆ m_wmin
uint32_t FakeBkgTools::FinalState::m_wmin = 0x0 |
|
private |
◆ selection
FSBitset FakeBkgTools::FinalState::selection = 0 |
The documentation for this class was generated from the following files:
constexpr std::enable_if_t< is_bitmask_v< E >, E & > set(E &lhs, E rhs)
Convenience function to set bits in a class enum bitmask.