34 m_runModus(
"analysis")
49 return StatusCode::SUCCESS;
55 const std::string &jetName)
const
61 std::string
author = jetName;
65 std::string
alias = readCdo->getChannelAlias(
author);
74 return StatusCode::SUCCESS;
78 std::vector<float*> inputPointers; inputPointers.clear();
80 unsigned nConfgVar=0;
bool badVariableFound=
false;
85 <<
", badVariableFound= "<<badVariableFound <<
", inputPointers.size()= "<<inputPointers.size() );
87 if ( inputVars.size()!=nConfgVar or badVariableFound ) {
88 ATH_MSG_WARNING(
"#BTAG# Number of expected variables for MVA: "<< nConfgVar <<
" does not match the number of variables found in the calibration file: " << inputVars.size() <<
" ... the algorithm will be 'disabled' "<<
alias<<
" "<<
author);
89 return StatusCode::SUCCESS;
95 double jeteta = jetToTag.
eta(), jetphi = jetToTag.
phi();
98 <<
" phi = " << jetphi <<
" pT = " <<vars.
m_jetpt/
GeV);
100 TLorentzVector jp4; jp4.SetPtEtaPhiM(jetToTag.
pt(), jetToTag.
eta(), jetToTag.
phi(), jetToTag.
m());
111 std::vector< ElementLink< xAOD::VertexContainer > > msvVertices;
114 std::vector<float> v_vtxmass = std::vector<float>(10,0);
115 std::vector<float> v_vtxefrc = std::vector<float>(10,0);
116 std::vector<float> v_vtxntrk = std::vector<float>(10,0);
117 std::vector<float> v_vtxDRj = std::vector<float>(10,0);
118 std::vector<float> v_vtxdls = std::vector<float>(10,0);
119 std::vector<float> v_vtxpt = std::vector<float>(10,0);
120 std::vector<float> v_vtxeta = std::vector<float>(10,0);
121 std::vector<float> v_vtxphi = std::vector<float>(10,0);
122 std::vector<float> v_vtxx = std::vector<float>(10,0);
123 std::vector<float> v_vtxy = std::vector<float>(10,0);
124 std::vector<float> v_vtxz = std::vector<float>(10,0);
126 if(!msvVertices.empty()){
127 for(
const auto& vtx : msvVertices){
128 if(msvVertices.size()>=10)
continue;
136 float x = (*vtx)->x();
137 float y = (*vtx)->y();
138 float z = (*vtx)->z();
139 TLorentzVector svp4; svp4.SetPtEtaPhiM(
pt,
eta,
phi,
mass);
142 const std::vector<ElementLink<xAOD::TrackParticleContainer> > svTrackLinks = (*vtx)->trackParticleLinks();
143 if(svTrackLinks.size()>1){
146 all_trks += svTrackLinks.size();
148 ATH_MSG_DEBUG(
"#BTAG# MSV_vtx mass: " <<
mass<<
", efrc: "<<efrc<<
", ntrk: "<<ntrk );
151 v_vtxmass[nsv] =
mass;
152 v_vtxefrc[nsv] = efrc;
153 v_vtxntrk[nsv] = ntrk;
154 v_vtxDRj[nsv] = jp4.DeltaR(svp4);
169 std::vector< ElementLink< xAOD::VertexContainer > > SV1Vertice;
171 if (!SV1Vertice.empty() && SV1Vertice[0].isValid()){
181 ATH_MSG_WARNING(
"Error retrieving input values; results will be incorrect!");
184 for(
int i=0;
i<nsv;
i++) {
190 int ivm1 = -1;
int ivm2 = -1;
191 float vm1 = 0.;
float vm2 = 0.;
192 TLorentzVector pvtx1; TLorentzVector pvtx2;
193 TVector3 sv1p3; TVector3 sv2p3;
194 for(
int i=0;
i<nsv;
i++) {
195 if( v_vtxntrk[
i]!=1) {
196 if( v_vtxmass[
i] > vm1 ) {
202 for(
int i=0;
i<nsv;
i++) {
203 if( v_vtxntrk[
i]!=1) {
204 if( v_vtxmass[
i] > vm2 && v_vtxmass[
i] < vm1 ) {
211 pvtx1.SetPtEtaPhiM(v_vtxpt[ivm1], v_vtxeta[ivm1], v_vtxphi[ivm1], v_vtxmass[ivm1]);
212 TVector3 p1 = pvtx1.Vect();
213 sv1p3.SetX(v_vtxx[ivm1] - priVtx.
x());
214 sv1p3.SetY(v_vtxy[ivm1] - priVtx.
y());
215 sv1p3.SetZ(v_vtxz[ivm1] - priVtx.
z());
223 pvtx2.SetPtEtaPhiM(v_vtxpt[ivm2], v_vtxeta[ivm2], v_vtxphi[ivm2], v_vtxmass[ivm2]);
224 TVector3 p2 = pvtx2.Vect();
225 sv2p3.SetX(v_vtxx[ivm2] - priVtx.
x());
226 sv2p3.SetY(v_vtxy[ivm2] - priVtx.
y());
227 sv2p3.SetZ(v_vtxz[ivm2] - priVtx.
z());
235 if(ivm1>=0&&ivm2>=0) {
237 vars.
m_mx12_2d12 = std::hypot( v_vtxx[ivm2] - v_vtxx[ivm1], v_vtxy[ivm2] - v_vtxy[ivm1] );
245 "nvtx= " << vars.
m_nvtx <<
275 return StatusCode::SUCCESS;
283 const std::vector<std::string>& inputVars,
285 bool &badVariableFound,
286 std::vector<float*> &inputPointers)
288 for (
const auto&
var : inputVars) {
289 if (
var==
"pt" ) { inputPointers.push_back(&
m_jetpt ) ; nConfgVar++; }
290 else if (
var==
"Nvtx" ) { inputPointers.push_back(&
m_nvtx ) ; nConfgVar++; }
291 else if (
var==
"MaxEfrc" ) { inputPointers.push_back(&
m_maxefrc ) ; nConfgVar++; }
292 else if (
var==
"sumMass" ) { inputPointers.push_back(&
m_summass ) ; nConfgVar++; }
293 else if (
var==
"totalntrk" ) { inputPointers.push_back(&
m_totalntrk ) ; nConfgVar++; }
294 else if (
var==
"diffntrkSV0" ) { inputPointers.push_back(&
m_diffntrkSV0 ) ; nConfgVar++; }
295 else if (
var==
"diffntrkSV1" ) { inputPointers.push_back(&
m_diffntrkSV1 ) ; nConfgVar++; }
296 else if (
var==
"normDist" ) { inputPointers.push_back(&
m_normDist ) ; nConfgVar++; }
297 else if (
var==
"maxVtxMass" ) { inputPointers.push_back(&
m_mmax_mass ) ; nConfgVar++; }
298 else if (
var==
"maxSecVtxMass" ) { inputPointers.push_back(&
m_mmx2_mass ) ; nConfgVar++; }
299 else if (
var==
"EfrcmaxVtxMass" ) { inputPointers.push_back(&
m_mmax_efrc ) ; nConfgVar++; }
300 else if (
var==
"EfrcmaxSecVtxMass") { inputPointers.push_back(&
m_mmx2_efrc ) ; nConfgVar++; }
301 else if (
var==
"dlsmaxVtxMass" ) { inputPointers.push_back(&
m_mmax_dist ) ; nConfgVar++; }
302 else if (
var==
"dlsmaxSecVtxMass" ) { inputPointers.push_back(&
m_mmx2_dist ) ; nConfgVar++; }
303 else if (
var==
"dRmaxVtxMassj" ) { inputPointers.push_back(&
m_mmax_DRjet ) ; nConfgVar++; }
304 else if (
var==
"dRmaxSecVtxMassj" ) { inputPointers.push_back(&
m_mmx2_DRjet ) ; nConfgVar++; }
305 else if (
var==
"d2Mass12" ) { inputPointers.push_back(&
m_mx12_2d12 ) ; nConfgVar++; }
306 else if (
var==
"DRMass12" ) { inputPointers.push_back(&
m_mx12_DR ) ; nConfgVar++; }
307 else if (
var==
"AngleMass12" ) { inputPointers.push_back(&
m_mx12_Angle ) ; nConfgVar++; }
309 msg << MSG::WARNING <<
"#BTAG# \""<<
var<<
"\" <- This variable found in xml/calib-file does not match to any variable declared in MultiSV... the algorithm will be 'disabled'." <<
endmsg;
310 badVariableFound=
true;