give information to the info class.
tagging done. Fill the JetTag and return ... fill most powerfull discriminating variable it's not a likelihood, but this can directly be accessed from the Jet without changing the getFlavourTagWeight() method
160 {
161
163 std::string
author = jetToTag.jetAuthor();
165
168
169 std::vector<const Trk::Track*> TrkFromV0;
171 bool canUseSvxDirection=false;
172
175 m_SVForIPTool->getDirectionFromSecondaryVertexInfo(SvxDirection,canUseSvxDirection,
177 }
178
181 m_SVForIPTool->getTrkFromV0FromSecondaryVertexInfo(TrkFromV0,
183 }
184
185 ATH_MSG_VERBOSE(
"#BTAG# TrkFromV0 : number of reconstructed bad tracks: " << TrkFromV0.size());
186
188 int nbTrack = 0;
189 std::vector<const xAOD::TrackParticle*>* trackVector = NULL;
190 const Analysis::TrackAssociation *trkInJet = jetToTag.getAssociation<TrackAssociation>("Tracks");
191 if(!trkInJet){
193 }
194 else{
195 trackVector = jetToTag.getAssociation<TrackAssociation>("Tracks")->tracks();
196 std::vector<const xAOD::TrackParticle*>::iterator jetItr;
197 for( jetItr = trackVector->begin(); jetItr != trackVector->end() ; ++jetItr ) {
199 nbTrack++;
201
204
205 ATH_MSG_VERBOSE(
"#BTAG# result of selectTrack is OK, grade= " << (std::string)(*theGrade));
206
207 bool tobeUsed = false;
208 for(
int i=0;
i<nbPart;
i++) {
211 *theGrade )
213 }
214
215 if (std::find(TrkFromV0.begin(),TrkFromV0.end(),*aTemp->
track()) != TrkFromV0.end()) {
216 ATH_MSG_VERBOSE(
"#BTAG# Bad track in jet, pt = " << aTemp->
pt() <<
" eta = " << aTemp->
eta() <<
" phi = " << aTemp->
phi());
218 }
219 if (tobeUsed)
m_tracksInJet.push_back(GradedTrack(aTemp, *theGrade));
220 delete theGrade;
221 theGrade=0;
222 }
223 }
224
225 delete trackVector;
226 }
227
230
235 unit = SvxDirection.unit();
236 ATH_MSG_DEBUG(
"#BTAG# Using direction from sec vertex finder tool '"
238 <<
" phi: " <<
unit.phi()
239 <<
" theta: " <<
unit.theta()
240 << " instead of jet direction phi: " << jetDirection.phi()
241 << " theta: " << jetDirection.theta());
242 }
243
246
247 const int nbTrackMean = 3;
248 vectD0Signi.reserve(nbTrackMean);
249 vectD0Signi_abs.reserve(nbTrackMean);
250
251 for (std::vector<GradedTrack>::iterator trkItr =
m_tracksInJet.begin();
254
255 double d0wrtPriVtx(0.);
256 double d0ErrwrtPriVtx(1.);
257 double signOfIP(1.);
258
259
261 if(myIPandSigma==0) {
263 } else {
264 d0wrtPriVtx=myIPandSigma->
IPd0;
265 d0ErrwrtPriVtx=myIPandSigma->
sigmad0;
266 delete myIPandSigma;
267 myIPandSigma=0;
268 }
269
272
274
276 double sd0 = signOfIP*fabs(d0wrtPriVtx);
277 double sd0significance = signOfIP*fabs(d0wrtPriVtx/d0ErrwrtPriVtx);
278
279 vectD0Signi.push_back(sd0significance);
280 vectD0Signi_abs.push_back( fabs(sd0significance) );
281
282 ATH_MSG_VERBOSE(
"#BTAG# TrackCounting: Trk: grade= " << (std::string)(*trkItr).grade
283 <<
" Eta= " << trk->
eta() <<
" Phi= " << trk->
phi() <<
" pT= " << trk->
pt()
284 << " d0= " << sd0
285 << "+-" << d0ErrwrtPriVtx
286 << " d0sig= " << sd0significance );
287
288 }
289
290
294
295
297 std::string instanceName("TrackCounting2D");
298 if (
m_flipIP) instanceName +=
"Neg";
299 TrackCountingInfo* infoTrackCounting = NULL;
300
302 infoTrackCounting = new TrackCountingInfo(instanceName);
303
304 int ntrk = vectD0Signi.size();
305 infoTrackCounting->setnTracks( ntrk );
306
308 ATH_MSG_DEBUG(
"#BTAG# " << ntrk <<
" tracks used for TrackCounting, ordered ip2d significance / |ip2d significance|:" );
309 for(
uint i=0;
i<vectD0Signi.size();
i++){
310 ATH_MSG_DEBUG(
"#BTAG# trk " << i+1 <<
"/" << ntrk <<
": " << vectD0Signi.at(i) <<
" / " << vectD0Signi_abs.at(i));
311 }
312 if( ntrk>=2 ){
313 ATH_MSG_DEBUG(
"#BTAG# filling 2nd / 2nd abs: " << vectD0Signi.at(1) <<
" / " << vectD0Signi_abs.at(1));
314 infoTrackCounting->setd0sig_2nd( vectD0Signi.at(1) );
315 infoTrackCounting->setd0sig_abs_2nd( vectD0Signi_abs.at(1) );
316 }
317 if( ntrk>=3 ){
318 ATH_MSG_DEBUG(
"#BTAG# filling 3rd / 3rd abs: " << vectD0Signi.at(2) <<
" / " << vectD0Signi_abs.at(2));
319 infoTrackCounting->setd0sig_3rd( vectD0Signi.at(2) );
320 infoTrackCounting->setd0sig_abs_3rd( vectD0Signi_abs.at(2) );
321 }
322 }
323
328 if(infoTrackCounting){
329 std::vector<double> v_tofill;
330 double tofill =
exp(-20.);
331 if(vectD0Signi.size()>=2){
332 tofill =
exp(vectD0Signi.at(1));
333 infoTrackCounting->makeValid();
334 }
335 v_tofill.push_back( tofill );
336 v_tofill.push_back(1.);
337 infoTrackCounting->setTagLikelihood( v_tofill );
338 jetToTag.addInfo( infoTrackCounting );
339 }
340
342
343 return;
344 }
const PlainObject unit() const
This is a plugin that makes Eigen look like CLHEP & defines some convenience methods.
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.
std::vector< GradedTrack > m_tracksInJet
The jet of TrackParticles to be tagged.
static bool m_greater(T a, T b)
sort algorithm for vectors
virtual FourMom_t p4() const
The full 4-momentum of the particle.
float py() const
The y-component of the jet's momentum.
float px() const
The x-component of the jet's momentum.
float pz() const
The z-component of the jet's momentum.
const Trk::Perigee & perigeeParameters() const
Returns the Trk::MeasuredPerigee track parameters.
const Trk::Track * track() const
Returns a pointer (which can be NULL) to the Trk::Track which was used to make this TrackParticle.
virtual double phi() const override final
The azimuthal angle ( ) of the particle (has range to .)
virtual double pt() const override final
The transverse momentum ( ) of the particle.
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
Eigen::Matrix< double, 3, 1 > Vector3D
std::vector< double > FloatVec
TrackParticle_v1 TrackParticle
Reference the current persistent version: