![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
ATLAS Offline Software
|
#include <LhoodMM_tools.h>
|
| LhoodMM_tools (const std::string &name) |
|
| ~LhoodMM_tools () |
|
virtual StatusCode | initialize () override |
| Dummy implementation of the initialisation function. More...
|
|
virtual StatusCode | getTotalYield (float &yield, float &statErrUp, float &statErrDown) override final |
| returns the accumulated fake lepton background yield (or compute it, in the case of the likelihood matrix method), and fills the registered histograms (if any) The 'selection' and 'process' settings used for these operations can be chosen with the 'Selection' and 'Process' properties. More...
|
|
virtual StatusCode | register1DHistogram (TH1 *h1, const float *val) override |
| associates a 1D histogram to the tool, to obtain a binned estimate of the fake lepton background the 'val' argument points to a variable corresponding to the X axis of the histogram and that needs to be updated before each call to addEvent() undefined behaviour if the pointers are invalidated during the tool's lifetime More...
|
|
virtual StatusCode | register2DHistogram (TH2 *h2, const float *xval, const float *yval) override |
| associates a 2D histogram to the tool, to obtain a binned estimate of the fake lepton background the 'xval' / 'yval' arguments point to variables corresponding to the X/Y axis of the histogram and that need to be updated before each call to addEvent() undefined behaviour if the pointers are invalidated during the tool's lifetime More...
|
|
virtual StatusCode | register3DHistogram (TH3 *h3, const float *xval, const float *yval, const float *zval) override |
| associates a 3D histogram to the tool, to obtain a binned estimate of the fake lepton background More...
|
|
double | nfakes (Double_t *poserr, Double_t *negerr) |
|
double | nfakes_std (double *error) |
|
double | nfakes_std_perEventWeight (double *error) |
|
StatusCode | setFitType (const std::string &ft) |
|
Int_t | getFitStatus () |
|
void | setPrintLevel (Int_t printLevel) |
|
void | set_do_std_perEventWeight (bool val) |
|
virtual StatusCode | saveProgress (TDirectory *dir) override |
|
StatusCode | mergeSubJobs () |
|
bool | perfectFit () |
|
virtual StatusCode | addEvent (const xAOD::IParticleContainer &particles, float extraWeight=1.f) override final |
| supply list of leptons / global variables, internal counters incremented Does not return anything; event weight(s) must be retrieved by subsequent call(s) to getEventWeight() (for tools inheriting from ILinearFakeBkgTool) More...
|
|
virtual bool | isAffectedBySystematic (const CP::SystematicVariation &systematic) const override |
| Declare the interface that this class provides. More...
|
|
virtual CP::SystematicSet | affectingSystematics () const override |
| the list of all systematics this tool can be affected by More...
|
|
virtual CP::SystematicSet | recommendedSystematics () const override |
| the list of all systematics this tool recommends to use More...
|
|
virtual StatusCode | applySystematicVariation (const CP::SystematicSet &systConfig) override |
| effects: configure this tool for the given list of systematic variations. More...
|
|
virtual CP::SystematicSet | affectingSystematicsFor (const std::string &nuisanceParameter) const override |
| These functions are slow, don't use them in the tools implementations. More...
|
|
virtual std::string | getUncertaintyDescription (const CP::SystematicVariation &systematic) const override final |
| returns a human-readable description of the source of systematic uncertainty specified as argument More...
|
|
virtual void | printUncertaintyDescription (const CP::SystematicVariation &systematic) const override final |
| prints a human-readable description of the source of systematic uncertainty specified as argument More...
|
|
virtual bool | isSystematicUncertainty (const CP::SystematicVariation &systematic) const override final |
| checks whether the specified source of uncertainty originates from a systematic uncertainty in the efficiencies (as opposed to statistical) More...
|
|
virtual bool | isStatisticalUncertainty (const CP::SystematicVariation &systematic) const override final |
| checks whether the specified source of uncertainty originates from a statistical uncertainty in the efficiencies (as opposed to systematic) More...
|
|
virtual bool | affectsElectrons (const CP::SystematicVariation &systematic) const override final |
| checks whether the specified source of uncertainty affects electrons More...
|
|
virtual bool | affectsMuons (const CP::SystematicVariation &systematic) const override final |
| checks whether the specified source of uncertainty affects muons More...
|
|
virtual bool | affectsTaus (const CP::SystematicVariation &systematic) const override final |
| checks whether the specified source of uncertainty affects taus More...
|
|
virtual bool | affectsRealEfficiencies (const CP::SystematicVariation &systematic) const override final |
| checks whether the specified source of uncertainty affects real efficiencies More...
|
|
virtual bool | affectsFakeEfficiencies (const CP::SystematicVariation &systematic) const override final |
| checks whether the specified source of uncertainty affects fake efficiencies More...
|
|
virtual bool | affectsFakeFactors (const CP::SystematicVariation &systematic) const override final |
| checks whether the specified source of uncertainty affects fake factors More...
|
|
virtual const IFakeBkgSystDescriptor & | getSystDescriptor () const override |
| retrieves an interface to various helper methods to identify what the different SystematicVariations correspond to More...
|
|
virtual void | print () const =0 |
| Print the state of the tool. More...
|
|
virtual void | print () const |
| Print the state of the tool. More...
|
|
ServiceHandle< StoreGateSvc > & | evtStore () |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | evtStore () const |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | detStore () const |
| The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
virtual StatusCode | sysInitialize () override |
| Perform system initialization for an algorithm. More...
|
|
virtual StatusCode | sysStart () override |
| Handle START transition. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | inputHandles () const override |
| Return this algorithm's input handles. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | outputHandles () const override |
| Return this algorithm's output handles. More...
|
|
Gaudi::Details::PropertyBase & | declareProperty (Gaudi::Property< T > &t) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc="none") |
| Declare a new Gaudi property. More...
|
|
void | updateVHKA (Gaudi::Details::PropertyBase &) |
|
MsgStream & | msg () const |
|
MsgStream & | msg (const MSG::Level lvl) const |
|
bool | msgLvl (const MSG::Level lvl) const |
|
|
static constexpr const char * | defaultSelection () |
| default value taken by the 'selection' argument of several methods or properties It indicates how the analysis selects leptons in the signal region The syntax supported for this arguments is described in the package documentation. More...
|
|
static constexpr const char * | defaultProcess () |
| default value taken by the 'process' argument of several methods or properties It indicates what should be treated as fake lepton background. More...
|
|
|
StatusCode | setup () |
|
StatusCode | addEventCustom (const std::vector< bool > &isTight_vals, const std::vector< FakeBkgTools::Efficiency > &realEff_vals, const std::vector< FakeBkgTools::Efficiency > &fakeEff_vals, const std::vector< int > &charges, float weight) |
|
StatusCode | incrementMatrices (const LhoodMMEvent &mmevt) |
|
StatusCode | incrementOneMatrixSet (LhoodMMFitInfo &fitInfo, const LhoodMMEvent &mmevt) |
|
void | get_init_pars (std::vector< double > &init_pars, int nlep) |
|
void | get_analytic (std::vector< double > &nrf, const int nlep) |
|
double | fixPosErr (double n_fake_fit, TMinuit_LHMM *lhoodFit) |
|
double | fixNegErr (double n_fake_fit, TMinuit_LHMM *lhoodFit) |
|
void | mapLhood (TMinuit_LHMM *lhoodFit, int nlep, double min, double max) |
|
StatusCode | fillHistograms () |
|
StatusCode | fillHisto_internal (const std::vector< LhoodMMFitInfo > &fitInfo_vec, TH1 *h) |
|
bool | importEfficiencies (bool resetDB=false) |
| load the config file(s) storing efficiencies More...
|
|
std::pair< uint16_t, float > | identifyCpSystematicVariation (const CP::SystematicVariation &systematic) const |
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &) |
| specialization for handling Gaudi::Property<SG::VarHandleKey> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &) |
| specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &) |
| specialization for handling Gaudi::Property<SG::VarHandleBase> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &) |
| specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
|
|
|
static double | logPoisson (double obs, double pred) |
|
static void | fcn_nlep (Int_t &npar, Double_t *gin, Double_t &f, Double_t *par, Int_t iflag) |
|
static void | fcn_minnlep_maxnlep (Int_t &npar, Double_t *gin, Double_t &f, Double_t *par, Int_t iflag) |
|
Definition at line 25 of file LhoodMM_tools.h.
◆ StoreGateSvc_t
◆ LhoodMM_tools()
LhoodMM_tools::LhoodMM_tools |
( |
const std::string & |
name | ) |
|
Definition at line 41 of file LhoodMM_tools.cxx.
48 declareProperty(
"FixHistogramNormalization",
m_fixNormalization,
"Boolean to determine whether or not histograms are scaled such that their normalization is equal to the fake yield computed for the entire sample (true = yes, do the scaleing)");
◆ ~LhoodMM_tools()
LhoodMM_tools::~LhoodMM_tools |
( |
| ) |
|
◆ addEvent()
|
finaloverridevirtualinherited |
supply list of leptons / global variables, internal counters incremented Does not return anything; event weight(s) must be retrieved by subsequent call(s) to getEventWeight() (for tools inheriting from ILinearFakeBkgTool)
prevent further calls to applySystematicVariation() if not allowed
only retrieved if some of the efficiency parameters are event-level!
for standalone compilation, pp is already a reference and the * operator is redefined to a no-op so that this works
Implements CP::IFakeBkgTool.
Definition at line 155 of file BaseFakeBkgTool.cxx.
160 return StatusCode::FAILURE;
168 #ifdef FAKEBKGTOOLS_ATLAS_ENVIRONMENT
171 eventInfo = &iparticles.eventInfo;
175 for(
const auto& pp : iparticles)
198 return StatusCode::FAILURE;
200 ATH_MSG_DEBUG(
"particle has fake fact. = " <<
d.fake_factor.value(
this) <<
", fake eff. = " <<
d.fake_efficiency.value(
this) <<
", real eff. = " <<
d.real_efficiency.value(
this));
204 d.real_efficiency.nominal =
p.auxdataConst<
float>(
"real_eff");
205 d.fake_efficiency.nominal =
p.auxdataConst<
float>(
"fake_eff");
◆ addEventCustom() [1/2]
StatusCode LhoodMM_tools::addEventCustom |
( |
| ) |
|
|
overrideprotectedvirtual |
Implements CP::BaseFakeBkgTool.
Definition at line 262 of file LhoodMM_tools.cxx.
266 ATH_MSG_WARNING(
"Attempt to add an event with 0 leptons. This event will be ignored.");
267 return StatusCode::SUCCESS;
269 std::vector<bool> isTight_vals;
270 std::vector<Efficiency> realEff_vals;
271 std::vector<Efficiency> fakeEff_vals;
272 std::vector<int> charges;
273 std::vector<FakeBkgTools::ParticleData>::const_iterator particles_it;
276 isTight_vals.push_back(
p.tight);
277 realEff_vals.push_back(
p.real_efficiency);
278 fakeEff_vals.push_back(
p.fake_efficiency);
279 double r_eff =
p.real_efficiency.value(
this);
280 double f_eff =
p.fake_efficiency.value(
this);
284 for(
const std::pair<short unsigned int, FakeBkgTools::Uncertainty> kv :
p.real_efficiency.uncertainties)
286 ATH_MSG_DEBUG(
"real eff uncertainties for first lepton are " << kv.second.up <<
" " << kv.second.down);
288 for(
const std::pair<short unsigned int, FakeBkgTools::Uncertainty> kv :
p.fake_efficiency.uncertainties)
290 ATH_MSG_DEBUG(
"fake eff uncertainties for first lepton are " << kv.second.up <<
" " << kv.second.down);
293 charges.push_back(
p.charge);
294 if ( r_eff < 0.01 && f_eff< 0.01) {
◆ addEventCustom() [2/2]
Definition at line 237 of file LhoodMM_tools.cxx.
245 int nlep = isTight_vals.size();
253 LhoodMMEvent mmevt(nlep, realEff_vals, fakeEff_vals, isTight_vals, charges, extraweight);
258 return StatusCode::SUCCESS;
◆ affectingSystematics()
the list of all systematics this tool can be affected by
Implements CP::IReentrantSystematicsTool.
Definition at line 409 of file BaseFakeBkgTool.cxx.
413 ATH_MSG_ERROR(
"This function can be called only once the tool has been initialized, since the number of systematic variations depends on the configuration...");
414 throw std::logic_error(
"BaseFakeBkgTool::affectingSystematics() called before initialization");
419 std::string
type =
step?
"STAT" :
"SYST";
◆ affectingSystematicsFor()
These functions are slow, don't use them in the tools implementations.
Implements CP::IFakeBkgSystDescriptor.
Definition at line 589 of file BaseFakeBkgTool.cxx.
594 ATH_MSG_ERROR(
"This function can be called only once the tool has been initialized, since the number of systematic variations depends on the configuration...");
597 bool up=
true, down=
true;
598 auto pos1=nuisanceParameter.find(
"__up"), pos2=nuisanceParameter.find(
"__down");
599 if(pos1!=std::string::npos && pos1+4==nuisanceParameter.length()) down =
false;
600 else if(pos2!=std::string::npos && pos2+6==nuisanceParameter.length())
up =
false;
601 std::string
np = nuisanceParameter.substr(0,
std::min(pos1, pos2));
605 if(syst && syst->name==
np)
◆ affectsElectrons()
|
finaloverridevirtualinherited |
◆ affectsFakeEfficiencies()
|
finaloverridevirtualinherited |
◆ affectsFakeFactors()
|
finaloverridevirtualinherited |
◆ affectsMuons()
|
finaloverridevirtualinherited |
◆ affectsRealEfficiencies()
|
finaloverridevirtualinherited |
◆ affectsTaus()
|
finaloverridevirtualinherited |
◆ applySystematicVariation()
effects: configure this tool for the given list of systematic variations.
any requested systematics that are not affecting this tool will be silently ignored (unless they cause other errors). failures: systematic unknown failures: requesting multiple variations on the same systematic (e.g. up & down) failures: requesting an unsupported variation on an otherwise supported systematic (e.g. a 2 sigma variation and the tool only supports 1 sigma variations) failures: unsupported combination of supported systematic failures: other tool specific errors
prevent further calls to applySystematicVariation() if not allowed
Implements CP::ISystematicsTool.
Definition at line 436 of file BaseFakeBkgTool.cxx.
440 ATH_MSG_ERROR(
"This function can be called only once the tool has been initialized");
441 throw std::logic_error(
"BaseFakeBkgTool::applySystematicVariation() called before initialization");
445 ATH_MSG_ERROR(
"this particular method doesn't support multiple calls to applySystematicVariation(), or after the first call to addEvent(). Please use a separate instance of the tool for each variation.");
446 throw std::logic_error(
"BaseFakeBkgTool::applySystematicVariation() called at a wrong time");
449 if(!systConfig.
size())
452 return StatusCode::SUCCESS;
458 return StatusCode::SUCCESS;
462 if(
sc != StatusCode::SUCCESS)
return sc;
463 std::unique_ptr<UncertaintyList> uncertainties;
464 for(
auto& sysvar : mysys)
469 ATH_MSG_ERROR(
"The systematic variation " << sysvar.name() <<
" is not recognized, despite being present in affectingSystematics()...");
470 return StatusCode::FAILURE;
472 if(!uncertainties) uncertainties.reset(
new UncertaintyList(
var.first,
var.second));
477 auto emplaced =
m_systSetDict.emplace(systConfig, std::move(*uncertainties));
481 return StatusCode::SUCCESS;
◆ CheckHistogramCompatibility()
StatusCode BaseFakeBkgTool::CheckHistogramCompatibility |
( |
const TH1 * |
lhs, |
|
|
const TH1 * |
rhs |
|
) |
| |
|
protectedinherited |
Definition at line 330 of file BaseFakeBkgTool.cxx.
333 if(std::string(lhs->GetName()) != rhs->GetName())
error =
"names";
334 else if(lhs->GetDimension() != rhs->GetDimension())
error =
"dimensions";
335 else if(lhs->GetNbinsX()!=rhs->GetNbinsX() || lhs->GetNbinsY()!=rhs->GetNbinsY() || lhs->GetNbinsZ()!=rhs->GetNbinsZ())
error =
"number of bins";
338 for(
auto getAxis : std::initializer_list<
const TAxis*(TH1::*)()
const>{&TH1::GetXaxis, &TH1::GetYaxis, &TH1::GetZaxis})
341 for(
int i=0;
i<=lhsAxis->GetNbins();++
i)
343 auto x=lhsAxis->GetBinUpEdge(
i),
y=rhsAxis->GetBinUpEdge(
i),
width=lhsAxis->GetBinWidth(
i?
i:1);
350 ATH_MSG_ERROR(
"the registered histogram \"" << lhs->GetName() <<
"\" is not compatible with the one saved in the in-progress ROOT file (mismatching " <<
error <<
"). Or, you tried registering two different histograms with the same name.");
351 return StatusCode::FAILURE;
353 return StatusCode::SUCCESS;
◆ clientForDB()
|
finaloverrideprotectedvirtual |
◆ declareGaudiProperty() [1/4]
specialization for handling Gaudi::Property<SG::VarHandleKeyArray>
Definition at line 170 of file AthCommonDataStore.h.
175 hndl.documentation());
◆ declareGaudiProperty() [2/4]
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h.
161 hndl.documentation());
◆ declareGaudiProperty() [3/4]
specialization for handling Gaudi::Property<SG::VarHandleBase>
Definition at line 184 of file AthCommonDataStore.h.
189 hndl.documentation());
◆ declareGaudiProperty() [4/4]
◆ declareProperty() [1/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleBase
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 245 of file AthCommonDataStore.h.
250 this->declare(hndl.
vhKey());
251 hndl.
vhKey().setOwner(
this);
◆ declareProperty() [2/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleKey
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 221 of file AthCommonDataStore.h.
◆ declareProperty() [3/6]
◆ declareProperty() [4/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This is the generic version, for types that do not derive from SG::VarHandleKey
. It just forwards to the base class version of declareProperty
.
Definition at line 333 of file AthCommonDataStore.h.
◆ declareProperty() [5/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This dispatches to either the generic declareProperty
or the one for VarHandle/Key/KeyArray.
Definition at line 352 of file AthCommonDataStore.h.
◆ declareProperty() [6/6]
◆ defaultProcess()
static constexpr const char* CP::IFakeBkgTool::defaultProcess |
( |
| ) |
|
|
inlinestaticconstexprinherited |
default value taken by the 'process' argument of several methods or properties It indicates what should be treated as fake lepton background.
The syntax supported for this arguments is described in the package documentation.
Definition at line 37 of file IFakeBkgTool.h.
◆ defaultSelection()
static constexpr const char* CP::IFakeBkgTool::defaultSelection |
( |
| ) |
|
|
inlinestaticconstexprinherited |
default value taken by the 'selection' argument of several methods or properties It indicates how the analysis selects leptons in the signal region The syntax supported for this arguments is described in the package documentation.
Definition at line 32 of file IFakeBkgTool.h.
◆ detStore()
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ extraDeps_update_handler()
Add StoreName to extra input/output deps as needed.
use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given
◆ fcn_minnlep_maxnlep()
void LhoodMM_tools::fcn_minnlep_maxnlep |
( |
Int_t & |
npar, |
|
|
Double_t * |
gin, |
|
|
Double_t & |
f, |
|
|
Double_t * |
par, |
|
|
Int_t |
iflag |
|
) |
| |
|
staticprivate |
Definition at line 557 of file LhoodMM_tools.cxx.
562 const bool verbose = (
l->m_printLevel > 0);
566 for (
int ipar = 0; ipar < npar; ipar++) {
570 int minnlep =
l->m_minnlep;
571 int maxnlep_loose =
l->m_maxnlep_loose;
577 Double_t sinterm_tot = 1.;
579 int theta_nlep_index = 1 + maxnlep_loose -minnlep;
581 for (
int ilep = minnlep; ilep <= maxnlep_loose; ilep++) {
582 theta_nlep_index +=
l->m_real_indices[ilep-1].size();
583 ASG_MSG_VERBOSE(
"theta_nlep_index for ilep = " << ilep <<
" = " << theta_nlep_index);
591 for (
int ilep = minnlep; ilep <= maxnlep_loose; ilep++) {
592 if (
l->m_current_fitInfo->eventCount[ilep-1] == 0) {
593 ASG_MSG_VERBOSE(
"m_real_indices[" << ilep-1 <<
"].size() = " <<
l->m_real_indices[ilep-1].size());
594 real_index +=
l->m_real_indices[ilep-1].size();
595 for (
int ipar = 0; ipar < (
int)
l->m_fake_indices[ilep-1].size()-1; ipar++) {
600 l->m_curr_nlep = ilep;
601 Int_t npar_thisnlep = 0x1 << ilep;
603 int theta_tot_index =
l->m_theta_tot_start_index+ilep-minnlep;
606 if (
l->m_maxnlep_loose - minnlep > 0) {
609 costerm = TMath::Cos(
par[theta_tot_index]);
614 pars_thisnlep[0] =
rsq*sinterm_tot*costerm*sinterm_tot*costerm;
615 sinterm_tot *= TMath::Sin(
par[theta_tot_index]);
617 pars_thisnlep[0] =
rsq;
621 ASG_MSG_VERBOSE(
"m_real_indices[ilep-1].size() = " <<
l->m_real_indices[ilep-1].size());
622 for (
unsigned ipar = 0; ipar <
l->m_real_indices[ilep-1].size(); ipar++) {
623 pars_thisnlep[par_index] =
par[real_index+ipar];
628 for (
int ipar = 0; ipar < (
int)
l->m_fake_indices[ilep-1].size()-1; ipar++) {
630 pars_thisnlep[par_index+ipar] =
par[theta_nlep_index];
631 if(
verbose)
ASG_MSG_VERBOSE(
"f pars_thisnlep[" << par_index+ipar <<
"] = " << pars_thisnlep[par_index+ipar]);
634 fcn_nlep(npar_thisnlep, gin,
f, pars_thisnlep, iflag);
637 real_index +=
l->m_real_indices[ilep-1].size();
◆ fcn_nlep()
void LhoodMM_tools::fcn_nlep |
( |
Int_t & |
npar, |
|
|
Double_t * |
gin, |
|
|
Double_t & |
f, |
|
|
Double_t * |
par, |
|
|
Int_t |
iflag |
|
) |
| |
|
staticprivate |
Definition at line 643 of file LhoodMM_tools.cxx.
648 const bool verbose = (
l->m_printLevel > 0);
650 int nlep =
l->m_curr_nlep;
652 int rank = 0x1 << nlep;
656 for (
int ipar = 0; ipar < npar; ipar++) {
662 std::string
txt =
"testing variable transform: angle pars in fcn: ";
663 for (
int i = 0;
i < npar;
i++) {
671 std::shared_ptr<TMatrixT<double>> nrf, MMmatrix, ntlpred;
672 nrf =
l->m_nrf_mat_vec[lepidx];
677 MMmatrix =
l->m_MMmatrix_vec[lepidx];
678 ntlpred =
l->m_ntlpred_vec[lepidx];
680 (*nrf)(0,0) =
par[0];
681 double rsq = TMath::Abs(
par[0]);
683 int rsize =
l->m_real_indices[lepidx].size();
684 int fsize =
l->m_fake_indices[lepidx].size();
686 for (
int ipar = 0; ipar < rsize; ipar++) {
687 ASG_MSG_VERBOSE(
"In fcn, setting real par " <<
l->m_real_indices[lepidx][ipar] <<
" to " <<
par[ipar+1]);
688 (*nrf)(
l->m_real_indices[lepidx][ipar], 0) =
par[ipar+1];
694 for (
int ipar = 0; ipar < fsize; ipar++) {
696 if (ipar < fsize-1 ) {
697 double costerm = TMath::Cos(
par[rsize+ipar+1]);
698 if(
verbose)
ASG_MSG_VERBOSE(
"for setting fake parameter, sinterm = " << sinterm <<
" par index = " <<
l->m_real_indices[lepidx].size()+ipar+1);
699 (*nrf)(
l->m_fake_indices[lepidx][ipar],0) =
rsq*sinterm*costerm*sinterm*costerm;
701 (*nrf)(
l->m_fake_indices[lepidx][ipar],0) =
rsq*sinterm*sinterm;
705 ASG_MSG_VERBOSE(
"In fcn, setting fake par " <<
l->m_fake_indices[lepidx][ipar] <<
" to " << (*nrf)(
l->m_fake_indices[lepidx][ipar],0));
707 sinterm *= TMath::Sin(
par[rsize+ipar+1]);
715 *ntlpred = (*MMmatrix)*(*nrf);
724 if (
l->m_doFakeFactor) {
730 for (
int ipar = ipar_start; ipar < rank; ipar++) {
731 if(
verbose)
ASG_MSG_VERBOSE(
"Comparing parameter " << ipar <<
": " <<
l->m_current_fitInfo->event_cat.at(lepidx).at(ipar) <<
" to " << (*ntlpred)(ipar,0));
733 int nobs =
l->m_current_fitInfo->event_cat.at(lepidx).at(ipar);
736 s=
l->m_current_fitInfo->event_sumw2.at(lepidx).at(ipar)/nobs;
◆ fillHisto_internal()
Definition at line 1159 of file LhoodMM_tools.cxx.
1173 int nbins =
h->GetNcells();
1176 Double_t
nf, poserr, negerr, shift = 0.;
1178 for (
int ibin = 0; ibin <
nbins; ibin++) {
1182 if (totEvents > 0) {
1183 ATH_MSG_VERBOSE(
"Filling bin " << ibin <<
" with " << totEvents <<
" events");
1185 h->SetBinContent(ibin,
nf+shift);
1186 if (TMath::IsNaN(
h->GetBinContent(ibin))) {
1187 h->SetBinContent(ibin,0.);
1188 h->SetBinError(ibin, 0.);
1190 h->SetBinError(ibin,TMath::Max(poserr,-negerr));
1193 h->SetBinContent(ibin,0.);
1194 h->SetBinError(ibin, 0.);
1196 ATH_MSG_VERBOSE(
"Result is " <<
h->GetBinContent(ibin) <<
" +/- " <<
h->GetBinError(ibin));
1201 double poserr, negerr;
1205 totFakes =
nfakes(&poserr, &negerr);
1208 double totHistContent = 0.;
1209 for (
int ibin = 0; ibin <
nbins; ibin++) {
1210 totHistContent +=
h->GetBinContent(ibin);
1217 if (totHistContent > 0.) {
1218 scaleFactor = totFakes/totHistContent;
1222 for (
int ibin = 1; ibin <=
nbins; ibin++) {
1223 h->SetBinContent(ibin, scaleFactor*
h->GetBinContent(ibin));
1224 h->SetBinError(ibin, scaleFactor*
h->GetBinError(ibin));
1227 return StatusCode::SUCCESS;
◆ fillHistograms()
StatusCode LhoodMM_tools::fillHistograms |
( |
| ) |
|
|
private |
Definition at line 1132 of file LhoodMM_tools.cxx.
1137 auto & fitInfo_vec = map1_iter->second;
1143 auto& fitInfo_vec = map2_iter->second;
1144 TH2*
histogram = (TH2*)map2_iter->first;
1150 auto& fitInfo_vec = map3_iter->second;
◆ fixNegErr()
double LhoodMM_tools::fixNegErr |
( |
double |
n_fake_fit, |
|
|
TMinuit_LHMM * |
lhoodFit |
|
) |
| |
|
private |
Definition at line 1581 of file LhoodMM_tools.cxx.
1586 Double_t f_from_fit, junk;
1589 lhoodFit->mnstat(f_from_fit, junk, junk, ijunk, ijunk, ijunk);
1592 double n_fake_guess_hi = n_fake_fit;
1593 double n_fake_guess_lo = 0.;
1594 double n_fake_guess = n_fake_guess_lo;
1595 double f_with_guess;
1598 bool stopSearch = 0;
1599 double convergeCriteria = 0.01;
1600 double min_n_fake_guess = 0.05;
1602 int nfake_tot_index = 1;
1604 Double_t arglist[10];
1608 arglist[0] = nfake_tot_index;
1609 arglist[1] = n_fake_fit;
1610 lhoodFit->mnexcm(
"SET PAR", arglist, 2, ierflg);
1611 lhoodFit->mnexcm(
"FIX PAR", arglist, 1, ierflg);
1615 lhoodFit->mnexcm(
"MIGRAD", arglist ,2,ierflg);
1618 lhoodFit->mnstat(f_from_fit, junk, junk, ijunk, ijunk, ijunk);
1620 while (!stopSearch) {
1624 arglist[0] = nfake_tot_index;
1625 arglist[1] = n_fake_guess;
1626 lhoodFit->mnexcm(
"SET PAR", arglist, 2, ierflg);
1627 lhoodFit->mnexcm(
"FIX PAR", arglist, 1, ierflg);
1631 lhoodFit->mnexcm(
"MIGRAD", arglist ,2,ierflg);
1633 lhoodFit->mnstat(f_with_guess, junk, junk, ijunk, ijunk, ijunk);
1635 ATH_MSG_VERBOSE(
"nlep, n_fake_guess, n_fake_guess_lo, n_fake_guesss_hi, f_from_fit, f_with_guess: " <<
"?" <<
" " << n_fake_guess <<
" " << n_fake_guess_lo <<
" " << n_fake_guess_hi <<
" " << f_from_fit <<
" " << f_with_guess);
1637 if ((f_with_guess - f_from_fit) > 0.5) {
1638 n_fake_guess_lo = n_fake_guess;
1640 n_fake_guess_hi = n_fake_guess;
1642 n_fake_guess = 0.5*(n_fake_guess_lo+n_fake_guess_hi);
1644 if (((n_fake_guess_hi - n_fake_guess_lo)/n_fake_guess_hi < convergeCriteria) || (n_fake_guess_hi < min_n_fake_guess) ) {
1646 if (n_fake_guess_hi < n_fake_fit) {
1654 arglist[0] = nfake_tot_index;
1655 arglist[1] = n_fake_fit;
1656 lhoodFit->mnexcm(
"SET PAR", arglist, 2, ierflg);
1659 return n_fake_guess - n_fake_fit;
◆ fixPosErr()
double LhoodMM_tools::fixPosErr |
( |
double |
n_fake_fit, |
|
|
TMinuit_LHMM * |
lhoodFit |
|
) |
| |
|
private |
Definition at line 1490 of file LhoodMM_tools.cxx.
1495 Double_t f_from_fit, junk;
1499 double n_fake_guess_hi = TMath::Max(n_fake_fit*5,1.);
1500 double n_fake_guess_lo = n_fake_fit;
1501 double n_fake_guess = n_fake_guess_hi;
1502 double f_with_guess;
1505 bool stopSearch = 0;
1507 double convergeCriteria = 0.01;
1509 int nfake_tot_index = 1;
1511 Double_t arglist[10];
1515 arglist[0] = nfake_tot_index;
1516 arglist[1] = n_fake_fit;
1517 lhoodFit->mnexcm(
"SET PAR", arglist, 2, ierflg);
1518 lhoodFit->mnexcm(
"FIX PAR", arglist, 1, ierflg);
1522 lhoodFit->mnexcm(
"MIGRAD", arglist ,2,ierflg);
1525 lhoodFit->mnstat(f_from_fit, junk, junk, ijunk, ijunk, ijunk);
1528 while (!stopSearch) {
1530 arglist[0] = nfake_tot_index;
1531 arglist[1] = n_fake_guess;
1532 lhoodFit->mnexcm(
"SET PAR", arglist, 2, ierflg);
1533 lhoodFit->mnexcm(
"FIX PAR", arglist, 1, ierflg);
1537 lhoodFit->mnexcm(
"MIGRAD", arglist ,2,ierflg);
1540 lhoodFit->mnstat(f_with_guess, junk, junk, ijunk, ijunk, ijunk);
1542 ATH_MSG_VERBOSE(
"nlep, n_fake_guess, n_fake_guess_lo, n_fake_guesss_hi, f_from_fit, f_with_guess: " <<
"?" <<
" " << n_fake_guess <<
" " << n_fake_guess_lo <<
" " << n_fake_guess_hi <<
" " << f_from_fit <<
" " << f_with_guess);
1544 if (TMath::IsNaN(f_with_guess)) {
1545 f_with_guess = f_from_fit + 1.;
1547 if ((f_with_guess - f_from_fit) > 0.5) {
1548 n_fake_guess_hi = n_fake_guess;
1550 n_fake_guess_lo = n_fake_guess;
1553 n_fake_guess = 0.5*(n_fake_guess_lo+n_fake_guess_hi);
1555 ATH_MSG_VERBOSE(
"n_fake_guess_lo, hi = " << n_fake_guess_hi <<
" " << n_fake_guess_lo);
1556 if ((n_fake_guess_hi - n_fake_guess_lo)/n_fake_guess_hi < convergeCriteria) {
1558 ATH_MSG_VERBOSE(
"(n_fake_guess_lo, n_fake_fit = " << n_fake_guess_lo <<
" " << n_fake_fit);
1559 if (n_fake_guess_lo > n_fake_fit) {
1568 arglist[0] = nfake_tot_index;
1569 arglist[1] = n_fake_fit;
1570 lhoodFit->mnexcm(
"SET PAR", arglist, 2, ierflg);
1573 return n_fake_guess - n_fake_fit;
◆ get_analytic()
void LhoodMM_tools::get_analytic |
( |
std::vector< double > & |
nrf, |
|
|
const int |
nlep |
|
) |
| |
|
private |
Definition at line 1333 of file LhoodMM_tools.cxx.
1341 int lepidx = nlep-1;
1345 const int rank = 0x1 << nlep;
1347 std::vector<FakeBkgTools::Efficiency> coeff_denom(rank);
1352 for (
int irf = 0; irf < rank; irf++) {
1356 coeff_denom[irf].setToConst(0.);
1358 float chargefactor ;
1361 for (
int ibit = 0; ibit < nlep; ibit++) {
1362 reals.set(ibit, ~fakes[ibit]);
1364 for (
int itl = 0; itl < rank; itl++) {
1368 for (
int ibit = 0; ibit < nlep; ibit++) {
1369 tights.set(ibit, ~antitights[ibit]);
1374 if (
m_fsvec[lepidx]->accept_selection(tights, charges)
1375 &&
m_fsvec[lepidx]->accept_process(nlep, reals, tights) ) {
1380 if (nlep > 2 && tights.count() == 2) {
1386 if (nlep == 2 && tights.count() == 2) {
1392 chargefactor =
m_OSfrac[lepidx][tights.count()];
1394 ATH_MSG_VERBOSE(
"chargefactor = " << chargefactor <<
" for nlep = " << nlep);
1400 coeff_denom[irf].add(tmpEff);
1409 if (coeff_denom[irf].
nominal == 0.) {
1413 for (
int itl = 0; itl < rank; itl++) {
1420 std::shared_ptr<TMatrixT<double>> MMmatrix;
1423 for (
int i = 0;
i < rank;
i++) {
1424 for (
int j = 0; j < rank; j++) {
1432 if(verbose) MMmatrix->Print();
1434 TMatrixT<double> MMmatrix_inv(rank,rank);
1435 MMmatrix_inv = *MMmatrix;
1436 MMmatrix_inv.Invert();
1438 TMatrixT<double> MMmatrix_sqr = MMmatrix_inv;
1439 for (
int i = 0;
i < rank;
i++) {
1440 for (
int j = 0; j < rank; j++) {
1441 MMmatrix_sqr(
i,j) *= MMmatrix_sqr[
i][j];
1445 TMatrixT<double> nevents_mat(rank,1), nfake_mat(rank,1), nfake_err_mat(rank,1);
1446 for (
int i = 0;
i < rank;
i++) {
1451 if(
verbose) nevents_mat.Print();
1453 nfake_mat = MMmatrix_inv*nevents_mat;
1456 if(
verbose) MMmatrix->Print();
1458 if(
verbose) nevents_mat.Print();
1460 if(
verbose) nfake_mat.Print();
1463 nfake_err_mat = MMmatrix_sqr*nevents_mat;
1466 for (
int ipar = 0; ipar < (0x1 <<nlep) ; ipar++) {
1467 nrf[ipar] = nfake_mat(ipar, 0);
1473 for (
int ibit = 0; ibit < nlep; ibit++) {
1474 tights.set(ibit, 1);
1475 reals.set(ibit, ~fakes[ibit]);
1477 if (
m_fsvec[lepidx]->accept_process(nlep, reals, tights) &&
m_fsvec[lepidx]->accept_selection(tights, charges)) {
1478 ATH_MSG_VERBOSE(
"Adding " << nfake_mat(ipar,0) <<
" to m_nfakes_std");
1485 ATH_MSG_VERBOSE(
"Accepted " << n_proc_acc <<
" processes for nlep = " << nlep);
◆ get_init_pars()
void LhoodMM_tools::get_init_pars |
( |
std::vector< double > & |
init_pars, |
|
|
int |
nlep |
|
) |
| |
|
private |
Definition at line 1243 of file LhoodMM_tools.cxx.
1247 int lepidx = nlep-1;
1250 nrf.resize(0
x1 <<nlep);
1255 std::string
txt =
"Testing variable transform: Initial nrf: ";
1256 for (
auto i = nrf.begin();
i != nrf.end(); ++
i)
1262 double nfakes_std_thisnlep = 0;
1265 for (
int ipar = 0; ipar < 0x1 <<nlep; ipar++) {
1269 for (
int ibit = 0; ibit < nlep; ibit++) {
1270 reals.set(ibit, ~fakes[ibit]);
1273 bool countsAsFake =
false;
1274 for (
int jpar = 0; jpar < 0x1 <<nlep; jpar++) {
1276 for (
int kpar = 0; kpar < 0x1 <<nlep; kpar++) {
1278 if (!countsAsFake &&
1279 m_fsvec[lepidx]->accept_process(nlep, reals, tights) &&
1280 m_fsvec[lepidx]->accept_selection(tights, charges) ) {
1282 nfakes_std_thisnlep += nrf[ipar];
1284 countsAsFake =
true;
1289 if (!countsAsFake) {
1296 init_pars[0] = nfakes_std_thisnlep;
1297 for (
unsigned ipar = 1; ipar <=
m_real_indices[lepidx].size(); ipar++) {
1301 if (nfakes_std_thisnlep > 0.5) {
1302 double sinterm = 1.;
1305 init_pars[ipar] = TMath::ACos(TMath::Sqrt(TMath::Max(nrf[
m_fake_indices[lepidx][ifake] ], 0.)/(nfakes_std_thisnlep))/sinterm);
1306 sinterm *= TMath::Sin(init_pars[ipar]);
1316 txt =
"testing variable transform: Initial pars: ";
1317 for (
int i = 0;
i < (0x1 << nlep);
i++) {
1324 for (
int ipar = 2; ipar < (0x1 << nlep); ipar++) {
1325 if (TMath::IsNaN(init_pars[ipar])) {
1326 init_pars[ipar] = 0.;
1328 ATH_MSG_VERBOSE(
"Setting angle parameter " << ipar <<
" to " << init_pars[ipar]);
◆ getCachedFinalState()
FinalState BaseFakeBkgTool::getCachedFinalState |
( |
uint8_t |
nparticles, |
|
|
const std::string & |
strPID, |
|
|
const std::string & |
strProc, |
|
|
bool & |
success |
|
) |
| |
|
protectedinherited |
◆ getFitStatus()
Int_t CP::LhoodMM_tools::getFitStatus |
( |
| ) |
|
|
inline |
◆ getKey()
Get the (hashed) key of an object that is in the event store.
This is a bit of a special one. StoreGateSvc
and xAOD::TEvent
both provide ways for getting the SG::sgkey_t
key for an object that is in the store, based on a bare pointer. But they provide different interfaces for doing so.
In order to allow tools to efficiently perform this operation, they can use this helper function.
- See also
- asg::AsgTool::getName
- Parameters
-
ptr | The bare pointer to the object that the event store should know about |
- Returns
- The hashed key of the object in the store. If not found, an invalid (zero) key.
Definition at line 119 of file AsgTool.cxx.
121 #ifdef XAOD_STANDALONE
124 return evtStore()->event()->getKey( ptr );
127 return (
proxy ==
nullptr ? 0 :
proxy->sgkey() );
128 #endif // XAOD_STANDALONE
◆ getListOfEfficienciesAffectedBy()
std::string BaseFakeBkgTool::getListOfEfficienciesAffectedBy |
( |
uint16_t |
uid | ) |
const |
|
protectedinherited |
Definition at line 356 of file BaseFakeBkgTool.cxx.
360 ATH_MSG_ERROR(
"This function can be called only once the tool has been initialized");
363 std::bitset<Database::N_EFFICIENCY_TYPES> affects;
369 if(syst) affects = syst->affects;
372 ATH_MSG_ERROR(
"uncertainty with UID " << std::hex << uid << std::dec <<
" not found in database");
377 if(affects[Database::ELECTRON_REAL_EFFICIENCY])
info +=
"electron real efficiencies, ";
378 if(affects[Database::ELECTRON_FAKE_EFFICIENCY])
info +=
"electron fake efficiencies, ";
379 if(affects[Database::ELECTRON_FAKE_FACTOR])
info +=
"electron fake factors, ";
380 if(affects[Database::MUON_REAL_EFFICIENCY])
info +=
"muon real efficiencies, ";
381 if(affects[Database::MUON_FAKE_EFFICIENCY])
info +=
"muon fake efficiencies, ";
382 if(affects[Database::MUON_FAKE_FACTOR])
info +=
"muon fake factors, ";
383 if(affects[Database::PHOTON_ELE_FAKE_FACTOR])
info +=
"electron->photon fake rate, ";
384 if(affects[Database::PHOTON_ELE_FAKE_FACTOR_SF])
info +=
"electron->photon fake rate scale factor, ";
385 return info.substr(0,
info.size()-2);
◆ getName()
const std::string & asg::AsgTool::getName |
( |
const void * |
ptr | ) |
const |
|
inherited |
Get the name of an object that is / should be in the event store.
This is a bit of a special one. StoreGateSvc
and xAOD::TEvent
both provide ways for getting the std::string
name for an object that is in the store, based on a bare pointer. But they provide different interfaces for doing so.
In order to allow tools to efficiently perform this operation, they can use this helper function.
- See also
- asg::AsgTool::getKey
- Parameters
-
ptr | The bare pointer to the object that the event store should know about |
- Returns
- The string name of the object in the store. If not found, an empty string.
Definition at line 106 of file AsgTool.cxx.
108 #ifdef XAOD_STANDALONE
111 return evtStore()->event()->getName( ptr );
114 static const std::string
dummy =
"";
116 #endif // XAOD_STANDALONE
◆ getProperty()
template<class T >
const T* asg::AsgTool::getProperty |
( |
const std::string & |
name | ) |
const |
|
inherited |
Get one of the tool's properties.
◆ getSystDescriptor()
|
inlineoverridevirtualinherited |
retrieves an interface to various helper methods to identify what the different SystematicVariations correspond to
Implements CP::IFakeBkgTool.
Definition at line 74 of file BaseFakeBkgTool.h.
◆ getTotalYield()
StatusCode LhoodMM_tools::getTotalYield |
( |
float & |
yield, |
|
|
float & |
statErrorUp, |
|
|
float & |
statErrorDown |
|
) |
| |
|
finaloverridevirtual |
returns the accumulated fake lepton background yield (or compute it, in the case of the likelihood matrix method), and fills the registered histograms (if any) The 'selection' and 'process' settings used for these operations can be chosen with the 'Selection' and 'Process' properties.
Only statistical uncertainties can be retrieved; use applySystematicVariation() to obtain uncertainties
Implements CP::IFakeBkgTool.
Definition at line 302 of file LhoodMM_tools.cxx.
311 Double_t poserr, negerr;
314 yield =
nfakes(&poserr,&negerr);
316 ATH_MSG_DEBUG(
"Leaving getTotalYield with yield = " << yield);
319 statErrDown = -negerr;
◆ getUncertaintyDescription()
|
finaloverridevirtualinherited |
returns a human-readable description of the source of systematic uncertainty specified as argument
need to add more info (bin index, etc)
Implements CP::IFakeBkgSystDescriptor.
Definition at line 490 of file BaseFakeBkgTool.cxx.
494 ATH_MSG_ERROR(
"This function can be called only once the tool has been initialized");
501 ATH_MSG_WARNING(
"Systematic variation " + systematic.
name() +
" is not recognized by BaseFakeBkgTool");
507 return "Total statistical uncertainty in the event yield";
513 info =
"Statistical uncertainty affecting ";
521 info =
"Systematic uncertainty \"" + syst->name +
"\" affecting ";
525 ATH_MSG_ERROR(
"uncertainty with UID " << std::hex << UID << std::dec <<
" not found in database");
◆ identifyCpSystematicVariation()
Definition at line 388 of file BaseFakeBkgTool.cxx.
392 ATH_MSG_ERROR(
"This function can be called only once the tool has been initialized, since the number of systematic variations depends on the configuration...");
393 throw std::logic_error(
"BaseFakeBkgTool::identifyCpSystematicVariation() called before initialization");
397 if(!std::regex_match(
bn, smr,
std::regex(
"FAKEBKG_(STAT|SYST)_VAR(\\d+)")))
return {{0}, 0.f};
398 unsigned index = std::stol(smr[2].
str());
◆ importEfficiencies()
bool BaseFakeBkgTool::importEfficiencies |
( |
bool |
resetDB = false | ) |
|
|
privateinherited |
load the config file(s) storing efficiencies
XML parsing error
ROOT histograms importing error, or unknown error
Definition at line 109 of file BaseFakeBkgTool.cxx.
139 std::string fullmsg =
"(while parsing XML, line";
142 fullmsg +=
"): " +
err.reason;
◆ incrementMatrices()
Definition at line 324 of file LhoodMM_tools.cxx.
326 int nlep = mmevt.
nlep();
338 const float*
val = map1_iter->second;
339 TH1*
h = map1_iter->first;
346 fitInfo = &histoMap->second[
icell];
352 fitInfo = &histoMap->second[
icell];
360 return StatusCode::FAILURE;
364 std::map<TH2*, std::pair<const float*, const float*> >
::iterator map2_iter;
366 std::pair<const float*, const float*>
val = map2_iter->second;
367 TH2*
h = map2_iter->first;
375 fitInfo = &histoMap->second[
icell];
380 fitInfo = &histoMap->second[
icell];
384 return StatusCode::FAILURE;
389 std::map<TH3*, std::tuple<const float*, const float*, const float*> >
::iterator map3_iter;
391 std::tuple<const float*, const float*, const float*>
val = map3_iter->second;
392 TH3*
h = map3_iter->first;
399 fitInfo = &histoMap->second[
icell];
403 icell =
h->FindBin(*(std::get<0>(
val)), *(std::get<1>(
val)), *(std::get<2>(
val)) );
404 fitInfo = &histoMap->second[
icell];
408 return StatusCode::FAILURE;
412 return StatusCode::SUCCESS;
◆ incrementOneMatrixSet()
Definition at line 415 of file LhoodMM_tools.cxx.
418 int nlep = mmevt.
nlep();
420 int rank = 0x1 << nlep;
430 unsigned int catIndex = 0;
431 for (
int jlep = 0; jlep < nlep; jlep++) {
432 catIndex += (!mmevt.
isTight(jlep)) << jlep;
449 for (
int icomb = 0; icomb < (0x1 << nlep); icomb++) {
451 std::bitset<s_nLepMax+1> tights(icomb);
452 int ntight = tights.count();
454 for (
int jlep = 0; jlep < nlep; jlep++) {
456 totcharge += mmevt.
charge(jlep);
460 ATH_MSG_VERBOSE(
"Setting OSfrac_denom[" << lepidx <<
"][" << ntight <<
"]");
465 ATH_MSG_VERBOSE(
"Setting OSfrac_num[" << lepidx <<
"][" << ntight <<
"]");
466 if ((TMath::Abs(totcharge) < ntight) || ntight == 1) fitInfo.
OSfrac_num[lepidx][ntight]+=
weight;
470 std::vector<std::vector<FakeBkgTools::Efficiency>>
vals(2, std::vector<FakeBkgTools::Efficiency>(nlep));
471 for (
int ilep = 0; ilep < nlep; ilep++) {
480 vals[0][ilep].setToConst(1.0);
490 for (
int irf = 0; irf < rank; irf++) {
491 for (
int itl = 0; itl < rank; itl++) {
493 for (
int ilep = 0; ilep < nlep; ilep++) {
494 if (itl & (0
x1 << ilep) ) {
495 if (irf & (0
x1 << ilep)) {
503 if (irf & (0
x1 << ilep) ) {
510 ATH_MSG_VERBOSE(
"about to set m_coeffs_num[" << lepidx <<
"][" << itl <<
"][" << irf <<
"]");
512 fitInfo.
normterms[lepidx][(itl<<nlep) + irf].
add(curr_coeff_num);
513 fitInfo.
coeffs_num[lepidx][itl][irf].add(curr_coeff_num);
518 return StatusCode::SUCCESS;
521 return StatusCode::FAILURE;
◆ initialize()
StatusCode LhoodMM_tools::initialize |
( |
| ) |
|
|
overridevirtual |
Dummy implementation of the initialisation function.
It's here to allow the dual-use tools to skip defining an initialisation function. Since many are doing so...
Reimplemented from CP::BaseFakeBkgTool.
Definition at line 68 of file LhoodMM_tools.cxx.
◆ inputHandles()
Return this algorithm's input handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ isAffectedBySystematic()
◆ isStatisticalUncertainty()
|
finaloverridevirtualinherited |
checks whether the specified source of uncertainty originates from a statistical uncertainty in the efficiencies (as opposed to systematic)
Implements CP::IFakeBkgSystDescriptor.
Definition at line 540 of file BaseFakeBkgTool.cxx.
543 if(UID)
return Database::isStatUID(UID);
◆ isSystematicUncertainty()
|
finaloverridevirtualinherited |
checks whether the specified source of uncertainty originates from a systematic uncertainty in the efficiencies (as opposed to statistical)
Implements CP::IFakeBkgSystDescriptor.
Definition at line 533 of file BaseFakeBkgTool.cxx.
536 if(UID)
return Database::isSystUID(UID);
◆ logPoisson()
double LhoodMM_tools::logPoisson |
( |
double |
obs, |
|
|
double |
pred |
|
) |
| |
|
staticprivate |
Definition at line 544 of file LhoodMM_tools.cxx.
546 double f = -(obs*TMath::Log(pred)-pred);
547 if (obs > 0)
f += obs*TMath::Log(obs)-obs;
◆ mapLhood()
void CP::LhoodMM_tools::mapLhood |
( |
TMinuit_LHMM * |
lhoodFit, |
|
|
int |
nlep, |
|
|
double |
min, |
|
|
double |
max |
|
) |
| |
|
private |
◆ mergeSubJobs()
StatusCode LhoodMM_tools::mergeSubJobs |
( |
| ) |
|
Definition at line 1700 of file LhoodMM_tools.cxx.
1706 std::unique_ptr<TFile>
fin(
new TFile(
filename.c_str()));
1707 if (
fin ==
nullptr) {
1709 return StatusCode::FAILURE;
1714 return StatusCode::FAILURE;
1720 TTree *t_nlep = (TTree*)
fin->Get((
prefix +
"LhoodMM_progress_nlep").c_str());
1721 if (t_nlep ==
nullptr) {
1723 return StatusCode::FAILURE;
1726 int merged_maxnlep, merged_maxnlep_prev = -1;
1727 t_nlep->SetBranchAddress(
"maxnlep", &merged_maxnlep);
1729 TTree *
t = (TTree*)
fin->Get((
prefix +
"LhoodMM_progress").c_str());
1732 return StatusCode::FAILURE;
1737 Int_t
nentries = (Int_t)t_nlep->GetEntries();
1738 for (Int_t ievt = 0; ievt <
nentries; ievt++) {
1739 t_nlep->GetEntry(ievt);
1740 if (ievt > 0 && (merged_maxnlep != merged_maxnlep_prev)) {
1741 ATH_MSG_ERROR(
"Attempting to merge files with different lepton multiplicities. This is not supported.");
1742 return StatusCode::FAILURE;
1744 merged_maxnlep_prev = merged_maxnlep;
1755 t->SetBranchAddress(
"glb_fitInfo", &fitInfoPtr );
1761 std::unique_ptr<std::map<TH1*, std::vector< LhoodMMFitInfo > > > tmp_fitInfo_1dhisto_map(
new std::map<TH1*, std::vector< LhoodMMFitInfo > >);
1762 auto *tmp_fitInfo_1dhisto_map_ptr = tmp_fitInfo_1dhisto_map.get();
1763 t->SetBranchAddress(
"fitInfo_1dhisto_map", &tmp_fitInfo_1dhisto_map_ptr);
1764 std::unique_ptr<std::map<TH2*, std::vector< LhoodMMFitInfo > > > tmp_fitInfo_2dhisto_map(
new std::map<TH2*, std::vector< LhoodMMFitInfo > >);
1765 auto *tmp_fitInfo_2dhisto_map_ptr = tmp_fitInfo_2dhisto_map.get();
1766 t->SetBranchAddress(
"fitInfo_2dhisto_map", &tmp_fitInfo_2dhisto_map_ptr);
1767 std::map<TH3*, std::vector< LhoodMMFitInfo > > *tmp_fitInfo_3dhisto_map =
new std::map<TH3*, std::vector< LhoodMMFitInfo > >;
1768 t->SetBranchAddress(
"fitInfo_3dhisto_map", &tmp_fitInfo_3dhisto_map);
1771 for (Int_t ievt = 0; ievt <
nentries; ievt++) {
1778 for (
auto&
im: *tmp_fitInfo_1dhisto_map) {
1781 std::string iname = ihistogram->GetName();
1782 if (
hname == iname) {
1794 for (
auto&
im: *tmp_fitInfo_2dhisto_map) {
1797 std::string iname = ihistogram->GetName();
1798 if (
hname == iname) {
1810 for (
auto&
im: *tmp_fitInfo_3dhisto_map){
1813 std::string iname = ihistogram->GetName();
1814 if (
hname == iname) {
1834 return StatusCode::SUCCESS;
◆ msg() [1/2]
◆ msg() [2/2]
◆ msg_level_name()
const std::string & asg::AsgTool::msg_level_name |
( |
| ) |
const |
|
inherited |
A deprecated function for getting the message level's name.
Instead of using this, weirdly named function, user code should get the string name of the current minimum message level (in case they really need it...), with:
MSG::name( msg().level() )
This function's name doesn't follow the ATLAS coding rules, and as such will be removed in the not too distant future.
- Returns
- The string name of the current minimum message level that's printed
Definition at line 101 of file AsgTool.cxx.
◆ msgLvl()
◆ nfakes()
double LhoodMM_tools::nfakes |
( |
Double_t * |
poserr, |
|
|
Double_t * |
negerr |
|
) |
| |
Definition at line 746 of file LhoodMM_tools.cxx.
762 for (
int ilep = 0; ilep <
s_nLepMax; ilep++) {
766 if (
error.size() > 0) {
785 for (
int icomb = 0; icomb < (0x1 << (ilep+1)); icomb++) {
787 ATH_MSG_VERBOSE(
"ilep " << ilep <<
" (0x1 << ilep) " << std::hex << (0
x1 << ilep) <<
" icomb " << std::hex << icomb << std::dec);
791 if (
m_fsvec[ilep]->accept_selection(tights, charges)) {
793 ATH_MSG_VERBOSE(
"tights = " << std::hex << tights << std::dec <<
" nlep = " << nlep);
807 int maxNlep_proc = 0;
809 for(
unsigned c=0;
c<(1
u<<
n);++
c)
814 for (
int ibit = 0; ibit <
n; ibit++) {
815 reals.set(ibit, ~fakes[ibit]);
818 if (
m_fsvec[
n-1]->accept_process(
n, reals, tights) ) {
819 if(
n < minNlep_proc) minNlep_proc =
n;
820 if (
n > maxNlep_proc) {
832 if(
setup() != StatusCode::SUCCESS)
return 0.;
847 double nfake_fit, nfake_fitErr;
856 std::unique_ptr<TMinuit_LHMM> lhoodFit(
new TMinuit_LHMM(npar));
861 Double_t arglist[10];
865 lhoodFit->mnexcm(
"SET ERR", arglist ,1,ierflg);;
873 init_pars.resize(npar);
875 vector< vector <double> > loc_init_pars;
879 loc_init_pars[ilep-1].resize(0
x1 << ilep);
881 for (
int ipar = 0; ipar < (0x1 << ilep); ipar++) {
882 init_pars[
index+ipar] = loc_init_pars[ilep-1][ipar];
887 Double_t
step = TMath::Max(loc_init_pars[
m_minnlep-1][0]/1000,0.001);
893 vector<TString> parameterName;
896 parameterName.push_back(
"nfake_tot");
897 TString sreal =
"nreal";
900 sprintf(tmpchar,
"_%i", ilep);
901 TString tmpstr = sreal;
902 tmpstr.Append(tmpchar);
903 for (
unsigned isublep = 0; isublep <
m_real_indices[ilep-1].size(); isublep++) {
904 TString locsreal = tmpstr;
906 sprintf(tmpchar2,
"_%u", isublep);
907 locsreal.Append(tmpchar2);
908 parameterName.push_back(locsreal);
910 nreal_start_indices[ilep-1] = (parameterName.size());
911 ATH_MSG_VERBOSE(
"nreal_start_indices[" << ilep-1 <<
"] = " << nreal_start_indices[ilep-1]);
916 TString stheta_tot =
"theta_tot";
920 TString tmpstr = stheta_tot;
921 tmpstr.Append(tmpchar);
922 parameterName.push_back(tmpstr);
926 TString stheta =
"theta_";
928 sprintf(tmpchar,
"%i", ilep);
929 TString tmpstr = stheta;
930 tmpstr.Append(tmpchar);
934 TString locstheta = tmpstr;
936 sprintf(tmpchar2,
"%i", jlep);
937 locstheta.Append(tmpchar2);
938 parameterName.push_back(locstheta);
952 ATH_MSG_VERBOSE(
"nfakes for nlep = " << ilep <<
" used to find theta_tot = " << loc_init_pars[ilep-1][0]);
953 theta_tot[theta_index] = TMath::ACos(TMath::Sqrt(TMath::Max(loc_init_pars[ilep-1][0],0.)/(
m_nfakes_std))/sinterm);
954 if (TMath::IsNaN( theta_tot[theta_index] ) ) {
957 sinterm *= TMath::Sin(theta_tot[theta_index]);
970 upper_limits.resize(npar);
976 for (
unsigned isublep = 0; isublep <
m_real_indices[ilep-1].size(); isublep++) {
982 for (
int ipar = real_index; ipar < npar; ipar++) {
988 init_par_values.resize(npar);
994 for (
unsigned isublep = 0; isublep <
m_real_indices[ilep-1].size(); isublep++) {
995 ATH_MSG_VERBOSE(
"Setting parameter " << glob_index <<
" to " << init_pars[init_index+isublep]);
996 init_par_values[glob_index] = init_pars[init_index+isublep];
999 init_index+=
pow(2,ilep);
1010 theta_start_indices[
i] = theta_start_indices[
i-1] +
m_fake_indices[
i-1].size() - 1;
1028 index+= 0x1 << ilep;
1031 for (ipar = 0; ipar < npar; ipar++) {
1032 lhoodFit->mnparm(ipar, parameterName[ipar], init_par_values[ipar],
step, 0., upper_limits[ipar], ierflg);
1043 int nGoodLeptonMult = 0;
1049 for (
unsigned ipar = nreal_start_indices[ilep-1]; ipar < nreal_start_indices[ilep-1] +
m_real_indices[ilep-1].size(); ipar++) {
1052 lhoodFit->mnexcm(
"SET PAR", arglist, 2, ierflg);
1053 lhoodFit->mnexcm(
"FIX PAR", arglist, 1, ierflg);
1058 lhoodFit->mnexcm(
"SET PAR", arglist, 2, ierflg);
1059 lhoodFit->mnexcm(
"FIX PAR", arglist, 1, ierflg);
1062 for (
unsigned ipar = theta_start_indices[ilep-1]+1; ipar < theta_start_indices[ilep-1] +
m_fake_indices[ilep-1].size() ; ipar++) {
1065 lhoodFit->mnexcm(
"SET PAR", arglist, 2, ierflg);
1066 lhoodFit->mnexcm(
"FIX PAR", arglist, 1, ierflg);
1071 index += (0x1 << ilep) - 2;
1074 if (nGoodLeptonMult == 0) {
1075 ATH_MSG_VERBOSE(
"No possible fake contribution for any lepton multiplicity");
1083 lhoodFit->mnexcm(
"MIGRAD", arglist ,2,ierflg);
1087 Double_t amin, edm, errdef;
1088 Int_t nvpar, nparx, icstat;
1089 lhoodFit->mnstat(amin,edm,errdef,nvpar,nparx,icstat);
1091 lhoodFit->GetParameter(0, nfake_fit, nfake_fitErr);
1095 if (poserr && negerr) {
1098 lhoodFit->mnexcm(
"MINOS", arglist ,2,ierflg);
1099 lhoodFit->mnerrs(0, *poserr, *negerr, nfake_fitErr, gcc);
1102 lhoodFit->mnstat(amin,edm,errdef,nvpar,nparx,icstat);
1103 lhoodFit->GetParameter(0, nfake_fit, nfake_fitErr);
1107 if ( *poserr < 1.
e-5) {
1108 *poserr =
fixPosErr(nfake_fit, lhoodFit.get());
1110 if (*negerr > -1.
e-5 ) {
1111 *negerr =
fixNegErr(nfake_fit, lhoodFit.get());
1114 if (*negerr > -1.
e-5) {
1115 *negerr = -nfake_fitErr;
1117 if (nfake_fit + *negerr < 0.) {
1118 *negerr = -nfake_fit;
1122 if (*poserr < 1.
e-5) {
1123 *poserr = nfake_fitErr;
◆ nfakes_std()
double LhoodMM_tools::nfakes_std |
( |
double * |
error | ) |
|
◆ nfakes_std_perEventWeight()
double LhoodMM_tools::nfakes_std_perEventWeight |
( |
double * |
error | ) |
|
◆ outputHandles()
Return this algorithm's output handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ perfectFit()
bool CP::LhoodMM_tools::perfectFit |
( |
| ) |
|
|
inline |
◆ print() [1/2]
void asg::AsgTool::print |
( |
| ) |
const |
|
virtualinherited |
Print the state of the tool.
Implements asg::IAsgTool.
Reimplemented in JetRecTool, JetFinder, JetModifiedMassDrop, JetFromPseudojet, JetReclusterer, JetReclusteringTool, JetTruthLabelingTool, JetPileupLabelingTool, HI::HIPileupTool, top::TopObjectSelection, JetDumper, JetBottomUpSoftDrop, JetRecursiveSoftDrop, JetSoftDrop, JetConstituentsRetriever, JetSubStructureMomentToolsBase, JetSplitter, JetToolRunner, JetPruner, JetPseudojetRetriever, JetTrimmer, AsgHelloTool, and KtDeltaRTool.
Definition at line 131 of file AsgTool.cxx.
◆ print() [2/2]
virtual void asg::IAsgTool::print |
( |
| ) |
const |
|
pure virtualinherited |
Print the state of the tool.
Implemented in JetRecTool, JetFinder, JetModifiedMassDrop, JetFromPseudojet, JetReclusterer, JetReclusteringTool, JetTruthLabelingTool, JetPileupLabelingTool, HI::HIPileupTool, top::TopObjectSelection, asg::AsgTool, JetDumper, JetBottomUpSoftDrop, JetRecursiveSoftDrop, JetSoftDrop, JetConstituentsRetriever, JetSubStructureMomentToolsBase, JetSplitter, JetToolRunner, JetPruner, JetPseudojetRetriever, JetTrimmer, AsgHelloTool, and KtDeltaRTool.
◆ printUncertaintyDescription()
|
finaloverridevirtualinherited |
◆ recommendedSystematics()
◆ register1DHistogram()
StatusCode LhoodMM_tools::register1DHistogram |
( |
TH1 * |
h1, |
|
|
const float * |
val |
|
) |
| |
|
overridevirtual |
associates a 1D histogram to the tool, to obtain a binned estimate of the fake lepton background the 'val' argument points to a variable corresponding to the X axis of the histogram and that needs to be updated before each call to addEvent() undefined behaviour if the pointers are invalidated during the tool's lifetime
Reimplemented from CP::BaseFakeBkgTool.
Definition at line 159 of file LhoodMM_tools.cxx.
163 if(
sc != StatusCode::SUCCESS)
return sc;
170 int ncells =
h1->GetNcells();
172 fitinfovec->resize(ncells);
181 ATH_MSG_ERROR(
"Error in LhoodMM_tools::register1DHistogram: histogram has already been registered");
182 return StatusCode::FAILURE;
184 return StatusCode::SUCCESS;
◆ register2DHistogram()
StatusCode LhoodMM_tools::register2DHistogram |
( |
TH2 * |
h2, |
|
|
const float * |
xval, |
|
|
const float * |
yval |
|
) |
| |
|
overridevirtual |
associates a 2D histogram to the tool, to obtain a binned estimate of the fake lepton background the 'xval' / 'yval' arguments point to variables corresponding to the X/Y axis of the histogram and that need to be updated before each call to addEvent() undefined behaviour if the pointers are invalidated during the tool's lifetime
Reimplemented from CP::BaseFakeBkgTool.
Definition at line 187 of file LhoodMM_tools.cxx.
191 if(
sc != StatusCode::SUCCESS)
return sc;
197 int ncells = h2->GetNcells();
199 fitinfovec->resize(ncells);
204 ATH_MSG_INFO(
"Registered a 2D histogram "<<h2->GetName());
206 ATH_MSG_ERROR(
"Error in LhoodMM_tools::register2DHistogram: histogram has already been registered");
207 return StatusCode::FAILURE;
209 return StatusCode::SUCCESS;
◆ register3DHistogram()
StatusCode LhoodMM_tools::register3DHistogram |
( |
TH3 * |
h3, |
|
|
const float * |
xval, |
|
|
const float * |
yval, |
|
|
const float * |
zval |
|
) |
| |
|
overridevirtual |
associates a 3D histogram to the tool, to obtain a binned estimate of the fake lepton background
the 'xval' / 'yval' / 'zval' arguments point to variables corresponding to the X/Y/Z axis of the histogram and that need to be updated before each call to addEvent() undefined behaviour if the pointers are invalidated during the tool's lifetime
Reimplemented from CP::BaseFakeBkgTool.
Definition at line 212 of file LhoodMM_tools.cxx.
216 if(
sc != StatusCode::SUCCESS)
return sc;
222 int ncells = h3->GetNcells();
224 fitinfovec->resize(ncells);
229 ATH_MSG_INFO(
"Registered a 3D histogram "<<h3->GetName());
231 ATH_MSG_ERROR(
"Error in LhoodMM_tools::register3DHistogram: histogram has already been registered");
232 return StatusCode::FAILURE;
234 return StatusCode::SUCCESS;
◆ renounce()
◆ renounceArray()
◆ reset()
void LhoodMM_tools::reset |
( |
| ) |
|
|
protectedvirtual |
Definition at line 73 of file LhoodMM_tools.cxx.
95 for (
int ilep = 0; ilep <
s_nLepMax; ilep++) {
98 for (
int ientry = 0; ientry < (0x1 << (ilep+1)); ientry++) {
99 m_coeffs[ilep][ientry].resize((0
x1 << (ilep+1)) );
100 for (
int jentry = 0; jentry < (0x1 << (ilep+1)); jentry++) {
122 for (
int ilep = 0; ilep <
s_nLepMax; ilep++) {
134 for (
int ilep = 0; ilep <
s_nLepMax; ilep++) {
135 m_nrf_mat_vec[ilep] = std::shared_ptr<TMatrixT<double>>(std::make_shared<TMatrixT<double>>(0x1 << (ilep+1),1) );
136 m_MMmatrix_vec[ilep] = std::shared_ptr<TMatrixT<double>>(std::make_shared<TMatrixT<double>> ((0x1 << (ilep+1)),(0x1 << (ilep+1))));
137 m_ntlpred_vec[ilep] = std::shared_ptr<TMatrixT<double>>(std::make_shared< TMatrixT<double>>(0x1 << (ilep+1),1));
◆ saveProgress()
StatusCode LhoodMM_tools::saveProgress |
( |
TDirectory * |
dir | ) |
|
|
overridevirtual |
Implements CP::IFakeBkgTool.
Definition at line 1667 of file LhoodMM_tools.cxx.
1672 ATH_MSG_ERROR(
"Multiple calls to saveProgress are not supported");
1673 return StatusCode::FAILURE;
1678 std::unique_ptr<TTree>
t(
new TTree(
"LhoodMM_progress",
"Stores current info from LhoodMM_toos"));
1680 std::unique_ptr<TTree> t_nlep(
new TTree(
"LhoodMM_progress_nlep",
"Stores minimum and maximum lepton multiplicities"));
1683 ATH_MSG_VERBOSE(
"Branch split level is " << fitInfoBranch->GetSplitLevel() );
1697 return StatusCode::SUCCESS;
◆ set_do_std_perEventWeight()
void CP::LhoodMM_tools::set_do_std_perEventWeight |
( |
bool |
val | ) |
|
|
inline |
◆ setFitType()
StatusCode LhoodMM_tools::setFitType |
( |
const std::string & |
ft | ) |
|
Definition at line 146 of file LhoodMM_tools.cxx.
149 return StatusCode::SUCCESS;
150 }
else if (
ft ==
"MM") {
152 return StatusCode::SUCCESS;
154 ATH_MSG_ERROR(
"Error in LhoodMM_tools::setFitType: please specify \"MM\" for matrix method or \"FF\" for fake factor method");
155 return StatusCode::FAILURE;
◆ setPrintLevel()
void CP::LhoodMM_tools::setPrintLevel |
( |
Int_t |
printLevel | ) |
|
|
inline |
◆ setup()
StatusCode LhoodMM_tools::setup |
( |
| ) |
|
|
private |
Definition at line 526 of file LhoodMM_tools.cxx.
531 for (
int jlep = 0; jlep < ilep; jlep++) {
540 return StatusCode::SUCCESS;
◆ sysInitialize()
◆ sysStart()
Handle START transition.
We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.
◆ updateVHKA()
◆ m_alreadyMerged
bool CP::LhoodMM_tools::m_alreadyMerged |
|
private |
◆ m_cachedFinalStates
◆ m_coeffs
std::vector< std::vector < std::vector < double > > > CP::LhoodMM_tools::m_coeffs |
|
private |
◆ m_convertWhenMissing
bool CP::BaseFakeBkgTool::m_convertWhenMissing = false |
|
protectedinherited |
◆ m_curr_nlep
int CP::LhoodMM_tools::m_curr_nlep |
|
private |
◆ m_current_fitInfo
◆ m_current_lhoodMM_tool
◆ m_database
◆ m_detStore
◆ m_dilep_SSfrac_denom
double CP::LhoodMM_tools::m_dilep_SSfrac_denom |
|
private |
◆ m_dilep_SSfrac_num
double CP::LhoodMM_tools::m_dilep_SSfrac_num |
|
private |
◆ m_do_std_perEventWeight
bool CP::LhoodMM_tools::m_do_std_perEventWeight |
|
private |
◆ m_doFakeFactor
bool CP::LhoodMM_tools::m_doFakeFactor |
|
private |
◆ m_energyUnit
std::string CP::BaseFakeBkgTool::m_energyUnit |
|
protectedinherited |
property EnergyUnit user can choose between MeV or GeV to indicate the unit of the pT parametrization of efficiencies in the input files
Definition at line 122 of file BaseFakeBkgTool.h.
◆ m_evtStore
◆ m_externalWeight
float CP::BaseFakeBkgTool::m_externalWeight |
|
protectedinherited |
◆ m_fake_indices
std::vector<std::vector<int> > CP::LhoodMM_tools::m_fake_indices |
|
private |
◆ m_fitInfo_1dhisto_map
std::map<TH1*, std::vector< LhoodMMFitInfo > > CP::LhoodMM_tools::m_fitInfo_1dhisto_map |
|
private |
◆ m_fitInfo_2dhisto_map
std::map<TH2*, std::vector< LhoodMMFitInfo > > CP::LhoodMM_tools::m_fitInfo_2dhisto_map |
|
private |
◆ m_fitInfo_3dhisto_map
std::map<TH3*, std::vector< LhoodMMFitInfo > > CP::LhoodMM_tools::m_fitInfo_3dhisto_map |
|
private |
◆ m_fitStatus
Int_t CP::LhoodMM_tools::m_fitStatus |
|
private |
◆ m_fixNormalization
bool CP::LhoodMM_tools::m_fixNormalization |
|
private |
◆ m_fsvec
◆ m_global_fitInfo
◆ m_hasher
std::hash<std::string> CP::BaseFakeBkgTool::m_hasher |
|
protectedinherited |
◆ m_initialized
bool CP::BaseFakeBkgTool::m_initialized = false |
|
protectedinherited |
◆ m_inputFiles
std::vector<std::string> CP::BaseFakeBkgTool::m_inputFiles |
|
protectedinherited |
◆ m_lastSaveIndex
unsigned CP::LhoodMM_tools::m_lastSaveIndex |
|
private |
◆ m_lockedSystematicVariations
bool CP::BaseFakeBkgTool::m_lockedSystematicVariations = false |
|
protectedinherited |
◆ m_maxnlep
int CP::LhoodMM_tools::m_maxnlep |
|
private |
◆ m_maxnlep_loose
int CP::LhoodMM_tools::m_maxnlep_loose |
|
private |
◆ m_maxWeight
float CP::LhoodMM_tools::m_maxWeight |
|
private |
◆ m_minnlep
int CP::LhoodMM_tools::m_minnlep |
|
private |
◆ m_MMmatrix_vec
std::vector<std::shared_ptr<TMatrixT<double> > > CP::LhoodMM_tools::m_MMmatrix_vec |
|
private |
◆ m_needEventInfo
bool CP::BaseFakeBkgTool::m_needEventInfo = true |
|
protectedinherited |
◆ m_needToResize
bool CP::LhoodMM_tools::m_needToResize |
|
private |
◆ m_nfakes_std
double CP::LhoodMM_tools::m_nfakes_std |
|
private |
◆ m_nfakes_std_err
double CP::LhoodMM_tools::m_nfakes_std_err |
|
private |
◆ m_nfakes_std_err_perEventWeight
double CP::LhoodMM_tools::m_nfakes_std_err_perEventWeight |
|
private |
◆ m_nfakes_std_perEventWeight
double CP::LhoodMM_tools::m_nfakes_std_perEventWeight |
|
private |
◆ m_nrf_mat_vec
std::vector<std::shared_ptr<TMatrixT<double> > > CP::LhoodMM_tools::m_nrf_mat_vec |
|
private |
◆ m_ntlpred_vec
std::vector<std::shared_ptr<TMatrixT<double> > > CP::LhoodMM_tools::m_ntlpred_vec |
|
private |
◆ m_OSfrac
std::vector< std::vector < double > > CP::LhoodMM_tools::m_OSfrac |
|
private |
◆ m_particles
◆ m_perfectFit
bool CP::LhoodMM_tools::m_perfectFit |
|
private |
◆ m_prevSave
bool CP::LhoodMM_tools::m_prevSave |
|
private |
◆ m_printLevel
Int_t CP::LhoodMM_tools::m_printLevel |
|
private |
◆ m_process
'process' settings used to compute the total yield / fill histograms
Definition at line 118 of file BaseFakeBkgTool.h.
◆ m_progressFileDirectory
std::string CP::BaseFakeBkgTool::m_progressFileDirectory |
|
protectedinherited |
◆ m_progressFileName
std::string CP::BaseFakeBkgTool::m_progressFileName |
|
protectedinherited |
◆ m_real_indices
std::vector<std::vector<int> > CP::LhoodMM_tools::m_real_indices |
|
private |
◆ m_requireOS
bool CP::LhoodMM_tools::m_requireOS |
|
private |
◆ m_requireSS
bool CP::LhoodMM_tools::m_requireSS |
|
private |
◆ m_selectedUncertainties
◆ m_selection
'selection' settings used to compute the total yield / fill histograms
Definition at line 115 of file BaseFakeBkgTool.h.
◆ m_systSetDict
◆ m_theta_tot_start_index
int CP::LhoodMM_tools::m_theta_tot_start_index |
|
private |
◆ m_tightAccessor
this can't be a unique_ptr as this can cause issues with the dictionary in some particular circumstances
Definition at line 133 of file BaseFakeBkgTool.h.
◆ m_tightDecoNameAndType
std::string CP::BaseFakeBkgTool::m_tightDecoNameAndType |
|
protectedinherited |
◆ m_unlimitedSystematicVariations
bool CP::BaseFakeBkgTool::m_unlimitedSystematicVariations = true |
|
protectedinherited |
◆ m_useDB
bool CP::BaseFakeBkgTool::m_useDB = true |
|
protectedinherited |
◆ m_values_1dhisto_map
std::map<TH1*, const float*> CP::BaseFakeBkgTool::m_values_1dhisto_map |
|
protectedinherited |
◆ m_values_2dhisto_map
std::map<TH2*, std::pair<const float*, const float*> > CP::BaseFakeBkgTool::m_values_2dhisto_map |
|
protectedinherited |
◆ m_values_3dhisto_map
std::map<TH3*, std::tuple<const float*, const float*, const float*> > CP::BaseFakeBkgTool::m_values_3dhisto_map |
|
protectedinherited |
◆ m_varHandleArraysDeclared
◆ m_vhka
◆ s_maxRank
const int CP::LhoodMM_tools::s_maxRank = 64 |
|
inlinestaticprivate |
◆ s_nLepMax
const int CP::LhoodMM_tools::s_nLepMax = 6 |
|
inlinestaticprivate |
◆ s_piover2
const double CP::LhoodMM_tools::s_piover2 = 1.57079632679489661923 |
|
inlinestaticprivate |
◆ s_piover4
const double CP::LhoodMM_tools::s_piover4 = 0.785398163397448309616 |
|
inlinestaticprivate |
The documentation for this class was generated from the following files:
def retrieve(aClass, aKey=None)
std::vector< std::vector< double > > OSfrac_denom
Electron_v1 Electron
Definition of the current "egamma version".
std::string basename() const
description: the base name, i.e.
size_t size() const
returns: size of the set
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
const std::string & name() const
description: the full systematics name, for use in strings, etc.
void add(LhoodMMFitInfo &rhs, int nLepMax)
Class to wrap a set of SystematicVariations.
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool msgLvl(const MSG::Level lvl) const
bool isTight(unsigned ilep) const
#define ATH_MSG_VERBOSE(x)
void resizeVectors(unsigned nlep)
@ u
Enums for curvilinear frames.
virtual void setOwner(IDataHandleHolder *o)=0
std::vector< double > eventCount
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
constexpr auto getAxis(H *hist)
Helper to get corresponding TAxis selected by Monitored::Axis.
std::vector< std::vector< double > > OSfrac_num
const FakeBkgTools::Efficiency & realEffObj(unsigned ilep) const
::StatusCode StatusCode
StatusCode definition for legacy code.
std::vector< std::vector< double > > event_sumw2
Class describing a tau jet.
std::vector< std::vector< double > > event_cat
bool add(const std::string &hname, TKey *tobj)
const std::string & name(Level lvl)
Convenience function for translating message levels to strings.
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
std::vector< std::vector< std::vector< FakeBkgTools::Efficiency > > > coeffs_num
int charge(unsigned ilep) const
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
void insert(const SystematicVariation &systematic)
description: insert a systematic into the set
std::string to_string(const DetectorType &type)
double charge(const T &p)
virtual bool getBool(const SG::AuxElement &element, const CP::SystematicSet *sys=nullptr) const =0
get the selection decoration
Class describing the basic event information.
Photon_v1 Photon
Definition of the current "egamma version".
struct TBPatternUnitContext Muon
std::string PathResolverFindDataFile(const std::string &logical_file_name)
#define ATH_MSG_WARNING(x)
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
@ Tau
The object is a tau (jet)
def TH1F(name, title, nxbins, bins_par2, bins_par3=None, path='', **kwargs)
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
const FakeBkgTools::Efficiency & fakeEffObj(unsigned ilep) const
static StatusCode filterForAffectingSystematics(const SystematicSet &systConfig, const SystematicSet &affectingSystematics, SystematicSet &filteredSystematics)
description: filter the systematics for the affected systematics returns: success guarantee: strong f...
float parameter() const
description: the numeric parameter contained in the subvariation(), or 0 if the subvariation can't be...
std::vector< std::vector< FakeBkgTools::Efficiency > > normterms