 |
ATLAS Offline Software
|
Go to the documentation of this file.
39 ATH_MSG_ERROR (
"Ghost matching is not a valid tau-track association scheme for trigger, use cone association. Aborting.");
40 return StatusCode::FAILURE;
49 return StatusCode::SUCCESS;
55 std::vector<const xAOD::TrackParticle*> tauTracks;
56 std::vector<const xAOD::TrackParticle*> wideTracks;
57 std::vector<const xAOD::TrackParticle*> otherTracks;
63 if (!trackPartInHandle.
isValid()) {
64 ATH_MSG_ERROR (
"Could not retrieve HiveDataObj with key " << trackPartInHandle.
key());
65 return StatusCode::FAILURE;
67 trackParticleCont = trackPartInHandle.
cptr();
71 std::vector<const xAOD::TrackParticle*> vecTrksLargeD0;
74 if (!trackPartInHandle.
isValid()) {
75 ATH_MSG_VERBOSE (
"Could not retrieve HiveDataObj with key " << trackPartInHandle.
key());
76 ATH_MSG_VERBOSE (
"LRT container " << trackPartInHandle.
key()<<
" is not being used for tau tracks");
79 largeD0TracksParticleCont = trackPartInHandle.
cptr();
80 vecTrksLargeD0 = std::vector<const xAOD::TrackParticle*>(largeD0TracksParticleCont->
begin(), largeD0TracksParticleCont->
end());
91 ATH_MSG_ERROR (
"Could not retrieve HiveDataObj with key " << jetContHandle.
key());
92 return StatusCode::FAILURE;
94 jetContainer = jetContHandle.
cptr();
97 std::vector<const xAOD::TrackParticle*> vecTrks;
98 vecTrks.reserve( trackParticleCont->
size() );
99 for (
auto trk : *trackParticleCont){
100 if (!
inEleRM()) { vecTrks.push_back(trk); }
103 auto original_id_track_link = acc_originalObject(*trk);
104 if (!original_id_track_link.isValid()) {
108 vecTrks.push_back(*original_id_track_link);
120 bool foundLRTCont =
bool (largeD0TracksParticleCont !=
nullptr);
124 getTauTracksFromPV(pTau, vecTrksLargeD0, pVertex,
false,
nullptr, tauTracks, wideTracks, otherTracks);
133 bool alreadyUsed =
false;
141 if( (*track_it) == tau_trk->track()) alreadyUsed =
true;
144 if(alreadyUsed)
ATH_MSG_INFO(
"Found Already Used track new, now removing: " << *track_it );
145 if (alreadyUsed) track_it = tauTracks.erase(track_it);
152 for (
unsigned int i = 0;
i < tauTracks.size(); ++
i) {
156 <<
" eta " << trackParticle->
eta()
157 <<
" phi " << trackParticle->
phi());
172 track->addTrackLink(linkToTrackParticle);
174 track->setP4(trackParticle->
pt(), trackParticle->
eta(), trackParticle->
phi(), trackParticle->
m());
192 for (
unsigned int i = 0;
i < wideTracks.size(); ++
i) {
196 <<
" eta " << trackParticle->
eta()
197 <<
" phi " << trackParticle->
phi());
210 track->addTrackLink(linkToTrackParticle);
212 track->setP4(trackParticle->
pt(), trackParticle->
eta(), trackParticle->
phi(), trackParticle->
m());
229 for (
unsigned int i = 0;
i < otherTracks.size(); ++
i) {
233 <<
" eta " << trackParticle->
eta()
234 <<
" phi " << trackParticle->
phi());
248 track->addTrackLink(linkToTrackParticle);
250 track->setP4(trackParticle->
pt(), trackParticle->
eta(), trackParticle->
phi(), trackParticle->
m());
251 float dR =
track->p4().DeltaR(pTau.
p4());
282 if(beamSpotHandle.isValid()) {
284 const auto&
cov = beamSpotHandle->beamVtx().covariancePosition();
287 if(!tauTracks.empty()) {
288 vxbkp.
setZ(tauTracks.at(0)->z0());
306 assert (trackLink.getStorableObjectPointer() == &tauTrackCon);
309 dec_z0sinthetaTJVA(*
track) =
track->z0sinThetaTJVA(pTau);
310 dec_d0SigTJVA(*
track) = -999.;
311 dec_z0sinthetaSigTJVA(*
track) = -999.;
315 std::unique_ptr<const Trk::ImpactParametersAndSigma> myIPandSigma
321 dec_d0SigTJVA(*
track) = (myIPandSigma->
sigmad0 != 0.) ?
static_cast<float>( myIPandSigma->
IPd0 / myIPandSigma->
sigmad0 ) : -999.
f;
332 if (
sc.isFailure() && !
sc.isRecoverable()) {
333 ATH_MSG_ERROR(
"couldn't extrapolate tracks to calo surface");
334 return StatusCode::FAILURE;
338 return StatusCode::SUCCESS;
347 double dR = pTau.
p4().DeltaR(trackParticle.
p4());
364 const std::vector<const xAOD::TrackParticle*>& vecTrackParticles,
366 const bool& useGhostTracks,
368 std::vector<const xAOD::TrackParticle*> &tauTracks,
369 std::vector<const xAOD::TrackParticle*> &wideTracks,
370 std::vector<const xAOD::TrackParticle*> &otherTracks)
const
372 std::vector<const xAOD::TrackParticle*> ghostTracks;
383 for (
uint i = 0;
i < ghostTracks.size();
i++){
385 auto original_id_track_link = acc_originalTrack(*(ghostTracks[
i]));
386 if (!original_id_track_link.isValid()) {
390 ghostTracks[
i] = *original_id_track_link;
400 double dR = pTau.
p4().DeltaR(trackParticle->p4());
402 if (
std::find(ghostTracks.begin(), ghostTracks.end(), trackParticle) == ghostTracks.end()) {
406 bool isSeedClosest =
false;
409 TLorentzVector jetLV;
410 jetLV.SetPtEtaPhiM(jetP4.Pt(), jetP4.Eta(), jetP4.Phi(), jetP4.M());
411 double dRjet = trackParticle->p4().DeltaR(jetLV);
414 isSeedClosest = (
jet == pTau.
jet());
417 if(!isSeedClosest)
continue;
423 tauTracks.push_back(trackParticle);
425 wideTracks.push_back(trackParticle);
427 otherTracks.push_back(trackParticle);
429 std::sort(tauTracks.begin(), tauTracks.end(),
TrackSort());
430 std::sort(wideTracks.begin(), wideTracks.end(),
TrackSort());
431 std::sort(otherTracks.begin(), otherTracks.end(),
TrackSort());
443 std::unique_ptr<Trk::CaloExtension> uniqueExtension;
446 assert (trackLink.getStorableObjectPointer() == &tauTrackCon);
449 if( !orgTrack )
continue;
450 trackIndex = orgTrack->
index();
455 float etaHad = -10.0;
456 float phiHad = -10.0;
459 ATH_MSG_DEBUG(
"Try extrapolation of track with pt = " << orgTrack->
pt()
460 <<
", eta " << orgTrack->
eta()
461 <<
", phi" << orgTrack->
phi() );
467 caloExtension = (*particleCache)[trackIndex];
468 ATH_MSG_VERBOSE(
"Getting element " << trackIndex <<
" from the particleCache");
469 if( not caloExtension ){
471 "Calculating with the a CaloExtensionTool");
473 Gaudi::Hive::currentContext(), *orgTrack);
474 caloExtension = uniqueExtension.get();
481 Gaudi::Hive::currentContext(), *orgTrack);
482 caloExtension = uniqueExtension.get();
490 const std::vector<Trk::CurvilinearParameters>& clParametersVector = caloExtension->
caloLayerIntersections();
491 if (clParametersVector.empty()) {
496 bool validECal =
false;
497 bool validHCal =
false;
510 etaEM =
cur.position().eta();
511 phiEM =
cur.position().phi();
519 etaHad =
cur.position().eta();
520 phiHad =
cur.position().phi();
523 if( validECal and validHCal )
break;
526 if( not validECal and std::abs(orgTrack->
pt()) < 2.48 ){
530 if( not validHCal and orgTrack->
pt() > 2000. ){
535 <<
" phi="<<orgTrack->
phi()
536 <<
" to ECal eta=" << etaEM
538 <<
" HCal eta=" << etaHad
548 return StatusCode::SUCCESS;
554 std::vector<const xAOD::TrackParticle*> &wideTracks,
555 std::vector<const xAOD::TrackParticle*> &otherTracks,
557 double maxDeltaZ0)
const
562 if (tauTracks.empty())
return;
566 float z0_leadTrk =
getZ0(leadTrack, tauOrigin);
568 if (z0_leadTrk >
MAX-1)
return;
570 ATH_MSG_VERBOSE(
"before z0 cut: #coreTracks=" << tauTracks.size() <<
", #wideTracks=" << wideTracks.size() <<
", #otherTracks=" << otherTracks.size());
575 itr = tauTracks.begin()+1;
576 while (itr!=tauTracks.end()) {
577 float z0 =
getZ0(*itr, tauOrigin);
578 float deltaZ0=
z0 - z0_leadTrk;
581 if ( std::abs(deltaZ0) < maxDeltaZ0 ) {++itr;}
583 otherTracks.push_back(*itr);
584 itr = tauTracks.erase(itr);
589 itr = wideTracks.begin();
590 while (itr!=wideTracks.end()) {
591 float z0 =
getZ0(*itr, tauOrigin);
592 float deltaZ0=
z0 - z0_leadTrk;
595 if ( std::abs(deltaZ0) < maxDeltaZ0 ) { ++itr; }
597 otherTracks.push_back(*itr);
598 itr = wideTracks.erase(itr);
602 ATH_MSG_VERBOSE(
"after z0 cut: #coreTracks=" << tauTracks.size() <<
", #wideTracks=" << wideTracks.size() <<
", #otherTracks=" << otherTracks.size());
605 std::sort(tauTracks.begin(), tauTracks.end(),
TrackSort());
606 std::sort(wideTracks.begin(), wideTracks.end(),
TrackSort());
607 std::sort(otherTracks.begin(), otherTracks.end(),
TrackSort());
617 std::unique_ptr<Trk::Perigee> perigee;
626 float z0 = perigee->parameters()[
Trk::z0];
633 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 through calorimeter Layers Both the caloEntryLayerIntersecti...
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.
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
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