|
ATLAS Offline Software
|
#include <BPhysPVCascadeTools.h>
|
| BPhysPVCascadeTools (const CascadeTools *cascadeTools) |
|
| BPhysPVCascadeTools (const CascadeTools *cascadeTools, const xAOD::EventInfo *) |
|
void | ProcessVertex (const std::vector< TLorentzVector > &mom, Amg::MatrixX cov, xAOD::BPhysHypoHelper &vtx, xAOD::BPhysHelper::pv_type pvtype, double mass) const |
|
void | FillBPhysHelper (const std::vector< TLorentzVector > &mom, Amg::MatrixX cov, xAOD::BPhysHelper &vtx, const xAOD::Vertex *refPV, const xAOD::VertexContainer *refPvContainer, xAOD::BPhysHelper::pv_type pvtype, int) const |
| Fills the BPhysHelper object with the standard parameters. More...
|
|
size_t | FindLowZIndex (const std::vector< TLorentzVector > &mom, const xAOD::BPhysHelper &Obj, const std::vector< const xAOD::Vertex * > &PVlist, const size_t PV_minNTracks=0) const |
| Returns the index integer of the vertex with the lowest Z in relation to the given vertex. More...
|
|
size_t | FindLowA0Index (const std::vector< TLorentzVector > &mom, const xAOD::BPhysHelper &Obj, const std::vector< const xAOD::Vertex * > &PVlist, const size_t PV_minNTracks=0) const |
| Returns the index integer of the vertex with the lowest A0 in relation to the given vertex. More...
|
|
void | SetMinNTracksInPV (size_t PV_minNTracks) |
| Set the minimum number of tracks required for primary vertices to be considered for primary vertex association to a secondary vertex. More...
|
|
Amg::Vector3D | GetBeamSpot () const |
| Get the current beamspot position either from cache or from BeamCondSvc. More...
|
|
size_t | FindLowZ0BAIndex (const std::vector< TLorentzVector > &mom, const xAOD::BPhysHelper &obj, const std::vector< const xAOD::Vertex * > &PVlist, const size_t PV_minNTracks=0) const |
| Find the index for the PV with the lowest distance in z of the SV's DOCA point w.r.t. More...
|
|
double | DistInZtoDOCA (const std::vector< TLorentzVector > &mom, const xAOD::BPhysHelper &obj, const xAOD::Vertex *vertex) const |
| Calculate the distance along z axis between the PV and SV's DOCA point w.r.t. More...
|
|
Amg::Vector3D | DocaExtrapToBeamSpot (const std::vector< TLorentzVector > &mom, const xAOD::BPhysHelper &obj) const |
| Point of DOCA w.r.t. More...
|
|
StatusCode | FillCandwithRefittedVertices (bool refitPV, const xAOD::VertexContainer *pvContainer, xAOD::VertexContainer *refPvContainer, const Analysis::PrimaryVertexRefitter *pvRefitter, size_t in_PV_max, int DoVertexType, Trk::VxCascadeInfo *casc, int index, double mass, xAOD::BPhysHypoHelper &vtx) |
|
bool | msgLvl (const MSG::Level lvl) const |
| Test the output level. More...
|
|
MsgStream & | msg () const |
| The standard message stream. More...
|
|
MsgStream & | msg (const MSG::Level lvl) const |
| The standard message stream. More...
|
|
void | setLevel (MSG::Level lvl) |
| Change the current logging level. More...
|
|
|
template<size_t NTracks> |
static bool | VerticesMatchTracks (const xAOD::Vertex *v1, const xAOD::Vertex *v2) |
|
template<size_t NTracks> |
static const xAOD::Vertex * | FindVertex (const xAOD::VertexContainer *c, const xAOD::Vertex *v) |
|
static std::vector< const xAOD::Vertex * > | GetGoodPV (const xAOD::VertexContainer *pvContainer) |
| Static method call with DerivationFramework::BPhysDerHelpers::GetGoodPV Returns a std::vector containing only PVs of type 1 and 3 - HighPt and Pileup, which have at least PV_minNTracks tracks. More...
|
|
static void | PrepareVertexLinks (Trk::VxCascadeInfo *result, const xAOD::TrackParticleContainer *importedTrackCollection) |
|
static void | PrepareVertexLinks (Trk::VxCascadeInfo *result, const std::vector< const xAOD::TrackParticleContainer * > &) |
|
static std::vector< const xAOD::TrackParticle * > | CollectAllChargedTracks (const std::vector< xAOD::Vertex * > &cascadeVertices) |
|
static void | SetVectorInfo (xAOD::BPhysHelper &, const Trk::VxCascadeInfo *) |
|
static bool | uniqueCollection (const std::vector< const xAOD::TrackParticle * > &) |
|
static bool | uniqueCollection (const std::vector< const xAOD::TrackParticle * > &, const std::vector< const xAOD::TrackParticle * > &) |
|
static bool | LinkVertices (SG::AuxElement::Decorator< VertexLinkVector > &decor, const std::vector< const xAOD::Vertex * > &vertices, const xAOD::VertexContainer *vertexContainer, const xAOD::Vertex *vert) |
|
static double | getParticleMass (const HepPDT::ParticleDataTable *pdt, int pdg) |
|
Definition at line 34 of file BPhysPVCascadeTools.h.
◆ VertexLink
◆ VertexLinkVector
◆ BPhysPVCascadeTools() [1/2]
DerivationFramework::BPhysPVCascadeTools::BPhysPVCascadeTools |
( |
const CascadeTools * |
cascadeTools | ) |
|
◆ BPhysPVCascadeTools() [2/2]
◆ CollectAllChargedTracks()
Definition at line 246 of file BPhysPVCascadeTools.cxx.
248 std::vector<const xAOD::TrackParticle*> exclTrk;
249 for(
size_t jt=0; jt<cascadeVertices.size(); jt++) {
250 for(
size_t it=0;
it<cascadeVertices[jt]->vxTrackAtVertex().
size();
it++) {
251 if(cascadeVertices[jt]->trackParticle(
it)->
charge() != 0) exclTrk.push_back(cascadeVertices[jt]->trackParticle(
it));
◆ DistInZtoDOCA()
Calculate the distance along z axis between the PV and SV's DOCA point w.r.t.
the beamline.
Definition at line 174 of file BPhysPVCascadeTools.cxx.
◆ DocaExtrapToBeamSpot()
Point of DOCA w.r.t.
the beamline backward extrapolated along the B candidate's momentum direction.
Definition at line 183 of file BPhysPVCascadeTools.cxx.
186 TLorentzVector totalMom;
187 unsigned int NTrk =
mom.size();
188 for(
unsigned int it=0;
it<NTrk;
it++) totalMom +=
mom[
it];
189 TVector3 totP = totalMom.Vect();
192 if (
pT.mag2() > 0 ) {
196 xDOCA = xSV - pSV*
pT.dot(xT)/
pT.mag2();
198 std::cout <<
"BPhysPVCascadeTools::DocaExtrapToBeamSpot: WARNING pT == 0."
◆ FillBPhysHelper()
◆ FillCandwithRefittedVertices()
Definition at line 257 of file BPhysPVCascadeTools.cxx.
268 const std::vector<xAOD::Vertex*> &cascadeVertices = casc->
vertices();
269 const bool doPt = (DoVertexType & 1) != 0;
270 const bool doA0 = (DoVertexType & 2) != 0;
271 const bool doZ0 = (DoVertexType & 4) != 0;
272 const bool doZ0BA = (DoVertexType & 8) != 0;
278 const std::vector<const xAOD::Vertex*> GoodPVs =
GetGoodPV(pvContainer);
280 if (GoodPVs.empty() ==
false) {
282 size_t pVmax =
std::min((
size_t)in_PV_max, GoodPVs.size());
283 std::vector<const xAOD::Vertex*> refPVvertexes;
284 std::vector<xAOD::Vertex*> refPVvertexes_toDelete;
285 std::vector<int> exitCode;
286 refPVvertexes.reserve(pVmax);
287 refPVvertexes_toDelete.reserve(pVmax);
288 exitCode.reserve(pVmax);
292 for (
size_t i =0;
i < pVmax ;
i++) {
301 if (refPV ==
nullptr) {
302 refPVvertexes.push_back(oldPV);
303 refPVvertexes_toDelete.push_back(
nullptr);
305 refPVvertexes.push_back(refPV);
306 refPVvertexes_toDelete.push_back(refPV);
309 boost::container::static_vector<size_t, 4> indexesUsed;
310 boost::container::static_vector<std::pair<size_t, xAOD::BPhysHelper::pv_type>, 4> indexestoProcess;
313 indexestoProcess.push_back(std::make_pair
326 if( lowZBA < pVmax ) {
332 for(
size_t i =0 ;
i<indexestoProcess.size();
i++){
334 auto index = indexestoProcess[
i].first;
335 auto pvtype = indexestoProcess[
i].second;
337 (refPVvertexes_toDelete.at(
index)) ? refPvContainer : pvContainer;
338 if(ParentContainer == refPvContainer &&
std::find(indexesUsed.begin(),
339 indexesUsed.end(),
index) == indexesUsed.end()) {
342 indexesUsed.push_back(
index);
345 ParentContainer, pvtype, exitCode[
index]);
350 for(
size_t x : indexesUsed) refPVvertexes_toDelete[
x] =
nullptr;
354 refPVvertexes.clear();
355 refPVvertexes_toDelete.clear();
361 size_t highPtindex = pvtool.FindHighPtIndex(GoodPVs);
377 if ( lowZBA < GoodPVs.size() ) {
387 if(pvContainer->
empty())
return StatusCode::FAILURE;
419 return StatusCode::SUCCESS;
◆ FindLowA0Index()
Returns the index integer of the vertex with the lowest A0 in relation to the given vertex.
Definition at line 98 of file BPhysPVCascadeTools.cxx.
106 size_t size = PVlist.size();
108 for(
size_t i =1;
i<
size;
i++) {
109 if ( PVlist[
i]->nTrackParticles() >= PV_minNTracks ) {
◆ FindLowZ0BAIndex()
Find the index for the PV with the lowest distance in z of the SV's DOCA point w.r.t.
the beamline and the PV.
Definition at line 155 of file BPhysPVCascadeTools.cxx.
161 for (
size_t i = 0;
i<PVlist.size(); ++
i) {
162 if ( PVlist[
i]->nTrackParticles() >= PV_minNTracks ) {
164 if (z0BA < lowZ0BAcalc) {
◆ FindLowZIndex()
Returns the index integer of the vertex with the lowest Z in relation to the given vertex.
Definition at line 76 of file BPhysPVCascadeTools.cxx.
84 size_t size = PVlist.size();
87 if ( PVlist[
i]->nTrackParticles() >= PV_minNTracks ) {
89 if(a0z < lowA0zcalc) {
◆ FindVertex()
◆ GetBeamSpot()
Amg::Vector3D DerivationFramework::BPhysPVCascadeTools::GetBeamSpot |
( |
| ) |
const |
◆ GetGoodPV()
Static method call with DerivationFramework::BPhysDerHelpers::GetGoodPV Returns a std::vector containing only PVs of type 1 and 3 - HighPt and Pileup, which have at least PV_minNTracks tracks.
Definition at line 120 of file BPhysPVCascadeTools.cxx.
124 std::vector<const xAOD::Vertex*> goodPrimaryVertices;
125 goodPrimaryVertices.reserve(pvContainer->
size());
129 if ( thistype == Pileupvtx || thistype == Pvtx ) {
130 goodPrimaryVertices.push_back(*
ptr);
135 return goodPrimaryVertices;
◆ getParticleMass()
double DerivationFramework::BPhysPVCascadeTools::getParticleMass |
( |
const HepPDT::ParticleDataTable * |
pdt, |
|
|
int |
pdg |
|
) |
| |
|
static |
◆ initMessaging()
void AthMessaging::initMessaging |
( |
| ) |
const |
|
privateinherited |
Initialize our message level and MessageSvc.
This method should only be called once.
Definition at line 39 of file AthMessaging.cxx.
◆ LinkVertices()
Definition at line 460 of file BPhysPVCascadeTools.cxx.
466 auto precedingVerticesItr = vertices.begin();
467 for(; precedingVerticesItr!=vertices.end(); ++precedingVerticesItr) {
469 if( !(*precedingVerticesItr) )
482 precedingVertexLinks.push_back( vertexLink );
487 decor(*vert) = precedingVertexLinks;
◆ msg() [1/2]
MsgStream & AthMessaging::msg |
( |
| ) |
const |
|
inlineinherited |
The standard message stream.
Returns a reference to the default message stream May not be invoked before sysInitialize() has been invoked.
Definition at line 164 of file AthMessaging.h.
◆ msg() [2/2]
MsgStream & AthMessaging::msg |
( |
const MSG::Level |
lvl | ) |
const |
|
inlineinherited |
The standard message stream.
Returns a reference to the default message stream May not be invoked before sysInitialize() has been invoked.
Definition at line 179 of file AthMessaging.h.
180 {
return msg() << lvl; }
◆ msgLvl()
bool AthMessaging::msgLvl |
( |
const MSG::Level |
lvl | ) |
const |
|
inlineinherited |
Test the output level.
- Parameters
-
lvl | The message level to test against |
- Returns
- boolean Indicating if messages at given level will be printed
- Return values
-
true | Messages at level "lvl" will be printed |
Definition at line 151 of file AthMessaging.h.
◆ PrepareVertexLinks() [1/2]
Definition at line 221 of file BPhysPVCascadeTools.cxx.
223 auto &collection =
result->vertices();
224 for(
auto v : collection) {
225 std::vector<ElementLink<DataVector<xAOD::TrackParticle> > > newLinkVector;
226 for(
auto mylink :
v->trackParticleLinks()) {
229 for(
auto col : trackCols){
235 if(foundcontainer ==
nullptr){
236 throw std::runtime_error(
"Could not find track in original containers");
238 mylink.setStorableObject(*foundcontainer,
true);
239 newLinkVector.push_back( mylink );
242 v->setTrackParticleLinks( newLinkVector );
◆ PrepareVertexLinks() [2/2]
Definition at line 204 of file BPhysPVCascadeTools.cxx.
206 auto &collection =
result->vertices();
207 for(
auto v : collection)
209 std::vector<ElementLink<DataVector<xAOD::TrackParticle> > > newLinkVector;
210 for(
unsigned int i=0;
i<
v->trackParticleLinks().
size();
i++)
214 newLinkVector.push_back( mylink );
217 v->setTrackParticleLinks( newLinkVector );
◆ ProcessVertex()
◆ setLevel()
void AthMessaging::setLevel |
( |
MSG::Level |
lvl | ) |
|
|
inherited |
◆ SetMinNTracksInPV()
void DerivationFramework::BPhysPVCascadeTools::SetMinNTracksInPV |
( |
size_t |
PV_minNTracks | ) |
|
Set the minimum number of tracks required for primary vertices to be considered for primary vertex association to a secondary vertex.
Note that this requirement will not be applied for finding the vertex with the highest pT sum (FindHighPtIndex()) since it would possibly exclude this vertex which has been marked earlier in the tool chain.
Definition at line 139 of file BPhysPVCascadeTools.cxx.
◆ SetVectorInfo()
Definition at line 424 of file BPhysPVCascadeTools.cxx.
426 const std::vector< std::vector<TLorentzVector> > &moms = casc->
getParticleMoms();
427 const std::vector<xAOD::Vertex*> &cascadeVertices = casc->
vertices();
429 std::vector<float>
px;
430 std::vector<float>
py;
431 std::vector<float>
pz;
432 for(
size_t jt=0; jt<moms.size(); jt++) {
433 for(
size_t it=0;
it<cascadeVertices[jt]->vxTrackAtVertex().
size();
it++) {
434 px.push_back( moms[jt][
it].Px() );
435 py.push_back( moms[jt][
it].Py() );
436 pz.push_back( moms[jt][
it].Pz() );
◆ uniqueCollection() [1/2]
◆ uniqueCollection() [2/2]
◆ VerticesMatchTracks()
Definition at line 129 of file BPhysPVCascadeTools.h.
133 std::array<const xAOD::TrackParticle*, NTracks> a1;
134 std::array<const xAOD::TrackParticle*, NTracks> a2;
135 for(
size_t i=0;
i<NTracks;
i++){
137 a2[
i] =
v2->trackParticle(
i);
◆ ATLAS_THREAD_SAFE
std::atomic_flag m_initialized AthMessaging::ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT |
|
mutableprivateinherited |
◆ m_cascadeTools
◆ m_copyAllVertices
bool DerivationFramework::BPhysPVCascadeTools::m_copyAllVertices |
◆ m_eventInfo
◆ m_imsg
std::atomic<IMessageSvc*> AthMessaging::m_imsg { nullptr } |
|
mutableprivateinherited |
◆ m_lvl
std::atomic<MSG::Level> AthMessaging::m_lvl { MSG::NIL } |
|
mutableprivateinherited |
◆ m_msg_tls
boost::thread_specific_ptr<MsgStream> AthMessaging::m_msg_tls |
|
mutableprivateinherited |
MsgStream instance (a std::cout like with print-out levels)
Definition at line 132 of file AthMessaging.h.
◆ m_nm
std::string AthMessaging::m_nm |
|
privateinherited |
◆ m_PV_minNTracks
size_t DerivationFramework::BPhysPVCascadeTools::m_PV_minNTracks |
|
private |
The documentation for this class was generated from the following files:
std::atomic< MSG::Level > m_lvl
Current logging level.
float setA0xyErr(const float val, const pv_type vertexType=BPhysHelper::PV_MIN_A0)
transverse impact parameter error
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
size_t nTrackParticles() const
Get the number of tracks associated with this vertex.
std::string find(const std::string &s)
return a remapped string
bool setTauErr(const float val, const pv_type vertexType=BPhysHelper::PV_MIN_A0, const tau_type tauType=BPhysHypoHelper::TAU_CONST_MASS)
proper decay time error
bool setRefitPVStatus(int code, const pv_type vertexType=BPhysHelper::PV_MIN_A0)
Set the exitCode of the refitter for vertex of type pv_type.
const std::vector< xAOD::Vertex * > & vertices() const
std::vector< size_t > vec
const std::vector< Amg::MatrixX > & getCovariance() const
std::atomic< IMessageSvc * > m_imsg
MessageSvc pointer.
float beamPosX() const
X coordinate of the beam spot position.
bool isValid() const
Test to see if the link can be dereferenced.
IMessageSvc * getMessageSvc(bool quiet=false)
std::vector< VertexLink > VertexLinkVector
xAOD::Vertex * refitVertex(const xAOD::Vertex *vertex, const xAOD::Vertex *excludeVertex, bool ReturnCopy=true, int *exitcode=nullptr) const
AthMessaging()
Default constructor:
float beamPosY() const
Y coordinate of the beam spot position.
#define BPHYS_CHECK(EXP)
Useful CHECK macro.
float setA0xy(const float val, const pv_type vertexType=BPhysHelper::PV_MIN_A0)
transverse impact parameter
float setZ0Err(const float val, const pv_type vertexType=BPhysHelper::PV_MIN_A0)
longitudinal impact parameter error
const TrackParticle * trackParticle(size_t i) const
Get the pointer to a given track that was used in vertex reco.
float setA0Err(const float val, const pv_type vertexType=BPhysHelper::PV_MIN_A0)
3D impact parameter error
MsgStream & msg() const
The standard message stream.
bool setLxy(const float val, const pv_type vertexType=BPhysHelper::PV_MIN_A0)
Set the transverse decay distance and its error measured between the refitted primary vertex of type ...
ElementLink implementation for ROOT usage.
bool setElement(ElementType element)
Set to point to an element.
bool setPv(const xAOD::Vertex *pv, const xAOD::VertexContainer *vertexContainer, const pv_type vertexType=BPhysHelper::PV_MIN_A0)
Set the refitted collision vertex of type pv_type.
float beamPosZ() const
Z coordinate of the beam spot position.
bool setStorableObject(BaseConstReference data, bool replace=false, IProxyDict *sg=0)
Set link to point to a new container (storable).
const xAOD::Vertex * vtx() const
Getter method for the cached xAOD::Vertex.
double charge(const T &p)
value_type push_back(value_type pElem)
Add an element to the end of the collection.
Eigen::Matrix< double, 3, 1 > Vector3D
const std::vector< std::vector< TLorentzVector > > & getParticleMoms() const
bool setLxyErr(const float val, const pv_type vertexType=BPhysHelper::PV_MIN_A0)
its error
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
bool setOrigPv(const xAOD::Vertex *pv, const xAOD::VertexContainer *vertexContainer, const pv_type vertexType=BPhysHelper::PV_MIN_A0)
Set the original collision vertex of type pv_type.
bool setRefTrks(std::vector< float > px, std::vector< float > py, std::vector< float > pz)
Sets refitted track momenta.
Class describing a Vertex.
void sort(typename std::reverse_iterator< DataModel_detail::iterator< DVL > > beg, typename std::reverse_iterator< DataModel_detail::iterator< DVL > > end, const Compare &comp)
Specialization of sort for DataVector/List.
std::string m_nm
Message source name.
const xAOD::Vertex * pv(const pv_type vertexType=BPhysHelper::PV_MIN_A0)
Get the refitted collision vertex of type pv_type.
float setA0(const float val, const pv_type vertexType=BPhysHelper::PV_MIN_A0)
Set the 3D and transverse impact parameters and their error.
Class describing a TrackParticle.
const T * at(size_type n) const
Access an element, as an rvalue.
float setZ0(const float val, const pv_type vertexType=BPhysHelper::PV_MIN_A0)
longitudinal impact parameter
void initMessaging() const
Initialize our message level and MessageSvc.
boost::thread_specific_ptr< MsgStream > m_msg_tls
MsgStream instance (a std::cout like with print-out levels)
bool setTau(const float val, const pv_type vertexType=BPhysHelper::PV_MIN_A0, const tau_type tauType=BPhysHypoHelper::TAU_CONST_MASS)
: Set the proper decay time and error.
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.