![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
ATLAS Offline Software
|
#include <BeamspotVertexPreProcessor.h>
|
| BeamspotVertexPreProcessor (const std::string &type, const std::string &name, const IInterface *parent) |
|
virtual | ~BeamspotVertexPreProcessor () |
|
virtual StatusCode | initialize () |
|
virtual StatusCode | finalize () |
|
virtual DataVector< Track > * | processTrackCollection (const DataVector< Track > *trks) |
| Main processing of track collection. More...
|
|
void | accumulateVTX (AlignTrack *alignTrack) |
| methods added for the full VTX fit: More...
|
|
void | solveVTX () |
|
virtual void | printSummary () |
| 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 > &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 |
|
|
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::Vertex * | findVertexCandidate (const Track *track) const |
|
const VertexOnTrack * | provideVotFromVertex (const Track *track, const xAOD::Vertex *&vtx) const |
|
const VertexOnTrack * | provideVotFromBeamspot (const Track *track) const |
|
void | provideVtxBeamspot (const AlignVertex *b, AmgSymMatrix(3) *q, Amg::Vector3D *v) const |
|
const Track * | doConstraintRefit (ToolHandle< IGlobalTrackFitter > &fitter, const Track *track, const VertexOnTrack *vot, const ParticleHypothesis &particleHypothesis) const |
|
bool | doBeamspotConstraintTrackSelection (const Track *track) |
|
AlignTrack * | doTrackRefit (const Track *track) |
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &) |
| specialization for handling Gaudi::Property<SG::VarHandleKey> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &) |
| specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &) |
| specialization for handling Gaudi::Property<SG::VarHandleBase> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &) |
| specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
|
|
◆ StoreGateSvc_t
◆ BeamspotVertexPreProcessor()
Trk::BeamspotVertexPreProcessor::BeamspotVertexPreProcessor |
( |
const std::string & |
type, |
|
|
const std::string & |
name, |
|
|
const IInterface * |
parent |
|
) |
| |
Definition at line 47 of file BeamspotVertexPreProcessor.cxx.
83 declareInterface<IAlignTrackPreProcessor>(
this);
101 declareProperty(
"DoFullVertex",
m_doFullVertexConstraint ,
"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" );
111 std::vector<std::string> defaultInterestedVertexContainers;
112 defaultInterestedVertexContainers.emplace_back(
"PrimaryVertices");
◆ ~BeamspotVertexPreProcessor()
Trk::BeamspotVertexPreProcessor::~BeamspotVertexPreProcessor |
( |
| ) |
|
|
virtualdefault |
◆ accumulateVTX()
void Trk::BeamspotVertexPreProcessor::accumulateVTX |
( |
AlignTrack * |
| ) |
|
|
virtual |
methods added for the full VTX fit:
Reimplemented from Trk::IAlignTrackPreProcessor.
Definition at line 953 of file BeamspotVertexPreProcessor.cxx.
961 ATH_MSG_DEBUG(
"This alignTrack is not associated to any vertex -> return. ");
966 const Amg::MatrixX * ptrWeights = alignTrack->weightMatrix();
967 const Amg::MatrixX * ptrWeightsFD = alignTrack->weightMatrixFirstDeriv();
968 const Amg::VectorX * ptrResiduals = alignTrack->residualVector();
969 const std::vector<AlignModuleDerivatives> * ptrDerivs = alignTrack->derivatives();
972 if (!ptrWeights || !ptrWeightsFD || !ptrResiduals || !ptrDerivs) {
973 msg(MSG::ERROR)<<
"something missing from alignTrack!"<<
endmsg;
974 if (!ptrWeights)
msg(MSG::ERROR)<<
"no weights!"<<
endmsg;
975 if (!ptrWeightsFD)
msg(MSG::ERROR)<<
"no weights for first deriv!"<<
endmsg;
976 if (!ptrResiduals)
msg(MSG::ERROR)<<
"no residuals!"<<
endmsg;
977 if (!ptrDerivs)
msg(MSG::ERROR)<<
"no derivatives!"<<
endmsg;
983 std::vector<AlignModuleDerivatives> derivatives = *ptrDerivs;
992 ATH_MSG_DEBUG(
"accumulateVTX: The derivative vector size is " << derivatives.size() );
996 std::vector<Amg::VectorX*> allDerivatives[3];
999 const int WSize(weights.cols());
1001 std::vector<AlignModuleVertexDerivatives> derivX;
1003 for ( ; derivIt!=derivIt_end ; ++derivIt) {
1012 std::vector<Amg::VectorX>& deriv_vec = derivIt->second;
1013 ATH_MSG_VERBOSE(
"accumulateVTX: The deriv_vec size is " << deriv_vec.size() );
1015 int nModPars = alignPars->
size();
1016 if ((nModPars+3) != (
int)deriv_vec.size() ) {
1017 ATH_MSG_ERROR(
"accumulateVTX: Derivatives w.r.t. the vertex seem to be missing");
1020 for (
int i=0;
i<3;
i++) {
1021 allDerivatives[
i].push_back(&deriv_vec[nModPars+
i]);
1022 for (
int j=0;j<WSize;j++) {
1023 F(
i,j) = deriv_vec[nModPars+
i][j];
1031 ATH_MSG_ERROR(
"accumulateVTX: Derivatives do not have a valid pointer to the module.");
1038 derivIt = derivatives.begin();
1039 for ( ; derivIt!=derivIt_end ; ++derivIt) {
1047 std::vector<Amg::VectorX>& deriv_vec = derivIt->second;
1048 std::vector<Amg::VectorX> drdaWF;
1050 << deriv_vec.size());
1052 int nModPars = alignPars->
size();
1053 if ((nModPars + 3) != (
int)deriv_vec.size()) {
1055 "accumulateVTX: Derivatives w.r.t. the vertex seem to be missing");
1058 drdaWF.reserve(nModPars);
1059 for (
int i = 0;
i < nModPars;
i++) {
1060 drdaWF.emplace_back(2.0 * (WF)*deriv_vec[
i]);
1062 ATH_MSG_DEBUG(
"accumulateVTX: derivX incremented by: " << drdaWF);
1064 derivX.emplace_back(
module,std::move(drdaWF));
1067 ATH_MSG_ERROR(
"accumulateVTX: Derivatives do not have a valid pointer to the module.");
1075 int nmodules = allDerivatives[0].size();
1077 for(
int ii=0; ii<3; ++ii ) {
1078 VTXDerivatives[ii] = (*(allDerivatives[ii])[0]);
1079 for(
int jj=1; jj<nmodules; ++jj ) {
1080 VTXDerivatives[ii] += (*(allDerivatives[ii])[jj]);
1088 Amg::
VectorX RHM= weightsFirstDeriv * residuals;
1091 for (
int ipar=0;ipar<3;ipar++) {
1095 Amg::MatrixX derivativesT = (VTXDerivatives[ipar]).transpose();
1096 ATH_MSG_DEBUG(
"derivativesT (size "<<derivativesT.cols()<<
"): "<<derivativesT);
1099 vtxV[ipar] = tempV(0,0);
1101 for (
int jpar=ipar;jpar<3;jpar++) {
1107 vtxM(ipar,jpar) = tempM(0,0);
1115 alignVertex->incrementVector(vtxV);
1116 alignVertex->incrementMatrix(vtxM);
1118 alignVertex->addDerivatives(&derivX);
◆ declareGaudiProperty() [1/4]
specialization for handling Gaudi::Property<SG::VarHandleKeyArray>
Definition at line 170 of file AthCommonDataStore.h.
175 hndl.documentation());
◆ declareGaudiProperty() [2/4]
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h.
161 hndl.documentation());
◆ declareGaudiProperty() [3/4]
specialization for handling Gaudi::Property<SG::VarHandleBase>
Definition at line 184 of file AthCommonDataStore.h.
189 hndl.documentation());
◆ declareGaudiProperty() [4/4]
◆ declareProperty() [1/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation 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.
250 this->declare(hndl.
vhKey());
251 hndl.
vhKey().setOwner(
this);
◆ declareProperty() [2/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation 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.
◆ declareProperty() [3/6]
◆ declareProperty() [4/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation 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.
◆ declareProperty() [5/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation 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.
◆ declareProperty() [6/6]
◆ detStore()
◆ doBeamspotConstraintTrackSelection()
bool Trk::BeamspotVertexPreProcessor::doBeamspotConstraintTrackSelection |
( |
const Track * |
track | ) |
|
|
private |
Definition at line 676 of file BeamspotVertexPreProcessor.cxx.
680 bool haveVertex =
false;
691 ATH_MSG_DEBUG(
"Primary vertex collection for this event has "<<vertices->
size()<<
" vertices");
692 if (vertices->
size()<2){
693 ATH_MSG_DEBUG(
"Only Dummy vertex present, no Primary vertices.");
700 ATH_MSG_DEBUG(
"Could not retrieve primary vertex collection from the StoreGate");
715 const double qoverP = perigee->parameters()[
Trk::qOverP] * 1000.;
723 ATH_MSG_DEBUG(
"this track passes the beamspot track selection, will do beamspot constraint on it ");
◆ doConstraintRefit()
Definition at line 637 of file BeamspotVertexPreProcessor.cxx.
643 const EventContext& ctx = Gaudi::Hive::currentContext();
644 const Track* newTrack =
nullptr;
648 std::vector<const MeasurementBase *> measurementCollection;
649 measurementCollection.push_back(vot);
653 for ( ; imeas != imeas_end ; ++imeas) measurementCollection.push_back(*imeas);
657 const PerigeeSurface& surface=vot->associatedSurface();
658 ATH_MSG_DEBUG(
" Track reference surface will be: " << surface);
662 newTrack = (
fitter->
fit(ctx, measurementCollection,
667 measurementCollection, *(
track->trackParameters()->front()),
◆ doTrackRefit()
Definition at line 730 of file BeamspotVertexPreProcessor.cxx.
733 const Track* newTrack =
nullptr;
745 IGlobalTrackFitter::AlignmentCache alignCache;
751 if( !vot )
ATH_MSG_INFO(
"VoT not found for this track! ");
752 if( !vtx )
ATH_MSG_INFO(
"VTX pointer not found for this track! ");
759 msg(MSG::ERROR)<<
"VertexConstraint track refit failed! "<<
endmsg;
772 msg(MSG::ERROR)<<
"BSConstraint track refit failed! "<<
endmsg;
804 msg(MSG::ERROR)<<
"Normal track refit failed! "<<
endmsg;
815 alignTrack->setOriginalTrack(
track);
817 alignTrack->setType(
type);
833 alignTrack->setFullCovarianceMatrix(alignCache.m_fullCovarianceMatrix);
834 alignTrack->setDerivativeMatrix(alignCache.m_derivMatrix);
842 if( (ivtx->originalVertex())==vtx ) {
852 ATH_MSG_DEBUG(
" The Beam Spot constraint will be added to the vertex.." );
856 (qtemp)(2,2) = 1000000.0;
857 avtx->setConstraint( &qtemp, &vtemp);
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ extraDeps_update_handler()
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 |
◆ finalize()
StatusCode Trk::BeamspotVertexPreProcessor::finalize |
( |
| ) |
|
|
virtual |
◆ findVertexCandidate()
Definition at line 371 of file BeamspotVertexPreProcessor.cxx.
376 std::vector< std::pair< const xAOD::Vertex*, std::vector<VxTrackAtVertex> > >::const_iterator iter =
m_allTracksVector.begin();
377 std::vector< std::pair< const xAOD::Vertex*, std::vector<VxTrackAtVertex> > >::const_iterator iterEnd =
m_allTracksVector.end();
379 for(; iter != iterEnd; ++iter){
380 std::pair< const xAOD::Vertex*, std::vector<VxTrackAtVertex> > thisPair = *iter;
389 if(findResult != iVxTrackEnd){
391 findVxCandidate = thisPair.first;
400 return findVxCandidate;
◆ initialize()
StatusCode Trk::BeamspotVertexPreProcessor::initialize |
( |
| ) |
|
|
virtual |
Definition at line 124 of file BeamspotVertexPreProcessor.cxx.
126 ATH_MSG_INFO(
"BeamspotVertexPreProcessor::initialize()");
140 return StatusCode::FAILURE;
148 return StatusCode::FAILURE;
156 return StatusCode::FAILURE;
164 return StatusCode::FAILURE;
175 msg(
MSG::FATAL) <<
"Requested BeamSpot track selection but Track Selector not configured"<<
endmsg;
176 return StatusCode::FAILURE;
180 return StatusCode::FAILURE;
189 return StatusCode::FAILURE;
195 return StatusCode::FAILURE;
200 ATH_MSG_INFO(
"************************************************************************");
202 ATH_MSG_INFO(
"* You have requested the Full Vertex Constraint option. *");
203 ATH_MSG_INFO(
"* It is your duty to assure that all detector elements *");
204 ATH_MSG_INFO(
"* used for track fitting are also loaded in the alignment framework!!! *");
206 ATH_MSG_INFO(
"* Also make sure the accurate track covariance matrix *");
207 ATH_MSG_INFO(
"* is returned by the GlobalChi2Fitter! *");
209 ATH_MSG_INFO(
"************************************************************************");
213 return StatusCode::SUCCESS;
◆ inputHandles()
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 |
◆ isAssociatedToPV()
◆ isAssociatedToVertex()
Definition at line 310 of file BeamspotVertexPreProcessor.cxx.
315 std::vector<VxTrackAtVertex > vertexTracks =
vertex->vxTrackAtVertex();
318 std::vector<VxTrackAtVertex >::const_iterator iVxTrackBegin = vertexTracks.begin();
319 std::vector<VxTrackAtVertex >::const_iterator iVxTrackEnd = vertexTracks.end();
321 std::vector<VxTrackAtVertex>::const_iterator findResult = std::find_if(iVxTrackBegin, iVxTrackEnd, thisCompare);
323 return findResult != iVxTrackEnd;
◆ msg() [1/2]
◆ msg() [2/2]
◆ msgLvl()
◆ outputHandles()
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 327 of file BeamspotVertexPreProcessor.cxx.
336 for(; strs_iter != strs_end; ++strs_iter){
338 if (
evtStore()->contains<xAOD::VertexContainer>(*strs_iter)) {
340 ATH_MSG_DEBUG (
"Could not retrieve xAOD vertex container with key "+(*strs_iter));
348 for(; vtxIter != vtxEnd; ++vtxIter){
350 ATH_MSG_DEBUG(
"this vertex did not pass the primary vertex selection...");
354 if ((*vtxIter)->vxTrackAtVertexAvailable()){
356 std::vector<VxTrackAtVertex> vtxTracks = (*vtxIter)->vxTrackAtVertex();
360 ATH_MSG_DEBUG(
"this vertex did not pass the vxTrackAtVertexAvailable() call...");
◆ printSummary()
void Trk::BeamspotVertexPreProcessor::printSummary |
( |
| ) |
|
|
virtual |
◆ processTrackCollection()
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 879 of file BeamspotVertexPreProcessor.cxx.
881 ATH_MSG_DEBUG(
"BeamspotVertexPreProcessor::processTrackCollection()");
883 if( !tracks || (tracks->empty()) )
903 for ( ; itr != itr_end; ++itr, ++
index) {
907 if (not
track)
continue;
922 alignTrack->setTrackSummary( std::make_unique<Trk::TrackSummary> (*
track->trackSummary()) );
924 if( !(alignTrack->getVtx()) ) {
933 ATH_MSG_DEBUG(
"No Track refit for track " <<
index <<
" --> building new aligntrack");
935 alignTrack->setOriginalTrack(
track);
939 if (alignTrack) newTrks->
push_back(alignTrack);
942 ATH_MSG_INFO(
"Processing of input track collection completed (size: " << tracks->size() <<
"). Size of the alignTrack collection: " << newTrks->
size() );
944 if (newTrks->
empty()) {
◆ provideVotFromBeamspot()
Definition at line 517 of file BeamspotVertexPreProcessor.cxx.
519 const EventContext& ctx = Gaudi::Hive::currentContext();
524 float beamSpotX = bpos.x();
525 float beamSpotY = bpos.y();
526 float beamSpotZ = bpos.z();
527 float beamTiltX = beamSpotHandle->beamTilt(0);
528 float beamTiltY = beamSpotHandle->beamTilt(1);
537 float beamX = beamSpotX +
tan(beamTiltX) * (
z0-beamSpotZ);
538 float beamY = beamSpotY +
tan(beamTiltY) * (
z0-beamSpotZ);
540 ATH_MSG_DEBUG(
"constructing beam point (x,y,z) = ( "<<beamX<<
" , "<<beamY<<
" , "<<
z0<<
" )");
541 std::optional<PerigeeSurface> surface = std::nullopt;
543 LocalParameters beamSpotParameters;
547 beamSpotCov.setZero();
548 beamSpotCov(0,0) = beamSigmaX * beamSigmaX;
549 beamSpotCov(1,1) = beamSigmaY * beamSigmaY;
554 surface.emplace(globPos);
558 beamSpotParameters = LocalParameters(Par0);
561 const Perigee* perigee =
nullptr;
562 std::unique_ptr<const Trk::TrackParameters>
tmp =
566 perigee =
static_cast<const Perigee*
>(
tmp.release());
570 const Perigee * trackPerigee =
track->perigeeParameters();
571 if ( trackPerigee && trackPerigee->associatedSurface() == *surface )
572 perigee = trackPerigee->clone();
581 Eigen::Matrix<double,1,2> jacobian;
584 double ptInv = 1./perigee->momentum().perp();
585 jacobian(0,0) = -ptInv * perigee->momentum().y();
586 jacobian(0,1) = ptInv * perigee->momentum().x();
589 errorMatrix =
Amg::MatrixX( jacobian*(beamSpotCov*jacobian.transpose()));
590 if( errorMatrix.cols() != 1 )
596 std::move(errorMatrix),
602 ATH_MSG_DEBUG(
" the VertexOnTrack objects created from BeamSpot are " << *vot);
◆ provideVotFromVertex()
vertex as perigeeSurface
Definition at line 404 of file BeamspotVertexPreProcessor.cxx.
406 const EventContext& ctx = Gaudi::Hive::currentContext();
415 if (!(
nullptr==findVtx) ) {
434 ATH_MSG_DEBUG(
" updated Vertex by KalmanVertexUpdator: "<<updatedVtx);
439 const PerigeeSurface surface(globPos);
440 const Perigee* perigee =
nullptr;
441 std::unique_ptr<const Trk::TrackParameters>
tmp =
445 perigee =
static_cast<const Perigee*
> (
tmp.release());
448 const Perigee * trackPerigee =
track->perigeeParameters();
449 if ( trackPerigee && trackPerigee->associatedSurface() == surface )
450 perigee = trackPerigee->clone();
455 if (updatedVtx!= tmpVtx)
delete updatedVtx;
468 Jacobian(0,0) = -ptInv*perigee->
momentum().
y();
469 Jacobian(0,1) = ptInv*perigee->
momentum().
x();
474 AmgSymMatrix(3) vtxCov = updatedVtx->covariancePosition();
484 tmpCov(0,0) = 1.
e-10 ;
485 tmpCov(1,1) = 1.
e-10;
486 tmpCov(2,2) = 1.
e-10;
489 errorMatrix =
Amg::MatrixX( vtxCov.similarity(Jacobian) );
497 if (tmpVtx != updatedVtx){
507 vot =
new VertexOnTrack(std::move(localParams), std::move(errorMatrix), surface);
508 ATH_MSG_DEBUG(
"the VertexOnTrack created from vertex: "<<*vot);
◆ provideVtxBeamspot()
Definition at line 609 of file BeamspotVertexPreProcessor.cxx.
614 float beamSpotX = bpos.x();
615 float beamSpotY = bpos.y();
616 float beamSpotZ = bpos.z();
617 float beamTiltX = beamSpotHandle->beamTilt(0);
618 float beamTiltY = beamSpotHandle->beamTilt(1);
624 float z0 =
b->originalPosition()->z();
625 (*v)(0) = beamSpotX +
tan(beamTiltX) * (
z0-beamSpotZ);
626 (*v)(1) = beamSpotY +
tan(beamTiltY) * (
z0-beamSpotZ);
628 (*q)(0,0) = beamSigmaX*beamSigmaX;
629 (*q)(1,1) = beamSigmaY*beamSigmaY;
630 (*q)(2,2) = beamSigmaZ*beamSigmaZ;
632 ATH_MSG_DEBUG(
"VTX constraint point (x,y,z) = ( "<< (*
v)[0] <<
" , "<< (*
v)[1] <<
" , "<< (*
v)[2] <<
" )");
633 ATH_MSG_DEBUG(
"VTX constraint size (x,y,z) = ( "<< beamSigmaX <<
" , "<< beamSigmaY <<
" , "<< beamSigmaZ <<
" )");
◆ renounce()
◆ renounceArray()
◆ selectUpdatedVertices()
bool Trk::BeamspotVertexPreProcessor::selectUpdatedVertices |
( |
const xAOD::Vertex * |
updatedVtx | ) |
const |
|
private |
Definition at line 272 of file BeamspotVertexPreProcessor.cxx.
274 if (vtx->numberDoF() <= 0){
275 ATH_MSG_WARNING(
" VERY STRANGE!!! , the updated vertex has been rejected as non-positive DoF: "<< vtx->numberDoF() <<
" the type of this vertex:"<< vtx->vertexType() );
280 ATH_MSG_DEBUG(
" the updated vertex has been rejected as vxTrackAtVertex size: "<< vtx->vxTrackAtVertex().size() );
284 if ((vtx->covariancePosition())(0,0)<=0 ||
285 (vtx->covariancePosition())(1,1)<=0 ||
286 (vtx->covariancePosition())(2,2)<=0){
287 ATH_MSG_WARNING(
" VERY STRANGE!!! , this updated vertex has been rejected as negative diagonal error matrix ");
◆ selectVertices()
bool Trk::BeamspotVertexPreProcessor::selectVertices |
( |
const xAOD::Vertex * |
vtx | ) |
const |
|
private |
◆ setLogStream()
virtual void Trk::IAlignTrackPreProcessor::setLogStream |
( |
std::ostream * |
os | ) |
|
|
inlinevirtualinherited |
◆ 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.
◆ solveVTX()
void Trk::BeamspotVertexPreProcessor::solveVTX |
( |
| ) |
|
|
virtual |
◆ sysInitialize()
◆ sysStart()
Handle START transition.
We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.
◆ updateVHKA()
◆ m_alignModuleTool
◆ m_AlignVertices
◆ m_allTracksVector
◆ m_beamSpotKey
◆ m_BSScalingFactor
double Trk::BeamspotVertexPreProcessor::m_BSScalingFactor |
|
private |
◆ m_BSTrackSelector
◆ m_compareMethod
std::string Trk::BeamspotVertexPreProcessor::m_compareMethod |
|
private |
◆ m_constraintMode
unsigned int Trk::BeamspotVertexPreProcessor::m_constraintMode |
|
private |
◆ m_detStore
◆ m_doAssociatedToPVSelection
bool Trk::BeamspotVertexPreProcessor::m_doAssociatedToPVSelection |
|
private |
◆ m_doBeamspotConstraint
bool Trk::BeamspotVertexPreProcessor::m_doBeamspotConstraint |
|
private |
◆ m_doBSTrackSelection
bool Trk::BeamspotVertexPreProcessor::m_doBSTrackSelection |
|
private |
◆ m_doFullVertexConstraint
bool Trk::BeamspotVertexPreProcessor::m_doFullVertexConstraint |
|
private |
◆ m_doNormalRefit
bool Trk::BeamspotVertexPreProcessor::m_doNormalRefit |
|
private |
◆ m_doPrimaryVertexConstraint
bool Trk::BeamspotVertexPreProcessor::m_doPrimaryVertexConstraint |
|
private |
◆ m_doTrkSelection
bool Trk::BeamspotVertexPreProcessor::m_doTrkSelection |
|
private |
◆ m_evtStore
◆ m_extrapolator
ToolHandle<IExtrapolator> Trk::BeamspotVertexPreProcessor::m_extrapolator |
|
private |
◆ m_interestedVertexContainers
std::vector<std::string> Trk::BeamspotVertexPreProcessor::m_interestedVertexContainers |
|
private |
◆ m_logStream
std::ostream* Trk::IAlignTrackPreProcessor::m_logStream |
|
protectedinherited |
◆ m_maxPt
double Trk::BeamspotVertexPreProcessor::m_maxPt |
|
private |
◆ m_minTrksInVtx
int Trk::BeamspotVertexPreProcessor::m_minTrksInVtx |
|
private |
◆ m_nFailedBSRefits
int Trk::BeamspotVertexPreProcessor::m_nFailedBSRefits |
|
private |
◆ m_nFailedNormalRefits
int Trk::BeamspotVertexPreProcessor::m_nFailedNormalRefits |
|
private |
◆ m_nFailedPVRefits
int Trk::BeamspotVertexPreProcessor::m_nFailedPVRefits |
|
private |
◆ m_nTracks
int Trk::BeamspotVertexPreProcessor::m_nTracks |
|
private |
◆ m_particleNumber
int Trk::BeamspotVertexPreProcessor::m_particleNumber |
|
private |
◆ m_PVContainerName
std::string Trk::BeamspotVertexPreProcessor::m_PVContainerName |
|
private |
◆ m_PVScalingFactor
double Trk::BeamspotVertexPreProcessor::m_PVScalingFactor |
|
private |
◆ m_refitTracks
bool Trk::BeamspotVertexPreProcessor::m_refitTracks |
|
private |
◆ m_runOutlierRemoval
bool Trk::BeamspotVertexPreProcessor::m_runOutlierRemoval |
|
private |
◆ m_selectVertices
bool Trk::BeamspotVertexPreProcessor::m_selectVertices |
|
private |
◆ m_SLTrackFitter
◆ m_storeFitMatrices
bool Trk::BeamspotVertexPreProcessor::m_storeFitMatrices |
|
private |
◆ m_trackFitter
◆ m_trackToVertexIPEstimatorTool
◆ m_trackTypeCounter
std::vector<int> Trk::BeamspotVertexPreProcessor::m_trackTypeCounter |
|
private |
◆ m_trkSelector
◆ m_useSingleFitter
bool Trk::BeamspotVertexPreProcessor::m_useSingleFitter |
|
private |
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files:
def retrieve(aClass, aKey=None)
JetConstituentVector::iterator iterator
const ShapeFitter * fitter
bool m_storeFitMatrices
flag to store derivative and covariance matrices after refit
AmgMatrix(3, 3) NeutralParticleParameterCalculator
double m_maxPt
Max pT range for refitting tracks.
std::vector< std::string > m_interestedVertexContainers
std::string m_compareMethod
the method used to judge whether two tracks are the same track
Const iterator class for DataVector/DataList.
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
bool m_doBeamspotConstraint
do beamspot constraint
Eigen::Matrix< double, Eigen::Dynamic, 1 > VectorX
Dynamic Vector - dynamic allocation.
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
bool m_refitTracks
flag to refit tracks
DataVector< AlignVertex > m_AlignVertices
collection of AlignVertices used in FullVertex constraint option
Vertex_v1 Vertex
Define the latest version of the vertex class.
bool isAssociatedToPV(const Track *track, const xAOD::VertexContainer *vertices)
ToolHandle< ITrackToVertexIPEstimator > m_trackToVertexIPEstimatorTool
Scalar perp() const
perp method - perpenticular length
int m_particleNumber
type of material interaction in extrapolation
Eigen::Matrix< double, 2, 1 > Vector2D
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Dummy class used to allow special convertors to be called for surfaces owned by a detector element.
bool m_doBSTrackSelection
the selection mechanism which is based on cutting the perigee parameters, pt, etc.
double m_BSScalingFactor
scaling factor on beasmpot width
bool m_selectVertices
do vertex selection
const VertexOnTrack * provideVotFromBeamspot(const Track *track) const
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
void provideVtxBeamspot(const AlignVertex *b, AmgSymMatrix(3) *q, Amg::Vector3D *v) const
ParametersT< 5, Charged, PerigeeSurface > Perigee
std::vector< SG::VarHandleKeyArray * > m_vhka
bool msgLvl(const MSG::Level lvl) const
const Amg::Vector3D & position() const
Returns the 3-pos.
bool m_doNormalRefit
provide tracks in the case failed BS, PV and FullVertex constraints.
std::ostream * m_logStream
logfile output stream
ToolHandle< InDet::IInDetTrackSelectionTool > m_trkSelector
new track selector tool
#define ATH_MSG_VERBOSE(x)
bool isSLTrack() const
method to determine whether a straight line track or not
std::vector< std::pair< const xAOD::Vertex *, std::vector< VxTrackAtVertex > > > m_allTracksVector
ParametersBase< 5, Charged > TrackParameters
const Track * doConstraintRefit(ToolHandle< IGlobalTrackFitter > &fitter, const Track *track, const VertexOnTrack *vot, const ParticleHypothesis &particleHypothesis) const
bool fit(const LArSamples::AbsShape &data, const AbsShape &reference, double &k, double &deltaT, double &chi2, const ScaledErrorData *sed=0) const
bool m_doPrimaryVertexConstraint
do vertex constraint
VxType::VertexType vertexType() const
The type of the vertex.
const VertexOnTrack * provideVotFromVertex(const Track *track, const xAOD::Vertex *&vtx) const
Matrix< Scalar, OtherDerived::RowsAtCompileTime, OtherDerived::RowsAtCompileTime > similarity(const MatrixBase< OtherDerived > &m) const
std::pair< double, ParamDefs > DefinedParameter
virtual void setOwner(IDataHandleHolder *o)=0
AmgSymMatrix(5) &GXFTrackState
ToolHandle< Trk::IAlignModuleTool > m_alignModuleTool
Pointer to AlignModuleTool.
AlignModule is a grouping of TrkDetElementBase objects, grouped according to the type of alignment,...
int m_minTrksInVtx
requirement to the minimal number of tracks in the vertex
ToolHandle< IExtrapolator > m_extrapolator
straight line track fitter
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
@ BeamspotConstrained
refitted with beamspot constraint
SG::ReadCondHandleKey< InDet::BeamSpotData > m_beamSpotKey
bool m_doAssociatedToPVSelection
the selection mechanism that only use the tracks associated to PV
std::vector< int > m_trackTypeCounter
bool m_doTrkSelection
to activate the preprocessor track selection
bool isAssociatedToVertex(const Track *track, const xAOD::Vertex *vertex)
void prepareAllTracksVector()
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
bool m_doFullVertexConstraint
do GX full vertex constraint
int m_nFailedNormalRefits
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
unsigned int m_constraintMode
Definition of ATLAS Math & Geometry primitives (Amg)
bool selectVertices(const xAOD::Vertex *vtx) const
value_type push_back(value_type pElem)
Add an element to the end of the collection.
StatusCode initialize(bool used=true)
Eigen::Matrix< double, 3, 1 > Vector3D
const xAOD::Vertex * findVertexCandidate(const Track *track) const
bool m_useSingleFitter
only use 1 fitter for refitting track
float numberDoF() const
Returns the number of degrees of freedom of the vertex fit as float.
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
Class describing a Vertex.
@ Original
not refitted, just copy constructed from original Track
ToolHandle< IGlobalTrackFitter > m_trackFitter
normal track fitter
#define ATH_MSG_WARNING(x)
@ NormalRefitted
normally refitted, without adding any pseudo-measurement
double m_PVScalingFactor
scaling factor on primary vertex position error
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
bool m_runOutlierRemoval
switch whether to run outlier logics or not
bool doBeamspotConstraintTrackSelection(const Track *track)
static void dumpLessTrackInfo(const Track &track, MsgStream &msg)
dump less track information
@ NTrackTypes
total number of track types
std::vector< Trk::VxTrackAtVertex > & vxTrackAtVertex()
Non-const access to the VxTrackAtVertex vector.
std::string m_PVContainerName
the name of the primary vertex container
@ VertexConstrained
refitted with vertex constraint
AlignVertex is a simple structure to store objects belonging to a vertex. Contains a pointer to the o...
size_type size() const noexcept
Returns the number of elements in the collection.
ToolHandle< IGlobalTrackFitter > m_SLTrackFitter
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
ToolHandle< InDet::IInDetTrackSelectionTool > m_BSTrackSelector
new track selector tool for tracks to be used with beam-spot constraint
bool empty() const noexcept
Returns true if the collection is empty.
AlignTrack * doTrackRefit(const Track *track)
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
AlignTrack is a generalization of a Trk::Track, used as the basic object to contain track information...
bool selectUpdatedVertices(const xAOD::Vertex *updatedVtx) const