30#include "GaudiKernel/SystemOfUnits.h"
32using Gaudi::Units::GeV;
33using Gaudi::Units::mm;
62 return std::abs(phi1) > std::abs(phi2);
123 return StatusCode::SUCCESS;
135 auto& eventID = ctx.eventID();
137 eventID.bunch_crossing_id());
144 tSelectingTracks.stop();
151 nTotalPassedTracks, nTotalHighPTTracks);
152 ATH_MSG_DEBUG(
"Number of all Tracks: " << nTotalTracks <<
" Selected Tracks: " << nTotalPassedTracks <<
153 " highPt Tracks: " << nTotalHighPTTracks );
156 if (nTotalHighPTTracks == 0) {
168 myVertexCollection = std::make_unique<TrigVertexCollection>();
179 for (
auto&& track: tracks) {
182 float qOverP = trackPars->parameters()[
Trk::qOverP];
184 double pt = std::abs(std::sin(
theta)/qOverP)/Gaudi::Units::GeV;
197 const EventContext& ctx)
const
201 unsigned bcid = ctx.eventID().bunch_crossing_id();
229 std::vector<double> clusterZ0;
232 while ( ! tracks.empty() ) {
236 ATH_MSG_DEBUG(
"Number of tracks remaining = " << tracks.size() );
244 trackClusterer.
cluster(tracks, indetBeamSpot);
252 <<
"cluster().size()=" << trackClusterer.
clusterTracks().size()
253 <<
" + unusedTracks().size()=" << trackClusterer.
unusedTracks().size()
254 <<
" != tracks.size()=" << tracks.size()
281 ATH_MSG_DEBUG(
"Number of tracks remaining after cluster #(" << nClusters <<
") = " << tracks.size());
292 if ( ! primaryVertex ) {
300 const T2Vertex myVertex(*primaryVertex, vertexTracks, beamSpot, trackClusterer.
seedZ0());
309 if ( ! passVertex ) {
315 myVertexCollection.
push_back(primaryVertex);
328 for (
double prevClusterZ0: clusterZ0) {
332 clusterZ0.push_back(trackClusterer.
seedZ0());
340 ATH_MSG_DEBUG(
"Splitting the entire cluster of tracks into two");
344 ATH_MSG_DEBUG(
"Splitting only tracks succesfully fitted to a vertex");
346 mySplitTrackCollection.assign(vertexTracks.
begin(), vertexTracks.
end());
358 ATH_MSG_DEBUG(
"Number of tracks remaining = " << tracks.size() );
363 if ( passVertexBCID ) {
375 return static_cast<unsigned int>(nPassVtx);
384 const EventContext& ctx )
const
397 vector<TrackVector> splitTrackCollections = trackManager.
split(myFullTrackCollection, ctx);
402 mySplitVertexCollections.
push_back(splitVertices);
405 for (
auto&& tracks: splitTrackCollections) {
407 ATH_MSG_DEBUG(
"split vertex # of tracks " << tracks.size());
418 trackClusterer.
cluster(tracks, indetBeamSpot);
463 const T2SplitVertex splitVertex( *(*splitVertices)[0], *(*splitVertices)[1] );
514 const double deltaZ0 = track.perigeeParameters()->parameters()[
Trk::z0] - clusterer.
seedZ0();
515 const AmgSymMatrix(5)& perigeeCov = *track.perigeeParameters()->covariance();
517 const double z0Pull = ( z0Error > 0. ) ? deltaZ0 / z0Error : 0.;
549 auto mon =
Monitored::Group(
m_monTool, ntrk, sumpt, sumpt2, mass, qual,
chi2,
x,
y,
z, xzoom, yzoom, zzoom, xerr, yerr, zerr, xy, pull, ntrkInVtx, BCID );
551 auto mon =
Monitored::Group(
m_monTool, ntrk, sumpt, sumpt2, mass, qual,
chi2,
x,
y,
z, xzoom, yzoom, zzoom, xerr, yerr, zerr, xy, pull, ntrkInVtx );
583 auto mon =
Monitored::Group(
m_monTool, ntrk1, x1, y1, z1, x1err, y1err, z1err, ntrk2, x2, y2, z2, x2err, y2err, z2err,
584 dntrk, dx, dy, dz, dxerr, dyerr, dzerr, dxpull, dypull, dzpull);
Scalar theta() const
theta method
#define ATH_CHECK
Evaluate an expression and check for errors.
DataVector adapter that acts like it holds const pointers.
#define AmgSymMatrix(dim)
DataVector< Trk::Track > TrackCollection
This typedef represents a collection of Trk::Track objects.
Athena::TPCnvVers::Old Athena::TPCnvVers::Current Athena::TPCnvVers::Current Athena::TPCnvVers::Old Athena::TPCnvVers::Current Athena::TPCnvVers::Old Athena::TPCnvVers::Old Athena::TPCnvVers::Old Athena::TPCnvVers::Old Athena::TPCnvVers::Current Athena::TPCnvVers::Current Athena::TPCnvVers::Old Athena::TPCnvVers::Current TrigVertexCollection
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
bool operator()(const Trk::Track *trk1, const Trk::Track *trk2)
bool operator()(const Trk::Track *trk1, const Trk::Track *trk2)
DataVector adapter that acts like it holds const pointers.
const DV * asDataVector() const
Return a pointer to this object, as a const DataVector.
value_type push_back(value_type pElem)
Add an element to the end of the collection.
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
size_type size() const noexcept
Returns the number of elements in the collection.
Group of local monitoring quantities and retain correlation when filling histograms
Declare a monitored scalar variable.
double seedZ0() const
Z0 position of a seed track that was used for clustering.
const TrackVector & unusedTracks() const
Tracks that were not included into cluster, have to be called after return from a clustering method.
static TrackPerigee trackPerigeeFromString(const std::string &perigeeStr)
const TrackVector & clusterTracks() const
This is the same vector as returned from clustering method, have to be called after return from a clu...
const TrackVector & cluster(const TrackVector &tracks, const InDet::BeamSpotData *beamspot=nullptr)
Find one cluster in a set of tracks.
std::vector< TrackVector > split(const TrackVector &cluster, const EventContext &ctx) const
encapsulates LVL2 vertex parameters (in the global reference frame), covariance matrix,...
const Perigee * perigeeParameters() const
return Perigee.
double chi2(TH1 *h0, TH1 *h1)
int count(std::string s, const std::string ®x)
count how many occurances of a regx are in a string
ParametersBase< TrackParametersDim, Charged > TrackParameters
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.