ATLAS Offline Software
Loading...
Searching...
No Matches
Analysis::TrackCounting Class Referenceabstract

#include <TrackCounting.h>

Inheritance diagram for Analysis::TrackCounting:
Collaboration diagram for Analysis::TrackCounting:

Public Member Functions

 TrackCounting (const std::string &, const std::string &, const IInterface *)
virtual ~TrackCounting ()
 Implementations of the methods defined in the abstract base class.
StatusCode initialize ()
StatusCode finalize ()
void finalizeHistos ()
 finalize the histos: Normalize other histos and fill the integratedNegativeIP histos.
void setOrigin (const Trk::VxCandidate *priVtx)
 Set the primary vertex.
void tagJet (xAOD::Jet &jetToTag)
 called by BJetBuilder
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const
 DeclareInterfaceID (ITagTool, 1, 0)
virtual StatusCode tagJet (const xAOD::Vertex &priVtx, const xAOD::Jet &, xAOD::BTagging &, const std::string &) const =0
 Method to return the name of the tagging tool.

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Static Private Member Functions

template<class T>
static bool m_greater (T a, T b)
 sort algorithm for vectors

Private Attributes

ToolHandle< Reco::ITrackToVertexm_trackToVertexTool
 TrackToVertex tool.
ToolHandle< TrackSelectorm_trackSelectorTool
 Track selection cuts for TrackCounting.
std::vector< GradedTrackm_tracksInJet
 The jet of TrackParticles to be tagged.
const Trk::VxCandidatem_priVtx = 0
 Storage for the primary vertex.
std::vector< std::string > m_trackGradePartitionsDefinition
 track classification.
std::vector< TrackGradePartition * > m_trackGradePartitions
bool m_RejectBadTracks
 possibility to exclude Bad Tracks found with SVTagger and possibility to use the sign of the impact parameter with SVTagger/JetFitter
bool m_SignWithSvx
bool m_flipIP
bool m_writeInfo
 write tagging info to info class
std::string m_truthMatchingName
double m_purificationDeltaR
std::vector< std::string > m_jetCollectionList
std::string m_secVxFinderNameForV0Removal
std::string m_secVxFinderNameForIPSign
ToolHandle< SVForIPToolm_SVForIPTool
ToolHandle< ITrackGradeFactorym_trackGradeFactory
 ToolHandle for the ITrackGradeFactory tool.
ToolHandle< Trk::ITrackToVertexIPEstimatorm_trackToVertexIPEstimator
 Tool for the estimation of the IPs to the Vertex.
bool m_unbiasIPEstimation
 option to unbias IP estimation (remove track from vertex)
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default)
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

Definition at line 38 of file TrackCounting.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ TrackCounting()

Analysis::TrackCounting::TrackCounting ( const std::string & name,
const std::string & n,
const IInterface * p )

Definition at line 33 of file TrackCounting.cxx.

34 : AthAlgTool(name,n,p),
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"),
42
43 declareInterface<ITagTool>(this);
44 // global configuration:
45 declareProperty("SignWithSvx", m_SignWithSvx = false);
46 declareProperty("SVForIPTool", m_SVForIPTool);
47
48 // track categories:
50 m_trackGradePartitionsDefinition.push_back("Good");
51 declareProperty("RejectBadTracks", m_RejectBadTracks = false);
52 declareProperty("flipIPSign", m_flipIP = false);
53
54 // tools:
55 declareProperty("trackSelectorTool", m_trackSelectorTool);
56 declareProperty("trackToVertexTool", m_trackToVertexTool);
57 declareProperty("trackGradeFactory", m_trackGradeFactory);
58
59 // information to persistify:
60 declareProperty("writeInfo", m_writeInfo = true);
61
62 declareProperty("truthMatchingName", m_truthMatchingName = "TruthInfo");
63 declareProperty("purificationDeltaR", m_purificationDeltaR = 0.8);
64
65 declareProperty("SecVxFinderNameForV0Removal", m_secVxFinderNameForV0Removal);
66 declareProperty("SecVxFinderNameForIPSign", m_secVxFinderNameForIPSign);
67
68 declareProperty("TrackToVertexIPEstimator",m_trackToVertexIPEstimator);
69 declareProperty("unbiasIPEstimation",m_unbiasIPEstimation);
70 }
ToolHandle< Reco::ITrackToVertex > m_trackToVertexTool
TrackToVertex tool.
std::string m_secVxFinderNameForV0Removal
std::string m_truthMatchingName
std::string m_secVxFinderNameForIPSign
std::vector< std::string > m_trackGradePartitionsDefinition
track classification.
ToolHandle< SVForIPTool > m_SVForIPTool
ToolHandle< ITrackGradeFactory > m_trackGradeFactory
ToolHandle for the ITrackGradeFactory tool.
ToolHandle< TrackSelector > m_trackSelectorTool
Track selection cuts for TrackCounting.
bool m_writeInfo
write tagging info to info class
bool m_unbiasIPEstimation
option to unbias IP estimation (remove track from vertex)
bool m_RejectBadTracks
possibility to exclude Bad Tracks found with SVTagger and possibility to use the sign of the impact p...
ToolHandle< Trk::ITrackToVertexIPEstimator > m_trackToVertexIPEstimator
Tool for the estimation of the IPs to the Vertex.
AthAlgTool()
Default constructor:
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ ~TrackCounting()

Analysis::TrackCounting::~TrackCounting ( )
virtual

Implementations of the methods defined in the abstract base class.

Definition at line 72 of file TrackCounting.cxx.

72 {
73 for (size_t i = 0; i < m_trackGradePartitions.size(); i++)
74 delete m_trackGradePartitions.at(i);
75 }
std::vector< TrackGradePartition * > m_trackGradePartitions

Member Function Documentation

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }

◆ DeclareInterfaceID()

Analysis::ITagTool::DeclareInterfaceID ( ITagTool ,
1 ,
0  )
inherited

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ finalize()

StatusCode Analysis::TrackCounting::finalize ( )

Definition at line 154 of file TrackCounting.cxx.

154 {
155
156 return StatusCode::SUCCESS;
157 }

◆ finalizeHistos()

void Analysis::TrackCounting::finalizeHistos ( )
inlinevirtual

finalize the histos: Normalize other histos and fill the integratedNegativeIP histos.

This cannot be done in the finalize() of this algtool because the histo service writes the histos BEFORE AlgTool::finalize() methods are called. However, it is closed AFTER Algorithm::finalize() methods are called ... In the calling Algorithm::finalize() method the following method will be called.

Implements Analysis::ITagTool.

Definition at line 47 of file TrackCounting.h.

47{};

◆ initialize()

StatusCode Analysis::TrackCounting::initialize ( )

retrieving TrackToVertex:

creation of TrackSelector: (private instance)

retrieving the track grade factory

prepare the track partitions:

Definition at line 78 of file TrackCounting.cxx.

78 {
79
81 if ( m_trackToVertexTool.retrieve().isFailure() ) {
82 ATH_MSG_FATAL("#BTAG# Failed to retrieve tool " << m_trackToVertexTool);
83 return StatusCode::FAILURE;
84 } else {
85 ATH_MSG_DEBUG("#BTAG# Retrieved tool " << m_trackToVertexTool);
86 }
87
88 if(m_SVForIPTool.retrieve().isFailure()) {
89 ATH_MSG_FATAL( "#BTAG# Failed to retrieve tool " << m_SVForIPTool);
90 } else {
91 ATH_MSG_DEBUG("#BTAG# Retrieved tool " << m_SVForIPTool);
92 }
93
94 if(m_trackToVertexIPEstimator.retrieve().isFailure()) {
95 ATH_MSG_FATAL( "#BTAG# Failed to retrieve tool " << m_trackToVertexIPEstimator);
96 } else {
97 ATH_MSG_DEBUG("#BTAG# Retrieved tool " << m_trackToVertexIPEstimator);
98 }
99
101 if ( m_trackSelectorTool.retrieve().isFailure() ) {
102 ATH_MSG_FATAL( "#BTAG# Failed to retrieve tool " << m_trackSelectorTool);
103 return StatusCode::FAILURE;
104 } else {
105 ATH_MSG_DEBUG("#BTAG# Retrieved tool " << m_trackSelectorTool);
106 }
107
109 if ( m_trackGradeFactory.retrieve().isFailure() ) {
110 ATH_MSG_FATAL( "#BTAG# Failed to retrieve tool " << m_trackGradeFactory);
111 return StatusCode::FAILURE;
112 } else {
113 ATH_MSG_DEBUG("#BTAG# Retrieved tool " << m_trackGradeFactory);
114 }
115
117 int nbPart = m_trackGradePartitionsDefinition.size();
118 ATH_MSG_DEBUG("#BTAG# Defining " << nbPart <<" track partitions: ");
119 for(int i=0;i<nbPart;i++) {
120 TrackGradePartition* part(0);
121 try {
122 part = new TrackGradePartition(m_trackGradePartitionsDefinition[i], *m_trackGradeFactory);
123 }
124 catch(std::string error) {
125 ATH_MSG_ERROR("#BTAG# Reported error " << error);
126 ATH_MSG_ERROR("#BTAG# List of categories provided to TrackCounting by jO : ");
127
128 for (int l=0;l<nbPart;l++) {
129 ATH_MSG_ERROR("#BTAG# string " << m_trackGradePartitionsDefinition[l]);
130 }
131
132 ATH_MSG_ERROR("#BTAG# List of categories provided by the TrackGradeFactory " << m_trackGradeFactory);
133
134 const TrackGradesDefinition &trackFactoryGradesDefinition = m_trackGradeFactory->getTrackGradesDefinition();
135 const std::vector<TrackGrade> &gradeList = trackFactoryGradesDefinition.getList();
136
137 std::vector<TrackGrade>::const_iterator listIter=gradeList.begin();
138 std::vector<TrackGrade>::const_iterator listEnd=gradeList.end();
139
140 for ( ; listIter !=listEnd ; ++listIter ) {
141 ATH_MSG_ERROR("#BTAG# n. " << (*listIter).gradeNumber() << " string " << (*listIter).gradeString());
142 }
143
144 ATH_MSG_ERROR("#BTAG# Terminating now... ");
145 return StatusCode::FAILURE;
146 }
147 ATH_MSG_INFO("#BTAG# " << (*part));
148 m_trackGradePartitions.push_back(part);
149 }
150 return StatusCode::SUCCESS;
151 }
#define ATH_MSG_ERROR(x)
#define ATH_MSG_FATAL(x)
#define ATH_MSG_INFO(x)
#define ATH_MSG_DEBUG(x)
l
Printing final latex table to .tex output file.

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ m_greater()

template<class T>
bool Analysis::TrackCounting::m_greater ( T a,
T b )
inlinestaticprivate

sort algorithm for vectors

Definition at line 106 of file TrackCounting.h.

106 {
107 return a > b;
108 }
static Double_t a

◆ msg()

MsgStream & AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ msgLvl()

bool AthCommonMsg< AlgTool >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ renounce()

std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > AthCommonDataStore< AthCommonMsg< AlgTool > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ setOrigin()

void Analysis::TrackCounting::setOrigin ( const Trk::VxCandidate * priVtx)
inline

Set the primary vertex.

TODO: This is temporary ! The primary vertex should be part of the JetTag IParticle interface implementation. The trouble with ElementLink and persistency has to be solved for that. Revisit ...

Definition at line 111 of file TrackCounting.h.

111{ m_priVtx=priVtx; }
const Trk::VxCandidate * m_priVtx
Storage for the primary vertex.

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in asg::AsgMetadataTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and DerivationFramework::CfAthAlgTool.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ tagJet() [1/2]

virtual StatusCode Analysis::ITagTool::tagJet ( const xAOD::Vertex & priVtx,
const xAOD::Jet & ,
xAOD::BTagging & ,
const std::string &  ) const
pure virtualinherited

Method to return the name of the tagging tool.

The tagging method.

TODO: The first argument is temporary ! The primary vertex should be part of the JetTag IParticle interface implementation. The trouble with ElementLink and persistency has to be solved for that. Revisit ...

TODO: The second argument will be removed as soon as we have the JetTag containing the necessary pointers to the constituent TrackParticles via navigation. But maybe this is not a very good idea since then a JetTag always must be created even if the tagging does not work. Think ...

◆ tagJet() [2/2]

void Analysis::TrackCounting::tagJet ( xAOD::Jet & jetToTag)

called by BJetBuilder

author to know which jet algorithm:

getting sign from SecVxFinderTool

getting Bad Tracks from SecVxFinderTool

extract the TrackParticles from the jet and apply track selection:

jet direction:

sign of the impact parameter

signed ip and significances

sort vector of significances in descending order

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

Definition at line 160 of file TrackCounting.cxx.

160 {
161
163 std::string author = jetToTag.jetAuthor();
164 ATH_MSG_VERBOSE("#BTAG# Using jet type " << author);
165
166 m_tracksInJet.clear();
167 int nbPart = m_trackGradePartitionsDefinition.size();
168
169 std::vector<const Trk::Track*> TrkFromV0;
170 Amg::Vector3D SvxDirection;
171 bool canUseSvxDirection=false;
172
174 if (m_SignWithSvx) {
175 m_SVForIPTool->getDirectionFromSecondaryVertexInfo(SvxDirection,canUseSvxDirection,//output
176 jetToTag,m_secVxFinderNameForIPSign,m_priVtx->recVertex());//input
177 }
178
180 if (m_RejectBadTracks) {
181 m_SVForIPTool->getTrkFromV0FromSecondaryVertexInfo(TrkFromV0,//output
182 jetToTag,m_secVxFinderNameForV0Removal);//input
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){
192 ATH_MSG_WARNING("#BTAG# Could not find tracks in jets");
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 ) {
198 const xAOD::TrackParticle * aTemp = *jetItr;
199 nbTrack++;
200 if( m_trackSelectorTool->selectTrack(m_priVtx->recVertex().position(), aTemp) ) {
201
202 TrackGrade * theGrade = m_trackGradeFactory->getGrade(*aTemp,
203 jetToTag.p4() );
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++) {
209 if (std::find( (m_trackGradePartitions[i]->grades()).begin(),
210 (m_trackGradePartitions[i]->grades()).end(),
211 *theGrade )
212 != (m_trackGradePartitions[i]->grades()).end()) tobeUsed = true;
213 }
214 // is it a bad track ?
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());
217 if (m_RejectBadTracks) tobeUsed = false;
218 }
219 if (tobeUsed) m_tracksInJet.push_back(GradedTrack(aTemp, *theGrade));
220 delete theGrade;
221 theGrade=0;
222 }
223 } // end loop on trakparticles
224
225 delete trackVector;
226 }
227
228 ATH_MSG_VERBOSE("#BTAG# #tracks = " << nbTrack);
229 ATH_MSG_VERBOSE("#BTAG# the z of the primary Vertex= " << m_priVtx->recVertex().position().z());
230
232 Amg::Vector3D jetDirection(jetToTag.px(),jetToTag.py(),jetToTag.pz());
233 Amg::Vector3D unit = jetDirection.unit();
234 if (m_SignWithSvx && canUseSvxDirection) {
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
244 FloatVec vectD0Signi;
245 FloatVec vectD0Signi_abs;
246 // reserve approximate space (optimization):
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();
252 trkItr != m_tracksInJet.end(); ++trkItr) {
253 const xAOD::TrackParticle* trk = (*trkItr).track;
254
255 double d0wrtPriVtx(0.);
256 double d0ErrwrtPriVtx(1.);
257 double signOfIP(1.);
258
259 /* use new Tool for "unbiased" IP estimation */
260 const Trk::ImpactParametersAndSigma* myIPandSigma = m_trackToVertexIPEstimator->estimate(*trk->track(),m_priVtx,m_unbiasIPEstimation);
261 if(myIPandSigma==0) {
262 ATH_MSG_WARNING("#BTAG# trackToVertexIPEstimator failed !");
263 } else {
264 d0wrtPriVtx=myIPandSigma->IPd0;
265 d0ErrwrtPriVtx=myIPandSigma->sigmad0;
266 delete myIPandSigma;
267 myIPandSigma=0;
268 }
269
271 signOfIP=m_trackToVertexIPEstimator->get2DLifetimeSignOfTrack(trk->perigeeParameters(),unit,m_priVtx->recVertex());
272
273 if (m_flipIP) signOfIP = -signOfIP; // A.X.
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 } // end loop on gradedtracks
289
290
292 sort( vectD0Signi.begin(), vectD0Signi.end(), m_greater<float> );
293 sort( vectD0Signi_abs.begin(), vectD0Signi_abs.end(), m_greater<float> );
294
295
297 std::string instanceName("TrackCounting2D");
298 if (m_flipIP) instanceName += "Neg";// A.X.
299 TrackCountingInfo* infoTrackCounting = NULL;
300
301 if(m_writeInfo) {
302 infoTrackCounting = new TrackCountingInfo(instanceName);
303
304 int ntrk = vectD0Signi.size();
305 infoTrackCounting->setnTracks( ntrk );
306
307 ATH_MSG_VERBOSE("#BTAG# Filling TrackCountingInfo...");
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
341 m_tracksInJet.clear();
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)
unsigned int uint
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.
Definition Jet_v1.cxx:71
float py() const
The y-component of the jet's momentum.
Definition Jet_v1.cxx:94
float px() const
The x-component of the jet's momentum.
Definition Jet_v1.cxx:90
float pz() const
The z-component of the jet's momentum.
Definition Jet_v1.cxx:99
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:

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308 {
309 // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310 // << " size: " << m_vhka.size() << endmsg;
311 for (auto &a : m_vhka) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }
std::vector< SG::VarHandleKeyArray * > m_vhka

Member Data Documentation

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_flipIP

bool Analysis::TrackCounting::m_flipIP
private

Definition at line 82 of file TrackCounting.h.

◆ m_jetCollectionList

std::vector<std::string> Analysis::TrackCounting::m_jetCollectionList
private

Definition at line 90 of file TrackCounting.h.

◆ m_priVtx

const Trk::VxCandidate* Analysis::TrackCounting::m_priVtx = 0
private

Storage for the primary vertex.

Can be removed when JetTag provides origin().

Definition at line 71 of file TrackCounting.h.

◆ m_purificationDeltaR

double Analysis::TrackCounting::m_purificationDeltaR
private

Definition at line 88 of file TrackCounting.h.

◆ m_RejectBadTracks

bool Analysis::TrackCounting::m_RejectBadTracks
private

possibility to exclude Bad Tracks found with SVTagger and possibility to use the sign of the impact parameter with SVTagger/JetFitter

Definition at line 79 of file TrackCounting.h.

◆ m_secVxFinderNameForIPSign

std::string Analysis::TrackCounting::m_secVxFinderNameForIPSign
private

Definition at line 94 of file TrackCounting.h.

◆ m_secVxFinderNameForV0Removal

std::string Analysis::TrackCounting::m_secVxFinderNameForV0Removal
private

Definition at line 93 of file TrackCounting.h.

◆ m_SignWithSvx

bool Analysis::TrackCounting::m_SignWithSvx
private

Definition at line 80 of file TrackCounting.h.

◆ m_SVForIPTool

ToolHandle< SVForIPTool > Analysis::TrackCounting::m_SVForIPTool
private

Definition at line 95 of file TrackCounting.h.

◆ m_trackGradeFactory

ToolHandle< ITrackGradeFactory > Analysis::TrackCounting::m_trackGradeFactory
private

ToolHandle for the ITrackGradeFactory tool.

Definition at line 98 of file TrackCounting.h.

◆ m_trackGradePartitions

std::vector<TrackGradePartition*> Analysis::TrackCounting::m_trackGradePartitions
private

Definition at line 75 of file TrackCounting.h.

◆ m_trackGradePartitionsDefinition

std::vector<std::string> Analysis::TrackCounting::m_trackGradePartitionsDefinition
private

track classification.

Definition at line 74 of file TrackCounting.h.

◆ m_trackSelectorTool

ToolHandle< TrackSelector > Analysis::TrackCounting::m_trackSelectorTool
private

Track selection cuts for TrackCounting.

Definition at line 63 of file TrackCounting.h.

◆ m_tracksInJet

std::vector<GradedTrack> Analysis::TrackCounting::m_tracksInJet
private

The jet of TrackParticles to be tagged.

Definition at line 66 of file TrackCounting.h.

◆ m_trackToVertexIPEstimator

ToolHandle< Trk::ITrackToVertexIPEstimator > Analysis::TrackCounting::m_trackToVertexIPEstimator
private

Tool for the estimation of the IPs to the Vertex.

Definition at line 101 of file TrackCounting.h.

◆ m_trackToVertexTool

ToolHandle< Reco::ITrackToVertex > Analysis::TrackCounting::m_trackToVertexTool
private

TrackToVertex tool.

Definition at line 60 of file TrackCounting.h.

◆ m_truthMatchingName

std::string Analysis::TrackCounting::m_truthMatchingName
private

Definition at line 87 of file TrackCounting.h.

◆ m_unbiasIPEstimation

bool Analysis::TrackCounting::m_unbiasIPEstimation
private

option to unbias IP estimation (remove track from vertex)

Definition at line 103 of file TrackCounting.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.

◆ m_writeInfo

bool Analysis::TrackCounting::m_writeInfo
private

write tagging info to info class

Definition at line 85 of file TrackCounting.h.


The documentation for this class was generated from the following files: