|
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 StatusCode | addEvent (const ConstDataVector< 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) |
|
template<class C > |
StatusCode | addEventImpl (const C &iparticles, float mcWeight) |
| only used when m_useDB is false More...
|
|
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 27 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.
50 "Boolean to determine whether or not histograms are scaled such that their normalization "
51 "is equal to the fake yield computed for the entire sample (true = yes, do the scaling)");
54 "Give results corresponding to the fake factor method rather than the matrix method");
◆ ~LhoodMM_tools()
LhoodMM_tools::~LhoodMM_tools |
( |
| ) |
|
◆ addEvent() [1/2]
|
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)
Implements CP::IFakeBkgTool.
Definition at line 243 of file BaseFakeBkgTool.cxx.
◆ addEvent() [2/2]
|
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)
Implements CP::IFakeBkgTool.
Definition at line 238 of file BaseFakeBkgTool.cxx.
◆ addEventCustom() [1/2]
StatusCode LhoodMM_tools::addEventCustom |
( |
| ) |
|
|
overrideprotectedvirtual |
Implements CP::BaseFakeBkgTool.
Definition at line 266 of file LhoodMM_tools.cxx.
270 ATH_MSG_WARNING(
"Attempt to add an event with 0 leptons. This event will be ignored.");
271 return StatusCode::SUCCESS;
273 std::vector<bool> isTight_vals;
274 std::vector<Efficiency> realEff_vals;
275 std::vector<Efficiency> fakeEff_vals;
276 std::vector<int> charges;
277 std::vector<FakeBkgTools::ParticleData>::const_iterator particles_it;
280 isTight_vals.push_back(
p.tight);
281 realEff_vals.push_back(
p.real_efficiency);
282 fakeEff_vals.push_back(
p.fake_efficiency);
283 double r_eff =
p.real_efficiency.value(
this);
284 double f_eff =
p.fake_efficiency.value(
this);
288 for(
const std::pair<short unsigned int, FakeBkgTools::Uncertainty> kv :
p.real_efficiency.uncertainties)
290 ATH_MSG_DEBUG(
"real eff uncertainties for first lepton are " << kv.second.up <<
" " << kv.second.down);
292 for(
const std::pair<short unsigned int, FakeBkgTools::Uncertainty> kv :
p.fake_efficiency.uncertainties)
294 ATH_MSG_DEBUG(
"fake eff uncertainties for first lepton are " << kv.second.up <<
" " << kv.second.down);
297 charges.push_back(
p.charge);
298 if ( r_eff < 0.01 && f_eff< 0.01) {
◆ addEventCustom() [2/2]
Definition at line 241 of file LhoodMM_tools.cxx.
249 int nlep = isTight_vals.size();
257 LhoodMMEvent mmevt(nlep, realEff_vals, fakeEff_vals, isTight_vals, charges, extraweight);
262 return StatusCode::SUCCESS;
◆ addEventImpl()
template<class C >
StatusCode BaseFakeBkgTool::addEventImpl |
( |
const C & |
iparticles, |
|
|
float |
mcWeight |
|
) |
| |
|
privateinherited |
only used when m_useDB is false
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
Definition at line 174 of file BaseFakeBkgTool.cxx.
179 return StatusCode::FAILURE;
187 #ifdef FAKEBKGTOOLS_ATLAS_ENVIRONMENT
190 eventInfo = &iparticles.eventInfo;
194 for(
const auto& pp : iparticles)
217 return StatusCode::FAILURE;
219 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));
◆ affectingSystematics()
the list of all systematics this tool can be affected by
Implements CP::IReentrantSystematicsTool.
Definition at line 438 of file BaseFakeBkgTool.cxx.
442 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...");
443 throw std::logic_error(
"BaseFakeBkgTool::affectingSystematics() called before initialization");
448 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 618 of file BaseFakeBkgTool.cxx.
623 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...");
626 bool up=
true, down=
true;
627 auto pos1=nuisanceParameter.find(
"__up"), pos2=nuisanceParameter.find(
"__down");
628 if(pos1!=std::string::npos && pos1+4==nuisanceParameter.length()) down =
false;
629 else if(pos2!=std::string::npos && pos2+6==nuisanceParameter.length())
up =
false;
630 std::string
np = nuisanceParameter.substr(0,
std::min(pos1, pos2));
634 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 465 of file BaseFakeBkgTool.cxx.
469 ATH_MSG_ERROR(
"This function can be called only once the tool has been initialized");
470 throw std::logic_error(
"BaseFakeBkgTool::applySystematicVariation() called before initialization");
474 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.");
475 throw std::logic_error(
"BaseFakeBkgTool::applySystematicVariation() called at a wrong time");
478 if(!systConfig.
size())
481 return StatusCode::SUCCESS;
487 return StatusCode::SUCCESS;
491 if(
sc != StatusCode::SUCCESS)
return sc;
492 std::unique_ptr<UncertaintyList> uncertainties;
493 for(
auto& sysvar : mysys)
498 ATH_MSG_ERROR(
"The systematic variation " << sysvar.name() <<
" is not recognized, despite being present in affectingSystematics()...");
499 return StatusCode::FAILURE;
501 if(!uncertainties) uncertainties.reset(
new UncertaintyList(
var.first,
var.second));
506 auto emplaced =
m_systSetDict.emplace(systConfig, std::move(*uncertainties));
510 return StatusCode::SUCCESS;
◆ CheckHistogramCompatibility()
StatusCode BaseFakeBkgTool::CheckHistogramCompatibility |
( |
const TH1 * |
lhs, |
|
|
const TH1 * |
rhs |
|
) |
| |
|
protectedinherited |
Definition at line 359 of file BaseFakeBkgTool.cxx.
362 if(std::string(lhs->GetName()) != rhs->GetName())
error =
"names";
363 else if(lhs->GetDimension() != rhs->GetDimension())
error =
"dimensions";
364 else if(lhs->GetNbinsX()!=rhs->GetNbinsX() || lhs->GetNbinsY()!=rhs->GetNbinsY() || lhs->GetNbinsZ()!=rhs->GetNbinsZ())
error =
"number of bins";
367 for(
auto getAxis : std::initializer_list<
const TAxis*(TH1::*)()
const>{&TH1::GetXaxis, &TH1::GetYaxis, &TH1::GetZaxis})
370 for(
int i=0;
i<=lhsAxis->GetNbins();++
i)
372 auto x=lhsAxis->GetBinUpEdge(
i),
y=rhsAxis->GetBinUpEdge(
i),
width=lhsAxis->GetBinWidth(
i?
i:1);
379 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.");
380 return StatusCode::FAILURE;
382 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);
253 return PBASE::declareProperty(
name,hndl,
doc);
◆ 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.
229 return PBASE::declareProperty(
name,hndl,
doc);
◆ 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.
338 return PBASE::declareProperty(
name, property,
doc);
◆ 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 38 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 33 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 561 of file LhoodMM_tools.cxx.
566 const bool verbose = (
l->m_printLevel > 0);
570 for (
int ipar = 0; ipar < npar; ipar++) {
574 int minnlep =
l->m_minnlep;
575 int maxnlep_loose =
l->m_maxnlep_loose;
581 Double_t sinterm_tot = 1.;
583 int theta_nlep_index = 1 + maxnlep_loose -minnlep;
585 for (
int ilep = minnlep; ilep <= maxnlep_loose; ilep++) {
586 theta_nlep_index +=
l->m_real_indices[ilep-1].size();
587 ASG_MSG_VERBOSE(
"theta_nlep_index for ilep = " << ilep <<
" = " << theta_nlep_index);
595 for (
int ilep = minnlep; ilep <= maxnlep_loose; ilep++) {
596 if (
l->m_current_fitInfo->eventCount[ilep-1] == 0) {
597 ASG_MSG_VERBOSE(
"m_real_indices[" << ilep-1 <<
"].size() = " <<
l->m_real_indices[ilep-1].size());
598 real_index +=
l->m_real_indices[ilep-1].size();
599 for (
int ipar = 0; ipar < (
int)
l->m_fake_indices[ilep-1].size()-1; ipar++) {
604 l->m_curr_nlep = ilep;
605 Int_t npar_thisnlep = 0x1 << ilep;
607 int theta_tot_index =
l->m_theta_tot_start_index+ilep-minnlep;
610 if (
l->m_maxnlep_loose - minnlep > 0) {
613 costerm = TMath::Cos(
par[theta_tot_index]);
618 pars_thisnlep[0] =
rsq*sinterm_tot*costerm*sinterm_tot*costerm;
619 sinterm_tot *= TMath::Sin(
par[theta_tot_index]);
621 pars_thisnlep[0] =
rsq;
625 ASG_MSG_VERBOSE(
"m_real_indices[ilep-1].size() = " <<
l->m_real_indices[ilep-1].size());
626 for (
unsigned ipar = 0; ipar <
l->m_real_indices[ilep-1].size(); ipar++) {
627 pars_thisnlep[par_index] =
par[real_index+ipar];
632 for (
int ipar = 0; ipar < (
int)
l->m_fake_indices[ilep-1].size()-1; ipar++) {
634 pars_thisnlep[par_index+ipar] =
par[theta_nlep_index];
635 if(
verbose)
ASG_MSG_VERBOSE(
"f pars_thisnlep[" << par_index+ipar <<
"] = " << pars_thisnlep[par_index+ipar]);
638 fcn_nlep(npar_thisnlep, gin,
f, pars_thisnlep, iflag);
641 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 647 of file LhoodMM_tools.cxx.
652 const bool verbose = (
l->m_printLevel > 0);
654 int nlep =
l->m_curr_nlep;
656 int rank = 0x1 << nlep;
660 for (
int ipar = 0; ipar < npar; ipar++) {
666 std::string txt =
"testing variable transform: angle pars in fcn: ";
667 for (
int i = 0;
i < npar;
i++) {
675 std::shared_ptr<TMatrixT<double>> nrf, MMmatrix, ntlpred;
676 nrf =
l->m_nrf_mat_vec[lepidx];
681 MMmatrix =
l->m_MMmatrix_vec[lepidx];
682 ntlpred =
l->m_ntlpred_vec[lepidx];
684 (*nrf)(0,0) =
par[0];
685 double rsq = TMath::Abs(
par[0]);
687 int rsize =
l->m_real_indices[lepidx].size();
688 int fsize =
l->m_fake_indices[lepidx].size();
690 for (
int ipar = 0; ipar < rsize; ipar++) {
691 ASG_MSG_VERBOSE(
"In fcn, setting real par " <<
l->m_real_indices[lepidx][ipar] <<
" to " <<
par[ipar+1]);
692 (*nrf)(
l->m_real_indices[lepidx][ipar], 0) =
par[ipar+1];
698 for (
int ipar = 0; ipar < fsize; ipar++) {
700 if (ipar < fsize-1 ) {
701 double costerm = TMath::Cos(
par[rsize+ipar+1]);
702 if(
verbose)
ASG_MSG_VERBOSE(
"for setting fake parameter, sinterm = " << sinterm <<
" par index = " <<
l->m_real_indices[lepidx].size()+ipar+1);
703 (*nrf)(
l->m_fake_indices[lepidx][ipar],0) =
rsq*sinterm*costerm*sinterm*costerm;
705 (*nrf)(
l->m_fake_indices[lepidx][ipar],0) =
rsq*sinterm*sinterm;
709 ASG_MSG_VERBOSE(
"In fcn, setting fake par " <<
l->m_fake_indices[lepidx][ipar] <<
" to " << (*nrf)(
l->m_fake_indices[lepidx][ipar],0));
711 sinterm *= TMath::Sin(
par[rsize+ipar+1]);
719 *ntlpred = (*MMmatrix)*(*nrf);
728 if (
l->m_doFakeFactor) {
734 for (
int ipar = ipar_start; ipar < rank; ipar++) {
735 if(
verbose)
ASG_MSG_VERBOSE(
"Comparing parameter " << ipar <<
": " <<
l->m_current_fitInfo->event_cat.at(lepidx).at(ipar) <<
" to " << (*ntlpred)(ipar,0));
737 int nobs =
l->m_current_fitInfo->event_cat.at(lepidx).at(ipar);
740 s=
l->m_current_fitInfo->event_sumw2.at(lepidx).at(ipar)/nobs;
◆ fillHisto_internal()
StatusCode LhoodMM_tools::fillHisto_internal |
( |
const std::vector< LhoodMMFitInfo > & |
fitInfo_vec, |
|
|
TH1 * |
h |
|
) |
| |
|
private |
Definition at line 1166 of file LhoodMM_tools.cxx.
1180 int nbins =
h->GetNcells();
1183 Double_t nf, poserr, negerr, shift = 0.;
1185 for (
int ibin = 0; ibin <
nbins; ibin++) {
1189 if (totEvents > 0) {
1190 ATH_MSG_VERBOSE(
"Filling bin " << ibin <<
" with " << totEvents <<
" events");
1191 nf =
nfakes(&poserr, &negerr);
1192 h->SetBinContent(ibin, nf+shift);
1193 if (TMath::IsNaN(
h->GetBinContent(ibin))) {
1194 h->SetBinContent(ibin,0.);
1195 h->SetBinError(ibin, 0.);
1197 h->SetBinError(ibin,TMath::Max(poserr,-negerr));
1200 h->SetBinContent(ibin,0.);
1201 h->SetBinError(ibin, 0.);
1203 ATH_MSG_VERBOSE(
"Result is " <<
h->GetBinContent(ibin) <<
" +/- " <<
h->GetBinError(ibin));
1208 double poserr, negerr;
1212 totFakes =
nfakes(&poserr, &negerr);
1215 double totHistContent = 0.;
1216 for (
int ibin = 0; ibin <
nbins; ibin++) {
1217 totHistContent +=
h->GetBinContent(ibin);
1224 if (totHistContent > 0.) {
1225 scaleFactor = totFakes/totHistContent;
1229 for (
int ibin = 1; ibin <=
nbins; ibin++) {
1230 h->SetBinContent(ibin, scaleFactor*
h->GetBinContent(ibin));
1231 h->SetBinError(ibin, scaleFactor*
h->GetBinError(ibin));
1234 return StatusCode::SUCCESS;
◆ fillHistograms()
StatusCode LhoodMM_tools::fillHistograms |
( |
| ) |
|
|
private |
Definition at line 1139 of file LhoodMM_tools.cxx.
1144 auto & fitInfo_vec = map1_iter->second;
1150 auto& fitInfo_vec = map2_iter->second;
1151 TH2*
histogram = (TH2*)map2_iter->first;
1157 auto& fitInfo_vec = map3_iter->second;
1158 TH3*
histogram = (TH3*)map3_iter->first;
◆ fixNegErr()
double LhoodMM_tools::fixNegErr |
( |
double |
n_fake_fit, |
|
|
TMinuit_LHMM * |
lhoodFit |
|
) |
| |
|
private |
Definition at line 1588 of file LhoodMM_tools.cxx.
1593 Double_t f_from_fit, junk;
1596 lhoodFit->mnstat(f_from_fit, junk, junk, ijunk, ijunk, ijunk);
1599 double n_fake_guess_hi = n_fake_fit;
1600 double n_fake_guess_lo = 0.;
1601 double n_fake_guess = n_fake_guess_lo;
1602 double f_with_guess;
1605 bool stopSearch = 0;
1606 double convergeCriteria = 0.01;
1607 double min_n_fake_guess = 0.05;
1609 int nfake_tot_index = 1;
1611 Double_t arglist[10];
1615 arglist[0] = nfake_tot_index;
1616 arglist[1] = n_fake_fit;
1617 lhoodFit->mnexcm(
"SET PAR", arglist, 2, ierflg);
1618 lhoodFit->mnexcm(
"FIX PAR", arglist, 1, ierflg);
1622 lhoodFit->mnexcm(
"MIGRAD", arglist ,2,ierflg);
1625 lhoodFit->mnstat(f_from_fit, junk, junk, ijunk, ijunk, ijunk);
1627 while (!stopSearch) {
1631 arglist[0] = nfake_tot_index;
1632 arglist[1] = n_fake_guess;
1633 lhoodFit->mnexcm(
"SET PAR", arglist, 2, ierflg);
1634 lhoodFit->mnexcm(
"FIX PAR", arglist, 1, ierflg);
1638 lhoodFit->mnexcm(
"MIGRAD", arglist ,2,ierflg);
1640 lhoodFit->mnstat(f_with_guess, junk, junk, ijunk, ijunk, ijunk);
1642 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);
1644 if ((f_with_guess - f_from_fit) > 0.5) {
1645 n_fake_guess_lo = n_fake_guess;
1647 n_fake_guess_hi = n_fake_guess;
1649 n_fake_guess = 0.5*(n_fake_guess_lo+n_fake_guess_hi);
1651 if (((n_fake_guess_hi - n_fake_guess_lo)/n_fake_guess_hi < convergeCriteria) || (n_fake_guess_hi < min_n_fake_guess) ) {
1653 if (n_fake_guess_hi < n_fake_fit) {
1661 arglist[0] = nfake_tot_index;
1662 arglist[1] = n_fake_fit;
1663 lhoodFit->mnexcm(
"SET PAR", arglist, 2, ierflg);
1666 return n_fake_guess - n_fake_fit;
◆ fixPosErr()
double LhoodMM_tools::fixPosErr |
( |
double |
n_fake_fit, |
|
|
TMinuit_LHMM * |
lhoodFit |
|
) |
| |
|
private |
Definition at line 1497 of file LhoodMM_tools.cxx.
1502 Double_t f_from_fit, junk;
1506 double n_fake_guess_hi = TMath::Max(n_fake_fit*5,1.);
1507 double n_fake_guess_lo = n_fake_fit;
1508 double n_fake_guess = n_fake_guess_hi;
1509 double f_with_guess;
1512 bool stopSearch = 0;
1514 double convergeCriteria = 0.01;
1516 int nfake_tot_index = 1;
1518 Double_t arglist[10];
1522 arglist[0] = nfake_tot_index;
1523 arglist[1] = n_fake_fit;
1524 lhoodFit->mnexcm(
"SET PAR", arglist, 2, ierflg);
1525 lhoodFit->mnexcm(
"FIX PAR", arglist, 1, ierflg);
1529 lhoodFit->mnexcm(
"MIGRAD", arglist ,2,ierflg);
1532 lhoodFit->mnstat(f_from_fit, junk, junk, ijunk, ijunk, ijunk);
1535 while (!stopSearch) {
1537 arglist[0] = nfake_tot_index;
1538 arglist[1] = n_fake_guess;
1539 lhoodFit->mnexcm(
"SET PAR", arglist, 2, ierflg);
1540 lhoodFit->mnexcm(
"FIX PAR", arglist, 1, ierflg);
1544 lhoodFit->mnexcm(
"MIGRAD", arglist ,2,ierflg);
1547 lhoodFit->mnstat(f_with_guess, junk, junk, ijunk, ijunk, ijunk);
1549 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);
1551 if (TMath::IsNaN(f_with_guess)) {
1552 f_with_guess = f_from_fit + 1.;
1554 if ((f_with_guess - f_from_fit) > 0.5) {
1555 n_fake_guess_hi = n_fake_guess;
1557 n_fake_guess_lo = n_fake_guess;
1560 n_fake_guess = 0.5*(n_fake_guess_lo+n_fake_guess_hi);
1562 ATH_MSG_VERBOSE(
"n_fake_guess_lo, hi = " << n_fake_guess_hi <<
" " << n_fake_guess_lo);
1563 if ((n_fake_guess_hi - n_fake_guess_lo)/n_fake_guess_hi < convergeCriteria) {
1565 ATH_MSG_VERBOSE(
"(n_fake_guess_lo, n_fake_fit = " << n_fake_guess_lo <<
" " << n_fake_fit);
1566 if (n_fake_guess_lo > n_fake_fit) {
1575 arglist[0] = nfake_tot_index;
1576 arglist[1] = n_fake_fit;
1577 lhoodFit->mnexcm(
"SET PAR", arglist, 2, ierflg);
1580 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 1340 of file LhoodMM_tools.cxx.
1348 int lepidx = nlep-1;
1352 const int rank = 0x1 << nlep;
1354 std::vector<FakeBkgTools::Efficiency> coeff_denom(rank);
1359 for (
int irf = 0; irf < rank; irf++) {
1363 coeff_denom[irf].setToConst(0.);
1365 float chargefactor ;
1368 for (
int ibit = 0; ibit < nlep; ibit++) {
1369 reals.set(ibit, ~fakes[ibit]);
1371 for (
int itl = 0; itl < rank; itl++) {
1375 for (
int ibit = 0; ibit < nlep; ibit++) {
1376 tights.set(ibit, ~antitights[ibit]);
1381 if (
m_fsvec[lepidx]->accept_selection(tights, charges)
1382 &&
m_fsvec[lepidx]->accept_process(nlep, reals, tights) ) {
1387 if (nlep > 2 && tights.count() == 2) {
1393 if (nlep == 2 && tights.count() == 2) {
1399 chargefactor =
m_OSfrac[lepidx][tights.count()];
1401 ATH_MSG_VERBOSE(
"chargefactor = " << chargefactor <<
" for nlep = " << nlep);
1407 coeff_denom[irf].add(tmpEff);
1416 if (coeff_denom[irf].nominal == 0.) {
1420 for (
int itl = 0; itl < rank; itl++) {
1427 std::shared_ptr<TMatrixT<double>> MMmatrix;
1430 for (
int i = 0;
i < rank;
i++) {
1431 for (
int j = 0; j < rank; j++) {
1439 if(verbose) MMmatrix->Print();
1441 TMatrixT<double> MMmatrix_inv(rank,rank);
1442 MMmatrix_inv = *MMmatrix;
1443 MMmatrix_inv.Invert();
1445 TMatrixT<double> MMmatrix_sqr = MMmatrix_inv;
1446 for (
int i = 0;
i < rank;
i++) {
1447 for (
int j = 0; j < rank; j++) {
1448 MMmatrix_sqr(
i,j) *= MMmatrix_sqr[
i][j];
1452 TMatrixT<double> nevents_mat(rank,1), nfake_mat(rank,1), nfake_err_mat(rank,1);
1453 for (
int i = 0;
i < rank;
i++) {
1458 if(
verbose) nevents_mat.Print();
1460 nfake_mat = MMmatrix_inv*nevents_mat;
1463 if(
verbose) MMmatrix->Print();
1465 if(
verbose) nevents_mat.Print();
1467 if(
verbose) nfake_mat.Print();
1470 nfake_err_mat = MMmatrix_sqr*nevents_mat;
1473 for (
int ipar = 0; ipar < (0x1 <<nlep) ; ipar++) {
1474 nrf[ipar] = nfake_mat(ipar, 0);
1480 for (
int ibit = 0; ibit < nlep; ibit++) {
1481 tights.set(ibit, 1);
1482 reals.set(ibit, ~fakes[ibit]);
1484 if (
m_fsvec[lepidx]->accept_process(nlep, reals, tights) &&
m_fsvec[lepidx]->accept_selection(tights, charges)) {
1485 ATH_MSG_VERBOSE(
"Adding " << nfake_mat(ipar,0) <<
" to m_nfakes_std");
1492 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 1250 of file LhoodMM_tools.cxx.
1254 int lepidx = nlep-1;
1257 nrf.resize(0
x1 <<nlep);
1262 std::string txt =
"Testing variable transform: Initial nrf: ";
1263 for (
auto i = nrf.begin();
i != nrf.end(); ++
i)
1269 double nfakes_std_thisnlep = 0;
1272 for (
int ipar = 0; ipar < 0x1 <<nlep; ipar++) {
1276 for (
int ibit = 0; ibit < nlep; ibit++) {
1277 reals.set(ibit, ~fakes[ibit]);
1280 bool countsAsFake =
false;
1281 for (
int jpar = 0; jpar < 0x1 <<nlep; jpar++) {
1283 for (
int kpar = 0; kpar < 0x1 <<nlep; kpar++) {
1285 if (!countsAsFake &&
1286 m_fsvec[lepidx]->accept_process(nlep, reals, tights) &&
1287 m_fsvec[lepidx]->accept_selection(tights, charges) ) {
1289 nfakes_std_thisnlep += nrf[ipar];
1291 countsAsFake =
true;
1296 if (!countsAsFake) {
1303 init_pars[0] = nfakes_std_thisnlep;
1304 for (
unsigned ipar = 1; ipar <=
m_real_indices[lepidx].size(); ipar++) {
1308 if (nfakes_std_thisnlep > 0.5) {
1309 double sinterm = 1.;
1312 init_pars[ipar] = TMath::ACos(TMath::Sqrt(TMath::Max(nrf[
m_fake_indices[lepidx][ifake] ], 0.)/(nfakes_std_thisnlep))/sinterm);
1313 sinterm *= TMath::Sin(init_pars[ipar]);
1323 txt =
"testing variable transform: Initial pars: ";
1324 for (
int i = 0;
i < (0x1 << nlep);
i++) {
1331 for (
int ipar = 2; ipar < (0x1 << nlep); ipar++) {
1332 if (TMath::IsNaN(init_pars[ipar])) {
1333 init_pars[ipar] = 0.;
1335 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
127 return (
proxy ==
nullptr ? 0 :
proxy->sgkey() );
128 #endif // XAOD_STANDALONE
◆ getListOfEfficienciesAffectedBy()
std::string BaseFakeBkgTool::getListOfEfficienciesAffectedBy |
( |
uint16_t |
uid | ) |
const |
|
protectedinherited |
Definition at line 385 of file BaseFakeBkgTool.cxx.
389 ATH_MSG_ERROR(
"This function can be called only once the tool has been initialized");
392 std::bitset<Database::N_EFFICIENCY_TYPES> affects;
398 if(syst) affects = syst->affects;
401 ATH_MSG_ERROR(
"uncertainty with UID " << std::hex << uid << std::dec <<
" not found in database");
406 if(affects[Database::ELECTRON_REAL_EFFICIENCY])
info +=
"electron real efficiencies, ";
407 if(affects[Database::ELECTRON_FAKE_EFFICIENCY])
info +=
"electron fake efficiencies, ";
408 if(affects[Database::ELECTRON_FAKE_FACTOR])
info +=
"electron fake factors, ";
409 if(affects[Database::MUON_REAL_EFFICIENCY])
info +=
"muon real efficiencies, ";
410 if(affects[Database::MUON_FAKE_EFFICIENCY])
info +=
"muon fake efficiencies, ";
411 if(affects[Database::MUON_FAKE_FACTOR])
info +=
"muon fake factors, ";
412 if(affects[Database::PHOTON_ELE_FAKE_FACTOR])
info +=
"electron->photon fake rate, ";
413 if(affects[Database::PHOTON_ELE_FAKE_FACTOR_SF])
info +=
"electron->photon fake rate scale factor, ";
414 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
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 306 of file LhoodMM_tools.cxx.
315 Double_t poserr, negerr;
318 yield =
nfakes(&poserr,&negerr);
320 ATH_MSG_DEBUG(
"Leaving getTotalYield with yield = " << yield);
323 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 519 of file BaseFakeBkgTool.cxx.
523 ATH_MSG_ERROR(
"This function can be called only once the tool has been initialized");
530 ATH_MSG_WARNING(
"Systematic variation " + systematic.
name() +
" is not recognized by BaseFakeBkgTool");
536 return "Total statistical uncertainty in the event yield";
542 info =
"Statistical uncertainty affecting ";
550 info =
"Systematic uncertainty \"" + syst->name +
"\" affecting ";
554 ATH_MSG_ERROR(
"uncertainty with UID " << std::hex << UID << std::dec <<
" not found in database");
◆ identifyCpSystematicVariation()
Definition at line 417 of file BaseFakeBkgTool.cxx.
421 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...");
422 throw std::logic_error(
"BaseFakeBkgTool::identifyCpSystematicVariation() called before initialization");
426 if(!std::regex_match(
bn, smr,
std::regex(
"FAKEBKG_(STAT|SYST)_VAR(\\d+)")))
return {{0}, 0.f};
427 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 127 of file BaseFakeBkgTool.cxx.
157 std::string fullmsg =
"(while parsing XML, line";
160 fullmsg +=
"): " +
err.reason;
◆ incrementMatrices()
Definition at line 328 of file LhoodMM_tools.cxx.
330 int nlep = mmevt.
nlep();
342 const float*
val = map1_iter->second;
343 TH1*
h = map1_iter->first;
350 fitInfo = &histoMap->second[
icell];
356 fitInfo = &histoMap->second[
icell];
364 return StatusCode::FAILURE;
368 std::map<TH2*, std::pair<const float*, const float*> >
::iterator map2_iter;
370 std::pair<const float*, const float*>
val = map2_iter->second;
371 TH2*
h = map2_iter->first;
379 fitInfo = &histoMap->second[
icell];
384 fitInfo = &histoMap->second[
icell];
388 return StatusCode::FAILURE;
393 std::map<TH3*, std::tuple<const float*, const float*, const float*> >
::iterator map3_iter;
395 std::tuple<const float*, const float*, const float*>
val = map3_iter->second;
396 TH3*
h = map3_iter->first;
403 fitInfo = &histoMap->second[
icell];
407 icell =
h->FindBin(*(std::get<0>(
val)), *(std::get<1>(
val)), *(std::get<2>(
val)) );
408 fitInfo = &histoMap->second[
icell];
412 return StatusCode::FAILURE;
416 return StatusCode::SUCCESS;
◆ incrementOneMatrixSet()
Definition at line 419 of file LhoodMM_tools.cxx.
422 int nlep = mmevt.
nlep();
424 int rank = 0x1 << nlep;
434 unsigned int catIndex = 0;
435 for (
int jlep = 0; jlep < nlep; jlep++) {
436 catIndex += (!mmevt.
isTight(jlep)) << jlep;
453 for (
int icomb = 0; icomb < (0x1 << nlep); icomb++) {
455 std::bitset<s_nLepMax+1> tights(icomb);
456 int ntight = tights.count();
458 for (
int jlep = 0; jlep < nlep; jlep++) {
460 totcharge += mmevt.
charge(jlep);
464 ATH_MSG_VERBOSE(
"Setting OSfrac_denom[" << lepidx <<
"][" << ntight <<
"]");
469 ATH_MSG_VERBOSE(
"Setting OSfrac_num[" << lepidx <<
"][" << ntight <<
"]");
470 if ((TMath::Abs(totcharge) < ntight) || ntight == 1) fitInfo.
OSfrac_num[lepidx][ntight]+=
weight;
474 std::vector<std::vector<FakeBkgTools::Efficiency>>
vals(2, std::vector<FakeBkgTools::Efficiency>(nlep));
475 for (
int ilep = 0; ilep < nlep; ilep++) {
484 vals[0][ilep].setToConst(1.0);
494 for (
int irf = 0; irf < rank; irf++) {
495 for (
int itl = 0; itl < rank; itl++) {
497 for (
int ilep = 0; ilep < nlep; ilep++) {
498 if (itl & (0
x1 << ilep) ) {
499 if (irf & (0
x1 << ilep)) {
507 if (irf & (0
x1 << ilep) ) {
514 ATH_MSG_VERBOSE(
"about to set m_coeffs_num[" << lepidx <<
"][" << itl <<
"][" << irf <<
"]");
516 fitInfo.
normterms[lepidx][(itl<<nlep) + irf].
add(curr_coeff_num);
517 fitInfo.
coeffs_num[lepidx][itl][irf].add(curr_coeff_num);
522 return StatusCode::SUCCESS;
525 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 72 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 569 of file BaseFakeBkgTool.cxx.
572 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 562 of file BaseFakeBkgTool.cxx.
565 if(UID)
return Database::isSystUID(UID);
◆ logPoisson()
double LhoodMM_tools::logPoisson |
( |
double |
obs, |
|
|
double |
pred |
|
) |
| |
|
staticprivate |
Definition at line 548 of file LhoodMM_tools.cxx.
550 double f = -(obs*TMath::Log(pred)-pred);
551 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 1707 of file LhoodMM_tools.cxx.
1713 std::unique_ptr<TFile>
fin(
new TFile(
filename.c_str()));
1714 if (
fin ==
nullptr) {
1716 return StatusCode::FAILURE;
1721 return StatusCode::FAILURE;
1727 TTree *t_nlep = (TTree*)
fin->Get((
prefix +
"LhoodMM_progress_nlep").c_str());
1728 if (t_nlep ==
nullptr) {
1730 return StatusCode::FAILURE;
1733 int merged_maxnlep, merged_maxnlep_prev = -1;
1734 t_nlep->SetBranchAddress(
"maxnlep", &merged_maxnlep);
1736 TTree *
t = (TTree*)
fin->Get((
prefix +
"LhoodMM_progress").c_str());
1739 return StatusCode::FAILURE;
1744 Int_t
nentries = (Int_t)t_nlep->GetEntries();
1745 for (Int_t ievt = 0; ievt <
nentries; ievt++) {
1746 t_nlep->GetEntry(ievt);
1747 if (ievt > 0 && (merged_maxnlep != merged_maxnlep_prev)) {
1748 ATH_MSG_ERROR(
"Attempting to merge files with different lepton multiplicities. This is not supported.");
1749 return StatusCode::FAILURE;
1751 merged_maxnlep_prev = merged_maxnlep;
1762 t->SetBranchAddress(
"glb_fitInfo", &fitInfoPtr );
1768 std::unique_ptr<std::map<TH1*, std::vector< LhoodMMFitInfo > > > tmp_fitInfo_1dhisto_map(
new std::map<TH1*, std::vector< LhoodMMFitInfo > >);
1769 auto *tmp_fitInfo_1dhisto_map_ptr = tmp_fitInfo_1dhisto_map.get();
1770 t->SetBranchAddress(
"fitInfo_1dhisto_map", &tmp_fitInfo_1dhisto_map_ptr);
1771 std::unique_ptr<std::map<TH2*, std::vector< LhoodMMFitInfo > > > tmp_fitInfo_2dhisto_map(
new std::map<TH2*, std::vector< LhoodMMFitInfo > >);
1772 auto *tmp_fitInfo_2dhisto_map_ptr = tmp_fitInfo_2dhisto_map.get();
1773 t->SetBranchAddress(
"fitInfo_2dhisto_map", &tmp_fitInfo_2dhisto_map_ptr);
1774 std::map<TH3*, std::vector< LhoodMMFitInfo > > *tmp_fitInfo_3dhisto_map =
new std::map<TH3*, std::vector< LhoodMMFitInfo > >;
1775 t->SetBranchAddress(
"fitInfo_3dhisto_map", &tmp_fitInfo_3dhisto_map);
1778 for (Int_t ievt = 0; ievt <
nentries; ievt++) {
1785 for (
auto&
im: *tmp_fitInfo_1dhisto_map) {
1788 std::string iname = ihistogram->GetName();
1789 if (
hname == iname) {
1801 for (
auto&
im: *tmp_fitInfo_2dhisto_map) {
1804 std::string iname = ihistogram->GetName();
1805 if (
hname == iname) {
1817 for (
auto&
im: *tmp_fitInfo_3dhisto_map){
1820 std::string iname = ihistogram->GetName();
1821 if (
hname == iname) {
1841 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 750 of file LhoodMM_tools.cxx.
770 for (
int ilep = 0; ilep <
s_nLepMax; ilep++) {
774 if (
error.size() > 0) {
793 for (
int icomb = 0; icomb < (0x1 << (ilep+1)); icomb++) {
795 ATH_MSG_VERBOSE(
"ilep " << ilep <<
" (0x1 << ilep) " << std::hex << (0
x1 << ilep) <<
" icomb " << std::hex << icomb << std::dec);
799 if (
m_fsvec[ilep]->accept_selection(tights, charges)) {
801 ATH_MSG_VERBOSE(
"tights = " << std::hex << tights << std::dec <<
" nlep = " << nlep);
815 int maxNlep_proc = 0;
817 for(
unsigned c=0;
c<(1
u<<
n);++
c)
822 for (
int ibit = 0; ibit <
n; ibit++) {
823 reals.set(ibit, ~fakes[ibit]);
826 if (
m_fsvec[
n-1]->accept_process(
n, reals, tights) ) {
827 if(
n < minNlep_proc) minNlep_proc =
n;
828 if (
n > maxNlep_proc) {
839 if(
setup() != StatusCode::SUCCESS)
return 0.;
854 double nfake_fit, nfake_fitErr;
863 std::unique_ptr<TMinuit_LHMM> lhoodFit(
new TMinuit_LHMM(npar));
868 Double_t arglist[10];
872 lhoodFit->mnexcm(
"SET ERR", arglist ,1,ierflg);;
880 init_pars.resize(npar);
882 vector< vector <double> > loc_init_pars;
886 loc_init_pars[ilep-1].resize(0
x1 << ilep);
888 for (
int ipar = 0; ipar < (0x1 << ilep); ipar++) {
889 init_pars[
index+ipar] = loc_init_pars[ilep-1][ipar];
894 Double_t
step = TMath::Max(loc_init_pars[
m_minnlep-1][0]/1000,0.001);
900 vector<TString> parameterName;
903 parameterName.push_back(
"nfake_tot");
904 TString sreal =
"nreal";
907 sprintf(tmpchar,
"_%i", ilep);
908 TString tmpstr = sreal;
909 tmpstr.Append(tmpchar);
910 for (
unsigned isublep = 0; isublep <
m_real_indices[ilep-1].size(); isublep++) {
911 TString locsreal = tmpstr;
913 sprintf(tmpchar2,
"_%u", isublep);
914 locsreal.Append(tmpchar2);
915 parameterName.push_back(locsreal);
917 nreal_start_indices[ilep-1] = (parameterName.size());
918 ATH_MSG_VERBOSE(
"nreal_start_indices[" << ilep-1 <<
"] = " << nreal_start_indices[ilep-1]);
923 TString stheta_tot =
"theta_tot";
927 TString tmpstr = stheta_tot;
928 tmpstr.Append(tmpchar);
929 parameterName.push_back(tmpstr);
933 TString stheta =
"theta_";
935 sprintf(tmpchar,
"%i", ilep);
936 TString tmpstr = std::move(stheta);
937 tmpstr.Append(tmpchar);
941 TString locstheta = tmpstr;
943 sprintf(tmpchar2,
"%i", jlep);
944 locstheta.Append(tmpchar2);
945 parameterName.push_back(locstheta);
959 ATH_MSG_VERBOSE(
"nfakes for nlep = " << ilep <<
" used to find theta_tot = " << loc_init_pars[ilep-1][0]);
960 theta_tot[theta_index] = TMath::ACos(TMath::Sqrt(TMath::Max(loc_init_pars[ilep-1][0],0.)/(
m_nfakes_std))/sinterm);
961 if (TMath::IsNaN( theta_tot[theta_index] ) ) {
964 sinterm *= TMath::Sin(theta_tot[theta_index]);
977 upper_limits.resize(npar);
983 for (
unsigned isublep = 0; isublep <
m_real_indices[ilep-1].size(); isublep++) {
989 for (
int ipar = real_index; ipar < npar; ipar++) {
995 init_par_values.resize(npar);
1001 for (
unsigned isublep = 0; isublep <
m_real_indices[ilep-1].size(); isublep++) {
1002 ATH_MSG_VERBOSE(
"Setting parameter " << glob_index <<
" to " << init_pars[init_index+isublep]);
1003 init_par_values[glob_index] = init_pars[init_index+isublep];
1006 init_index+=
pow(2,ilep);
1017 theta_start_indices[
i] = theta_start_indices[
i-1] +
m_fake_indices[
i-1].size() - 1;
1035 index+= 0x1 << ilep;
1038 for (ipar = 0; ipar < npar; ipar++) {
1039 lhoodFit->mnparm(ipar, parameterName[ipar], init_par_values[ipar],
step, 0., upper_limits[ipar], ierflg);
1050 int nGoodLeptonMult = 0;
1056 for (
unsigned ipar = nreal_start_indices[ilep-1]; ipar < nreal_start_indices[ilep-1] +
m_real_indices[ilep-1].size(); ipar++) {
1059 lhoodFit->mnexcm(
"SET PAR", arglist, 2, ierflg);
1060 lhoodFit->mnexcm(
"FIX PAR", arglist, 1, ierflg);
1065 lhoodFit->mnexcm(
"SET PAR", arglist, 2, ierflg);
1066 lhoodFit->mnexcm(
"FIX PAR", arglist, 1, ierflg);
1069 for (
unsigned ipar = theta_start_indices[ilep-1]+1; ipar < theta_start_indices[ilep-1] +
m_fake_indices[ilep-1].size() ; ipar++) {
1072 lhoodFit->mnexcm(
"SET PAR", arglist, 2, ierflg);
1073 lhoodFit->mnexcm(
"FIX PAR", arglist, 1, ierflg);
1078 index += (0x1 << ilep) - 2;
1081 if (nGoodLeptonMult == 0) {
1082 ATH_MSG_VERBOSE(
"No possible fake contribution for any lepton multiplicity");
1090 lhoodFit->mnexcm(
"MIGRAD", arglist ,2,ierflg);
1094 Double_t amin, edm, errdef;
1095 Int_t nvpar, nparx, icstat;
1096 lhoodFit->mnstat(amin,edm,errdef,nvpar,nparx,icstat);
1098 lhoodFit->GetParameter(0, nfake_fit, nfake_fitErr);
1102 if (poserr && negerr) {
1105 lhoodFit->mnexcm(
"MINOS", arglist ,2,ierflg);
1106 lhoodFit->mnerrs(0, *poserr, *negerr, nfake_fitErr, gcc);
1109 lhoodFit->mnstat(amin,edm,errdef,nvpar,nparx,icstat);
1110 lhoodFit->GetParameter(0, nfake_fit, nfake_fitErr);
1114 if ( *poserr < 1.
e-5) {
1115 *poserr =
fixPosErr(nfake_fit, lhoodFit.get());
1117 if (*negerr > -1.
e-5 ) {
1118 *negerr =
fixNegErr(nfake_fit, lhoodFit.get());
1121 if (*negerr > -1.
e-5) {
1122 *negerr = -nfake_fitErr;
1124 if (nfake_fit + *negerr < 0.) {
1125 *negerr = -nfake_fit;
1129 if (*poserr < 1.
e-5) {
1130 *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, 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, 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 163 of file LhoodMM_tools.cxx.
167 if(
sc != StatusCode::SUCCESS)
return sc;
174 int ncells =
h1->GetNcells();
176 fitinfovec->resize(ncells);
185 ATH_MSG_ERROR(
"Error in LhoodMM_tools::register1DHistogram: histogram has already been registered");
186 return StatusCode::FAILURE;
188 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 191 of file LhoodMM_tools.cxx.
195 if(
sc != StatusCode::SUCCESS)
return sc;
201 int ncells = h2->GetNcells();
203 fitinfovec->resize(ncells);
208 ATH_MSG_INFO(
"Registered a 2D histogram "<<h2->GetName());
210 ATH_MSG_ERROR(
"Error in LhoodMM_tools::register2DHistogram: histogram has already been registered");
211 return StatusCode::FAILURE;
213 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 216 of file LhoodMM_tools.cxx.
220 if(
sc != StatusCode::SUCCESS)
return sc;
226 int ncells = h3->GetNcells();
228 fitinfovec->resize(ncells);
233 ATH_MSG_INFO(
"Registered a 3D histogram "<<h3->GetName());
235 ATH_MSG_ERROR(
"Error in LhoodMM_tools::register3DHistogram: histogram has already been registered");
236 return StatusCode::FAILURE;
238 return StatusCode::SUCCESS;
◆ renounce()
◆ renounceArray()
◆ reset()
void LhoodMM_tools::reset |
( |
| ) |
|
|
protectedvirtual |
Definition at line 77 of file LhoodMM_tools.cxx.
99 for (
int ilep = 0; ilep <
s_nLepMax; ilep++) {
102 for (
int ientry = 0; ientry < (0x1 << (ilep+1)); ientry++) {
103 m_coeffs[ilep][ientry].resize((0
x1 << (ilep+1)) );
104 for (
int jentry = 0; jentry < (0x1 << (ilep+1)); jentry++) {
126 for (
int ilep = 0; ilep <
s_nLepMax; ilep++) {
138 for (
int ilep = 0; ilep <
s_nLepMax; ilep++) {
139 m_nrf_mat_vec[ilep] = std::shared_ptr<TMatrixT<double>>(std::make_shared<TMatrixT<double>>(0x1 << (ilep+1),1) );
140 m_MMmatrix_vec[ilep] = std::shared_ptr<TMatrixT<double>>(std::make_shared<TMatrixT<double>> ((0x1 << (ilep+1)),(0x1 << (ilep+1))));
141 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 1674 of file LhoodMM_tools.cxx.
1679 ATH_MSG_ERROR(
"Multiple calls to saveProgress are not supported");
1680 return StatusCode::FAILURE;
1685 std::unique_ptr<TTree>
t(
new TTree(
"LhoodMM_progress",
"Stores current info from LhoodMM_toos"));
1687 std::unique_ptr<TTree> t_nlep(
new TTree(
"LhoodMM_progress_nlep",
"Stores minimum and maximum lepton multiplicities"));
1690 ATH_MSG_VERBOSE(
"Branch split level is " << fitInfoBranch->GetSplitLevel() );
1704 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 150 of file LhoodMM_tools.cxx.
153 return StatusCode::SUCCESS;
154 }
else if (
ft ==
"MM") {
156 return StatusCode::SUCCESS;
158 ATH_MSG_ERROR(
"Error in LhoodMM_tools::setFitType: please specify \"MM\" for matrix method or \"FF\" for fake factor method");
159 return StatusCode::FAILURE;
◆ setPrintLevel()
void CP::LhoodMM_tools::setPrintLevel |
( |
Int_t |
printLevel | ) |
|
|
inline |
◆ setup()
StatusCode LhoodMM_tools::setup |
( |
| ) |
|
|
private |
Definition at line 530 of file LhoodMM_tools.cxx.
535 for (
int jlep = 0; jlep < ilep; jlep++) {
544 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_accFakeEff
◆ m_accRealEff
◆ 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
constexpr int CP::LhoodMM_tools::s_maxRank = 64 |
|
staticconstexprprivate |
◆ s_mutex
std::mutex LhoodMM_tools::s_mutex |
|
staticprivate |
◆ s_nLepMax
constexpr int CP::LhoodMM_tools::s_nLepMax = 6 |
|
staticconstexprprivate |
◆ 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