|
ATLAS Offline Software
|
Go to the documentation of this file.
6 #include "TLorentzVector.h"
59 return std::find(theColl.cbegin(), theColl.cend(), theTrack) != theColl.cend();
63 bool isContained(
false);
65 for (muItr=theColl->
begin(); muItr!=theColl->
end(); ++muItr) {
66 auto& link = ( *muItr )->inDetTrackParticleLink();
67 if ( link.isValid() && ( *link == theTrack ) ) {isContained=
true;
break;}
78 if( (min<=0.0 || m >=
min) && (
max <= 0.0 ||
m <=
max))
return true;
84 return (min <=0.0 || value >=
min);
89 if(min <=0.0 || m >=
min)
return true;
100 std::vector<const xAOD::Vertex*> tocleanup;
101 if(pvRefitter) tocleanup.reserve(importedPVerticesCollection->
size());
102 bool vertexrefitted =
false;
103 for (
const xAOD::Vertex* PV : *importedPVerticesCollection) {
106 if(refPV) tocleanup.push_back(refPV);
109 TVector3 posV(helperpos.x(), helperpos.y(), helperpos.z());
110 TVector3 nV = bHelper.
totalP().Unit();
111 TVector3 dposV = posPV-posV;
112 double dposVnV = dposV*nV;
113 double d = std::sqrt(std::abs(dposV.Mag2()-dposVnV*dposVnV));
117 vertexrefitted = (vtx_closest == refPV);
120 for(
auto ptr : tocleanup){
121 if(
ptr != vtx_closest)
delete ptr;
127 std::vector<ElementLink<DataVector<xAOD::TrackParticle> > > newLinkVector;
129 for(
size_t i = 0;
i<
size;
i++){
132 auto itr =
std::find(trkcol->begin(), trkcol->end(), mylink);
133 if(itr != trkcol->end()){
135 mylink.setStorableObject(*trkcol,
true);
136 newLinkVector.push_back( mylink );
141 if(
size != newLinkVector.size()){
142 throw std::runtime_error(
"JpsiUpsilonCommon::RelinkVertexTracks: Could not relink all tracks");
153 auto size = mlinksold.size();
155 for(
size_t i = 0;
i<
size;
i++){
158 auto itr =
std::find(mucol->begin(), mucol->end(), mylink);
159 if(itr != mucol->end()){
160 auto mylink=mlinksold[
i];
161 mylink.setStorableObject(*mucol,
true);
162 newmulinks.push_back( mylink );
167 if(
size != newmulinks.size()){
168 throw std::runtime_error(
"JpsiUpsilonCommon::RelinkVertexMuons: Could not relink all tracks");
170 muonLinksDecor(*vtx) = std::move(newmulinks);
static Analysis::CleanUpVertex ClosestRefPV(xAOD::BPhysHelper &, const xAOD::VertexContainer *, const Analysis::PrimaryVertexRefitter *)
TVector3 totalP()
: Returns total 3-momentum calculated from the refitted tracks
Const iterator class for DataVector/DataList.
std::string find(const std::string &s)
return a remapped string
static void RelinkVertexMuons(const std::vector< const xAOD::MuonContainer * > &muoncols, xAOD::Vertex *vtx)
const TrackParticleLinks_t & trackParticleLinks() const
Get all the particles associated with the vertex.
static bool cutAcceptGreaterOR(const std::vector< double > &values, double min)
const Amg::Vector3D & position() const
Returns the 3-pos.
static bool isContainedIn(const xAOD::TrackParticle *, const std::vector< const xAOD::TrackParticle * > &)
static bool cutRange(double value, double min, double max)
xAOD::Vertex * refitVertex(const xAOD::Vertex *vertex, const xAOD::Vertex *excludeVertex, bool ReturnCopy=true, int *exitcode=nullptr) const
virtual FourMom_t p4() const override final
The full 4-momentum of the particle.
static bool cutAcceptGreater(double value, double min)
Helper class to provide type-safe access to aux data.
void setTrackParticleLinks(const TrackParticleLinks_t &trackParticles)
Set all track particle links at once.
void clearTracks()
Remove all tracks from the vertex.
ElementLink implementation for ROOT usage.
static void RelinkVertexTracks(const std::vector< const xAOD::TrackParticleContainer * > &trkcols, xAOD::Vertex *vtx)
The namespace of all packages in PhysicsAnalysis/JetTagging.
const xAOD::Vertex * vtx() const
Getter method for the cached xAOD::Vertex.
: B-physics xAOD helpers.
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
Class describing a Vertex.
std::vector< MuonLink > MuonLinkVector
Class describing a TrackParticle.
static double getPt(const xAOD::TrackParticle *, const xAOD::TrackParticle *)
size_type size() const noexcept
Returns the number of elements in the collection.
bool empty() const noexcept
Returns true if the collection is empty.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
static bool cutRangeOR(const std::vector< double > &values, double min, double max)