 |
ATLAS Offline Software
|
#include <BeamspotVertexPreProcessor.h>
|
| 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 |
|
|
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, 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...
|
|
◆ StoreGateSvc_t
◆ BeamspotVertexPreProcessor()
Trk::BeamspotVertexPreProcessor::BeamspotVertexPreProcessor |
( |
const std::string & |
type, |
|
|
const std::string & |
name, |
|
|
const IInterface * |
parent |
|
) |
| |
◆ ~BeamspotVertexPreProcessor()
Trk::BeamspotVertexPreProcessor::~BeamspotVertexPreProcessor |
( |
| ) |
|
|
virtualdefault |
◆ 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.
839 ATH_MSG_DEBUG(
"This alignTrack is not associated to any vertex -> return. ");
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();
850 if (!ptrWeights || !ptrWeightsFD || !ptrResiduals || !ptrDerivs) {
853 if (!ptrWeightsFD)
ATH_MSG_ERROR(
"no weights for first deriv!");
861 std::vector<AlignModuleDerivatives> derivatives = *ptrDerivs;
870 ATH_MSG_DEBUG(
"accumulateVTX: The derivative vector size is " << derivatives.size() );
872 std::vector<const Amg::VectorX*> allDerivatives[3];
874 const int WSize(
weights.cols());
876 std::vector<AlignModuleVertexDerivatives> derivX;
878 for (
const auto& deriv : derivatives) {
885 const std::vector<Amg::VectorX>& deriv_vec = deriv.second;
886 ATH_MSG_VERBOSE(
"accumulateVTX: The deriv_vec size is " << deriv_vec.size() );
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");
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];
904 ATH_MSG_ERROR(
"accumulateVTX: Derivatives do not have a valid pointer to the module.");
911 for (
const auto& deriv : derivatives) {
917 const std::vector<Amg::VectorX>& deriv_vec = deriv.second;
918 std::vector<Amg::VectorX> drdaWF;
920 << deriv_vec.size());
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");
928 drdaWF.reserve(nModPars);
929 for (
int i = 0;
i < nModPars;
i++) {
930 drdaWF.emplace_back(2.0 * WF * deriv_vec[
i]);
932 ATH_MSG_DEBUG(
"accumulateVTX: derivX incremented by: " << drdaWF);
934 derivX.emplace_back(
module,std::move(drdaWF));
937 ATH_MSG_ERROR(
"accumulateVTX: Derivatives do not have a valid pointer to the module.");
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]);
955 Amg::
VectorX RHM= weightsFirstDeriv * residuals;
958 for (
int ipar=0;ipar<3;ipar++) {
961 Amg::MatrixX derivativesT = (VTXDerivatives[ipar]).transpose();
962 ATH_MSG_DEBUG(
"derivativesT (size "<<derivativesT.cols()<<
"): "<<derivativesT);
965 vtxV[ipar] = tempV(0,0);
967 for (
int jpar=ipar;jpar<3;jpar++) {
973 vtxM(ipar,jpar) = tempM(0,0);
981 alignVertex->incrementVector(vtxV);
982 alignVertex->incrementMatrix(vtxM);
984 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 556 of file BeamspotVertexPreProcessor.cxx.
560 bool haveVertex =
false;
565 const EventContext& ctx = Gaudi::Hive::currentContext();
567 if(!vtxReadHandle.isValid()){
571 vertices = vtxReadHandle.cptr();
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.");
583 ATH_MSG_DEBUG(
"Could not retrieve primary vertex collection from the StoreGate");
598 const double qoverP = perigee->parameters()[
Trk::qOverP] * 1000.;
607 ATH_MSG_DEBUG(
"this track passes the beamspot track selection, will do beamspot constraint on it ");
◆ doConstraintRefit()
Definition at line 518 of file BeamspotVertexPreProcessor.cxx.
524 const EventContext& ctx = Gaudi::Hive::currentContext();
525 const Track* newTrack =
nullptr;
529 std::vector<const MeasurementBase *> measurementCollection;
530 measurementCollection.push_back(vot);
532 const auto &measurements = *(
track->measurementsOnTrack());
533 for(
const MeasurementBase* meas : measurements)
534 measurementCollection.push_back(meas);
538 const PerigeeSurface& surface=vot->associatedSurface();
539 ATH_MSG_DEBUG(
" Track reference surface will be: " << surface);
543 newTrack = (
fitter->
fit(ctx, measurementCollection,
548 measurementCollection, *(
track->trackParameters()->front()),
◆ doTrackRefit()
Definition at line 614 of file BeamspotVertexPreProcessor.cxx.
617 const Track* newTrack =
nullptr;
629 IGlobalTrackFitter::AlignmentCache alignCache;
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! ");
699 alignTrack->setOriginalTrack(
track);
701 alignTrack->setType(
type);
715 alignTrack->setFullCovarianceMatrix(alignCache.m_fullCovarianceMatrix);
716 alignTrack->setDerivativeMatrix(alignCache.m_derivMatrix);
724 if( (ivtx->originalVertex())==vtx ) {
734 ATH_MSG_DEBUG(
" The Beam Spot constraint will be added to the vertex.." );
738 (qtemp)(2,2) = 1000000.0;
739 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 |
( |
| ) |
|
|
overridevirtual |
◆ findVertexCandidate()
Definition at line 275 of file BeamspotVertexPreProcessor.cxx.
280 auto iVxTrackBegin = thisPair.second.begin();
281 auto iVxTrackEnd = thisPair.second.end();
284 auto findResult = std::find_if(iVxTrackBegin, iVxTrackEnd, thisCompare);
286 if(findResult != iVxTrackEnd){
288 findVxCandidate = thisPair.first;
293 return findVxCandidate;
◆ initialize()
StatusCode Trk::BeamspotVertexPreProcessor::initialize |
( |
| ) |
|
|
overridevirtual |
Definition at line 49 of file BeamspotVertexPreProcessor.cxx.
51 ATH_MSG_INFO(
"BeamspotVertexPreProcessor::initialize()");
65 return StatusCode::FAILURE;
73 return StatusCode::FAILURE;
81 return StatusCode::FAILURE;
89 return StatusCode::FAILURE;
101 ATH_MSG_FATAL(
"Requested BeamSpot track selection but Track Selector not configured");
102 return StatusCode::FAILURE;
106 return StatusCode::FAILURE;
114 ATH_MSG_FATAL(
"Requested beam-spot constraint but RefitTracks is False.");
115 return StatusCode::FAILURE;
121 return StatusCode::FAILURE;
126 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!!! *");
132 ATH_MSG_INFO(
"* Also make sure the accurate track covariance matrix *");
133 ATH_MSG_INFO(
"* is returned by the GlobalChi2Fitter! *");
135 ATH_MSG_INFO(
"************************************************************************");
139 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 232 of file BeamspotVertexPreProcessor.cxx.
236 std::vector<VxTrackAtVertex > vertexTracks =
vertex->vxTrackAtVertex();
239 std::vector<VxTrackAtVertex >::const_iterator iVxTrackBegin = vertexTracks.begin();
240 std::vector<VxTrackAtVertex >::const_iterator iVxTrackEnd = vertexTracks.end();
242 std::vector<VxTrackAtVertex>::const_iterator findResult = std::find_if(iVxTrackBegin, iVxTrackEnd, thisCompare);
244 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 248 of file BeamspotVertexPreProcessor.cxx.
253 const EventContext& ctx = Gaudi::Hive::currentContext();
258 ATH_MSG_DEBUG(
"this vertex did not pass the primary vertex selection...");
261 if (vtx->vxTrackAtVertexAvailable()){
262 std::vector<VxTrackAtVertex> vtxTracks = vtx->vxTrackAtVertex();
266 ATH_MSG_DEBUG(
"this vertex did not pass the vxTrackAtVertexAvailable() call...");
◆ printSummary()
void Trk::BeamspotVertexPreProcessor::printSummary |
( |
| ) |
|
|
overridevirtual |
◆ 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 761 of file BeamspotVertexPreProcessor.cxx.
763 ATH_MSG_DEBUG(
"BeamspotVertexPreProcessor::processTrackCollection()");
765 if( !tracks || (tracks->empty()) )
781 for (
const auto*
track : *tracks){
785 if (not
track)
continue;
800 alignTrack->setTrackSummary( std::make_unique<Trk::TrackSummary> (*
track->trackSummary()) );
802 if( !(alignTrack->getVtx()) ) {
811 ATH_MSG_DEBUG(
"No Track refit for track " <<
index <<
" --> building new aligntrack");
813 alignTrack->setOriginalTrack(
track);
817 if (alignTrack) newTrks->
push_back(alignTrack);
820 ATH_MSG_INFO(
"Processing of input track collection completed (size: " << tracks->size() <<
"). Size of the alignTrack collection: " << newTrks->
size() );
822 if (newTrks->
empty()) {
◆ provideVotFromBeamspot()
Definition at line 404 of file BeamspotVertexPreProcessor.cxx.
406 const EventContext& ctx = Gaudi::Hive::currentContext();
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);
422 float beamX = beamSpotX +
std::tan(beamTiltX) * (
z0-beamSpotZ);
423 float beamY = beamSpotY +
std::tan(beamTiltY) * (
z0-beamSpotZ);
425 ATH_MSG_DEBUG(
"constructing beam point (x,y,z) = ( "<<beamX<<
" , "<<beamY<<
" , "<<
z0<<
" )");
426 std::optional<PerigeeSurface> surface = std::nullopt;
428 LocalParameters beamSpotParameters;
432 beamSpotCov.setZero();
433 beamSpotCov(0,0) = beamSigmaX * beamSigmaX;
434 beamSpotCov(1,1) = beamSigmaY * beamSigmaY;
439 surface.emplace(globPos);
443 beamSpotParameters = LocalParameters(Par0);
446 const Perigee* perigee =
nullptr;
447 std::unique_ptr<const Trk::TrackParameters>
tmp =
451 perigee =
static_cast<const Perigee*
>(
tmp.release());
455 const Perigee * trackPerigee =
track->perigeeParameters();
456 if ( trackPerigee && trackPerigee->associatedSurface() == *surface )
457 perigee = trackPerigee->clone();
464 Eigen::Matrix<double,1,2> jacobian;
467 double ptInv = 1./perigee->momentum().perp();
468 jacobian(0,0) = -ptInv * perigee->momentum().y();
469 jacobian(0,1) = ptInv * perigee->momentum().x();
471 errorMatrix =
Amg::MatrixX( jacobian*(beamSpotCov*jacobian.transpose()));
472 if( errorMatrix.cols() != 1 )
478 std::move(errorMatrix),
484 ATH_MSG_DEBUG(
" the VertexOnTrack objects created from BeamSpot are " << *vot);
◆ provideVotFromVertex()
vertex as perigeeSurface
Definition at line 297 of file BeamspotVertexPreProcessor.cxx.
299 const EventContext& ctx = Gaudi::Hive::currentContext();
308 if (!(
nullptr==findVtx) ) {
325 ATH_MSG_DEBUG(
" updated Vertex by KalmanVertexUpdator: "<<updatedVtx);
329 const PerigeeSurface surface(globPos);
330 const Perigee* perigee =
nullptr;
331 std::unique_ptr<const Trk::TrackParameters>
tmp =
335 perigee =
static_cast<const Perigee*
> (
tmp.release());
338 const Perigee * trackPerigee =
track->perigeeParameters();
339 if ( trackPerigee && trackPerigee->associatedSurface() == surface )
340 perigee = trackPerigee->clone();
345 if (updatedVtx!= tmpVtx)
delete updatedVtx;
358 Jacobian(0,0) = -ptInv*perigee->
momentum().
y();
359 Jacobian(0,1) = ptInv*perigee->
momentum().
x();
364 AmgSymMatrix(3) vtxCov = updatedVtx->covariancePosition();
371 tmpCov(0,0) = 1.
e-10 ;
372 tmpCov(1,1) = 1.
e-10;
373 tmpCov(2,2) = 1.
e-10;
376 errorMatrix =
Amg::MatrixX( vtxCov.similarity(Jacobian) );
384 if (tmpVtx != updatedVtx){
394 vot =
new VertexOnTrack(std::move(localParams), std::move(errorMatrix), surface);
395 ATH_MSG_DEBUG(
"the VertexOnTrack created from vertex: "<<*vot);
◆ provideVtxBeamspot()
Definition at line 491 of file BeamspotVertexPreProcessor.cxx.
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);
505 float z0 =
b->originalPosition()->z();
506 (*v)(0) = beamSpotX +
std::tan(beamTiltX) * (
z0-beamSpotZ);
507 (*v)(1) = beamSpotY +
std::tan(beamTiltY) * (
z0-beamSpotZ);
509 (*q)(0,0) = beamSigmaX*beamSigmaX;
510 (*q)(1,1) = beamSigmaY*beamSigmaY;
511 (*q)(2,2) = beamSigmaZ*beamSigmaZ;
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 <<
" )");
◆ renounce()
◆ renounceArray()
◆ selectUpdatedVertices()
bool Trk::BeamspotVertexPreProcessor::selectUpdatedVertices |
( |
const xAOD::Vertex * |
updatedVtx | ) |
const |
|
private |
Definition at line 196 of file BeamspotVertexPreProcessor.cxx.
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() );
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() );
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 ");
◆ 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 |
( |
| ) |
|
|
overridevirtual |
◆ 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
PublicToolHandle<IAlignModuleTool> Trk::BeamspotVertexPreProcessor::m_alignModuleTool |
|
private |
◆ m_AlignVertices
◆ m_allTracksVector
◆ m_beamSpotKey
◆ m_BSScalingFactor
DoubleProperty Trk::BeamspotVertexPreProcessor::m_BSScalingFactor |
|
private |
◆ m_BSTrackSelector
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 |
◆ m_detStore
◆ 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
◆ m_extrapolator
ToolHandle<IExtrapolator> Trk::BeamspotVertexPreProcessor::m_extrapolator |
|
private |
◆ m_logStream
std::ostream* Trk::IAlignTrackPreProcessor::m_logStream = nullptr |
|
protectedinherited |
◆ m_maxPt
DoubleProperty Trk::BeamspotVertexPreProcessor::m_maxPt |
|
private |
◆ 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 |
◆ m_nFailedNormalRefits
int Trk::BeamspotVertexPreProcessor::m_nFailedNormalRefits = 0 |
|
private |
◆ m_nFailedPVRefits
int Trk::BeamspotVertexPreProcessor::m_nFailedPVRefits = 0 |
|
private |
◆ m_nTracks
int Trk::BeamspotVertexPreProcessor::m_nTracks = 0 |
|
private |
◆ 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
◆ 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 |
◆ 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
◆ 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
Initial value:{
this, "TrackFitter", "Trk::GlobalChi2Fitter/InDetTrackFitter",
"normal track fitter"}
Definition at line 93 of file BeamspotVertexPreProcessor.h.
◆ m_trackToVertexIPEstimatorTool
◆ m_trackTypeCounter
std::vector<int> Trk::BeamspotVertexPreProcessor::m_trackTypeCounter {} |
|
private |
◆ m_trkSelector
◆ m_useSingleFitter
BooleanProperty Trk::BeamspotVertexPreProcessor::m_useSingleFitter |
|
private |
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files:
const ShapeFitter * fitter
IntegerProperty m_minTrksInVtx
AmgMatrix(3, 3) NeutralParticleParameterCalculator
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
Eigen::Matrix< double, Eigen::Dynamic, 1 > VectorX
Dynamic Vector - dynamic allocation.
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
BooleanProperty m_refitTracks
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)
DoubleProperty m_BSScalingFactor
BooleanProperty m_doTrkSelection
ToolHandle< ITrackToVertexIPEstimator > m_trackToVertexIPEstimatorTool
Scalar perp() const
perp method - perpenticular length
Eigen::Matrix< double, 2, 1 > Vector2D
Dummy class used to allow special convertors to be called for surfaces owned by a detector element.
BooleanProperty m_doFullVertexConstraint
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.
std::ostream * m_logStream
logfile output stream
ToolHandle< InDet::IInDetTrackSelectionTool > m_trkSelector
#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
VxType::VertexType vertexType() const
The type of the vertex.
BooleanProperty m_runOutlierRemoval
BooleanProperty m_doPrimaryVertexConstraint
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
PublicToolHandle< IAlignModuleTool > m_alignModuleTool
Pointer to AlignModuleTool.
AmgSymMatrix(5) &GXFTrackState
AlignModule is a grouping of TrkDetElementBase objects, grouped according to the type of alignment,...
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
ToolHandle< IExtrapolator > m_extrapolator
@ BeamspotConstrained
refitted with beamspot constraint
SG::ReadCondHandleKey< InDet::BeamSpotData > m_beamSpotKey
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
std::vector< int > m_trackTypeCounter
bool isAssociatedToVertex(const Track *track, const xAOD::Vertex *vertex)
void prepareAllTracksVector()
SG::ReadHandleKey< xAOD::VertexContainer > m_PVContainerName
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
BooleanProperty m_doAssociatedToPVSelection
IntegerProperty m_particleNumber
int m_nFailedNormalRefits
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition of ATLAS Math & Geometry primitives (Amg)
bool selectVertices(const xAOD::Vertex *vtx) const
ParametersBase< TrackParametersDim, Charged > TrackParameters
BooleanProperty m_useSingleFitter
value_type push_back(value_type pElem)
Add an element to the end of the collection.
StatusCode initialize(bool used=true)
BooleanProperty m_doNormalRefit
Eigen::Matrix< double, 3, 1 > Vector3D
const xAOD::Vertex * findVertexCandidate(const Track *track) const
BooleanProperty m_storeFitMatrices
UnsignedIntegerProperty m_constraintMode
float numberDoF() const
Returns the number of degrees of freedom of the vertex fit as float.
BooleanProperty m_doBeamspotConstraint
Class describing a Vertex.
@ Original
not refitted, just copy constructed from original Track
ToolHandle< IGlobalTrackFitter > m_trackFitter
#define ATH_MSG_WARNING(x)
@ NormalRefitted
normally refitted, without adding any pseudo-measurement
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
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.
@ VertexConstrained
refitted with vertex constraint
AlignVertex is a simple structure to store objects belonging to a vertex. Contains a pointer to the o...
DoubleProperty m_PVScalingFactor
size_type size() const noexcept
Returns the number of elements in the collection.
ToolHandle< IGlobalTrackFitter > m_SLTrackFitter
ToolHandle< InDet::IInDetTrackSelectionTool > m_BSTrackSelector
bool empty() const noexcept
Returns true if the collection is empty.
AlignTrack * doTrackRefit(const Track *track)
AlignTrack is a generalization of a Trk::Track, used as the basic object to contain track information...
BooleanProperty m_doBSTrackSelection
bool selectUpdatedVertices(const xAOD::Vertex *updatedVtx) const