Commit 7f2c16f0 authored by Jean-Baptiste De Vivie De Regie's avatar Jean-Baptiste De Vivie De Regie
Browse files

fixes

parent 4edffbc4
......@@ -44,8 +44,8 @@ print("EGammaCommon: isMC = ", isMC)
if isMC:
print("EGammaCommon: isFullSim = ", isFullSim)
from EGammaVariableCorrection.EGammaVariableCorrectionConf import EGDiscVarDecorationTool as EGDVDT
DiscVarDecorator = EGDVDT(name = "DiscVarDecorator", VariablesToStore = ["d0", "d0sigma", "deltaPoverP", "eProbabilityHT"], OutputLevel = 3)
from DerivationFrameworkEGamma.DerivationFrameworkEGammaConf import EGDiscVarDecorationTool as EGDVDT
DiscVarDecorator = EGDVDT(name = "DiscVarDecorator", VariablesToStore = ["d0", "d0significance", "deltaPoverP", "eProbabilityHT"], OutputLevel = 3)
ToolSvc += DiscVarDecorator
if isFullSim:
......
......@@ -92,10 +92,12 @@ float EGDiscVarDecorationTool::Deco(const std::string& vN, const xAOD::Egamma *e
return trackDec(eg,0);
else if (vN == "d0sigma")
return trackDec(eg,1);
else if (vN == "deltaPoverP")
else if (vN == "d0significance")
return trackDec(eg,2);
else if (vN == "eProbabilityHT")
else if (vN == "deltaPoverP")
return trackDec(eg,3);
else if (vN == "eProbabilityHT")
return trackDec(eg,4);
else {
ATH_MSG_WARNING("Unknown variable " << vN << ", using dummy decoration 0");
return 0;
......@@ -114,19 +116,20 @@ float EGDiscVarDecorationTool::trackDec(const xAOD::Egamma *eg, unsigned short i
if (t) {
if (ityp == 0)
return t->d0();
else if (ityp == 1) {
else if (ityp == 1 || ityp == 2) {
float vard0 = t->definingParametersCovMatrix()(0,0);
if (vard0 > 0) {
return sqrtf(vard0);
float par = ityp == 1 ? sqrtf(vard0) : std::abs(t->d0())/sqrtf(vard0);
return par;
} else {
ATH_MSG_WARNING("negative d0 error, returning 0");
return 0.;
}
} else if (ityp == 2) {
} else if (ityp == 3) {
float qop = t->qOverP();
float qopLM = xAOD::EgammaHelpers::getLastMeasurementQoverP(t);
return 1.-qop/qopLM;
} else if (ityp == 3) {
} else if (ityp == 4) {
double tau = 15.0;
double fEpsilon = 1.0e-30; // to avoid division by 0
float TRT_PID = 0.0;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment