166 std::string
author = jetName;
172 double jeteta = jetToTag.
eta(), jetphi = jetToTag.
phi(), jetpt = jetToTag.
pt();
174 <<
" phi = " << jetphi <<
" pT = " <<jetpt/
m_c_mom);
178 if (std::abs(jeteta) <= 2.5) {
187 float ambtot = -1., xratio = -1., distnrm = 0., drJPVSV = 0., Lxy = -100., L3d = -100.;
189 float distnrmCorr=0.;
193 std::vector< ElementLink< xAOD::VertexContainer > > myVertices;
195 BTag.variable<std::vector<ElementLink<xAOD::VertexContainer> > >(
m_secVxFinderName,
"vertices", myVertices);
197 if (!myVertices.empty()) {
217 position.y() - PVposition.y(),
218 position.z() - PVposition.z() );
224 ATH_MSG_VERBOSE(
"#BTAG# DRJPVSV regular="<<drJPVSV_1<<
" flipped="<<drJPVSV_2<<
" chosen="<<drJPVSV);
226 Lxy = std::hypot(PvSvDir(0,0), PvSvDir(1,0));
227 L3d = std::hypot(PvSvDir(0,0), PvSvDir(1,0), PvSvDir(2,0));
232 std::vector<const xAOD::Vertex*> vecVertices;
233 for (
const auto& link : myVertices) {
234 if (!link.isValid()) {
235 ATH_MSG_WARNING(
"#BTAG# Secondary vertex from InDetVKalVxInJetFinder has zero pointer. Skipping... ");
238 vecVertices.push_back(*link);
247 ATH_MSG_VERBOSE(
"#BTAG# No vertex. Cannot calculate normalized distance.");
252 ATH_MSG_VERBOSE(
"#BTAG# Svx Mass = "<< ambtot <<
" Svx E frac = " << xratio <<
" NGood2TrackVertices = " << NSVPair);
262 std::string iname(
name().substr(8));
263 std::string instanceName(iname);
264 std::string::size_type
pos = iname.find(
"Tag");
265 if (
pos != std::string::npos) {
266 std::string
prefix = iname.substr(0,
pos);
267 std::string posfix = iname.substr(
pos+3);
269 instanceName += posfix;
281 BTag.setSV0_significance3D(distnrm);
310 float ambtotp = ambtot > 0. ? ambtot/(1.+ambtot) : 0.;
312 float trfJetPt =
log(jetToTag.
pt()/20000.);
313 if(trfJetPt<0.) trfJetPt=0.01;
314 if(trfJetPt>4.8) trfJetPt=4.79;
315 std::string
pref =
"";
317 if (jetpt >=
m_pTjetmin && std::abs(jeteta) <= 2.5) {
319 double deltaRtoClosestB = 999.;
320 if (jetToTag.
getAttribute(
"TruthLabelDeltaR_B",deltaRtoClosestB)) {
323 double deltaRtoClosestC;
324 jetToTag.
getAttribute(
"TruthLabelDeltaR_C", deltaRtoClosestC);
325 double deltaRmin = deltaRtoClosestB < deltaRtoClosestC ? deltaRtoClosestB : deltaRtoClosestC;
335 }
else if (0==
label) {
344 if (pref ==
"B" || pref ==
"C" || pref ==
"U") {
348 if (NSVPair > 0 && ambtot > 0.) {
349 if (xratiop == 1.) xratiop = 0.999999;
364 ATH_MSG_ERROR(
"#BTAG# No TruthInfo ! Cannot run in reference mode !");
365 return StatusCode::FAILURE;
369 std::vector<double> probi;
377 ATH_MSG_DEBUG(
"#BTAG# EFF b,u,c= " << effb <<
" " << effu <<
" " << effc);
378 if (NSVPair>0 && ambtot > 0.) {
380 AtomicProperty atom2(ambtotp,
"SecVtx Transformed Mass");
381 AtomicProperty atom3(xratiop,
"SecVtx Transformed Energy Fraction");
383 AtomicProperty atom1(NSVPair,
"Number of Two Track Vertices");
384 std::string compoName(
author+
"#");
385 Composite compo1(compoName+
"N2T");
386 Composite compo2(compoName+
"BidimME");
387 compo1.atoms.push_back(atom1);
388 compo2.atoms.push_back(atom2);
389 compo2.atoms.push_back(atom3);
391 slice1.composites.push_back(compo1);
392 slice1.composites.push_back(compo2);
394 AtomicProperty atom4(drJPVSV,
"DeltaR between jet axis and (PV,SV) axis");
395 Composite compo3(compoName+
"DRJPVSV");
396 compo3.atoms.push_back(atom4);
397 slice1.composites.push_back(compo3);
401 std::string compoName(
author+
"#");
404 AtomicProperty atom1(trfJetPt,
"log(JetPt/2e4)");
405 Composite compo(compoName+
"TridimMENPt");
406 compo.atoms.push_back(atom2);
407 compo.atoms.push_back(atom3);
408 compo.atoms.push_back(atom1);
409 Composite compo1(compoName+
"N2TEffSV2");
410 AtomicProperty atom4(NSVPair,
"Number of Two Track Vertices");
411 compo1.atoms.push_back(atom4);
412 slice1.composites.push_back(compo);
413 slice1.composites.push_back(compo1);
415 AtomicProperty atom1(
log((
float)NSVPair),
"log(Number of Two Track Vertices)");
416 Composite compo(compoName+
"TridimMEN2T");
417 compo.atoms.push_back(atom2);
418 compo.atoms.push_back(atom3);
419 compo.atoms.push_back(atom1);
420 slice1.composites.push_back(compo);
426 << probi[0] <<
" " << probi[1] <<
" " << probi[2]);
427 if (probi.size() >= 2) {
434 ATH_MSG_ERROR(
"#BTAG# Missing number in jet probabilities ! "<<probi.size());
439 probi.push_back((1.-effb));
440 probi.push_back((1.-effu));
442 probi.push_back((1.-effc));
445 if (probi.size()>=2){
463 return StatusCode::SUCCESS;