Loading [MathJax]/extensions/tex2jax.js
 |
ATLAS Offline Software
|
#include <TForwardElectronLikelihoodTool.h>
|
| TForwardElectronLikelihoodTool (const char *name="TForwardElectronLikelihoodTool") |
| Standard constructor. More...
|
|
StatusCode | initialize () |
| Initialize this class. More...
|
|
const asg::AcceptInfo & | getAcceptInfo () const |
| accesss to the accept info object More...
|
|
asg::AcceptData | accept (LikeEnumForward::LHAcceptVars_t &vars_struct) const |
| The main accept method: the actual cuts are applied here. More...
|
|
asg::AcceptData | accept (double likelihood, double eta, double eT, double ip) const |
|
asg::AcceptData | accept () const |
| Return dummy accept with only info. More...
|
|
double | calculate (LikeEnumForward::LHCalcVars_t &vars_struct) const |
|
double | calculate (double eta, double eT, double secondLambda, double lateral, double longitudinal, double centerLambda, double fracMax, double secondR, double significance, double secondDensity, double ip) const |
|
void | setPDFFileName (const std::string &val) |
| Add an input file that holds the PDFs. More...
|
|
void | setVariableNames (const std::string &val) |
| Define the variable names. More...
|
|
int | loadVarHistograms (const std::string &vstr, unsigned int varIndex) |
| Load the variable histograms from the pdf file. More...
|
|
void | setBinning (const std::string &val) |
| Define the binning. More...
|
|
unsigned int | getBitmask (void) const |
|
void | setBitmask (unsigned int val) |
|
void | setLevel (MSG::Level lvl) |
| Change the current logging level. More...
|
|
◆ TForwardElectronLikelihoodTool()
Root::TForwardElectronLikelihoodTool::TForwardElectronLikelihoodTool |
( |
const char * |
name = "TForwardElectronLikelihoodTool" | ) |
|
◆ accept() [1/3]
◆ accept() [2/3]
asg::AcceptData Root::TForwardElectronLikelihoodTool::accept |
( |
double |
likelihood, |
|
|
double |
eta, |
|
|
double |
eT, |
|
|
double |
ip |
|
) |
| const |
◆ accept() [3/3]
The main accept method: the actual cuts are applied here.
Definition at line 211 of file TForwardElectronLikelihoodTool.cxx.
218 bool passKineEta(
true);
219 bool passKineEt(
true);
222 if (fabs(vars_struct.
eta) < 2.5) {
225 <<
", which is fabs(eta)<2.5 Returning False.");
239 << vars_struct.
eT <<
". Returning false..");
249 double cutDiscriminant = -999.;
250 unsigned int ibin_combined = etbin *
s_fnEtaBins + etabin;
266 if (vars_struct.
likelihood < cutDiscriminant) {
◆ calculate() [1/2]
double Root::TForwardElectronLikelihoodTool::calculate |
( |
double |
eta, |
|
|
double |
eT, |
|
|
double |
secondLambda, |
|
|
double |
lateral, |
|
|
double |
longitudinal, |
|
|
double |
centerLambda, |
|
|
double |
fracMax, |
|
|
double |
secondR, |
|
|
double |
significance, |
|
|
double |
secondDensity, |
|
|
double |
ip |
|
) |
| const |
Definition at line 275 of file TForwardElectronLikelihoodTool.cxx.
290 vars.secondLambda = secondLambda;
291 vars.lateral = lateral;
292 vars.longitudinal = longitudinal;
293 vars.centerLambda = centerLambda;
294 vars.fracMax = fracMax;
295 vars.secondR = secondR;
296 vars.significance = significance;
297 vars.secondDensity = secondDensity;
◆ calculate() [2/2]
◆ evaluateLikelihood() [1/2]
double Root::TForwardElectronLikelihoodTool::evaluateLikelihood |
( |
std::vector< double > & |
varVector, |
|
|
double |
et, |
|
|
double |
eta, |
|
|
double |
ip = 0 |
|
) |
| const |
|
private |
Definition at line 336 of file TForwardElectronLikelihoodTool.cxx.
357 ATH_MSG_WARNING(
"Error! Variable vector size mismatch! Check your vector!");
373 for (
unsigned int s_or_b = 0; s_or_b < 2; s_or_b++) {
383 "Error! PDF integral == 0!");
395 else if (s_or_b == 1)
◆ evaluateLikelihood() [2/2]
double Root::TForwardElectronLikelihoodTool::evaluateLikelihood |
( |
std::vector< float > & |
varVector, |
|
|
double |
et, |
|
|
double |
eta, |
|
|
double |
ip = 0 |
|
) |
| const |
|
private |
◆ getAcceptInfo()
◆ getBinName()
std::string Root::TForwardElectronLikelihoodTool::getBinName |
( |
int |
etbin, |
|
|
int |
etabin, |
|
|
int |
ipbin, |
|
|
const std::string & |
iptype |
|
) |
| |
|
staticprivate |
Definition at line 474 of file TForwardElectronLikelihoodTool.cxx.
480 double eta_bounds[
s_fnEtaBins] = { 2.5, 2.6, 2.7, 2.8, 2.9,
481 3.0, 3.1, 3.16, 3.35, 3.6 };
483 if (!iptype.empty()) {
486 et_bounds[etbin], eta_bounds[etabin]);
489 et_bounds[etbin], eta_bounds[etabin]);
◆ getBitmask()
unsigned int Root::TForwardElectronLikelihoodTool::getBitmask |
( |
void |
| ) |
const |
|
inline |
◆ getIpBin()
unsigned int Root::TForwardElectronLikelihoodTool::getIpBin |
( |
double |
ip | ) |
|
|
staticprivate |
◆ getLikelihoodBitmask()
unsigned int Root::TForwardElectronLikelihoodTool::getLikelihoodBitmask |
( |
const std::string & |
vars | ) |
const |
|
private |
Mask out the variables ,out of all possible ones, that are not employed in the current configuration as read from the input config file.
Definition at line 494 of file TForwardElectronLikelihoodTool.cxx.
497 unsigned int mask = 0x0;
◆ getLikelihoodEtaBin()
unsigned int Root::TForwardElectronLikelihoodTool::getLikelihoodEtaBin |
( |
double |
eta | ) |
|
|
staticprivate |
◆ getLikelihoodEtHistBin()
unsigned int Root::TForwardElectronLikelihoodTool::getLikelihoodEtHistBin |
( |
double |
eT | ) |
|
|
staticprivate |
Coarse Et binning. Used for the likelihood and discriminant pdfs.
Definition at line 456 of file TForwardElectronLikelihoodTool.cxx.
458 const double GeV = 1000;
460 const double eTBins[nEtBins] = {
463 for (
unsigned int eTBin = 0; eTBin < nEtBins; ++eTBin) {
464 if (
eT < eTBins[eTBin]) {
468 return (nEtBins - 1);
◆ initialize()
StatusCode Root::TForwardElectronLikelihoodTool::initialize |
( |
| ) |
|
Initialize this class.
Definition at line 36 of file TForwardElectronLikelihoodTool.cxx.
45 "You need to specify the input PDF file name before you call "
46 "initialize() with setPDFFileName('your/file/name.root') ");
47 sc = StatusCode::FAILURE;
52 ATH_MSG_ERROR(
"Configuration issue : CutLikelihood expected size "
53 << number_of_expected_bin <<
" input size "
56 "Could NOT initialize! Please fix the errors mentioned above...");
57 sc = StatusCode::FAILURE;
68 sc = StatusCode::FAILURE;
72 sc = StatusCode::FAILURE;
77 sc = StatusCode::FAILURE;
81 if (
sc == StatusCode::FAILURE) {
83 "! Something went wrong with the setup of the return objects...");
93 gSystem->ExpandPathName(tmpString);
94 std::string
fname(tmpString.Data());
99 return StatusCode::FAILURE;
103 for (
unsigned int varIndex = 0; varIndex <
s_fnVariables; varIndex++) {
104 const std::string& vstr =
fVariables[varIndex];
121 ATH_MSG_DEBUG(
"Initialization complete for a LH tool with these specs:"
122 <<
"\n - PdfFileName : "
124 <<
"\n - Variable bitmask : "
126 <<
"\n - VariableNames : "
◆ initMessaging()
void AthMessaging::initMessaging |
( |
| ) |
const |
|
privateinherited |
Initialize our message level and MessageSvc.
This method should only be called once.
Definition at line 39 of file AthMessaging.cxx.
◆ loadVarHistograms()
int Root::TForwardElectronLikelihoodTool::loadVarHistograms |
( |
const std::string & |
vstr, |
|
|
unsigned int |
varIndex |
|
) |
| |
Load the variable histograms from the pdf file.
Definition at line 132 of file TForwardElectronLikelihoodTool.cxx.
135 for (
unsigned int s_or_b = 0; s_or_b < 2; ++s_or_b) {
136 for (
unsigned int ip = 0;
ip < IP_FBINS; ++
ip) {
140 std::string sig_bkg = (s_or_b == 0) ?
"sig" :
"bkg";
143 unsigned int eta_tmp =
eta;
144 unsigned int et_tmp =
et;
147 const std::string pdfdir =
std::format(
"{}/{}", vstr, sig_bkg);
149 vstr, sig_bkg, binname);
151 if (!
m_pdfFile->GetListOfKeys()->Contains(vstr.c_str())) {
153 << vstr <<
" because the folder does not exist.");
156 if (!((TDirectory*)
m_pdfFile->Get(vstr.c_str()))
158 ->Contains(sig_bkg.c_str())) {
160 << vstr <<
" because the folder does not exist.");
164 if (
et == 0 && !((TDirectory*)
m_pdfFile->Get(pdfdir.c_str()))
166 ->Contains(
pdf.c_str())) {
167 ATH_MSG_INFO(
"using lowest GeV bin in place of all below.");
170 vstr, sig_bkg, binname);
172 if (((TDirectory*)
m_pdfFile->Get(pdfdir.c_str()))
174 ->Contains(
pdf.c_str())) {
178 new EGSelectors::SafeTH1(
hist);
182 ATH_MSG_INFO(
"Skipping all other histograms with this variable.");
◆ msg() [1/2]
MsgStream & asg::AsgMessaging::msg |
( |
| ) |
const |
|
inherited |
The standard message stream.
- Returns
- A reference to the default message stream of this object.
Definition at line 49 of file AsgMessaging.cxx.
50 #ifndef XAOD_STANDALONE
52 #else // not XAOD_STANDALONE
54 #endif // not XAOD_STANDALONE
◆ msg() [2/2]
MsgStream & asg::AsgMessaging::msg |
( |
const MSG::Level |
lvl | ) |
const |
|
inherited |
The standard message stream.
- Parameters
-
lvl | The message level to set the stream to |
- Returns
- A reference to the default message stream, set to level "lvl"
Definition at line 57 of file AsgMessaging.cxx.
58 #ifndef XAOD_STANDALONE
60 #else // not XAOD_STANDALONE
63 #endif // not XAOD_STANDALONE
◆ msgLvl()
bool asg::AsgMessaging::msgLvl |
( |
const MSG::Level |
lvl | ) |
const |
|
inherited |
Test the output level of the object.
- Parameters
-
lvl | The message level to test against |
- Returns
- boolean Indicting if messages at given level will be printed
-
true
If messages at level "lvl" will be printed
Definition at line 41 of file AsgMessaging.cxx.
42 #ifndef XAOD_STANDALONE
43 return ::AthMessaging::msgLvl( lvl );
44 #else // not XAOD_STANDALONE
45 return m_msg.msgLevel( lvl );
46 #endif // not XAOD_STANDALONE
◆ setBinning()
void Root::TForwardElectronLikelihoodTool::setBinning |
( |
const std::string & |
val | ) |
|
|
inline |
◆ setBitmask()
void Root::TForwardElectronLikelihoodTool::setBitmask |
( |
unsigned int |
val | ) |
|
|
inline |
◆ setLevel()
void AthMessaging::setLevel |
( |
MSG::Level |
lvl | ) |
|
|
inherited |
◆ setPDFFileName()
void Root::TForwardElectronLikelihoodTool::setPDFFileName |
( |
const std::string & |
val | ) |
|
|
inline |
◆ setVariableNames()
void Root::TForwardElectronLikelihoodTool::setVariableNames |
( |
const std::string & |
val | ) |
|
|
inline |
◆ TransformLikelihoodOutput()
double Root::TForwardElectronLikelihoodTool::TransformLikelihoodOutput |
( |
double |
ps, |
|
|
double |
pb |
|
) |
| const |
|
private |
Apply a transform to zoom into the LH output peaks.
Optionally do pileup correction too
Definition at line 405 of file TForwardElectronLikelihoodTool.cxx.
410 double fEpsilon = 1
e-99;
420 else if (disc <= 0.0)
424 disc = -
log(1.0 / disc - 1.0) * (1. /
double(tau));
◆ ATLAS_THREAD_SAFE
std::atomic_flag m_initialized AthMessaging::ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT |
|
mutableprivateinherited |
◆ fIpBounds
const double Root::TForwardElectronLikelihoodTool::fIpBounds |
|
staticprivate |
◆ fPDFbins
◆ fVariables
const std::string Root::TForwardElectronLikelihoodTool::fVariables |
|
staticprivate |
Initial value:= {
"el_secondLambda", "el_lateral", "el_longitudinal", "el_centerLambda",
"el_fracMax", "el_secondR", "el_significance", "el_secondDensity"
}
Definition at line 240 of file TForwardElectronLikelihoodTool.h.
◆ m_acceptInfo
◆ m_cutLikelihood
std::vector<double> Root::TForwardElectronLikelihoodTool::m_cutLikelihood |
◆ m_cutLikelihoodPileupCorrectionA
std::vector<double> Root::TForwardElectronLikelihoodTool::m_cutLikelihoodPileupCorrectionA |
the cut on the PU discriminant is adjusted as a function of nVtx cut + nVtx*cutA + cutB this is different from the procedure for central electrons
pileup slope factor for cut on likelihood output
Definition at line 191 of file TForwardElectronLikelihoodTool.h.
◆ m_cutLikelihoodPileupCorrectionB
std::vector<double> Root::TForwardElectronLikelihoodTool::m_cutLikelihoodPileupCorrectionB |
◆ m_cutPosition_kinematicEt
int Root::TForwardElectronLikelihoodTool::m_cutPosition_kinematicEt |
|
private |
◆ m_cutPosition_kinematicEta
int Root::TForwardElectronLikelihoodTool::m_cutPosition_kinematicEta |
|
private |
◆ m_cutPosition_LH
int Root::TForwardElectronLikelihoodTool::m_cutPosition_LH |
|
private |
◆ m_doPileupCorrection
bool Root::TForwardElectronLikelihoodTool::m_doPileupCorrection |
Apply a transform to zoom into the LH output peaks.
Eta binning for pdfs and discriminant cuts. Et binning for for the likelihood pdfs and discriminants.
do pileup-dependent correction on discriminant value
Definition at line 183 of file TForwardElectronLikelihoodTool.h.
◆ m_imsg
std::atomic<IMessageSvc*> AthMessaging::m_imsg { nullptr } |
|
mutableprivateinherited |
◆ m_ipBinning
std::string Root::TForwardElectronLikelihoodTool::m_ipBinning |
|
private |
◆ m_lvl
std::atomic<MSG::Level> AthMessaging::m_lvl { MSG::NIL } |
|
mutableprivateinherited |
◆ m_msg_tls
boost::thread_specific_ptr<MsgStream> AthMessaging::m_msg_tls |
|
mutableprivateinherited |
MsgStream instance (a std::cout like with print-out levels)
Definition at line 132 of file AthMessaging.h.
◆ m_nm
std::string AthMessaging::m_nm |
|
privateinherited |
◆ m_pdfFile
TFile* Root::TForwardElectronLikelihoodTool::m_pdfFile {} |
|
private |
◆ m_pdfFileName
std::string Root::TForwardElectronLikelihoodTool::m_pdfFileName |
◆ m_variableBitMask
unsigned int Root::TForwardElectronLikelihoodTool::m_variableBitMask |
|
private |
◆ m_variableNames
std::string Root::TForwardElectronLikelihoodTool::m_variableNames |
◆ s_fnDiscEtBins
const unsigned int Root::TForwardElectronLikelihoodTool::s_fnDiscEtBins |
|
staticprivate |
◆ s_fnEtaBins
const unsigned int Root::TForwardElectronLikelihoodTool::s_fnEtaBins = 10 |
|
staticprivate |
◆ s_fnEtBinsHist
const unsigned int Root::TForwardElectronLikelihoodTool::s_fnEtBinsHist |
|
staticprivate |
◆ s_fnVariables
const unsigned int Root::TForwardElectronLikelihoodTool::s_fnVariables = 8 |
|
staticprivate |
The documentation for this class was generated from the following files:
std::atomic< MSG::Level > m_lvl
Current logging level.
Extra patterns decribing particle interation process.
constexpr unsigned nEtaBins
Scalar eta() const
pseudorapidity method
std::vector< size_t > vec
std::atomic< IMessageSvc * > m_imsg
MessageSvc pointer.
IMessageSvc * getMessageSvc(bool quiet=false)
typename vecDetail::vec_typedef< T, N >::type vec
Define a nice alias for the vectorized type.
setSAddress setEtaMS setDirPhiMS setDirZMS setBarrelRadius setEndcapAlpha setEndcapRadius setInterceptInner setEtaMap etaBin
int FindBin(double value) const
float eT(const U &p)
Accessor utility function for getting the value of Tranverse energy.
::StatusCode StatusCode
StatusCode definition for legacy code.
Class mimicking the AthMessaging class from the offline software.
#define ATH_MSG_WARNING(x)
std::string m_nm
Message source name.
def TH1F(name, title, nxbins, bins_par2, bins_par3=None, path='', **kwargs)
int addCut(const std::string &cutName, const std::string &cutDescription)
Add a cut; returning the cut position.