|
ATLAS Offline Software
|
#include <TForwardElectronLikelihoodTool.h>
|
| TForwardElectronLikelihoodTool (const char *name="TForwardElectronLikelihoodTool") |
| Standard constructor. More...
|
|
| ~TForwardElectronLikelihoodTool () |
| Standard destructor. 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" | ) |
|
◆ ~TForwardElectronLikelihoodTool()
Root::TForwardElectronLikelihoodTool::~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 251 of file TForwardElectronLikelihoodTool.cxx.
258 bool passKineEta(
true);
259 bool passKineEt(
true);
262 if (fabs(vars_struct.
eta) < 2.5) {
265 <<
", which is fabs(eta)<2.5 Returning False.");
279 << vars_struct.
eT <<
". Returning false..");
289 double cutDiscriminant = -999.;
290 unsigned int ibin_combined = etbin *
s_fnEtaBins + etabin;
306 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 315 of file TForwardElectronLikelihoodTool.cxx.
330 vars.secondLambda = secondLambda;
331 vars.lateral = lateral;
332 vars.longitudinal = longitudinal;
333 vars.centerLambda = centerLambda;
334 vars.fracMax = fracMax;
335 vars.secondR = secondR;
336 vars.significance = significance;
337 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 376 of file TForwardElectronLikelihoodTool.cxx.
397 ATH_MSG_WARNING(
"Error! Variable vector size mismatch! Check your vector!");
413 for (
unsigned int s_or_b = 0; s_or_b < 2; s_or_b++) {
423 "Error! PDF integral == 0!");
435 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()
void Root::TForwardElectronLikelihoodTool::getBinName |
( |
char * |
buffer, |
|
|
int |
etbin, |
|
|
int |
etabin, |
|
|
int |
ipbin, |
|
|
const std::string & |
iptype |
|
) |
| |
|
staticprivate |
Definition at line 514 of file TForwardElectronLikelihoodTool.cxx.
521 double eta_bounds[
s_fnEtaBins] = { 2.5, 2.6, 2.7, 2.8, 2.9,
522 3.0, 3.1, 3.16, 3.35, 3.6 };
524 if (!iptype.empty()) {
527 "%s%det%02deta%0.2f",
533 snprintf(
buffer, 200,
"et%deta%0.2f", 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 538 of file TForwardElectronLikelihoodTool.cxx.
541 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 496 of file TForwardElectronLikelihoodTool.cxx.
498 const double GeV = 1000;
500 const double eTBins[nEtBins] = {
503 for (
unsigned int eTBin = 0; eTBin < nEtBins; ++eTBin) {
504 if (
eT < eTBins[eTBin]) {
508 return (nEtBins - 1);
◆ initialize()
StatusCode Root::TForwardElectronLikelihoodTool::initialize |
( |
| ) |
|
Initialize this class.
Definition at line 65 of file TForwardElectronLikelihoodTool.cxx.
74 "You need to specify the input PDF file name before you call "
75 "initialize() with setPDFFileName('your/file/name.root') ");
76 sc = StatusCode::FAILURE;
81 ATH_MSG_ERROR(
"Configuration issue : CutLikelihood expected size "
82 << number_of_expected_bin <<
" input size "
85 "Could NOT initialize! Please fix the errors mentioned above...");
86 sc = StatusCode::FAILURE;
97 sc = StatusCode::FAILURE;
101 sc = StatusCode::FAILURE;
106 sc = StatusCode::FAILURE;
110 if (
sc == StatusCode::FAILURE) {
112 "! Something went wrong with the setup of the return objects...");
122 gSystem->ExpandPathName(tmpString);
123 std::string
fname(tmpString.Data());
128 return StatusCode::FAILURE;
132 for (
unsigned int varIndex = 0; varIndex <
s_fnVariables; varIndex++) {
133 const std::string& vstr =
fVariables[varIndex];
150 ATH_MSG_DEBUG(
"Initialization complete for a LH tool with these specs:"
151 <<
"\n - PdfFileName : "
153 <<
"\n - Variable bitmask : "
155 <<
"\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 161 of file TForwardElectronLikelihoodTool.cxx.
164 for (
unsigned int s_or_b = 0; s_or_b < 2; ++s_or_b) {
165 for (
unsigned int ip = 0;
ip < IP_FBINS; ++
ip) {
169 std::string sig_bkg = (s_or_b == 0) ?
"sig" :
"bkg";
172 unsigned int eta_tmp =
eta;
173 unsigned int et_tmp =
et;
178 snprintf(pdfdir, 500,
"%s/%s", vstr.c_str(), sig_bkg.c_str());
182 "%s_%s_smoothed_hist_from_KDE_%s",
187 if (!
m_pdfFile->GetListOfKeys()->Contains(vstr.c_str())) {
189 << vstr <<
" because the folder does not exist.");
192 if (!((TDirectory*)
m_pdfFile->Get(vstr.c_str()))
194 ->Contains(sig_bkg.c_str())) {
196 << vstr <<
" because the folder does not exist.");
200 if (
et == 0 && !((TDirectory*)
m_pdfFile->Get(pdfdir))
203 ATH_MSG_INFO(
"using lowest GeV bin in place of all below.");
207 "%s_%s_smoothed_hist_from_KDE_%s",
212 if (((TDirectory*)
m_pdfFile->Get(pdfdir))
218 new EGSelectors::SafeTH1(
hist);
222 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 445 of file TForwardElectronLikelihoodTool.cxx.
450 double fEpsilon = 1
e-99;
460 else if (disc <= 0.0)
464 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 244 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 195 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 187 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.