|
ATLAS Offline Software
|
Go to the documentation of this file.
7 #include "GaudiKernel/IToolSvc.h"
30 typedef std::vector<double>
FloatVec;
35 m_trackToVertexTool(
"Reco::TrackToVertex"),
36 m_trackSelectorTool(
"Analysis::TrackSelector"),
37 m_secVxFinderNameForV0Removal(
"InDetVKalVxInJetTool"),
38 m_secVxFinderNameForIPSign(
"InDetVKalVxInJetTool"),
39 m_SVForIPTool(
"Analysis::SVForIPTool"),
40 m_trackGradeFactory(
"Analysis::BasicTrackGradeFactory"),
41 m_unbiasIPEstimation(false){
43 declareInterface<ITagTool>(
this);
83 return StatusCode::FAILURE;
103 return StatusCode::FAILURE;
111 return StatusCode::FAILURE;
118 ATH_MSG_DEBUG(
"#BTAG# Defining " << nbPart <<
" track partitions: ");
119 for(
int i=0;
i<nbPart;
i++) {
124 catch(std::string
error) {
126 ATH_MSG_ERROR(
"#BTAG# List of categories provided to TrackCounting by jO : ");
128 for (
int l=0;
l<nbPart;
l++) {
135 const std::vector<TrackGrade> &gradeList = trackFactoryGradesDefinition.
getList();
137 std::vector<TrackGrade>::const_iterator listIter=gradeList.begin();
138 std::vector<TrackGrade>::const_iterator listEnd=gradeList.end();
140 for ( ; listIter !=listEnd ; ++listIter ) {
141 ATH_MSG_ERROR(
"#BTAG# n. " << (*listIter).gradeNumber() <<
" string " << (*listIter).gradeString());
145 return StatusCode::FAILURE;
150 return StatusCode::SUCCESS;
156 return StatusCode::SUCCESS;
163 std::string
author = jetToTag.jetAuthor();
169 std::vector<const Trk::Track*> TrkFromV0;
171 bool canUseSvxDirection=
false;
175 m_SVForIPTool->getDirectionFromSecondaryVertexInfo(SvxDirection,canUseSvxDirection,
181 m_SVForIPTool->getTrkFromV0FromSecondaryVertexInfo(TrkFromV0,
185 ATH_MSG_VERBOSE(
"#BTAG# TrkFromV0 : number of reconstructed bad tracks: " << TrkFromV0.size());
189 std::vector<const xAOD::TrackParticle*>* trackVector = NULL;
195 trackVector = jetToTag.getAssociation<
TrackAssociation>(
"Tracks")->tracks();
197 for( jetItr = trackVector->begin(); jetItr != trackVector->end() ; ++jetItr ) {
205 ATH_MSG_VERBOSE(
"#BTAG# result of selectTrack is OK, grade= " << (std::string)(*theGrade));
207 bool tobeUsed =
false;
208 for(
int i=0;
i<nbPart;
i++) {
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());
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());
247 const int nbTrackMean = 3;
248 vectD0Signi.reserve(nbTrackMean);
249 vectD0Signi_abs.reserve(nbTrackMean);
255 double d0wrtPriVtx(0.);
256 double d0ErrwrtPriVtx(1.);
261 if(myIPandSigma==0) {
264 d0wrtPriVtx=myIPandSigma->
IPd0;
265 d0ErrwrtPriVtx=myIPandSigma->
sigmad0;
276 double sd0 = signOfIP*fabs(d0wrtPriVtx);
277 double sd0significance = signOfIP*fabs(d0wrtPriVtx/d0ErrwrtPriVtx);
279 vectD0Signi.push_back(sd0significance);
280 vectD0Signi_abs.push_back( fabs(sd0significance) );
282 ATH_MSG_VERBOSE(
"#BTAG# TrackCounting: Trk: grade= " << (std::string)(*trkItr).grade
283 <<
" Eta= " << trk->
eta() <<
" Phi= " << trk->
phi() <<
" pT= " << trk->
pt()
285 <<
"+-" << d0ErrwrtPriVtx
286 <<
" d0sig= " << sd0significance );
292 sort( vectD0Signi.begin(), vectD0Signi.end(), m_greater<float> );
293 sort( vectD0Signi_abs.begin(), vectD0Signi_abs.end(), m_greater<float> );
297 std::string instanceName(
"TrackCounting2D");
298 if (
m_flipIP) instanceName +=
"Neg";
304 int ntrk = vectD0Signi.size();
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));
313 ATH_MSG_DEBUG(
"#BTAG# filling 2nd / 2nd abs: " << vectD0Signi.at(1) <<
" / " << vectD0Signi_abs.at(1));
318 ATH_MSG_DEBUG(
"#BTAG# filling 3rd / 3rd abs: " << vectD0Signi.at(2) <<
" / " << vectD0Signi_abs.at(2));
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));
335 v_tofill.push_back( tofill );
336 v_tofill.push_back(1.);
338 jetToTag.addInfo( infoTrackCounting );
JetConstituentVector::iterator iterator
bool m_unbiasIPEstimation
option to unbias IP estimation (remove track from vertex)
virtual double pt() const override final
The transverse momentum ( ) of the particle.
std::string m_truthMatchingName
ToolHandle< TrackSelector > m_trackSelectorTool
Track selection cuts for TrackCounting.
const Trk::RecVertex & recVertex(void) const
Returns a reference to reconstructed vertex.
virtual ~TrackCounting()
Implementations of the methods defined in the abstract base class.
std::string find(const std::string &s)
return a remapped string
virtual void setTagLikelihood(const std::vector< double > &)
Return and set methods for the likelihood.
const std::vector< TrackGrade > & getList() const
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
void setd0sig_abs_3rd(float d0sig_abs_3rd)
std::vector< std::string > m_trackGradePartitionsDefinition
track classification.
#define ATH_MSG_VERBOSE(x)
bool m_writeInfo
write tagging info to info class
ToolHandle< Trk::ITrackToVertexIPEstimator > m_trackToVertexIPEstimator
Tool for the estimation of the IPs to the Vertex.
std::string m_secVxFinderNameForV0Removal
virtual void makeValid()
sets the isValid flag to true, cannot be reversed!
ToolHandle< ITrackGradeFactory > m_trackGradeFactory
ToolHandle for the ITrackGradeFactory tool.
std::vector< double > FloatVec
void setd0sig_2nd(float d0sig_2nd)
const Trk::Perigee & perigeeParameters() const
Returns the Trk::MeasuredPerigee track parameters.
ToolHandle< SVForIPTool > m_SVForIPTool
float pz() const
The z-component of the jet's momentum.
::StatusCode StatusCode
StatusCode definition for legacy code.
std::vector< TrackGradePartition * > m_trackGradePartitions
TrackCounting(const std::string &, const std::string &, const IInterface *)
const Amg::Vector3D & position() const
return position of vertex
float py() const
The y-component of the jet's momentum.
The namespace of all packages in PhysicsAnalysis/JetTagging.
float px() const
The x-component of the jet's momentum.
std::vector< double >::iterator FloatVecIter
std::string m_secVxFinderNameForIPSign
void setd0sig_3rd(float d0sig_3rd)
Eigen::Matrix< double, 3, 1 > Vector3D
void tagJet(xAOD::Jet &jetToTag)
called by BJetBuilder
virtual FourMom_t p4() const
The full 4-momentum of the particle.
std::vector< GradedTrack > m_tracksInJet
The jet of TrackParticles to be tagged.
#define ATH_MSG_WARNING(x)
const PlainObject unit() const
This is a plugin that makes Eigen look like CLHEP & defines some convenience methods.
Class describing a TrackParticle.
void setd0sig_abs_2nd(float d0sig_abs_2nd)
const Trk::Track * track() const
Returns a pointer (which can be NULL) to the Trk::Track which was used to make this TrackParticle.
bool m_RejectBadTracks
possibility to exclude Bad Tracks found with SVTagger and possibility to use the sign of the impact p...
const Trk::VxCandidate * m_priVtx
Storage for the primary vertex.
double m_purificationDeltaR
virtual double phi() const override final
The azimuthal angle ( ) of the particle (has range to .)
ToolHandle< Reco::ITrackToVertex > m_trackToVertexTool
TrackToVertex tool.