10#include "GaudiKernel/TypeNameString.h"
11#include "GaudiKernel/SystemOfUnits.h"
18#include "Identifier/Identifier.h"
72 StatusCode status=
detStore().retrieve() ;
73 if( status.isFailure() ) {
82 return StatusCode::FAILURE;
87 if (status.isFailure()) {
96 if (status.isFailure()) {
106 "Track selection will be applied:"
108 <<
"\n pT > " <<
m_selPtMin/Gaudi::Units::GeV <<
" GeV"
115 return StatusCode::SUCCESS;
120 return StatusCode::SUCCESS;
135 return StatusCode::SUCCESS;
144 theVertexContainer->setStore( theVertexAuxContainer );
152 primaryVertex = vertex;
157 std::vector< const Trk::TrackParameters* > trackParametersToFit;
162 return StatusCode::SUCCESS;
167 auto track = trackParticle->track();
175 if(newTrack->perigeeParameters())
176 trackParametersToFit.push_back( newTrack->perigeeParameters() );
179 if(track->perigeeParameters())
180 trackParametersToFit.push_back( track->perigeeParameters() );
190 if(trackParametersToFit.size() > 1){
194 auto vertex =
m_vertexFitter->fit(ctx, trackParametersToFit, position );
199 theVertexContainer->
push_back (std::move(vertex));
208 return StatusCode::SUCCESS;
215 std::vector<Trk::DefinedParameter> defPar ;
216 defPar.push_back( z0 ) ;
217 defPar.push_back(
theta ) ;
218 if( !mp->covariance() )
return nullptr;
238 sortedMS.push_back( pm ) ;
239 for(
int i=0, i_max=ms.size() ; i!=i_max ; ++i ) {
240 sortedMS.push_back( ms[i] ) ;
250 const Trk::Perigee* perTrk = track->perigeeParameters();
252 ATH_MSG_WARNING(
"RefitTracksAndVertex() : No Perigee parameter on track!");
266 for ( ; it!=itEnd; ++it){
272 if (rio !=
nullptr) {
275 setSCT.push_back ( *it ) ;
277 setTRT.push_back ( *it ) ;
279 setPix.push_back ( *it ) ;
288 ATH_MSG_DEBUG(
"RefitTracksAndVertex() : Found " << setSCT.size() <<
" SCT measurm's!" ) ;
289 ATH_MSG_DEBUG(
"RefitTracksAndVertex() : Found " << setPix.size() <<
" Pix measurm's!" ) ;
290 ATH_MSG_DEBUG(
"RefitTracksAndVertex() : Found " << setTRT.size() <<
" TRT measurm's!") ;
302 ATH_MSG_ERROR(
"RefitTracksAndVertex() : PseudoMeasurementOnTrack creation failed! " );
305 ATH_MSG_DEBUG(
"RefitTracksAndVertex() : pmFromSi " << *pmFromSi) ;
310 for(
int i=0, i_max=setTRT.size() ; i!=i_max ; ++i ) {
311 setSCT.push_back( setTRT[i] ) ;
314 ATH_MSG_VERBOSE (
"RefitTracksAndVertex() : Si+PM MeasurementSet : " );
315 for(
int i=0, i_max=setSCT.size() ; i!=i_max ; ++i ) {
331 ATH_MSG_DEBUG(
"RefitTracksAndVertex() : Fit of SCT part of the track failed! " ) ;
341 return alg.dump( outst ) ;
346 outst <<
"|-------------------------------------------------------------------";
347 outst <<
"-----------------------------|" << std::endl ;
348 outst <<
"| processed : "
352 outst <<
"| accepted by track presel. : "
356 outst <<
"| accepted by track presel. + PM : "
360 outst <<
"| ------------------------------------------------------------------";
361 outst <<
"---------------------------- |" << std::endl ;
362 outst <<
"| reject by # PIX hits : "
366 outst <<
"| reject by # SCT hits : "
370 outst <<
"| reject by # TRT hits : "
374 outst <<
"| ------------------------------------------------------------------";
375 outst <<
"---------------------------- |" << std::endl ;
376 outst <<
"| reject by exist. PM(TRT) : "
380 outst <<
"|-------------------------------------------------------------------";
381 outst <<
"-----------------------------|" << std::endl ;
Scalar theta() const
theta method
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
#define CHECK(...)
Evaluate an expression and check for errors.
#define AmgSymMatrix(dim)
MsgStream & operator<<(MsgStream &outst, const RefitTracksAndVertex &alg)
DataVector< Trk::Track > TrackCollection
This typedef represents a collection of Trk::Track objects.
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
ServiceHandle< StoreGateSvc > & evtStore()
const ServiceHandle< StoreGateSvc > & detStore() const
DataModel_detail::const_iterator< DataVector > const_iterator
Standard const_iterator.
value_type push_back(value_type pElem)
Add an element to the end of the collection.
size_type size() const noexcept
Returns the number of elements in the collection.
std::string m_vertexListInput
Name of the TrackCollection (input).
StatusCode execute(const EventContext &ctx)
execute method of this algorithm that is called for each event
size_t m_nTracksPresel
Counter for number of tracks passing the preselection.
const AtlasDetectorID * m_idHelper
Detector ID helper.
double m_selEtaMax
maximal eta cut value for the TrackSelection
const Trk::MeasurementSet addPM(Trk::MeasurementSet &ms, const Trk::PseudoMeasurementOnTrack *pm)
adds a PseudoMeasurement to a MeasurementSet
StatusCode initialize()
initialize method of this algorithm.
MsgStream & dump(MsgStream &outst) const
double m_selEtaMin
minimal eta cut value for the TrackSelection
Trk::Track * fitSCTOnlyTrack(const Trk::Track *track)
Strips of all TRT hits from the track and replaces them with a TRT momentum constraint from a the TRT...
int m_selNHitSCTMin
minimal number of SCT hits cut value for the TrackSelection
int m_selNHitPIXMin
minimal number of PIX hits cut value for the TrackSelection
RefitTracksAndVertex(const std::string &name, ISvcLocator *pSvcLocator)
The RefitTracksAndVertex is an implementation to add the so-called TRT momentum constraint on a track...
const Trk::PseudoMeasurementOnTrack * createPMfromSi(const Trk::Perigee *mp)
creates a PseudoMeasurement with (z0, theta) from extended track perigee parameters
size_t m_nRejectSCT
Counter for number of tracks failing the min number of SCT hits req.
ToolHandle< Trk::IVertexFitter > m_vertexFitter
The TrackFitter to refit the tracks (segment, momentum constraint).
size_t m_nTracksProcessed
Counter for number of tracks processed.
std::string m_outputVertexContainerName
Name of vertex container.
size_t m_nRejectPM
Counter for number of tracks failing the addition of a pseudo-measurement (PM).
size_t m_nRejectPIX
Counter for number of tracks failing the min number of PIX hits req.
StatusCode finalize()
finalize method of this algorithm.
bool m_refitTracks
refitTracks
double m_selPtMin
minimal pT cut value for the TrackSelection
bool m_applyTrkSel
apply a selection on tracks or not
size_t m_nRejectTRT
Counter for number of tracks failing the min number of TRT hits req.
ToolHandle< Trk::ITrackFitter > m_trackFitter
The TrackFitter to refit the tracks (segment, momentum constraint).
std::string m_trackListOutput
Name of the TrackCollection (Output).
bool m_addPM
apply a pseudo measurement based on the original track (theta,z0)
size_t m_nTracksAccepted
Counter for number of tracks passing the preselection and with PM.
double eta() const
Access method for pseudorapidity - from momentum.
double pT() const
Access method for transverse momentum.
virtual const S & associatedSurface() const override final
Access to the Surface method.
Class to handle pseudo-measurements in fitters and on track objects.
Class to handle RIO On Tracks ROT) for InDet and Muons, it inherits from the common MeasurementBase.
Identifier identify() const
return the identifier -extends MeasurementBase
Abstract Base Class for tracking surfaces.
const Perigee * perigeeParameters() const
return Perigee.
size_t nTrackParticles() const
Get the number of tracks associated with this vertex.
const TrackParticle * trackParticle(size_t i) const
Get the pointer to a given track that was used in vertex reco.
const Amg::Vector3D & position() const
Returns the 3-pos.
Eigen::Matrix< double, 3, 1 > Vector3D
std::vector< const MeasurementBase * > MeasurementSet
vector of fittable measurements
ParametersT< TrackParametersDim, Charged, PerigeeSurface > Perigee
std::pair< double, ParamDefs > DefinedParameter
Typedef to of a std::pair<double, ParamDefs> to identify a passed-through double as a specific type o...
VertexAuxContainer_v1 VertexAuxContainer
Definition of the current jet auxiliary container.
VertexContainer_v1 VertexContainer
Definition of the current "Vertex container version".
Vertex_v1 Vertex
Define the latest version of the vertex class.