|
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 48 of file BeamspotVertexPreProcessor.cxx.
84 declareInterface<IAlignTrackPreProcessor>(
this);
102 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" );
112 std::vector<std::string> defaultInterestedVertexContainers;
113 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 954 of file BeamspotVertexPreProcessor.cxx.
962 ATH_MSG_DEBUG(
"This alignTrack is not associated to any vertex -> return. ");
967 const Amg::MatrixX * ptrWeights = alignTrack->weightMatrix();
968 const Amg::MatrixX * ptrWeightsFD = alignTrack->weightMatrixFirstDeriv();
969 const Amg::VectorX * ptrResiduals = alignTrack->residualVector();
970 const std::vector<AlignModuleDerivatives> * ptrDerivs = alignTrack->derivatives();
973 if (!ptrWeights || !ptrWeightsFD || !ptrResiduals || !ptrDerivs) {
974 msg(MSG::ERROR)<<
"something missing from alignTrack!"<<
endmsg;
975 if (!ptrWeights)
msg(MSG::ERROR)<<
"no weights!"<<
endmsg;
976 if (!ptrWeightsFD)
msg(MSG::ERROR)<<
"no weights for first deriv!"<<
endmsg;
977 if (!ptrResiduals)
msg(MSG::ERROR)<<
"no residuals!"<<
endmsg;
978 if (!ptrDerivs)
msg(MSG::ERROR)<<
"no derivatives!"<<
endmsg;
984 std::vector<AlignModuleDerivatives> derivatives = *ptrDerivs;
993 ATH_MSG_DEBUG(
"accumulateVTX: The derivative vector size is " << derivatives.size() );
997 std::vector<Amg::VectorX*> allDerivatives[3];
1000 const int WSize(
weights.cols());
1002 std::vector<AlignModuleVertexDerivatives> derivX;
1004 for ( ; derivIt!=derivIt_end ; ++derivIt) {
1013 std::vector<Amg::VectorX>& deriv_vec = derivIt->second;
1014 ATH_MSG_VERBOSE(
"accumulateVTX: The deriv_vec size is " << deriv_vec.size() );
1016 int nModPars = alignPars->
size();
1017 if ((nModPars+3) != (
int)deriv_vec.size() ) {
1018 ATH_MSG_ERROR(
"accumulateVTX: Derivatives w.r.t. the vertex seem to be missing");
1021 for (
int i=0;
i<3;
i++) {
1022 allDerivatives[
i].push_back(&deriv_vec[nModPars+
i]);
1023 for (
int j=0;j<WSize;j++) {
1024 F(
i,j) = deriv_vec[nModPars+
i][j];
1032 ATH_MSG_ERROR(
"accumulateVTX: Derivatives do not have a valid pointer to the module.");
1039 derivIt = derivatives.begin();
1040 for ( ; derivIt!=derivIt_end ; ++derivIt) {
1048 std::vector<Amg::VectorX>& deriv_vec = derivIt->second;
1049 std::vector<Amg::VectorX> drdaWF;
1051 << deriv_vec.size());
1053 int nModPars = alignPars->
size();
1054 if ((nModPars + 3) != (
int)deriv_vec.size()) {
1056 "accumulateVTX: Derivatives w.r.t. the vertex seem to be missing");
1059 drdaWF.reserve(nModPars);
1060 for (
int i = 0;
i < nModPars;
i++) {
1061 drdaWF.emplace_back(2.0 * (WF)*deriv_vec[
i]);
1063 ATH_MSG_DEBUG(
"accumulateVTX: derivX incremented by: " << drdaWF);
1065 derivX.emplace_back(
module,std::move(drdaWF));
1068 ATH_MSG_ERROR(
"accumulateVTX: Derivatives do not have a valid pointer to the module.");
1076 int nmodules = allDerivatives[0].size();
1078 for(
int ii=0; ii<3; ++ii ) {
1079 VTXDerivatives[ii] = (*(allDerivatives[ii])[0]);
1080 for(
int jj=1; jj<nmodules; ++jj ) {
1081 VTXDerivatives[ii] += (*(allDerivatives[ii])[jj]);
1089 Amg::
VectorX RHM= weightsFirstDeriv * residuals;
1092 for (
int ipar=0;ipar<3;ipar++) {
1096 Amg::MatrixX derivativesT = (VTXDerivatives[ipar]).transpose();
1097 ATH_MSG_DEBUG(
"derivativesT (size "<<derivativesT.cols()<<
"): "<<derivativesT);
1100 vtxV[ipar] = tempV(0,0);
1102 for (
int jpar=ipar;jpar<3;jpar++) {
1108 vtxM(ipar,jpar) = tempM(0,0);
1116 alignVertex->incrementVector(vtxV);
1117 alignVertex->incrementMatrix(vtxM);
1119 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);
253 return PBASE::declareProperty(
name,hndl,
doc);
◆ 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.
229 return PBASE::declareProperty(
name,hndl,
doc);
◆ 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.
338 return PBASE::declareProperty(
name, property,
doc);
◆ 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 677 of file BeamspotVertexPreProcessor.cxx.
681 bool haveVertex =
false;
692 ATH_MSG_DEBUG(
"Primary vertex collection for this event has "<<vertices->
size()<<
" vertices");
693 if (vertices->
size()<2){
694 ATH_MSG_DEBUG(
"Only Dummy vertex present, no Primary vertices.");
701 ATH_MSG_DEBUG(
"Could not retrieve primary vertex collection from the StoreGate");
716 const double qoverP = perigee->parameters()[
Trk::qOverP] * 1000.;
724 ATH_MSG_DEBUG(
"this track passes the beamspot track selection, will do beamspot constraint on it ");
◆ doConstraintRefit()
Definition at line 638 of file BeamspotVertexPreProcessor.cxx.
644 const EventContext& ctx = Gaudi::Hive::currentContext();
645 const Track* newTrack =
nullptr;
649 std::vector<const MeasurementBase *> measurementCollection;
650 measurementCollection.push_back(vot);
654 for ( ; imeas != imeas_end ; ++imeas) measurementCollection.push_back(*imeas);
658 const PerigeeSurface& surface=vot->associatedSurface();
659 ATH_MSG_DEBUG(
" Track reference surface will be: " << surface);
663 newTrack = (
fitter->
fit(ctx, measurementCollection,
668 measurementCollection, *(
track->trackParameters()->front()),
◆ doTrackRefit()
Definition at line 731 of file BeamspotVertexPreProcessor.cxx.
734 const Track* newTrack =
nullptr;
746 IGlobalTrackFitter::AlignmentCache alignCache;
752 if( !vot )
ATH_MSG_INFO(
"VoT not found for this track! ");
753 if( !vtx )
ATH_MSG_INFO(
"VTX pointer not found for this track! ");
760 msg(MSG::ERROR)<<
"VertexConstraint track refit failed! "<<
endmsg;
773 msg(MSG::ERROR)<<
"BSConstraint track refit failed! "<<
endmsg;
805 msg(MSG::ERROR)<<
"Normal track refit failed! "<<
endmsg;
816 alignTrack->setOriginalTrack(
track);
818 alignTrack->setType(
type);
834 alignTrack->setFullCovarianceMatrix(alignCache.m_fullCovarianceMatrix);
835 alignTrack->setDerivativeMatrix(alignCache.m_derivMatrix);
843 if( (ivtx->originalVertex())==vtx ) {
853 ATH_MSG_DEBUG(
" The Beam Spot constraint will be added to the vertex.." );
857 (qtemp)(2,2) = 1000000.0;
858 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 372 of file BeamspotVertexPreProcessor.cxx.
377 std::vector< std::pair< const xAOD::Vertex*, std::vector<VxTrackAtVertex> > >::const_iterator iter =
m_allTracksVector.begin();
378 std::vector< std::pair< const xAOD::Vertex*, std::vector<VxTrackAtVertex> > >::const_iterator iterEnd =
m_allTracksVector.end();
380 for(; iter != iterEnd; ++iter){
381 std::pair< const xAOD::Vertex*, std::vector<VxTrackAtVertex> > thisPair = *iter;
390 if(findResult != iVxTrackEnd){
392 findVxCandidate = thisPair.first;
401 return findVxCandidate;
◆ initialize()
StatusCode Trk::BeamspotVertexPreProcessor::initialize |
( |
| ) |
|
|
virtual |
Definition at line 125 of file BeamspotVertexPreProcessor.cxx.
127 ATH_MSG_INFO(
"BeamspotVertexPreProcessor::initialize()");
141 return StatusCode::FAILURE;
149 return StatusCode::FAILURE;
157 return StatusCode::FAILURE;
165 return StatusCode::FAILURE;
176 msg(
MSG::FATAL) <<
"Requested BeamSpot track selection but Track Selector not configured"<<
endmsg;
177 return StatusCode::FAILURE;
181 return StatusCode::FAILURE;
190 return StatusCode::FAILURE;
196 return StatusCode::FAILURE;
201 ATH_MSG_INFO(
"************************************************************************");
203 ATH_MSG_INFO(
"* You have requested the Full Vertex Constraint option. *");
204 ATH_MSG_INFO(
"* It is your duty to assure that all detector elements *");
205 ATH_MSG_INFO(
"* used for track fitting are also loaded in the alignment framework!!! *");
207 ATH_MSG_INFO(
"* Also make sure the accurate track covariance matrix *");
208 ATH_MSG_INFO(
"* is returned by the GlobalChi2Fitter! *");
210 ATH_MSG_INFO(
"************************************************************************");
214 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 311 of file BeamspotVertexPreProcessor.cxx.
316 std::vector<VxTrackAtVertex > vertexTracks =
vertex->vxTrackAtVertex();
319 std::vector<VxTrackAtVertex >::const_iterator iVxTrackBegin = vertexTracks.begin();
320 std::vector<VxTrackAtVertex >::const_iterator iVxTrackEnd = vertexTracks.end();
322 std::vector<VxTrackAtVertex>::const_iterator findResult = std::find_if(iVxTrackBegin, iVxTrackEnd, thisCompare);
324 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 328 of file BeamspotVertexPreProcessor.cxx.
337 for(; strs_iter != strs_end; ++strs_iter){
339 if (
evtStore()->contains<xAOD::VertexContainer>(*strs_iter)) {
341 ATH_MSG_DEBUG (
"Could not retrieve xAOD vertex container with key "+(*strs_iter));
349 for(; vtxIter != vtxEnd; ++vtxIter){
351 ATH_MSG_DEBUG(
"this vertex did not pass the primary vertex selection...");
355 if ((*vtxIter)->vxTrackAtVertexAvailable()){
357 std::vector<VxTrackAtVertex> vtxTracks = (*vtxIter)->vxTrackAtVertex();
361 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 880 of file BeamspotVertexPreProcessor.cxx.
882 ATH_MSG_DEBUG(
"BeamspotVertexPreProcessor::processTrackCollection()");
884 if( !tracks || (tracks->empty()) )
904 for ( ; itr != itr_end; ++itr, ++
index) {
908 if (not
track)
continue;
923 alignTrack->setTrackSummary( std::make_unique<Trk::TrackSummary> (*
track->trackSummary()) );
925 if( !(alignTrack->getVtx()) ) {
934 ATH_MSG_DEBUG(
"No Track refit for track " <<
index <<
" --> building new aligntrack");
936 alignTrack->setOriginalTrack(
track);
940 if (alignTrack) newTrks->
push_back(alignTrack);
943 ATH_MSG_INFO(
"Processing of input track collection completed (size: " << tracks->size() <<
"). Size of the alignTrack collection: " << newTrks->
size() );
945 if (newTrks->
empty()) {
◆ provideVotFromBeamspot()
Definition at line 518 of file BeamspotVertexPreProcessor.cxx.
520 const EventContext& ctx = Gaudi::Hive::currentContext();
525 float beamSpotX = bpos.x();
526 float beamSpotY = bpos.y();
527 float beamSpotZ = bpos.z();
528 float beamTiltX = beamSpotHandle->beamTilt(0);
529 float beamTiltY = beamSpotHandle->beamTilt(1);
538 float beamX = beamSpotX +
std::tan(beamTiltX) * (
z0-beamSpotZ);
539 float beamY = beamSpotY +
std::tan(beamTiltY) * (
z0-beamSpotZ);
541 ATH_MSG_DEBUG(
"constructing beam point (x,y,z) = ( "<<beamX<<
" , "<<beamY<<
" , "<<
z0<<
" )");
542 std::optional<PerigeeSurface> surface = std::nullopt;
544 LocalParameters beamSpotParameters;
548 beamSpotCov.setZero();
549 beamSpotCov(0,0) = beamSigmaX * beamSigmaX;
550 beamSpotCov(1,1) = beamSigmaY * beamSigmaY;
555 surface.emplace(globPos);
559 beamSpotParameters = LocalParameters(Par0);
562 const Perigee* perigee =
nullptr;
563 std::unique_ptr<const Trk::TrackParameters>
tmp =
567 perigee =
static_cast<const Perigee*
>(
tmp.release());
571 const Perigee * trackPerigee =
track->perigeeParameters();
572 if ( trackPerigee && trackPerigee->associatedSurface() == *surface )
573 perigee = trackPerigee->clone();
582 Eigen::Matrix<double,1,2> jacobian;
585 double ptInv = 1./perigee->momentum().perp();
586 jacobian(0,0) = -ptInv * perigee->momentum().y();
587 jacobian(0,1) = ptInv * perigee->momentum().x();
590 errorMatrix =
Amg::MatrixX( jacobian*(beamSpotCov*jacobian.transpose()));
591 if( errorMatrix.cols() != 1 )
597 std::move(errorMatrix),
603 ATH_MSG_DEBUG(
" the VertexOnTrack objects created from BeamSpot are " << *vot);
◆ provideVotFromVertex()
vertex as perigeeSurface
Definition at line 405 of file BeamspotVertexPreProcessor.cxx.
407 const EventContext& ctx = Gaudi::Hive::currentContext();
416 if (!(
nullptr==findVtx) ) {
435 ATH_MSG_DEBUG(
" updated Vertex by KalmanVertexUpdator: "<<updatedVtx);
440 const PerigeeSurface surface(globPos);
441 const Perigee* perigee =
nullptr;
442 std::unique_ptr<const Trk::TrackParameters>
tmp =
446 perigee =
static_cast<const Perigee*
> (
tmp.release());
449 const Perigee * trackPerigee =
track->perigeeParameters();
450 if ( trackPerigee && trackPerigee->associatedSurface() == surface )
451 perigee = trackPerigee->clone();
456 if (updatedVtx!= tmpVtx)
delete updatedVtx;
469 Jacobian(0,0) = -ptInv*perigee->
momentum().
y();
470 Jacobian(0,1) = ptInv*perigee->
momentum().
x();
475 AmgSymMatrix(3) vtxCov = updatedVtx->covariancePosition();
485 tmpCov(0,0) = 1.
e-10 ;
486 tmpCov(1,1) = 1.
e-10;
487 tmpCov(2,2) = 1.
e-10;
490 errorMatrix =
Amg::MatrixX( vtxCov.similarity(Jacobian) );
498 if (tmpVtx != updatedVtx){
508 vot =
new VertexOnTrack(std::move(localParams), std::move(errorMatrix), surface);
509 ATH_MSG_DEBUG(
"the VertexOnTrack created from vertex: "<<*vot);
◆ provideVtxBeamspot()
Definition at line 610 of file BeamspotVertexPreProcessor.cxx.
615 float beamSpotX = bpos.x();
616 float beamSpotY = bpos.y();
617 float beamSpotZ = bpos.z();
618 float beamTiltX = beamSpotHandle->beamTilt(0);
619 float beamTiltY = beamSpotHandle->beamTilt(1);
625 float z0 =
b->originalPosition()->z();
626 (*v)(0) = beamSpotX +
std::tan(beamTiltX) * (
z0-beamSpotZ);
627 (*v)(1) = beamSpotY +
std::tan(beamTiltY) * (
z0-beamSpotZ);
629 (*q)(0,0) = beamSigmaX*beamSigmaX;
630 (*q)(1,1) = beamSigmaY*beamSigmaY;
631 (*q)(2,2) = beamSigmaZ*beamSigmaZ;
633 ATH_MSG_DEBUG(
"VTX constraint point (x,y,z) = ( "<< (*
v)[0] <<
" , "<< (*
v)[1] <<
" , "<< (*
v)[2] <<
" )");
634 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 273 of file BeamspotVertexPreProcessor.cxx.
275 if (vtx->numberDoF() <= 0){
276 ATH_MSG_WARNING(
" VERY STRANGE!!! , the updated vertex has been rejected as non-positive DoF: "<< vtx->numberDoF() <<
" the type of this vertex:"<< vtx->vertexType() );
281 ATH_MSG_DEBUG(
" the updated vertex has been rejected as vxTrackAtVertex size: "<< vtx->vxTrackAtVertex().size() );
285 if ((vtx->covariancePosition())(0,0)<=0 ||
286 (vtx->covariancePosition())(1,1)<=0 ||
287 (vtx->covariancePosition())(2,2)<=0){
288 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
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
const Track * doConstraintRefit(ToolHandle< IGlobalTrackFitter > &fitter, const Track *track, const VertexOnTrack *vot, const ParticleHypothesis &particleHypothesis) const
ParametersT< TrackParametersDim, Charged, PerigeeSurface > Perigee
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
similarity method : yields ms = m*s*m^T
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
ParametersBase< TrackParametersDim, Charged > TrackParameters
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