|
ATLAS Offline Software
|
Go to the documentation of this file.
44 ATH_MSG_ERROR (
"Ghost matching is not a valid tau-track association scheme for trigger, use cone association. Aborting.");
45 return StatusCode::FAILURE;
54 return StatusCode::SUCCESS;
60 std::vector<const xAOD::TrackParticle*> tauTracks;
61 std::vector<const xAOD::TrackParticle*> wideTracks;
62 std::vector<const xAOD::TrackParticle*> otherTracks;
68 if (!trackPartInHandle.
isValid()) {
69 ATH_MSG_ERROR (
"Could not retrieve HiveDataObj with key " << trackPartInHandle.
key());
70 return StatusCode::FAILURE;
72 trackParticleCont = trackPartInHandle.
cptr();
76 std::vector<const xAOD::TrackParticle*> vecTrksLargeD0;
79 if (!trackPartInHandle.
isValid()) {
80 ATH_MSG_VERBOSE (
"Could not retrieve HiveDataObj with key " << trackPartInHandle.
key());
81 ATH_MSG_VERBOSE (
"LRT container " << trackPartInHandle.
key()<<
" is not being used for tau tracks");
84 largeD0TracksParticleCont = trackPartInHandle.
cptr();
85 vecTrksLargeD0 = std::vector<const xAOD::TrackParticle*>(largeD0TracksParticleCont->
begin(), largeD0TracksParticleCont->
end());
96 ATH_MSG_ERROR (
"Could not retrieve HiveDataObj with key " << jetContHandle.
key());
97 return StatusCode::FAILURE;
99 jetContainer = jetContHandle.
cptr();
102 std::vector<const xAOD::TrackParticle*> vecTrks;
103 vecTrks.reserve( trackParticleCont->
size() );
104 for (
auto trk : *trackParticleCont){
105 if (!
inEleRM()) { vecTrks.push_back(trk); }
108 auto original_id_track_link = acc_originalObject(*trk);
109 if (!original_id_track_link.isValid()) {
113 vecTrks.push_back(*original_id_track_link);
125 bool foundLRTCont =
bool (largeD0TracksParticleCont !=
nullptr);
129 getTauTracksFromPV(pTau, vecTrksLargeD0, pVertex,
false,
nullptr, tauTracks, wideTracks, otherTracks);
138 bool alreadyUsed =
false;
146 if( (*track_it) == tau_trk->track()) alreadyUsed =
true;
149 if(alreadyUsed)
ATH_MSG_INFO(
"Found Already Used track new, now removing: " << *track_it );
150 if (alreadyUsed) track_it = tauTracks.erase(track_it);
157 for (
unsigned int i = 0;
i < tauTracks.size(); ++
i) {
161 <<
" eta " << trackParticle->
eta()
162 <<
" phi " << trackParticle->
phi());
177 track->addTrackLink(linkToTrackParticle);
179 track->setP4(trackParticle->
pt(), trackParticle->
eta(), trackParticle->
phi(), trackParticle->
m());
197 for (
unsigned int i = 0;
i < wideTracks.size(); ++
i) {
201 <<
" eta " << trackParticle->
eta()
202 <<
" phi " << trackParticle->
phi());
215 track->addTrackLink(linkToTrackParticle);
217 track->setP4(trackParticle->
pt(), trackParticle->
eta(), trackParticle->
phi(), trackParticle->
m());
234 for (
unsigned int i = 0;
i < otherTracks.size(); ++
i) {
238 <<
" eta " << trackParticle->
eta()
239 <<
" phi " << trackParticle->
phi());
253 track->addTrackLink(linkToTrackParticle);
255 track->setP4(trackParticle->
pt(), trackParticle->
eta(), trackParticle->
phi(), trackParticle->
m());
256 float dR =
track->p4().DeltaR(pTau.
p4());
287 if(beamSpotHandle.isValid()) {
289 const auto&
cov = beamSpotHandle->beamVtx().covariancePosition();
292 if(!tauTracks.empty()) {
293 vxbkp.
setZ(tauTracks.at(0)->z0());
311 assert (trackLink.getStorableObjectPointer() == &tauTrackCon);
314 dec_z0sinthetaTJVA(*
track) =
track->z0sinThetaTJVA(pTau);
315 dec_d0SigTJVA(*
track) = -999.;
316 dec_z0sinthetaSigTJVA(*
track) = -999.;
320 std::unique_ptr<const Trk::ImpactParametersAndSigma> myIPandSigma
337 if (
sc.isFailure() && !
sc.isRecoverable()) {
338 ATH_MSG_ERROR(
"couldn't extrapolate tracks to calo surface");
339 return StatusCode::FAILURE;
343 return StatusCode::SUCCESS;
352 double dR = pTau.
p4().DeltaR(trackParticle.
p4());
356 bool goodTrack =
true;
371 const std::vector<const xAOD::TrackParticle*>& vecTrackParticles,
373 const bool& useGhostTracks,
375 std::vector<const xAOD::TrackParticle*> &tauTracks,
376 std::vector<const xAOD::TrackParticle*> &wideTracks,
377 std::vector<const xAOD::TrackParticle*> &otherTracks)
const
379 std::vector<const xAOD::TrackParticle*> ghostTracks;
390 for (
uint i = 0;
i < ghostTracks.size();
i++){
392 auto original_id_track_link = acc_originalTrack(*(ghostTracks[
i]));
393 if (!original_id_track_link.isValid()) {
397 ghostTracks[
i] = *original_id_track_link;
407 double dR = pTau.
p4().DeltaR(trackParticle->p4());
409 if (
std::find(ghostTracks.begin(), ghostTracks.end(), trackParticle) == ghostTracks.end()) {
413 bool isSeedClosest =
false;
416 TLorentzVector jetLV;
417 jetLV.SetPtEtaPhiM(jetP4.Pt(), jetP4.Eta(), jetP4.Phi(), jetP4.M());
418 double dRjet = trackParticle->p4().DeltaR(jetLV);
421 isSeedClosest = (
jet == pTau.
jet());
424 if(!isSeedClosest)
continue;
430 tauTracks.push_back(trackParticle);
432 wideTracks.push_back(trackParticle);
434 otherTracks.push_back(trackParticle);
436 std::sort(tauTracks.begin(), tauTracks.end(),
TrackSort());
437 std::sort(wideTracks.begin(), wideTracks.end(),
TrackSort());
438 std::sort(otherTracks.begin(), otherTracks.end(),
TrackSort());
450 std::unique_ptr<Trk::CaloExtension> uniqueExtension;
453 assert (trackLink.getStorableObjectPointer() == &tauTrackCon);
456 if( !orgTrack )
continue;
457 trackIndex = orgTrack->
index();
462 float etaHad = -10.0;
463 float phiHad = -10.0;
466 ATH_MSG_DEBUG(
"Try extrapolation of track with pt = " << orgTrack->
pt()
467 <<
", eta " << orgTrack->
eta()
468 <<
", phi" << orgTrack->
phi() );
474 caloExtension = (*particleCache)[trackIndex];
475 ATH_MSG_VERBOSE(
"Getting element " << trackIndex <<
" from the particleCache");
476 if( not caloExtension ){
478 "Calculating with the a CaloExtensionTool");
480 Gaudi::Hive::currentContext(), *orgTrack);
481 caloExtension = uniqueExtension.get();
488 Gaudi::Hive::currentContext(), *orgTrack);
489 caloExtension = uniqueExtension.get();
497 const std::vector<Trk::CurvilinearParameters>& clParametersVector = caloExtension->
caloLayerIntersections();
498 if (clParametersVector.empty()) {
503 bool validECal =
false;
504 bool validHCal =
false;
517 etaEM =
cur.position().eta();
518 phiEM =
cur.position().phi();
526 etaHad =
cur.position().eta();
527 phiHad =
cur.position().phi();
530 if( validECal and validHCal )
break;
533 if( not validECal and std::abs(orgTrack->
pt()) < 2.48 ){
537 if( not validHCal and orgTrack->
pt() > 2000. ){
542 <<
" phi="<<orgTrack->
phi()
543 <<
" to ECal eta=" << etaEM
545 <<
" HCal eta=" << etaHad
555 return StatusCode::SUCCESS;
561 std::vector<const xAOD::TrackParticle*> &wideTracks,
562 std::vector<const xAOD::TrackParticle*> &otherTracks,
564 double maxDeltaZ0)
const
569 if (tauTracks.empty())
return;
573 float z0_leadTrk =
getZ0(leadTrack, tauOrigin);
575 if (z0_leadTrk >
MAX-1)
return;
577 ATH_MSG_VERBOSE(
"before z0 cut: #coreTracks=" << tauTracks.size() <<
", #wideTracks=" << wideTracks.size() <<
", #otherTracks=" << otherTracks.size());
582 itr = tauTracks.begin()+1;
583 while (itr!=tauTracks.end()) {
584 float z0 =
getZ0(*itr, tauOrigin);
585 float deltaZ0=
z0 - z0_leadTrk;
588 if ( std::abs(deltaZ0) < maxDeltaZ0 ) {++itr;}
591 itr = tauTracks.erase(itr);
596 itr = wideTracks.begin();
597 while (itr!=wideTracks.end()) {
598 float z0 =
getZ0(*itr, tauOrigin);
599 float deltaZ0=
z0 - z0_leadTrk;
602 if ( std::abs(deltaZ0) < maxDeltaZ0 ) { ++itr; }
605 itr = wideTracks.erase(itr);
609 ATH_MSG_VERBOSE(
"after z0 cut: #coreTracks=" << tauTracks.size() <<
", #wideTracks=" << wideTracks.size() <<
", #otherTracks=" << otherTracks.size());
612 std::sort(tauTracks.begin(), tauTracks.end(),
TrackSort());
613 std::sort(wideTracks.begin(), wideTracks.end(),
TrackSort());
614 std::sort(otherTracks.begin(), otherTracks.end(),
TrackSort());
624 std::unique_ptr<Trk::Perigee> perigee;
633 float z0 = perigee->parameters()[
Trk::z0];
640 const std::bitset<xAOD::NumberOfTrackRecoInfo> patternReco =
track->patternRecoInfo();
JetConstituentVector::iterator iterator
virtual double pt() const override final
The transverse momentum ( ) of the particle.
StatusCode extrapolateToCaloSurface(xAOD::TauJet &pTau, xAOD::TauTrackContainer &tauTrackCon) const
Extrapolate track eta and phi to the calorimeter middle surface.
void setPosition(const Amg::Vector3D &position)
Sets the 3-position.
virtual double m() const override final
The invariant mass of the particle..
TauTrackType
Enumerator defining type of tau track.
bool toContainedElement(BaseConstReference data, ElementType element, IProxyDict *sg=0)
Set from element pointer and a reference to the container (storable)
std::string find(const std::string &s)
return a remapped string
const_pointer_type cptr()
Dereference the pointer.
size_t nAllTracks() const
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_trackPartInputContainer
Tracking class to hold the extrapolation from a particle from the ID to the muon system (or the other...
float charge() const
Returns the charge.
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
virtual double eta() const
The pseudorapidity ( ) of the particle.
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_largeD0TracksInputContainer
size_t nTracks(TauJetParameters::TauTrackFlag flag=TauJetParameters::TauTrackFlag::classifiedCharged) const
Helper method to sort tracks.
void removeOffsideTracksWrtLeadTrk(std::vector< const xAOD::TrackParticle * > &tauTracks, std::vector< const xAOD::TrackParticle * > &wideTracks, std::vector< const xAOD::TrackParticle * > &otherTracks, const xAOD::Vertex *tauOrigin, double maxDeltaZ0) const
CaloSampling::CaloSample caloSample(TrackParametersIdentifier id) const
CaloSample encoded in id, returns CaloSampling::Unknown if id is not valid
Gaudi::Property< double > m_ghostTrackDR
Helper class to provide constant type-safe access to aux data.
#define ATH_MSG_VERBOSE(x)
bool empty() const
Test if the key is blank.
void setX(float value)
Sets the x position.
float getZ0(const xAOD::TrackParticle *track, const xAOD::Vertex *vertex) const
Some internally used functions.
bool isEntryToVolume(TrackParametersIdentifier id) const
returns true if the id belongs to the volume entrance
VxType::VertexType vertexType() const
The type of the vertex.
@ NoVtx
Dummy vertex. TrackParticle was not used in vertex fit.
Gaudi::Property< float > m_z0maxDelta
Gaudi::Property< bool > m_bypassExtrapolator
std::vector< const T * > getAssociatedObjects(const std::string &name) const
get associated objects as a vector<object> this compact form throws an exception if the object is not...
@ JetConstitScaleMomentum
virtual FourMom_t p4() const override final
The full 4-momentum of the particle.
Gaudi::Property< bool > m_bypassSelector
helper class to encode and decode a TrackParametersIdentifier
void setZ(float value)
Sets the z position.
void setY(float value)
Sets the y position.
const TauTrackLinks_t & allTauTrackLinks() const
::StatusCode StatusCode
StatusCode definition for legacy code.
Class describing a tau jet.
Gaudi::Property< bool > m_applyZ0cut
const TauTrack * track(size_t i, TauJetParameters::TauTrackFlag flag=TauJetParameters::TauTrackFlag::classifiedCharged, int *container_index=0) const
Get the pointer to a given tauTrack associated with this tau /*container index needed by trackNonCons...
TauTrackFinder(const std::string &name)
Constructor and Destructor.
void addTauTrackLink(const ElementLink< TauTrackContainer > &tr)
add a TauTrack to the tau
Gaudi::Property< bool > m_storeInOtherTrks
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
virtual double phi() const
The azimuthal angle ( ) of the particle.
size_t index() const
Return the index of this element within its container.
@ SiSpacePointsSeedMaker_LargeD0
virtual bool isValid() override final
Can the handle be successfully dereferenced?
Gaudi::Property< double > m_maxJetDr_tau
ToolHandle< Trk::IParticleCaloExtensionTool > m_caloExtensionTool
tools
TauTrackType tauTrackType(const xAOD::TauJet &tauJet, const xAOD::TrackParticle &trackParticle, const xAOD::Vertex *primaryVertex) const
ROOT::Math::LorentzVector< ROOT::Math::PtEtaPhiM4D< double > > JetFourMom_t
Base 4 Momentum type for Jet.
SG::ReadHandleKey< xAOD::JetContainer > m_jetContainer
void setDetail(TauJetParameters::TrackDetail detail, float value)
ToolHandle< Trk::ITrackSelectorTool > m_trackSelectorTool_tau
ToolHandle< Trk::ITrackToVertexIPEstimator > m_trackToVertexIPEstimator
double charge(const T &p)
bool isLargeD0Track(const xAOD::TrackParticle *track) const
value_type push_back(value_type pElem)
Add an element to the end of the collection.
StatusCode initialize(bool used=true)
void makePrivateStore()
Create a new (empty) private store for this object.
virtual const std::string & key() const override final
Return the StoreGate ID for the referenced object.
Gaudi::Property< bool > m_useGhostTracks
TauTrack_v1 TauTrack
Definition of the current version.
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
virtual StatusCode initialize() override
Algorithm functions.
Class describing a Vertex.
const Vertex * vertex() const
#define ATH_MSG_WARNING(x)
Gaudi::Property< double > m_maxJetDr_wide
virtual FourMom_t p4() const
The full 4-momentum of the particle.
virtual StatusCode executeTrackFinder(xAOD::TauJet &pTau, xAOD::TauTrackContainer &tauTrackCon) const override
void setDetail(TauJetParameters::Detail detail, int value)
void getTauTracksFromPV(const xAOD::TauJet &tauJet, const std::vector< const xAOD::TrackParticle * > &vecTrackParticles, const xAOD::Vertex *primaryVertex, const bool &useGhostTracks, const xAOD::JetContainer *jetContainer, std::vector< const xAOD::TrackParticle * > &tauTracks, std::vector< const xAOD::TrackParticle * > &wideTracks, std::vector< const xAOD::TrackParticle * > &otherTracks) const
const TrackParticle * track() const
ToolHandle< Reco::ITrackToVertex > m_trackToVertexTool
Class describing a TrackParticle.
const SG::AuxVectorData * container() const
Return the container holding this element.
const std::vector< CurvilinearParameters > & caloLayerIntersections() const
access to the intersections with the calorimeter layers.
setBGCode setTAP setLVL2ErrorBits bool
size_type size() const noexcept
Returns the number of elements in the collection.
void setCovariancePosition(const AmgSymMatrix(3)&covariancePosition)
Sets the vertex covariance matrix.
SG::ReadCondHandleKey< InDet::BeamSpotData > m_beamSpotKey
std::set< CaloSampling::CaloSample > m_EMSamplings
std::set< CaloSampling::CaloSample > m_HadSamplings
Gaudi::Property< bool > m_removeDuplicateCoreTracks
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
virtual double phi() const override final
The azimuthal angle ( ) of the particle (has range to .)
SG::ReadHandleKey< CaloExtensionCollection > m_ParticleCacheKey