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;
83 vars.SetVariableRefs(
msg(),inputVars,nConfgVar,badVariableFound,inputPointers);
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;
92 bdt->SetPointers(inputPointers);
95 double jeteta = jetToTag.
eta(), jetphi = jetToTag.
phi();
96 vars.m_jetpt = jetToTag.
pt();
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);
141 vars.m_summass +=
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);
166 vars.m_totalntrk = all_trks;
169 std::vector< ElementLink< xAOD::VertexContainer > > SV1Vertice;
171 if (!SV1Vertice.empty() && SV1Vertice[0].isValid()){
173 vars.m_diffntrkSV1 = all_trks - SV1ntrk;
175 vars.m_diffntrkSV1 = all_trks;
178 vars.m_diffntrkSV0 = vars.m_diffntrkSV1;
181 ATH_MSG_WARNING(
"Error retrieving input values; results will be incorrect!");
184 for(
int i=0;
i<nsv;
i++) {
186 if(v_vtxefrc[
i] > vars.m_maxefrc ) vars.m_maxefrc = v_vtxefrc[
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());
216 vars.m_mmax_mass = v_vtxmass[ivm1];
217 vars.m_mmax_efrc = v_vtxefrc[ivm1];
219 vars.m_mmax_DRjet = v_vtxDRj[ivm1];
220 vars.m_mmax_dist = v_vtxdls[ivm1];
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());
228 vars.m_mmx2_mass = v_vtxmass[ivm2];
229 vars.m_mmx2_efrc = v_vtxefrc[ivm2];
231 vars.m_mmx2_DRjet = v_vtxDRj[ivm2];
232 vars.m_mmx2_dist = v_vtxdls[ivm2];
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] );
238 vars.m_mx12_DR = sv1p3.DeltaR(sv2p3);
240 vars.m_mx12_Angle = sv1p3.Angle(sv2p3);
245 "nvtx= " << vars.m_nvtx <<
246 ", maxefrc= " << vars.m_maxefrc <<
247 ", summass= " << vars.m_summass <<
248 ", totalntrk= " << vars.m_totalntrk <<
249 ", diffntrkSV0= " << vars.m_diffntrkSV0 <<
250 ", diffntrkSV1= " << vars.m_diffntrkSV1 <<
251 ", normDist= " << vars.m_normDist <<
252 ", mmax_mass= " << vars.m_mmax_mass <<
253 ", mmax_efrc= " << vars.m_mmax_efrc <<
254 ", mmax_DRjet= " << vars.m_mmax_DRjet <<
255 ", mmax_dist= " << vars.m_mmax_dist <<
256 ", mmx2_mass= " << vars.m_mmx2_mass <<
257 ", mmx2_efrc= " << vars.m_mmx2_efrc <<
258 ", mmx2_DRjet= " << vars.m_mmx2_DRjet <<
259 ", mmx2_dist= " << vars.m_mmx2_dist <<
260 ", mx12_2d12= " << vars.m_mx12_2d12 <<
261 ", mx12_DR= " << vars.m_mx12_DR <<
262 ", mx12_Angle=" << vars.m_mx12_Angle
275 return StatusCode::SUCCESS;