ATLAS Offline Software
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Types | Private Member Functions | Private Attributes | List of all members
Trk::BeamspotVertexPreProcessor Class Reference

#include <BeamspotVertexPreProcessor.h>

Inheritance diagram for Trk::BeamspotVertexPreProcessor:
Collaboration diagram for Trk::BeamspotVertexPreProcessor:

Public Member Functions

 BeamspotVertexPreProcessor (const std::string &type, const std::string &name, const IInterface *parent)
 
virtual ~BeamspotVertexPreProcessor ()
 
virtual StatusCode initialize () override
 
virtual StatusCode finalize () override
 
virtual DataVector< Track > * processTrackCollection (const DataVector< Track > *trks) override
 Main processing of track collection. More...
 
void accumulateVTX (AlignTrack *alignTrack) override
 methods added for the full VTX fit: More...
 
void solveVTX () override
 
virtual void printSummary () override
 Print processing summary to logfile. More...
 
virtual void setLogStream (std::ostream *os)
 sets the output stream for the logfile More...
 
virtual void setNtuple (TFile *)
 Sets output ntuple file, to be implemented if needed for detector-specific implementation. More...
 
virtual StatusCode fillNtuple ()
 writes tree and histogrms to ntuple More...
 
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & evtStore () const
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc. More...
 
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm. More...
 
virtual StatusCode sysStart () override
 Handle START transition. More...
 
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles. More...
 
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles. More...
 
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc="none")
 Declare a new Gaudi property. More...
 
void updateVHKA (Gaudi::Details::PropertyBase &)
 
MsgStream & msg () const
 
MsgStream & msg (const MSG::Level lvl) const
 
bool msgLvl (const MSG::Level lvl) const
 

Static Public Member Functions

static const InterfaceID & interfaceID ()
 

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution More...
 
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
 
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed. More...
 

Protected Attributes

std::ostream * m_logStream = nullptr
 logfile output stream More...
 

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

void prepareAllTracksVector ()
 
bool isAssociatedToPV (const Track *track, const xAOD::VertexContainer *vertices)
 
bool isAssociatedToVertex (const Track *track, const xAOD::Vertex *vertex)
 
bool selectVertices (const xAOD::Vertex *vtx) const
 
bool selectUpdatedVertices (const xAOD::Vertex *updatedVtx) const
 
const xAOD::VertexfindVertexCandidate (const Track *track) const
 
const VertexOnTrackprovideVotFromVertex (const Track *track, const xAOD::Vertex *&vtx) const
 
const VertexOnTrackprovideVotFromBeamspot (const Track *track) const
 
void provideVtxBeamspot (const AlignVertex *b, AmgSymMatrix(3) *q, Amg::Vector3D *v) const
 
const TrackdoConstraintRefit (ToolHandle< IGlobalTrackFitter > &fitter, const Track *track, const VertexOnTrack *vot, const ParticleHypothesis &particleHypothesis) const
 
bool doBeamspotConstraintTrackSelection (const Track *track)
 
AlignTrackdoTrackRefit (const Track *track)
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 

Private Attributes

ToolHandle< IGlobalTrackFitterm_trackFitter
 
ToolHandle< IGlobalTrackFitterm_SLTrackFitter
 
ToolHandle< IExtrapolatorm_extrapolator
 
ToolHandle< InDet::IInDetTrackSelectionToolm_trkSelector
 
ToolHandle< InDet::IInDetTrackSelectionToolm_BSTrackSelector
 
ToolHandle< ITrackToVertexIPEstimatorm_trackToVertexIPEstimatorTool
 
PublicToolHandle< IAlignModuleToolm_alignModuleTool
 Pointer to AlignModuleTool. More...
 
SG::ReadCondHandleKey< InDet::BeamSpotDatam_beamSpotKey
 
SG::ReadHandleKey< xAOD::VertexContainerm_PVContainerName
 
BooleanProperty m_runOutlierRemoval
 
IntegerProperty m_particleNumber
 
BooleanProperty m_doTrkSelection
 
BooleanProperty m_doBSTrackSelection
 
BooleanProperty m_doAssociatedToPVSelection
 
UnsignedIntegerProperty m_constraintMode {this, "ConstraintMode", 0}
 
std::vector< std::pair< const xAOD::Vertex *, std::vector< VxTrackAtVertex > > > m_allTracksVector
 
BooleanProperty m_doBeamspotConstraint
 
BooleanProperty m_doPrimaryVertexConstraint
 
BooleanProperty m_doFullVertexConstraint
 
BooleanProperty m_doNormalRefit
 
DoubleProperty m_maxPt
 
BooleanProperty m_refitTracks
 
BooleanProperty m_storeFitMatrices
 
BooleanProperty m_useSingleFitter
 
DoubleProperty m_BSScalingFactor
 
DoubleProperty m_PVScalingFactor
 
IntegerProperty m_minTrksInVtx
 
int m_nTracks = 0
 
std::vector< int > m_trackTypeCounter {}
 
int m_nFailedNormalRefits = 0
 
int m_nFailedBSRefits = 0
 
int m_nFailedPVRefits = 0
 
DataVector< AlignVertexm_AlignVertices
 collection of AlignVertices used in FullVertex constraint option More...
 
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default) More...
 
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default) More...
 
std::vector< SG::VarHandleKeyArray * > m_vhka
 
bool m_varHandleArraysDeclared
 

Detailed Description

Definition at line 50 of file BeamspotVertexPreProcessor.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ BeamspotVertexPreProcessor()

Trk::BeamspotVertexPreProcessor::BeamspotVertexPreProcessor ( const std::string &  type,
const std::string &  name,
const IInterface *  parent 
)

Definition at line 35 of file BeamspotVertexPreProcessor.cxx.

40 {
41  declareInterface<IAlignTrackPreProcessor>(this);
42 }

◆ ~BeamspotVertexPreProcessor()

Trk::BeamspotVertexPreProcessor::~BeamspotVertexPreProcessor ( )
virtualdefault

Member Function Documentation

◆ accumulateVTX()

void Trk::BeamspotVertexPreProcessor::accumulateVTX ( AlignTrack )
overridevirtual

methods added for the full VTX fit:

Reimplemented from Trk::IAlignTrackPreProcessor.

Definition at line 831 of file BeamspotVertexPreProcessor.cxx.

831  {
832 
833  if( !m_doFullVertexConstraint ) return;
834 
835  AlignVertex* alignVertex = alignTrack->getVtx();
836 
837  ATH_MSG_DEBUG( " In accumulateVTX ");
838  if( !alignVertex ) {
839  ATH_MSG_DEBUG( "This alignTrack is not associated to any vertex -> return. ");
840  return;
841  }
842 
843  // get pointers so we can reuse them if they're valid
844  const Amg::MatrixX * ptrWeights = alignTrack->weightMatrix();
845  const Amg::MatrixX * ptrWeightsFD = alignTrack->weightMatrixFirstDeriv();
846  const Amg::VectorX * ptrResiduals = alignTrack->residualVector();
847  const std::vector<AlignModuleDerivatives> * ptrDerivs = alignTrack->derivatives();
848 
849  // check if pointers are valid
850  if (!ptrWeights || !ptrWeightsFD || !ptrResiduals || !ptrDerivs) {
851  ATH_MSG_ERROR("something missing from alignTrack!");
852  if (!ptrWeights) ATH_MSG_ERROR("no weights!");
853  if (!ptrWeightsFD) ATH_MSG_ERROR("no weights for first deriv!");
854  if (!ptrResiduals) ATH_MSG_ERROR("no residuals!");
855  if (!ptrDerivs) ATH_MSG_ERROR("no derivatives!");
856  return;
857  }
858 
859  // get vectors
860  const Amg::VectorX& residuals = *ptrResiduals;
861  std::vector<AlignModuleDerivatives> derivatives = *ptrDerivs;
862 
863  // get weight matrices
864  const Amg::MatrixX& weights = *ptrWeights;
865  const Amg::MatrixX& weightsFirstDeriv = *ptrWeightsFD;
866  ATH_MSG_VERBOSE("weights="<<weights);
867  ATH_MSG_VERBOSE("weightsFirstDeriv="<<weightsFirstDeriv);
868 
869  // get all alignPars and all derivatives
870  ATH_MSG_DEBUG("accumulateVTX: The derivative vector size is " << derivatives.size() );
871 
872  std::vector<const Amg::VectorX*> allDerivatives[3];
873  Amg::VectorX VTXDerivatives[3];
874  const int WSize(weights.cols());
875  Amg::MatrixX WF(3,WSize);
876  std::vector<AlignModuleVertexDerivatives> derivX;
877 
878  for (const auto& deriv : derivatives) {
879  // get AlignModule
880  const AlignModule* module=deriv.first;
881 
882  // get alignment parameters
883  if( module ) {
884  Amg::MatrixX F(3,WSize);
885  const std::vector<Amg::VectorX>& deriv_vec = deriv.second;
886  ATH_MSG_VERBOSE( "accumulateVTX: The deriv_vec size is " << deriv_vec.size() );
887  DataVector<AlignPar>* alignPars = m_alignModuleTool->getAlignPars(module);
888  int nModPars = alignPars->size();
889  if ((nModPars+3) != std::ssize(deriv_vec)) {
890  ATH_MSG_ERROR("accumulateVTX: Derivatives w.r.t. the vertex seem to be missing");
891  return;
892  }
893  for (int i=0;i<3;i++) {
894  allDerivatives[i].push_back(&deriv_vec[nModPars+i]);
895  for (int j=0;j<WSize;j++) {
896  F(i,j) = deriv_vec[nModPars+i][j];
897  }
898  }
899 
900  // prepare the X object in the AlignVertex:
901  WF += F * weights;
902 
903  } else {
904  ATH_MSG_ERROR("accumulateVTX: Derivatives do not have a valid pointer to the module.");
905  return;
906  }
907  }
908 
909 
910  // second loop to fill the X object:
911  for (const auto& deriv : derivatives) {
912  // get AlignModule
913  const AlignModule* module=deriv.first;
914 
915  // get alignment parameters
916  if( module ) {
917  const std::vector<Amg::VectorX>& deriv_vec = deriv.second;
918  std::vector<Amg::VectorX> drdaWF;
919  ATH_MSG_DEBUG("accumulateVTX: The deriv_vec size is "
920  << deriv_vec.size());
921  DataVector<AlignPar>* alignPars = m_alignModuleTool->getAlignPars(module);
922  int nModPars = alignPars->size();
923  if ((nModPars + 3) != std::ssize(deriv_vec)) {
925  "accumulateVTX: Derivatives w.r.t. the vertex seem to be missing");
926  return;
927  }
928  drdaWF.reserve(nModPars);
929  for (int i = 0; i < nModPars; i++) {
930  drdaWF.emplace_back(2.0 * WF * deriv_vec[i]);
931  }
932  ATH_MSG_DEBUG("accumulateVTX: derivX incremented by: " << drdaWF);
933  // now add contribution from this track to the X object:
934  derivX.emplace_back(module,std::move(drdaWF));
935 
936  } else {
937  ATH_MSG_ERROR("accumulateVTX: Derivatives do not have a valid pointer to the module.");
938  return;
939  }
940  }
941 
942  // prepare derivatives w.r.t. the vertex position:
943  int nmodules = allDerivatives[0].size();
944  ATH_MSG_DEBUG("accumulateVTX: allDerivatives size is " << nmodules);
945  for( int ii=0; ii<3; ++ii ) {
946  VTXDerivatives[ii] = (*(allDerivatives[ii])[0]);
947  for( int jj=1; jj<nmodules; ++jj ) {
948  VTXDerivatives[ii] += (*(allDerivatives[ii])[jj]);
949  }
950  }
951 
952  AmgVector(3) vtxV;
953  AmgSymMatrix(3) vtxM;
954 
955  Amg::VectorX RHM= weightsFirstDeriv * residuals;
956  ATH_MSG_DEBUG("RHM: "<<RHM);
957 
958  for (int ipar=0;ipar<3;ipar++) {
959 
960  // calculate first derivative
961  Amg::MatrixX derivativesT = (VTXDerivatives[ipar]).transpose();
962  ATH_MSG_DEBUG("derivativesT (size "<<derivativesT.cols()<<"): "<<derivativesT);
963 
964  Amg::MatrixX tempV = (2.* derivativesT * RHM);
965  vtxV[ipar] = tempV(0,0);
966 
967  for (int jpar=ipar;jpar<3;jpar++) {
968 
969  // calculate second derivatives
970  Amg::MatrixX RHM2 = weights * (VTXDerivatives[jpar]);
971 
972  Amg::MatrixX tempM = (2.* derivativesT * RHM2);
973  vtxM(ipar,jpar) = tempM(0,0);
974 
975  }
976 
977  }
978 
979  // increment the vtx algebra objects:
980 
981  alignVertex->incrementVector(vtxV);
982  alignVertex->incrementMatrix(vtxM);
983  // ATH_MSG_DEBUG("accumulateVTX: derivX size = "<< derivX->size());
984  alignVertex->addDerivatives(&derivX);
985 
986 }

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T, V, H > &  hndl,
const SG::VarHandleKeyArrayType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKeyArray>

Definition at line 170 of file AthCommonDataStore.h.

172  {
173  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
174  hndl.value(),
175  hndl.documentation());
176 
177  }

◆ declareGaudiProperty() [2/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T, V, H > &  hndl,
const SG::VarHandleKeyType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158  {
159  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
160  hndl.value(),
161  hndl.documentation());
162 
163  }

◆ declareGaudiProperty() [3/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T, V, H > &  hndl,
const SG::VarHandleType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleBase>

Definition at line 184 of file AthCommonDataStore.h.

186  {
187  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
188  hndl.value(),
189  hndl.documentation());
190  }

◆ declareGaudiProperty() [4/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T, V, H > &  t,
const SG::NotHandleType  
)
inlineprivateinherited

specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray>

Definition at line 199 of file AthCommonDataStore.h.

200  {
201  return PBASE::declareProperty(t);
202  }

◆ declareProperty() [1/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleBase hndl,
const std::string &  doc,
const SG::VarHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleBase. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 245 of file AthCommonDataStore.h.

249  {
250  this->declare(hndl.vhKey());
251  hndl.vhKey().setOwner(this);
252 
253  return PBASE::declareProperty(name,hndl,doc);
254  }

◆ declareProperty() [2/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKey hndl,
const std::string &  doc,
const SG::VarHandleKeyType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleKey. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 221 of file AthCommonDataStore.h.

225  {
226  this->declare(hndl);
227  hndl.setOwner(this);
228 
229  return PBASE::declareProperty(name,hndl,doc);
230  }

◆ declareProperty() [3/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKeyArray hndArr,
const std::string &  doc,
const SG::VarHandleKeyArrayType  
)
inlineinherited

Definition at line 259 of file AthCommonDataStore.h.

263  {
264 
265  // std::ostringstream ost;
266  // ost << Algorithm::name() << " VHKA declareProp: " << name
267  // << " size: " << hndArr.keys().size()
268  // << " mode: " << hndArr.mode()
269  // << " vhka size: " << m_vhka.size()
270  // << "\n";
271  // debug() << ost.str() << endmsg;
272 
273  hndArr.setOwner(this);
274  m_vhka.push_back(&hndArr);
275 
276  Gaudi::Details::PropertyBase* p = PBASE::declareProperty(name, hndArr, doc);
277  if (p != 0) {
278  p->declareUpdateHandler(&AthCommonDataStore<PBASE>::updateVHKA, this);
279  } else {
280  ATH_MSG_ERROR("unable to call declareProperty on VarHandleKeyArray "
281  << name);
282  }
283 
284  return p;
285 
286  }

◆ declareProperty() [4/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc,
const SG::NotHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This is the generic version, for types that do not derive from SG::VarHandleKey. It just forwards to the base class version of declareProperty.

Definition at line 333 of file AthCommonDataStore.h.

337  {
338  return PBASE::declareProperty(name, property, doc);
339  }

◆ declareProperty() [5/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc = "none" 
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This dispatches to either the generic declareProperty or the one for VarHandle/Key/KeyArray.

Definition at line 352 of file AthCommonDataStore.h.

355  {
356  typedef typename SG::HandleClassifier<T>::type htype;
357  return declareProperty (name, property, doc, htype());
358  }

◆ declareProperty() [6/6]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( Gaudi::Property< T, V, H > &  t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145  {
146  typedef typename SG::HandleClassifier<T>::type htype;
148  }

◆ detStore()

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

95 { return m_detStore; }

◆ doBeamspotConstraintTrackSelection()

bool Trk::BeamspotVertexPreProcessor::doBeamspotConstraintTrackSelection ( const Track track)
private

Definition at line 556 of file BeamspotVertexPreProcessor.cxx.

556  {
557 
558  const xAOD::VertexContainer* vertices = nullptr;
559  const xAOD::Vertex* vertex = nullptr;
560  bool haveVertex = false;
561 
562  // retrieve the primary vertex if needed
564 
565  const EventContext& ctx = Gaudi::Hive::currentContext();
567  if(!vtxReadHandle.isValid()){
568  ATH_MSG_ERROR("Cannot retrieve the \'"<<m_PVContainerName<<"\' vertex collection from StoreGate");
570  } else {
571  vertices = vtxReadHandle.cptr();
572  // if there is no vertex, we can't associate the tracks to it
573  if(vertices) {
574  ATH_MSG_DEBUG("Primary vertex collection for this event has "<<vertices->size()<<" vertices");
575  if (vertices->size()<2){
576  ATH_MSG_DEBUG("Only Dummy vertex present, no Primary vertices.");
577  } else {
578  vertex = (*vertices)[0];
579  haveVertex = true;
580  }
581  }
582  else
583  ATH_MSG_DEBUG("Could not retrieve primary vertex collection from the StoreGate");
584  }
585  }
586 
587 
588  if( ( m_doAssociatedToPVSelection && haveVertex && vertex && isAssociatedToPV(track,vertices) ) ||
589  ( m_doBSTrackSelection && m_BSTrackSelector->accept(*track) ) ){
590 
591  if (m_maxPt > 0 )
592  {
593  const Trk::Perigee* perigee = track->perigeeParameters();
594  if (!perigee) {
595  ATH_MSG_DEBUG("NO perigee on this track");
596  return false;
597  }
598  const double qoverP = perigee->parameters()[Trk::qOverP] * 1000.;
599  double pt = 0.;
600  if (qoverP != 0 )
601  pt = std::abs(1.0/qoverP)*sin(perigee->parameters()[Trk::theta]);
602  ATH_MSG_DEBUG( " pt : "<< pt );
603  if (pt > m_maxPt)
604  return false;
605  } //maxPt selection
606 
607  ATH_MSG_DEBUG("this track passes the beamspot track selection, will do beamspot constraint on it ");
608  return true;
609  }
610  else return false;
611 }

◆ doConstraintRefit()

const Track * Trk::BeamspotVertexPreProcessor::doConstraintRefit ( ToolHandle< IGlobalTrackFitter > &  fitter,
const Track track,
const VertexOnTrack vot,
const ParticleHypothesis particleHypothesis 
) const
private

Definition at line 518 of file BeamspotVertexPreProcessor.cxx.

523 {
524  const EventContext& ctx = Gaudi::Hive::currentContext();
525  const Track* newTrack = nullptr;
526 
527  if(vot){
528 
529  std::vector<const MeasurementBase *> measurementCollection;
530  measurementCollection.push_back(vot);
531  // add all other measurements
532  const auto &measurements = *(track->measurementsOnTrack());
533  for(const MeasurementBase* meas : measurements)
534  measurementCollection.push_back(meas);
535 
537  // get track parameters at the vertex:
538  const PerigeeSurface& surface=vot->associatedSurface();
539  ATH_MSG_DEBUG(" Track reference surface will be: " << surface);
540  const TrackParameters* parsATvertex=m_extrapolator->extrapolateTrack(ctx, *track, surface).release();
541 
542  ATH_MSG_DEBUG(" Track will be refitted at this surface ");
543  newTrack = (fitter->fit(ctx, measurementCollection,
544  *parsATvertex, m_runOutlierRemoval, particleHypothesis)).release();
545  delete parsATvertex;
546  } else {
547  newTrack = (fitter->fit(ctx,
548  measurementCollection, *(track->trackParameters()->front()),
549  m_runOutlierRemoval, particleHypothesis)).release();
550  }
551  }
552 
553  return newTrack;
554 }

◆ doTrackRefit()

AlignTrack * Trk::BeamspotVertexPreProcessor::doTrackRefit ( const Track track)
private

Definition at line 614 of file BeamspotVertexPreProcessor.cxx.

614  {
615 
616  AlignTrack * alignTrack = nullptr;
617  const Track* newTrack = nullptr;
618  const VertexOnTrack* vot = nullptr;
619  const xAOD::Vertex* vtx = nullptr;
621  // configuration of the material effects needed for track fitter
623 
624  // initialization the GX2 track fitter
625  ToolHandle<Trk::IGlobalTrackFitter> fitter = m_trackFitter;
628 
629  IGlobalTrackFitter::AlignmentCache alignCache;
630 
631  ATH_MSG_DEBUG( "doTrackRefit ** START ** ");
632 
634  vot = provideVotFromVertex(track, vtx);
635  if( !vot ) ATH_MSG_INFO( "VoT not found for this track! ");
636  if( !vtx ) ATH_MSG_INFO( "VTX pointer not found for this track! ");
637  if(vot){
638  newTrack = doConstraintRefit(fitter, track, vot, particleHypothesis);
640  // this track failed the PV constraint reift
641  if (!newTrack) {
643  ATH_MSG_DEBUG("VertexConstraint track refit failed! ");
644  }
645  }
646  }
647 
650  if(vot){
651  newTrack = doConstraintRefit(fitter, track, vot, particleHypothesis);
653  // this track failed the BS constraint refit
654  if (!newTrack) {
656  ATH_MSG_DEBUG("BSConstraint track refit failed! ");
657  }
658  }
659  }
660 
661 
662  //Refit to get full fitter covariance matrix
663  // @TODO This is a little inefficienct and should
664  // be addressed when the alignment code is made MT safe
665  if(newTrack){
666  Trk::Track* tmpTrk = fitter->alignmentFit(alignCache,*newTrack,m_runOutlierRemoval,particleHypothesis);
667  delete newTrack;
668  newTrack = tmpTrk;
669  if(!tmpTrk){
671  {
673  ATH_MSG_DEBUG("VertexConstraint track refit2 failed! ");
675  {
677  ATH_MSG_DEBUG("BSConstraint track refit2 failed! ");
678  }
679  }
680  }
681 
682  if(!newTrack && m_doNormalRefit){
683  newTrack = fitter->alignmentFit(alignCache,*track,m_runOutlierRemoval,particleHypothesis);
685  // this track failed the normal refit
686  if (!newTrack) {
688  ATH_MSG_DEBUG("Normal track refit failed! ");
689  }
690  }
691 
692 
693 
694 
695 
696  if(newTrack) {
697  alignTrack = new AlignTrack(*newTrack);
698  // set original track pointer
699  alignTrack->setOriginalTrack(track);
700  // set the refit type
701  alignTrack->setType(type);
702 
703 
705  ATH_MSG_DEBUG("before refit: "<< *track);
707 
708  ATH_MSG_DEBUG("after refit: "<< *newTrack);
710  }
711 
712  if(AlignTrack::VertexConstrained == type || AlignTrack::BeamspotConstrained == type) alignTrack->doFindPerigee();
713 
714  if (m_storeFitMatrices) {
715  alignTrack->setFullCovarianceMatrix(alignCache.m_fullCovarianceMatrix);
716  alignTrack->setDerivativeMatrix(alignCache.m_derivMatrix);
717  }
718  delete newTrack;
719 
720  if( m_doFullVertexConstraint && vtx!=nullptr && type == AlignTrack::VertexConstrained ){
721  // try to log the track-vertex association in the AlignVertex object:
722  bool ifound=false;
723  for (AlignVertex* ivtx : m_AlignVertices) {
724  if( (ivtx->originalVertex())==vtx ) {
725  ifound = true;
726  }
727  }
728  if( !ifound ) {
729  AlignVertex* avtx=new AlignVertex(vtx);
730  ATH_MSG_DEBUG(" New AlignVertex has ben created.");
731 
732  // Beam Spot constraint on the vertex:
733  if( m_doBeamspotConstraint && (xAOD::VxType::PriVtx == vtx->vertexType() || xAOD::VxType::PileUp == vtx->vertexType()) && vtx->vxTrackAtVertex().size()>4 ) { // a beam line verex
734  ATH_MSG_DEBUG(" The Beam Spot constraint will be added to the vertex.." );
735  AmgSymMatrix(3) qtemp;
736  AmgVector(3) vtemp;
737  provideVtxBeamspot(avtx, &qtemp, &vtemp);
738  (qtemp)(2,2) = 1000000.0; // disable Z constraint
739  avtx->setConstraint( &qtemp, &vtemp);
740  }
741 
742  m_AlignVertices.push_back(avtx);
743  }
744  }
745  // increment counters
747  ++m_nTracks;
748 
749  }
750  // garbage collection:
751  if(vot) delete vot;
752 
753  ATH_MSG_DEBUG( "doTrackRefit ** COMPLETED ** ");
754  return alignTrack;
755 }

◆ evtStore() [1/2]

ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

85 { return m_evtStore; }

◆ evtStore() [2/2]

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( ) const
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 90 of file AthCommonDataStore.h.

90 { return m_evtStore; }

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase &  ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ fillNtuple()

virtual StatusCode Trk::IAlignTrackPreProcessor::fillNtuple ( )
inlinevirtualinherited

writes tree and histogrms to ntuple

Definition at line 54 of file IAlignTrackPreProcessor.h.

54 { return StatusCode::SUCCESS; }

◆ finalize()

StatusCode Trk::BeamspotVertexPreProcessor::finalize ( )
overridevirtual

Definition at line 1032 of file BeamspotVertexPreProcessor.cxx.

1033 {
1034  ATH_MSG_INFO("BeamspotVertexPreProcessor::finalize()");
1035 
1036  return StatusCode::SUCCESS;
1037 }

◆ findVertexCandidate()

const xAOD::Vertex * Trk::BeamspotVertexPreProcessor::findVertexCandidate ( const Track track) const
private

Definition at line 275 of file BeamspotVertexPreProcessor.cxx.

275  {
276 
277  const xAOD::Vertex* findVxCandidate = nullptr;
278 
279  for(const auto& thisPair : m_allTracksVector){
280  auto iVxTrackBegin = thisPair.second.begin();
281  auto iVxTrackEnd = thisPair.second.end();
282  Trk::CompareTwoTracks thisCompare(track, "compareAddress");
283 
284  auto findResult = std::find_if(iVxTrackBegin, iVxTrackEnd, thisCompare);
285 
286  if(findResult != iVxTrackEnd){
287  ATH_MSG_DEBUG("the found VxTrackAtVertex: "<<*findResult);
288  findVxCandidate = thisPair.first;
289  break;
290  }
291  }
292 
293  return findVxCandidate;
294 }

◆ initialize()

StatusCode Trk::BeamspotVertexPreProcessor::initialize ( )
overridevirtual

Definition at line 49 of file BeamspotVertexPreProcessor.cxx.

50 {
51  ATH_MSG_INFO("BeamspotVertexPreProcessor::initialize()");
52 
53  // configure main track selector if requested
54  if (!m_trkSelector.empty()) {
55  if (m_trkSelector.retrieve().isFailure())
56  ATH_MSG_ERROR("Failed to retrieve tool "<<m_trkSelector<<". No Track Selection will be done.");
57  else
58  ATH_MSG_INFO("Retrieved " << m_trkSelector);
59  }
60 
61  if (m_refitTracks) {
62  // configure main track fitter
63  if(m_trackFitter.retrieve().isFailure()) {
64  ATH_MSG_FATAL("Could not get " << m_trackFitter);
65  return StatusCode::FAILURE;
66  }
67  ATH_MSG_INFO("Retrieved " << m_trackFitter);
68 
69  // configure straight-line track fitter if requested
70  if (!m_useSingleFitter) {
71  if (m_SLTrackFitter.retrieve().isFailure()) {
72  ATH_MSG_FATAL("Could not get " << m_SLTrackFitter);
73  return StatusCode::FAILURE;
74  }
75  ATH_MSG_INFO("Retrieved " << m_SLTrackFitter);
76  }
77 
78  // TrackToVertexIPEstimator
79  if (m_trackToVertexIPEstimatorTool.retrieve().isFailure()) {
80  ATH_MSG_FATAL("Can not retrieve TrackToVertexIPEstimator of type " << m_trackToVertexIPEstimatorTool.typeAndName());
81  return StatusCode::FAILURE;
82  } else {
83  ATH_MSG_INFO ( "Retrieved TrackToVertexIPEstimator Tool " << m_trackToVertexIPEstimatorTool.typeAndName() );
84  }
85 
86  // configure Atlas extrapolator
87  if (m_extrapolator.retrieve().isFailure()) {
88  ATH_MSG_FATAL("Failed to retrieve tool "<<m_extrapolator);
89  return StatusCode::FAILURE;
90  }
91  ATH_MSG_INFO("Retrieved " << m_extrapolator);
92 
93  // configure beam-spot conditions service
95 
96  ATH_CHECK(m_PVContainerName.initialize());
97 
98  // configure beam-spot track selector if requested
100  if(m_BSTrackSelector.empty()) {
101  ATH_MSG_FATAL("Requested BeamSpot track selection but Track Selector not configured");
102  return StatusCode::FAILURE;
103  }
104  if (m_BSTrackSelector.retrieve().isFailure()) {
105  ATH_MSG_FATAL("Could not get " << m_BSTrackSelector);
106  return StatusCode::FAILURE;
107  }
108  ATH_MSG_INFO("Retrieved " << m_BSTrackSelector);
109  }
110 
111  } // end of 'if (m_refitTracks)'
112 
113  else if (m_doBeamspotConstraint) {
114  ATH_MSG_FATAL("Requested beam-spot constraint but RefitTracks is False.");
115  return StatusCode::FAILURE;
116  }
117 
119  if ( m_alignModuleTool.retrieve().isFailure() ) {
120  ATH_MSG_FATAL("Failed to retrieve tool " << m_alignModuleTool);
121  return StatusCode::FAILURE;
122  }
123  else {
124  ATH_MSG_INFO("Retrieved tool " << m_alignModuleTool);
125 
126  ATH_MSG_INFO("************************************************************************");
127  ATH_MSG_INFO("* *");
128  ATH_MSG_INFO("* You have requested the Full Vertex Constraint option. *");
129  ATH_MSG_INFO("* It is your duty to assure that all detector elements *");
130  ATH_MSG_INFO("* used for track fitting are also loaded in the alignment framework!!! *");
131  ATH_MSG_INFO("* *");
132  ATH_MSG_INFO("* Also make sure the accurate track covariance matrix *");
133  ATH_MSG_INFO("* is returned by the GlobalChi2Fitter! *");
134  ATH_MSG_INFO("* *");
135  ATH_MSG_INFO("************************************************************************");
136  }
137 
138  }
139  return StatusCode::SUCCESS;
140 }

◆ inputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< AlgTool > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ interfaceID()

const InterfaceID & IAlignTrackPreProcessor::interfaceID ( )
inlinestaticinherited

Definition at line 70 of file IAlignTrackPreProcessor.h.

71  {
72  return IID_Trk_IAlignTrackPreProcessor;
73  }

◆ isAssociatedToPV()

bool Trk::BeamspotVertexPreProcessor::isAssociatedToPV ( const Track track,
const xAOD::VertexContainer vertices 
)
private

Definition at line 218 of file BeamspotVertexPreProcessor.cxx.

219 {
220  if(!vertices) return false;
221 
222  for (const xAOD::Vertex* vtx : *vertices) {
223  if (vtx->vertexType() != 1) break;
224  if (isAssociatedToVertex(track, vtx)) return true;
225  }
226 
227  return false;
228 }

◆ isAssociatedToVertex()

bool Trk::BeamspotVertexPreProcessor::isAssociatedToVertex ( const Track track,
const xAOD::Vertex vertex 
)
private

Definition at line 232 of file BeamspotVertexPreProcessor.cxx.

233 {
234  if(!vertex) return false;
235 
236  std::vector<VxTrackAtVertex > vertexTracks = vertex->vxTrackAtVertex();
237  Trk::CompareTwoTracks thisCompare(track, "compareAddress");
238 
239  std::vector<VxTrackAtVertex >::const_iterator iVxTrackBegin = vertexTracks.begin();
240  std::vector<VxTrackAtVertex >::const_iterator iVxTrackEnd = vertexTracks.end();
241 
242  std::vector<VxTrackAtVertex>::const_iterator findResult = std::find_if(iVxTrackBegin, iVxTrackEnd, thisCompare);
243 
244  return findResult != iVxTrackEnd;
245 }

◆ msg() [1/2]

MsgStream& AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24  {
25  return this->msgStream();
26  }

◆ msg() [2/2]

MsgStream& AthCommonMsg< AlgTool >::msg ( const MSG::Level  lvl) const
inlineinherited

Definition at line 27 of file AthCommonMsg.h.

27  {
28  return this->msgStream(lvl);
29  }

◆ msgLvl()

bool AthCommonMsg< AlgTool >::msgLvl ( const MSG::Level  lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30  {
31  return this->msgLevel(lvl);
32  }

◆ outputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< AlgTool > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ prepareAllTracksVector()

void Trk::BeamspotVertexPreProcessor::prepareAllTracksVector ( )
private

Definition at line 248 of file BeamspotVertexPreProcessor.cxx.

248  {
249 
250  // do clean up firstly
251  m_allTracksVector.clear();
252 
253  const EventContext& ctx = Gaudi::Hive::currentContext();
255 
256  for(const xAOD::Vertex* vtx : *vtxReadHandle){
257  if(!selectVertices(vtx)) {
258  ATH_MSG_DEBUG("this vertex did not pass the primary vertex selection...");
259  continue;
260  }
261  if (vtx->vxTrackAtVertexAvailable()){
262  std::vector<VxTrackAtVertex> vtxTracks = vtx->vxTrackAtVertex();
263  m_allTracksVector.emplace_back(vtx, vtxTracks);
264  }
265  else {
266  ATH_MSG_DEBUG("this vertex did not pass the vxTrackAtVertexAvailable() call...");
267  continue;
268  }
269  }
270 
271  ATH_MSG_DEBUG("m_allTracksVector size: "<<m_allTracksVector.size());
272 }

◆ printSummary()

void Trk::BeamspotVertexPreProcessor::printSummary ( )
overridevirtual

Print processing summary to logfile.

Reimplemented from Trk::IAlignTrackPreProcessor.

Definition at line 1008 of file BeamspotVertexPreProcessor.cxx.

1009 {
1010  if(m_logStream) {
1011 
1012  *m_logStream<<"*************************************************************"<<std::endl;
1013  *m_logStream<<"****** BeamspotVertexPreProcessor summary ******"<<std::endl;
1014  *m_logStream<<"*"<<std::endl;
1015  *m_logStream<<"* number of created AlignTracks : "<<m_nTracks<<std::endl;
1016  if(m_nTracks>0) {
1017  *m_logStream<<"* --------------------------------------------"<<std::endl;
1018  for(int i=0; i<AlignTrack::NTrackTypes; ++i) {
1019  if(m_trackTypeCounter[i]>0)
1020  *m_logStream<<"* "<<(AlignTrack::AlignTrackType)i<<": "<<m_trackTypeCounter[i]<<std::endl;
1021  }
1022  }
1023  *m_logStream<<"*"<<std::endl;
1024  *m_logStream<<"* number of failed normal refits : " << m_nFailedNormalRefits << std::endl;
1025  *m_logStream<<"* number of failed refits with primary vertex : " << m_nFailedPVRefits << std::endl;
1026  *m_logStream<<"* number of failed refits with beam-spot : " << m_nFailedBSRefits << std::endl;
1027  *m_logStream<<"*"<<std::endl;
1028  }
1029 }

◆ processTrackCollection()

DataVector< Track > * Trk::BeamspotVertexPreProcessor::processTrackCollection ( const DataVector< Track > *  trks)
overridevirtual

Main processing of track collection.

The method should create AlignTracks but fill them into a collection of Tracks. The reason is that AlignTracks are needed further in the alignment processing but we want to store the newly created TrackCollection into StoreGate.

Implements Trk::IAlignTrackPreProcessor.

Definition at line 761 of file BeamspotVertexPreProcessor.cxx.

762 {
763  ATH_MSG_DEBUG("BeamspotVertexPreProcessor::processTrackCollection()");
764 
765  if( !tracks || (tracks->empty()) )
766  return nullptr;
767 
768  // Clear the AlignVertex container (will destruct the objects it owns as well!)
769  m_AlignVertices.clear();
770 
773 
774  // the output collection of AlignTracks
775  // we define it as collection of Tracks but fill AlignTracks inside
776  DataVector<Track> * newTrks = new DataVector<Track>;
777 
778  int index(0);
779  // loop over tracks
780  ATH_MSG_DEBUG( "Starting loop on input track collection: "<<index);
781  for (const auto* track : *tracks){
782  ++index;
783  ATH_MSG_DEBUG("Processing track "<<index);
784  AlignTrack * alignTrack = nullptr;
785  if (not track) continue;
786 
787  // check whether the track passes the basic selection
788  if (m_doTrkSelection) {
789  ATH_MSG_DEBUG( "Testing track selection on track: "<<index);
790  if ((not m_trkSelector.empty()) and (not m_trkSelector->accept(*track))) continue;
791  } // appliying track selection
792 
793  if(m_refitTracks){
794  ATH_MSG_DEBUG( "Refitting track: "<<index );
795  alignTrack = doTrackRefit(track);
796 
797  // 2nd track check after refit
798  if(alignTrack && !m_trkSelector.empty()) {
799  // refitted track loses the summary information, restoring it here
800  alignTrack->setTrackSummary( std::make_unique<Trk::TrackSummary> (*track->trackSummary()) );
801  // do not check for FullVertex tracks:
802  if( !(alignTrack->getVtx()) ) {
803  if( m_doTrkSelection && !m_trkSelector->accept(*alignTrack))
804  continue;
805  }
806  }
807  else {
808  ATH_MSG_DEBUG( "Refit of track " << index << " ended with no alignTrack" );
809  }
810  } else {
811  ATH_MSG_DEBUG( "No Track refit for track " << index << " --> building new aligntrack");
812  alignTrack = new AlignTrack(*track);
813  alignTrack->setOriginalTrack(track);
814  alignTrack->setType(AlignTrack::Original);
815  }
816  // add the new align track to the collection
817  if (alignTrack) newTrks->push_back(alignTrack);
818  } // end of loop over tracks
819 
820  ATH_MSG_INFO( "Processing of input track collection completed (size: " << tracks->size() << "). Size of the alignTrack collection: " << newTrks->size() );
821  // delete the collection if it's empty
822  if (newTrks->empty()) {
823  delete newTrks;
824  return nullptr;
825  }
826 
827  return newTrks;
828 }

◆ provideVotFromBeamspot()

const VertexOnTrack * Trk::BeamspotVertexPreProcessor::provideVotFromBeamspot ( const Track track) const
private

Definition at line 404 of file BeamspotVertexPreProcessor.cxx.

404  {
405 
406  const EventContext& ctx = Gaudi::Hive::currentContext();
407  const VertexOnTrack * vot = nullptr;
409  Amg::Vector3D bpos = beamSpotHandle->beamPos();
410  ATH_MSG_DEBUG("beam spot: "<<bpos);
411  float beamSpotX = bpos.x();
412  float beamSpotY = bpos.y();
413  float beamSpotZ = bpos.z();
414  float beamTiltX = beamSpotHandle->beamTilt(0);
415  float beamTiltY = beamSpotHandle->beamTilt(1);
416  float beamSigmaX = m_BSScalingFactor * beamSpotHandle->beamSigma(0);
417  float beamSigmaY = m_BSScalingFactor * beamSpotHandle->beamSigma(1);
418 
419  ATH_MSG_DEBUG("running refit with beam-spot");
420 
421  float z0 = track->perigeeParameters()->parameters()[Trk::z0];
422  float beamX = beamSpotX + std::tan(beamTiltX) * (z0-beamSpotZ);
423  float beamY = beamSpotY + std::tan(beamTiltY) * (z0-beamSpotZ);
424  Amg::Vector3D BSC(beamX, beamY, z0);
425  ATH_MSG_DEBUG("constructing beam point (x,y,z) = ( "<<beamX<<" , "<<beamY<<" , "<<z0<<" )");
426  std::optional<PerigeeSurface> surface = std::nullopt;
427  Amg::MatrixX errorMatrix;
428  LocalParameters beamSpotParameters;
429 
430  // covariance matrix of the beam-spot
431  AmgSymMatrix(2) beamSpotCov;
432  beamSpotCov.setZero();
433  beamSpotCov(0,0) = beamSigmaX * beamSigmaX;
434  beamSpotCov(1,1) = beamSigmaY * beamSigmaY;
435 
436  if(m_constraintMode == 0) {
437 
438  const Amg::Vector3D& globPos(BSC);
439  surface.emplace(globPos);
440 
441  // create a measurement for the beamspot
442  DefinedParameter Par0(0.,Trk::d0);
443  beamSpotParameters = LocalParameters(Par0);
444 
445  // calculate perigee parameters wrt. beam-spot
446  const Perigee* perigee = nullptr;
447  std::unique_ptr<const Trk::TrackParameters> tmp =
448  m_extrapolator->extrapolateTrack(ctx, *track, *surface);
449  // pass ownership only if of correct type
450  if (tmp && tmp->associatedSurface().type() == Trk::SurfaceType::Perigee) {
451  perigee = static_cast<const Perigee*>(tmp.release());
452  }
453 
454  if (!perigee) {
455  const Perigee * trackPerigee = track->perigeeParameters();
456  if ( trackPerigee && trackPerigee->associatedSurface() == *surface )
457  perigee = trackPerigee->clone();
458  }
459  if (not perigee){
460  ATH_MSG_WARNING("Perigee is nullptr in "<<__FILE__<<":"<<__LINE__);
461  return vot;
462  }
463 
464  Eigen::Matrix<double,1,2> jacobian;
465  jacobian.setZero();
466  //perigee is dereferenced here, must not be nullptr
467  double ptInv = 1./perigee->momentum().perp();
468  jacobian(0,0) = -ptInv * perigee->momentum().y();
469  jacobian(0,1) = ptInv * perigee->momentum().x();
470 
471  errorMatrix = Amg::MatrixX( jacobian*(beamSpotCov*jacobian.transpose()));
472  if( errorMatrix.cols() != 1 )
473  ATH_MSG_FATAL("Similarity transpose done incorrectly");
474  delete perigee;
475  }
476  if (surface){
477  vot = new VertexOnTrack(std::move(beamSpotParameters),
478  std::move(errorMatrix),
479  *surface);
480  } else {
481  ATH_MSG_WARNING("surface is nullptr in "<<__FILE__<<":"<<__LINE__);
482  }
483  if (vot){
484  ATH_MSG_DEBUG(" the VertexOnTrack objects created from BeamSpot are " << *vot);
485  }
486 
487  return vot;
488 }

◆ provideVotFromVertex()

const VertexOnTrack * Trk::BeamspotVertexPreProcessor::provideVotFromVertex ( const Track track,
const xAOD::Vertex *&  vtx 
) const
private

vertex as perigeeSurface

Definition at line 297 of file BeamspotVertexPreProcessor.cxx.

297  {
298 
299  const EventContext& ctx = Gaudi::Hive::currentContext();
300  const VertexOnTrack * vot = nullptr;
301  const xAOD::Vertex* tmpVtx = nullptr;
302  const xAOD::Vertex* updatedVtx = nullptr;
303 
304  const xAOD::Vertex* findVtx = findVertexCandidate(track);
305 
306  ATH_MSG_DEBUG("findVtx in provideVotFromVertex: "<<findVtx);
307 
308  if (!( nullptr==findVtx) ) {
309  vtx = findVtx;
310 
312  updatedVtx = new xAOD::Vertex(*vtx);
313  } else {
314  tmpVtx = new xAOD::Vertex(*vtx);
315  updatedVtx = m_trackToVertexIPEstimatorTool->getUnbiasedVertex(track->perigeeParameters(), vtx );
316  }
317 
318 
319  if(updatedVtx){
320 
321  if(!selectUpdatedVertices(updatedVtx))
322  return vot;
323 
325  ATH_MSG_DEBUG(" updated Vertex by KalmanVertexUpdator: "<<updatedVtx);
326 
328  Amg::Vector3D globPos(updatedVtx->position()); //look
329  const PerigeeSurface surface(globPos);
330  const Perigee* perigee = nullptr;
331  std::unique_ptr<const Trk::TrackParameters> tmp =
332  m_extrapolator->extrapolateTrack(ctx, *track, surface);
333  //pass ownership only if of correct type
334  if (tmp && tmp->associatedSurface().type() == Trk::SurfaceType::Perigee) {
335  perigee = static_cast<const Perigee*> (tmp.release());
336  }
337  if (!perigee) {
338  const Perigee * trackPerigee = track->perigeeParameters();
339  if ( trackPerigee && trackPerigee->associatedSurface() == surface )
340  perigee = trackPerigee->clone();
341  }
342  //if the perigee is still nonsense ...
343  if (not perigee){
344  //clean up
345  if (updatedVtx!= tmpVtx) delete updatedVtx;
346  delete tmpVtx;
347  //WARNING
348  ATH_MSG_WARNING("Perigee is nullptr in "<<__FILE__<<":"<<__LINE__);
349  //exit
350  return vot;
351  }
352 
353  // create the Jacobian matrix from Cartisian to Perigee
354  AmgMatrix(2,3) Jacobian;
355  Jacobian.setZero();
356  //perigee is dereferenced here, must not be nullptr!
357  double ptInv = 1./perigee->momentum().perp();
358  Jacobian(0,0) = -ptInv*perigee->momentum().y();
359  Jacobian(0,1) = ptInv*perigee->momentum().x();
360  Jacobian(1,2) = 1.0;
361 
362  ATH_MSG_DEBUG(" Jacobian matrix from Cartesian to Perigee: "<< Jacobian);
363 
364  AmgSymMatrix(3) vtxCov = updatedVtx->covariancePosition();
366 
367  Amg::MatrixX errorMatrix;
369  AmgSymMatrix(3) tmpCov;
370  tmpCov.setZero();
371  tmpCov(0,0) = 1.e-10 ;
372  tmpCov(1,1) = 1.e-10;
373  tmpCov(2,2) = 1.e-10;
374  errorMatrix = Amg::MatrixX( tmpCov.similarity(Jacobian) );
375  } else {
376  errorMatrix = Amg::MatrixX( vtxCov.similarity(Jacobian) );
377  }
378  delete perigee;
379 
380  // in fact, in most of the normal situation, pointer tmpVtx and updatedVtx are the same. You can check the source code
381  // But for safety, I would like to delete them seperately
382  // sroe(2016.09.23): This would result in an illegal double delete, if they really point to the same thing!
383  // http://stackoverflow.com/questions/9169774/what-happens-in-a-double-delete
384  if (tmpVtx != updatedVtx){
385  delete updatedVtx;
386  }
387  delete tmpVtx;
388  tmpVtx=nullptr;
389  updatedVtx=nullptr;
390 
391  LocalParameters localParams = Trk::LocalParameters(Amg::Vector2D(0,0));
392 
393  // VertexOnTrack Object
394  vot = new VertexOnTrack(std::move(localParams), std::move(errorMatrix), surface);
395  ATH_MSG_DEBUG("the VertexOnTrack created from vertex: "<<*vot);
396  }
397  }
398 
399  return vot;
400 
401 }

◆ provideVtxBeamspot()

void Trk::BeamspotVertexPreProcessor::provideVtxBeamspot ( const AlignVertex b,
AmgSymMatrix(3) *  q,
Amg::Vector3D v 
) const
private

Definition at line 491 of file BeamspotVertexPreProcessor.cxx.

491  {
492 
494  Amg::Vector3D bpos = beamSpotHandle->beamPos();
495  ATH_MSG_DEBUG("beam spot: "<<bpos);
496  float beamSpotX = bpos.x();
497  float beamSpotY = bpos.y();
498  float beamSpotZ = bpos.z();
499  float beamTiltX = beamSpotHandle->beamTilt(0);
500  float beamTiltY = beamSpotHandle->beamTilt(1);
501  float beamSigmaX = m_BSScalingFactor * beamSpotHandle->beamSigma(0);
502  float beamSigmaY = m_BSScalingFactor * beamSpotHandle->beamSigma(1);
503  float beamSigmaZ = m_BSScalingFactor * beamSpotHandle->beamSigma(2);
504 
505  float z0 = b->originalPosition()->z();
506  (*v)(0) = beamSpotX + std::tan(beamTiltX) * (z0-beamSpotZ);
507  (*v)(1) = beamSpotY + std::tan(beamTiltY) * (z0-beamSpotZ);
508  (*v)(2) = beamSpotZ;
509  (*q)(0,0) = beamSigmaX*beamSigmaX;
510  (*q)(1,1) = beamSigmaY*beamSigmaY;
511  (*q)(2,2) = beamSigmaZ*beamSigmaZ;
512 
513  ATH_MSG_DEBUG("VTX constraint point (x,y,z) = ( "<< (*v)[0] <<" , "<< (*v)[1] <<" , "<< (*v)[2] <<" )");
514  ATH_MSG_DEBUG("VTX constraint size (x,y,z) = ( "<< beamSigmaX <<" , "<< beamSigmaY <<" , "<< beamSigmaZ <<" )");
515 }

◆ renounce()

std::enable_if_t<std::is_void_v<std::result_of_t<decltype(&T::renounce)(T)> > && !std::is_base_of_v<SG::VarHandleKeyArray, T> && std::is_base_of_v<Gaudi::DataHandle, T>, void> AthCommonDataStore< AthCommonMsg< AlgTool > >::renounce ( T &  h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381  {
382  h.renounce();
383  PBASE::renounce (h);
384  }

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::renounceArray ( SG::VarHandleKeyArray handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364  {
365  handlesArray.renounce();
366  }

◆ selectUpdatedVertices()

bool Trk::BeamspotVertexPreProcessor::selectUpdatedVertices ( const xAOD::Vertex updatedVtx) const
private

Definition at line 196 of file BeamspotVertexPreProcessor.cxx.

196  {
197 
198  if (vtx->numberDoF() <= 0){
199  ATH_MSG_WARNING(" VERY STRANGE!!! , the updated vertex has been rejected as non-positive DoF: "<< vtx->numberDoF() <<" the type of this vertex:"<< vtx->vertexType() );
200  return false;
201  }
202 
203  if (static_cast<int>(vtx->vxTrackAtVertex().size()) < m_minTrksInVtx){
204  ATH_MSG_DEBUG(" the updated vertex has been rejected as vxTrackAtVertex size: "<< vtx->vxTrackAtVertex().size() );
205  return false;
206  }
207 
208  if ((vtx->covariancePosition())(0,0)<=0 ||
209  (vtx->covariancePosition())(1,1)<=0 ||
210  (vtx->covariancePosition())(2,2)<=0){
211  ATH_MSG_WARNING(" VERY STRANGE!!! , this updated vertex has been rejected as negative diagonal error matrix ");
212  return false;
213  }
214  return true;
215 }

◆ selectVertices()

bool Trk::BeamspotVertexPreProcessor::selectVertices ( const xAOD::Vertex vtx) const
private

Definition at line 178 of file BeamspotVertexPreProcessor.cxx.

178  {
179 
180  if(0 == vtx->vertexType()) {
181  ATH_MSG_DEBUG("this primary vertex has been rejected as type dummy");
182  return false;
183  }
184  if (vtx->numberDoF() <= 0){
185  ATH_MSG_WARNING(" VERY STRANGE!!!, this primary vertex has been rejected as non-positive DoF "<< vtx->numberDoF() <<" the type of this vertex: "<< vtx->vertexType() );
186  return false;
187  }
188  if (static_cast<int>(vtx->vxTrackAtVertex().size()) < m_minTrksInVtx){
189  ATH_MSG_DEBUG(" this primary vertex vxTrackAtVertex size: "<< vtx->vxTrackAtVertex().size() );
190  return false;
191  }
192  return true;
193 }

◆ setLogStream()

virtual void Trk::IAlignTrackPreProcessor::setLogStream ( std::ostream *  os)
inlinevirtualinherited

sets the output stream for the logfile

Definition at line 48 of file IAlignTrackPreProcessor.h.

48 { m_logStream = os; }

◆ setNtuple()

virtual void Trk::IAlignTrackPreProcessor::setNtuple ( TFile *  )
inlinevirtualinherited

Sets output ntuple file, to be implemented if needed for detector-specific implementation.

Definition at line 51 of file IAlignTrackPreProcessor.h.

51 {}

◆ solveVTX()

void Trk::BeamspotVertexPreProcessor::solveVTX ( )
overridevirtual

Reimplemented from Trk::IAlignTrackPreProcessor.

Definition at line 990 of file BeamspotVertexPreProcessor.cxx.

990  {
991 
993  ATH_MSG_DEBUG("In solveVTX. Number of vertices = " << m_AlignVertices.size() );
994  for (AlignVertex* ivtx : m_AlignVertices) {
995  if( ivtx->Ntracks()>1 ) {
996  ivtx->fitVertex();
997  } else {
998  ATH_MSG_WARNING("This vertex contains " << ivtx->Ntracks() << " tracks. No solution possible.");
999  }
1000 
1001  ATH_MSG_DEBUG( "This vertex contains " << ivtx->Ntracks() << " tracks.");
1002  if( msgLvl(MSG::DEBUG) ) ivtx->dump(msg(MSG::DEBUG));
1003  }
1004  }
1005 }

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in DerivationFramework::CfAthAlgTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and asg::AsgMetadataTool.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::updateVHKA ( Gaudi::Details::PropertyBase &  )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308  {
309  // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310  // << " size: " << m_vhka.size() << endmsg;
311  for (auto &a : m_vhka) {
312  std::vector<SG::VarHandleKey*> keys = a->keys();
313  for (auto k : keys) {
314  k->setOwner(this);
315  }
316  }
317  }

Member Data Documentation

◆ m_alignModuleTool

PublicToolHandle<IAlignModuleTool> Trk::BeamspotVertexPreProcessor::m_alignModuleTool
private
Initial value:
{
this, "AlignModuleTool", "InDet::InDetAlignModuleTool/InDetAlignModuleTool"}

Pointer to AlignModuleTool.

Definition at line 109 of file BeamspotVertexPreProcessor.h.

◆ m_AlignVertices

DataVector<AlignVertex> Trk::BeamspotVertexPreProcessor::m_AlignVertices
private

collection of AlignVertices used in FullVertex constraint option

Definition at line 166 of file BeamspotVertexPreProcessor.h.

◆ m_allTracksVector

std::vector< std::pair< const xAOD::Vertex*, std::vector<VxTrackAtVertex> > > Trk::BeamspotVertexPreProcessor::m_allTracksVector
private

Definition at line 132 of file BeamspotVertexPreProcessor.h.

◆ m_beamSpotKey

SG::ReadCondHandleKey<InDet::BeamSpotData> Trk::BeamspotVertexPreProcessor::m_beamSpotKey
private
Initial value:
{
this, "BeamSpotKey", "BeamSpotData", "SG key for beam spot" }

Definition at line 112 of file BeamspotVertexPreProcessor.h.

◆ m_BSScalingFactor

DoubleProperty Trk::BeamspotVertexPreProcessor::m_BSScalingFactor
private
Initial value:
{this, "BeamspotScalingFactor", 1.,
"scaling factor on beasmpot width"}

Definition at line 152 of file BeamspotVertexPreProcessor.h.

◆ m_BSTrackSelector

ToolHandle<InDet::IInDetTrackSelectionTool> Trk::BeamspotVertexPreProcessor::m_BSTrackSelector
private
Initial value:
{
this, "BSConstraintTrackSelector", "",
"new track selector tool for tracks to be used with beam-spot constraint"}

Definition at line 102 of file BeamspotVertexPreProcessor.h.

◆ m_constraintMode

UnsignedIntegerProperty Trk::BeamspotVertexPreProcessor::m_constraintMode {this, "ConstraintMode", 0}
private

Definition at line 130 of file BeamspotVertexPreProcessor.h.

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_doAssociatedToPVSelection

BooleanProperty Trk::BeamspotVertexPreProcessor::m_doAssociatedToPVSelection
private
Initial value:
{
this, "DoAssociatedToPVSelection", true,
"the selection mechanism that only use the tracks associated to PV"}

Definition at line 126 of file BeamspotVertexPreProcessor.h.

◆ m_doBeamspotConstraint

BooleanProperty Trk::BeamspotVertexPreProcessor::m_doBeamspotConstraint
private
Initial value:
{this, "DoBSConstraint", true,
"Constrain tracks to the beamspot (x,y) position"}

Definition at line 134 of file BeamspotVertexPreProcessor.h.

◆ m_doBSTrackSelection

BooleanProperty Trk::BeamspotVertexPreProcessor::m_doBSTrackSelection
private
Initial value:
{this, "DoBSTrackSelection", false,
"the selection mechanism which is based on cutting the perigee parameters, pt, etc."}

Definition at line 124 of file BeamspotVertexPreProcessor.h.

◆ m_doFullVertexConstraint

BooleanProperty Trk::BeamspotVertexPreProcessor::m_doFullVertexConstraint
private
Initial value:
{this, "DoFullVertex", false,
"Full 3D vertex constraint. Note DoPVConstraint needs to be set to true to use this option. If DoBSConstraint vertex position will be constrained to the BS"}

Definition at line 138 of file BeamspotVertexPreProcessor.h.

◆ m_doNormalRefit

BooleanProperty Trk::BeamspotVertexPreProcessor::m_doNormalRefit
private
Initial value:
{this, "doNormalRefit", true,
"provide tracks in the case failed BS, PV and FullVertex constraints."}

Definition at line 140 of file BeamspotVertexPreProcessor.h.

◆ m_doPrimaryVertexConstraint

BooleanProperty Trk::BeamspotVertexPreProcessor::m_doPrimaryVertexConstraint
private
Initial value:
{this, "DoPVConstraint", false,
"Constrain tracks to the associated primary vertex (x,y,z) position"}

Definition at line 136 of file BeamspotVertexPreProcessor.h.

◆ m_doTrkSelection

BooleanProperty Trk::BeamspotVertexPreProcessor::m_doTrkSelection
private
Initial value:
{this, "DoTrackSelection", true,
"to activate the preprocessor track selection"}

Definition at line 122 of file BeamspotVertexPreProcessor.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extrapolator

ToolHandle<IExtrapolator> Trk::BeamspotVertexPreProcessor::m_extrapolator
private
Initial value:
{
this, "Extrapolator", "Trk::Extrapolator/AtlasExtrapolator"}

Definition at line 98 of file BeamspotVertexPreProcessor.h.

◆ m_logStream

std::ostream* Trk::IAlignTrackPreProcessor::m_logStream = nullptr
protectedinherited

logfile output stream

Definition at line 66 of file IAlignTrackPreProcessor.h.

◆ m_maxPt

DoubleProperty Trk::BeamspotVertexPreProcessor::m_maxPt
private
Initial value:
{this, "maxPt", 0.,
"Max pT range for refitting tracks"}

Definition at line 143 of file BeamspotVertexPreProcessor.h.

◆ m_minTrksInVtx

IntegerProperty Trk::BeamspotVertexPreProcessor::m_minTrksInVtx
private
Initial value:
{this, "MinTrksInVtx", 3,
"requirement to the minimal number of tracks in the vertex"}

Definition at line 157 of file BeamspotVertexPreProcessor.h.

◆ m_nFailedBSRefits

int Trk::BeamspotVertexPreProcessor::m_nFailedBSRefits = 0
private

Definition at line 163 of file BeamspotVertexPreProcessor.h.

◆ m_nFailedNormalRefits

int Trk::BeamspotVertexPreProcessor::m_nFailedNormalRefits = 0
private

Definition at line 162 of file BeamspotVertexPreProcessor.h.

◆ m_nFailedPVRefits

int Trk::BeamspotVertexPreProcessor::m_nFailedPVRefits = 0
private

Definition at line 164 of file BeamspotVertexPreProcessor.h.

◆ m_nTracks

int Trk::BeamspotVertexPreProcessor::m_nTracks = 0
private

Definition at line 160 of file BeamspotVertexPreProcessor.h.

◆ m_particleNumber

IntegerProperty Trk::BeamspotVertexPreProcessor::m_particleNumber
private
Initial value:
{this, "ParticleNumber", 3,
"type of material interaction in extrapolation, 3=pion, 0=non-interacting"}

Definition at line 120 of file BeamspotVertexPreProcessor.h.

◆ m_PVContainerName

SG::ReadHandleKey<xAOD::VertexContainer> Trk::BeamspotVertexPreProcessor::m_PVContainerName
private
Initial value:
{
this, "PVContainerName", "PrimaryVertices"}

Definition at line 115 of file BeamspotVertexPreProcessor.h.

◆ m_PVScalingFactor

DoubleProperty Trk::BeamspotVertexPreProcessor::m_PVScalingFactor
private
Initial value:
{this, "PrimaryVertexScalingFactor", 1.,
"scaling factor on primary vertex position error"}

Definition at line 154 of file BeamspotVertexPreProcessor.h.

◆ m_refitTracks

BooleanProperty Trk::BeamspotVertexPreProcessor::m_refitTracks
private
Initial value:
{this, "RefitTracks", true,
"flag to refit tracks"}

Definition at line 146 of file BeamspotVertexPreProcessor.h.

◆ m_runOutlierRemoval

BooleanProperty Trk::BeamspotVertexPreProcessor::m_runOutlierRemoval
private
Initial value:
{this, "RunOutlierRemoval", false,
"switch whether to run outlier logics or not"}

Definition at line 118 of file BeamspotVertexPreProcessor.h.

◆ m_SLTrackFitter

ToolHandle<IGlobalTrackFitter> Trk::BeamspotVertexPreProcessor::m_SLTrackFitter
private
Initial value:
{
this, "SLTrackFitter", "", "straight line track fitter"}

Definition at line 96 of file BeamspotVertexPreProcessor.h.

◆ m_storeFitMatrices

BooleanProperty Trk::BeamspotVertexPreProcessor::m_storeFitMatrices
private
Initial value:
{this, "StoreFitMatrices", true,
"flag to store derivative and covariance matrices after refit"}

Definition at line 148 of file BeamspotVertexPreProcessor.h.

◆ m_trackFitter

ToolHandle<IGlobalTrackFitter> Trk::BeamspotVertexPreProcessor::m_trackFitter
private
Initial value:
{
this, "TrackFitter", "Trk::GlobalChi2Fitter/InDetTrackFitter",
"normal track fitter"}

Definition at line 93 of file BeamspotVertexPreProcessor.h.

◆ m_trackToVertexIPEstimatorTool

ToolHandle<ITrackToVertexIPEstimator> Trk::BeamspotVertexPreProcessor::m_trackToVertexIPEstimatorTool
private
Initial value:
{
this, "TrackToVertexIPEstimatorTool", ""}

Definition at line 105 of file BeamspotVertexPreProcessor.h.

◆ m_trackTypeCounter

std::vector<int> Trk::BeamspotVertexPreProcessor::m_trackTypeCounter {}
private

Definition at line 161 of file BeamspotVertexPreProcessor.h.

◆ m_trkSelector

ToolHandle<InDet::IInDetTrackSelectionTool> Trk::BeamspotVertexPreProcessor::m_trkSelector
private
Initial value:
{
this, "TrackSelector", "", "new track selector tool"}

Definition at line 100 of file BeamspotVertexPreProcessor.h.

◆ m_useSingleFitter

BooleanProperty Trk::BeamspotVertexPreProcessor::m_useSingleFitter
private
Initial value:
{this, "UseSingleFitter", false,
"only use 1 fitter for refitting track"}

Definition at line 150 of file BeamspotVertexPreProcessor.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files:
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
Trk::y
@ y
Definition: ParamDefs.h:56
LArSamples::FitterData::fitter
const ShapeFitter * fitter
Definition: ShapeFitter.cxx:23
Trk::LocalParameters
Definition: LocalParameters.h:98
Trk::BeamspotVertexPreProcessor::m_minTrksInVtx
IntegerProperty m_minTrksInVtx
Definition: BeamspotVertexPreProcessor.h:157
Trk::AmgMatrix
AmgMatrix(3, 3) NeutralParticleParameterCalculator
Definition: NeutralParticleParameterCalculator.cxx:233
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
Trk::ParticleSwitcher::particle
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
Definition: ParticleHypothesis.h:79
Amg::VectorX
Eigen::Matrix< double, Eigen::Dynamic, 1 > VectorX
Dynamic Vector - dynamic allocation.
Definition: EventPrimitives.h:30
Amg::MatrixX
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
Definition: EventPrimitives.h:27
Trk::BeamspotVertexPreProcessor::m_refitTracks
BooleanProperty m_refitTracks
Definition: BeamspotVertexPreProcessor.h:146
Trk::BeamspotVertexPreProcessor::m_AlignVertices
DataVector< AlignVertex > m_AlignVertices
collection of AlignVertices used in FullVertex constraint option
Definition: BeamspotVertexPreProcessor.h:166
xAOD::Vertex
Vertex_v1 Vertex
Define the latest version of the vertex class.
Definition: Event/xAOD/xAODTracking/xAODTracking/Vertex.h:16
Trk::BeamspotVertexPreProcessor::isAssociatedToPV
bool isAssociatedToPV(const Track *track, const xAOD::VertexContainer *vertices)
Definition: BeamspotVertexPreProcessor.cxx:218
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
Trk::BeamspotVertexPreProcessor::m_BSScalingFactor
DoubleProperty m_BSScalingFactor
Definition: BeamspotVertexPreProcessor.h:152
Trk::Track
The ATLAS Track class.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/Track.h:73
Trk::BeamspotVertexPreProcessor::m_doTrkSelection
BooleanProperty m_doTrkSelection
Definition: BeamspotVertexPreProcessor.h:122
Trk::BeamspotVertexPreProcessor::m_trackToVertexIPEstimatorTool
ToolHandle< ITrackToVertexIPEstimator > m_trackToVertexIPEstimatorTool
Definition: BeamspotVertexPreProcessor.h:105
perp
Scalar perp() const
perp method - perpenticular length
Definition: AmgMatrixBasePlugin.h:44
Amg::Vector2D
Eigen::Matrix< double, 2, 1 > Vector2D
Definition: GeoPrimitives.h:48
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:67
index
Definition: index.py:1
Trk::ParametersT
Dummy class used to allow special convertors to be called for surfaces owned by a detector element.
Definition: EMErrorDetail.h:25
Trk::BeamspotVertexPreProcessor::m_doFullVertexConstraint
BooleanProperty m_doFullVertexConstraint
Definition: BeamspotVertexPreProcessor.h:138
Trk::AlignTrack::Unknown
@ Unknown
default type
Definition: AlignTrack.h:46
test_pyathena.pt
pt
Definition: test_pyathena.py:11
Trk::BeamspotVertexPreProcessor::provideVotFromBeamspot
const VertexOnTrack * provideVotFromBeamspot(const Track *track) const
Definition: BeamspotVertexPreProcessor.cxx:404
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
Trk::BeamspotVertexPreProcessor::provideVtxBeamspot
void provideVtxBeamspot(const AlignVertex *b, AmgSymMatrix(3) *q, Amg::Vector3D *v) const
Definition: BeamspotVertexPreProcessor.cxx:491
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
Trk::z0
@ z0
Definition: ParamDefs.h:64
AthCommonMsg< AlgTool >::msgLvl
bool msgLvl(const MSG::Level lvl) const
Definition: AthCommonMsg.h:30
xAOD::Vertex_v1::position
const Amg::Vector3D & position() const
Returns the 3-pos.
Trk::IAlignTrackPreProcessor::m_logStream
std::ostream * m_logStream
logfile output stream
Definition: IAlignTrackPreProcessor.h:66
Trk::BeamspotVertexPreProcessor::m_trkSelector
ToolHandle< InDet::IInDetTrackSelectionTool > m_trkSelector
Definition: BeamspotVertexPreProcessor.h:100
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
Trk::AlignTrack::AlignTrackType
AlignTrackType
Definition: AlignTrack.h:45
Trk::AlignTrack::isSLTrack
bool isSLTrack() const
method to determine whether a straight line track or not
Definition: AlignTrack.cxx:263
Trk::BeamspotVertexPreProcessor::m_allTracksVector
std::vector< std::pair< const xAOD::Vertex *, std::vector< VxTrackAtVertex > > > m_allTracksVector
Definition: BeamspotVertexPreProcessor.h:132
Trk::BeamspotVertexPreProcessor::doConstraintRefit
const Track * doConstraintRefit(ToolHandle< IGlobalTrackFitter > &fitter, const Track *track, const VertexOnTrack *vot, const ParticleHypothesis &particleHypothesis) const
Definition: BeamspotVertexPreProcessor.cxx:518
Trk::Perigee
ParametersT< TrackParametersDim, Charged, PerigeeSurface > Perigee
Definition: Tracking/TrkEvent/TrkParameters/TrkParameters/TrackParameters.h:33
LArSamples::ShapeFitter::fit
bool fit(const LArSamples::AbsShape &data, const AbsShape &reference, double &k, double &deltaT, double &chi2, const ScaledErrorData *sed=0) const
Definition: ShapeFitter.cxx:32
xAOD::Vertex_v1::vertexType
VxType::VertexType vertexType() const
The type of the vertex.
Trk::BeamspotVertexPreProcessor::m_runOutlierRemoval
BooleanProperty m_runOutlierRemoval
Definition: BeamspotVertexPreProcessor.h:118
Trk::BeamspotVertexPreProcessor::m_doPrimaryVertexConstraint
BooleanProperty m_doPrimaryVertexConstraint
Definition: BeamspotVertexPreProcessor.h:136
python.CaloAddPedShiftConfig.type
type
Definition: CaloAddPedShiftConfig.py:42
Trk::BeamspotVertexPreProcessor::provideVotFromVertex
const VertexOnTrack * provideVotFromVertex(const Track *track, const xAOD::Vertex *&vtx) const
Definition: BeamspotVertexPreProcessor.cxx:297
similarity
Matrix< Scalar, OtherDerived::RowsAtCompileTime, OtherDerived::RowsAtCompileTime > similarity(const MatrixBase< OtherDerived > &m) const
similarity method : yields ms = m*s*m^T
Definition: AmgMatrixBasePlugin.h:133
Trk::DefinedParameter
std::pair< double, ParamDefs > DefinedParameter
Definition: DefinedParameter.h:27
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
Trk::BeamspotVertexPreProcessor::m_nFailedPVRefits
int m_nFailedPVRefits
Definition: BeamspotVertexPreProcessor.h:164
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:29
Trk::BeamspotVertexPreProcessor::m_alignModuleTool
PublicToolHandle< IAlignModuleTool > m_alignModuleTool
Pointer to AlignModuleTool.
Definition: BeamspotVertexPreProcessor.h:109
Trk::AmgSymMatrix
AmgSymMatrix(5) &GXFTrackState
Definition: GXFTrackState.h:156
Trk::ParticleHypothesis
ParticleHypothesis
Definition: ParticleHypothesis.h:28
AlignModule
AlignModule is a grouping of TrkDetElementBase objects, grouped according to the type of alignment,...
python.PyAthena.module
module
Definition: PyAthena.py:131
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
Trk::BeamspotVertexPreProcessor::m_extrapolator
ToolHandle< IExtrapolator > m_extrapolator
Definition: BeamspotVertexPreProcessor.h:98
Trk::BeamspotVertexPreProcessor::m_maxPt
DoubleProperty m_maxPt
Definition: BeamspotVertexPreProcessor.h:143
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:209
AthCommonDataStore
Definition: AthCommonDataStore.h:52
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
ParticleGun_EoverP_Config.momentum
momentum
Definition: ParticleGun_EoverP_Config.py:63
Trk::AlignTrack::BeamspotConstrained
@ BeamspotConstrained
refitted with beamspot constraint
Definition: AlignTrack.h:49
Trk::BeamspotVertexPreProcessor::m_beamSpotKey
SG::ReadCondHandleKey< InDet::BeamSpotData > m_beamSpotKey
Definition: BeamspotVertexPreProcessor.h:112
lumiFormat.i
int i
Definition: lumiFormat.py:85
Trk::theta
@ theta
Definition: ParamDefs.h:66
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
Definition: AthCommonDataStore.h:145
AmgVector
AmgVector(4) T2BSTrackFilterTool
Definition: T2BSTrackFilterTool.cxx:114
Trk::BeamspotVertexPreProcessor::m_trackTypeCounter
std::vector< int > m_trackTypeCounter
Definition: BeamspotVertexPreProcessor.h:161
xAOD::VxType::PriVtx
@ PriVtx
Primary vertex.
Definition: TrackingPrimitives.h:572
test_pyathena.parent
parent
Definition: test_pyathena.py:15
Trk::BeamspotVertexPreProcessor::isAssociatedToVertex
bool isAssociatedToVertex(const Track *track, const xAOD::Vertex *vertex)
Definition: BeamspotVertexPreProcessor.cxx:232
Trk::BeamspotVertexPreProcessor::prepareAllTracksVector
void prepareAllTracksVector()
Definition: BeamspotVertexPreProcessor.cxx:248
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
Trk::BeamspotVertexPreProcessor::m_PVContainerName
SG::ReadHandleKey< xAOD::VertexContainer > m_PVContainerName
Definition: BeamspotVertexPreProcessor.h:115
Trk::BeamspotVertexPreProcessor::m_nFailedBSRefits
int m_nFailedBSRefits
Definition: BeamspotVertexPreProcessor.h:163
drawFromPickle.tan
tan
Definition: drawFromPickle.py:36
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
DeMoUpdate.tmp
string tmp
Definition: DeMoUpdate.py:1167
Trk::BeamspotVertexPreProcessor::m_doAssociatedToPVSelection
BooleanProperty m_doAssociatedToPVSelection
Definition: BeamspotVertexPreProcessor.h:126
Trk::BeamspotVertexPreProcessor::m_particleNumber
IntegerProperty m_particleNumber
Definition: BeamspotVertexPreProcessor.h:120
Trk::BeamspotVertexPreProcessor::m_nFailedNormalRefits
int m_nFailedNormalRefits
Definition: BeamspotVertexPreProcessor.h:162
DataVector< AlignPar >
ReadFromCoolCompare.os
os
Definition: ReadFromCoolCompare.py:231
AthAlgTool::AthAlgTool
AthAlgTool()
Default constructor:
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
xAOD::VxType::PileUp
@ PileUp
Pile-up vertex.
Definition: TrackingPrimitives.h:574
Trk::SurfaceType::Perigee
@ Perigee
Amg
Definition of ATLAS Math & Geometry primitives (Amg)
Definition: AmgStringHelpers.h:19
Trk::BeamspotVertexPreProcessor::selectVertices
bool selectVertices(const xAOD::Vertex *vtx) const
Definition: BeamspotVertexPreProcessor.cxx:178
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
python.EventInfoMgtInit.release
release
Definition: EventInfoMgtInit.py:23
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
Trk::d0
@ d0
Definition: ParamDefs.h:63
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:76
Trk::TrackParameters
ParametersBase< TrackParametersDim, Charged > TrackParameters
Definition: Tracking/TrkEvent/TrkParameters/TrkParameters/TrackParameters.h:27
Trk::BeamspotVertexPreProcessor::m_useSingleFitter
BooleanProperty m_useSingleFitter
Definition: BeamspotVertexPreProcessor.h:150
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
weights
Definition: herwig7_interface.h:38
Trk::BeamspotVertexPreProcessor::m_doNormalRefit
BooleanProperty m_doNormalRefit
Definition: BeamspotVertexPreProcessor.h:140
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
Trk::MeasurementBaseType::VertexOnTrack
@ VertexOnTrack
Definition: MeasurementBase.h:52
Trk::BeamspotVertexPreProcessor::findVertexCandidate
const xAOD::Vertex * findVertexCandidate(const Track *track) const
Definition: BeamspotVertexPreProcessor.cxx:275
Trk::BeamspotVertexPreProcessor::m_storeFitMatrices
BooleanProperty m_storeFitMatrices
Definition: BeamspotVertexPreProcessor.h:148
CxxUtils::to
CONT to(RANGE &&r)
Definition: ranges.h:39
Trk::BeamspotVertexPreProcessor::m_constraintMode
UnsignedIntegerProperty m_constraintMode
Definition: BeamspotVertexPreProcessor.h:130
xAOD::Vertex_v1::numberDoF
float numberDoF() const
Returns the number of degrees of freedom of the vertex fit as float.
Trk::vertex
@ vertex
Definition: MeasurementType.h:21
DeMoScan.index
string index
Definition: DeMoScan.py:362
python.testIfMatch.matrix
matrix
Definition: testIfMatch.py:65
calibdata.delete
list delete
Definition: calibdata.py:45
a
TList * a
Definition: liststreamerinfos.cxx:10
Trk::BeamspotVertexPreProcessor::m_doBeamspotConstraint
BooleanProperty m_doBeamspotConstraint
Definition: BeamspotVertexPreProcessor.h:134
h
xAOD::Vertex_v1
Class describing a Vertex.
Definition: Vertex_v1.h:42
Trk::AlignTrack::Original
@ Original
not refitted, just copy constructed from original Track
Definition: AlignTrack.h:47
Trk::BeamspotVertexPreProcessor::m_trackFitter
ToolHandle< IGlobalTrackFitter > m_trackFitter
Definition: BeamspotVertexPreProcessor.h:93
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
Trk::AlignTrack::NormalRefitted
@ NormalRefitted
normally refitted, without adding any pseudo-measurement
Definition: AlignTrack.h:48
DEBUG
#define DEBUG
Definition: page_access.h:11
F
#define F(x, y, z)
Definition: MD5.cxx:112
AthCommonMsg< AlgTool >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
Trk::qOverP
@ qOverP
perigee
Definition: ParamDefs.h:67
if
if(febId1==febId2)
Definition: LArRodBlockPhysicsV0.cxx:567
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:629
Trk::BeamspotVertexPreProcessor::doBeamspotConstraintTrackSelection
bool doBeamspotConstraintTrackSelection(const Track *track)
Definition: BeamspotVertexPreProcessor.cxx:556
Trk::CompareTwoTracks
Definition: BeamspotVertexPreProcessor.h:173
Trk::AlignTrack::dumpLessTrackInfo
static void dumpLessTrackInfo(const Track &track, MsgStream &msg)
dump less track information
Definition: AlignTrack.cxx:276
Track
Definition: TriggerChamberClusterOnTrackCreator.h:21
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:801
xAOD::track
@ track
Definition: TrackingPrimitives.h:513
python.Constants.VERBOSE
int VERBOSE
Definition: Control/AthenaCommon/python/Constants.py:13
drawFromPickle.sin
sin
Definition: drawFromPickle.py:36
Trk::AlignTrack::NTrackTypes
@ NTrackTypes
total number of track types
Definition: AlignTrack.h:53
xAOD::Vertex_v1::vxTrackAtVertex
std::vector< Trk::VxTrackAtVertex > & vxTrackAtVertex()
Non-const access to the VxTrackAtVertex vector.
Definition: Vertex_v1.cxx:181
Trk::x
@ x
Definition: ParamDefs.h:55
Trk::AlignTrack::VertexConstrained
@ VertexConstrained
refitted with vertex constraint
Definition: AlignTrack.h:50
Trk::BeamspotVertexPreProcessor::m_nTracks
int m_nTracks
Definition: BeamspotVertexPreProcessor.h:160
AlignVertex
AlignVertex is a simple structure to store objects belonging to a vertex. Contains a pointer to the o...
Trk::BeamspotVertexPreProcessor::m_PVScalingFactor
DoubleProperty m_PVScalingFactor
Definition: BeamspotVertexPreProcessor.h:154
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
Trk::BeamspotVertexPreProcessor::m_SLTrackFitter
ToolHandle< IGlobalTrackFitter > m_SLTrackFitter
Definition: BeamspotVertexPreProcessor.h:96
Trk::BeamspotVertexPreProcessor::m_BSTrackSelector
ToolHandle< InDet::IInDetTrackSelectionTool > m_BSTrackSelector
Definition: BeamspotVertexPreProcessor.h:102
DataVector::empty
bool empty() const noexcept
Returns true if the collection is empty.
Trk::BeamspotVertexPreProcessor::doTrackRefit
AlignTrack * doTrackRefit(const Track *track)
Definition: BeamspotVertexPreProcessor.cxx:614
Trk::v
@ v
Definition: ParamDefs.h:78
fitman.k
k
Definition: fitman.py:528
AlignTrack
AlignTrack is a generalization of a Trk::Track, used as the basic object to contain track information...
Trk::BeamspotVertexPreProcessor::m_doBSTrackSelection
BooleanProperty m_doBSTrackSelection
Definition: BeamspotVertexPreProcessor.h:124
Trk::BeamspotVertexPreProcessor::selectUpdatedVertices
bool selectUpdatedVertices(const xAOD::Vertex *updatedVtx) const
Definition: BeamspotVertexPreProcessor.cxx:196