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(trackParametersToFit, position );
209 return StatusCode::SUCCESS;
216 std::vector<Trk::DefinedParameter> defPar ;
217 defPar.push_back( z0 ) ;
218 defPar.push_back(
theta ) ;
219 if( !mp->covariance() )
return nullptr;
239 sortedMS.push_back( pm ) ;
240 for(
int i=0, i_max=ms.size() ; i!=i_max ; ++i ) {
241 sortedMS.push_back( ms[i] ) ;
251 const Trk::Perigee* perTrk = track->perigeeParameters();
253 ATH_MSG_WARNING(
"RefitTracksAndVertex() : No Perigee parameter on track!");
267 for ( ; it!=itEnd; ++it){
273 if (rio !=
nullptr) {
276 setSCT.push_back ( *it ) ;
278 setTRT.push_back ( *it ) ;
280 setPix.push_back ( *it ) ;
289 ATH_MSG_DEBUG(
"RefitTracksAndVertex() : Found " << setSCT.size() <<
" SCT measurm's!" ) ;
290 ATH_MSG_DEBUG(
"RefitTracksAndVertex() : Found " << setPix.size() <<
" Pix measurm's!" ) ;
291 ATH_MSG_DEBUG(
"RefitTracksAndVertex() : Found " << setTRT.size() <<
" TRT measurm's!") ;
303 ATH_MSG_ERROR(
"RefitTracksAndVertex() : PseudoMeasurementOnTrack creation failed! " );
306 ATH_MSG_DEBUG(
"RefitTracksAndVertex() : pmFromSi " << *pmFromSi) ;
311 for(
int i=0, i_max=setTRT.size() ; i!=i_max ; ++i ) {
312 setSCT.push_back( setTRT[i] ) ;
315 ATH_MSG_VERBOSE (
"RefitTracksAndVertex() : Si+PM MeasurementSet : " );
316 for(
int i=0, i_max=setSCT.size() ; i!=i_max ; ++i ) {
332 ATH_MSG_DEBUG(
"RefitTracksAndVertex() : Fit of SCT part of the track failed! " ) ;
342 return alg.dump( outst ) ;
347 outst <<
"|-------------------------------------------------------------------";
348 outst <<
"-----------------------------|" << std::endl ;
349 outst <<
"| processed : "
353 outst <<
"| accepted by track presel. : "
357 outst <<
"| accepted by track presel. + PM : "
361 outst <<
"| ------------------------------------------------------------------";
362 outst <<
"---------------------------- |" << std::endl ;
363 outst <<
"| reject by # PIX hits : "
367 outst <<
"| reject by # SCT hits : "
371 outst <<
"| reject by # TRT hits : "
375 outst <<
"| ------------------------------------------------------------------";
376 outst <<
"---------------------------- |" << std::endl ;
377 outst <<
"| reject by exist. PM(TRT) : "
381 outst <<
"|-------------------------------------------------------------------";
382 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 with parameters:
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)
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.
StatusCode execute()
execute method of this algorithm that is called for each event
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.