Loading [MathJax]/extensions/tex2jax.js
 |
ATLAS Offline Software
|
#include <PrimaryVertexReFitter.h>
|
| PrimaryVertexReFitter (const std::string &name, ISvcLocator *pSvcLocator) |
|
virtual StatusCode | initialize () override |
|
virtual StatusCode | execute () override |
|
virtual StatusCode | finalize () override |
|
virtual StatusCode | sysInitialize () override |
| Override sysInitialize. More...
|
|
virtual const DataObjIDColl & | extraOutputDeps () const override |
| Return the list of extra output dependencies. 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 | 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 |
|
Definition at line 55 of file PrimaryVertexReFitter.h.
◆ accessorFloat_t
◆ StoreGateSvc_t
◆ PrimaryVertexReFitter()
Prompt::PrimaryVertexReFitter::PrimaryVertexReFitter |
( |
const std::string & |
name, |
|
|
ISvcLocator * |
pSvcLocator |
|
) |
| |
◆ 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]
◆ decorateLepWithReFitPrimaryVertex()
Definition at line 251 of file PrimaryVertexReFitter.cxx.
263 ATH_MSG_WARNING(
"decorateLepWithReFitPrimaryVertex - invalid input primary vertex pointer");
271 std::vector<const xAOD::TrackParticle*> priVtx_tracks_pass;
272 bool isRefit =
false;
275 if(
track == tracklep) {
277 ATH_MSG_DEBUG(
"decorateLepWithReFitPrimaryVertex -- lepton has been used, lepton pT =" << tracklep->
pt() <<
", track pT =" <<
track->pt());
281 priVtx_tracks_pass.push_back(
track);
285 ATH_MSG_DEBUG(
"decorateLepWithReFitPrimaryVertex -- Skip the primary vertex without lepton track");
290 if(priVtx_tracks_pass.size() < 2) {
291 ATH_MSG_DEBUG(
"decorateLepWithReFitPrimaryVertex -- Skip the primary vertex refitting: N tracks =" << priVtx_tracks_pass.size());
296 std::unique_ptr<xAOD::Vertex> refittedVtxRMLep =
m_vertexFitterTool->fitVertexWithSeed(
297 input, priVtx_tracks_pass,
input.priVtx->position(),
300 if(refittedVtxRMLep) {
301 ATH_MSG_DEBUG(
"decorateLepWithReFitPrimaryVertex -- save refitted non-prompt primary vertex with NTrack = " << refittedVtxRMLep->
nTrackParticles());
303 if(
input.refittedPriVtx) {
304 (*m_distToRefittedPriVtx) (*refittedVtxRMLep) =
Prompt::getDistance(
input.refittedPriVtx->position(), refittedVtxRMLep->position());
306 input.refittedPriVtx->position(),
307 refittedVtxRMLep->position(),
308 refittedVtxRMLep->covariance(),
315 refitVtxContainer.
push_back(std::move(refittedVtxRMLep));
◆ detStore()
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ execute()
StatusCode Prompt::PrimaryVertexReFitter::execute |
( |
| ) |
|
|
overridevirtual |
Definition at line 91 of file PrimaryVertexReFitter.cxx.
93 const EventContext& ctx = Gaudi::Hive::currentContext();
104 if (!h_inDetTracks.isValid()){
105 ATH_MSG_FATAL(
"execute - failed to find the InDetTrackParticles");
106 return StatusCode::FAILURE;
115 std::unique_ptr<xAOD::VertexContainer> refitVtxContainer = std::make_unique< xAOD::VertexContainer>();
116 std::unique_ptr<xAOD::VertexAuxContainer> refitVtxContainerAux = std::make_unique< xAOD::VertexAuxContainer>();
118 refitVtxContainer->setStore(refitVtxContainerAux.get());
122 std::move(refitVtxContainer), std::move(refitVtxContainerAux)
130 if (!h_leptonContainer.isValid()){
131 ATH_MSG_FATAL(
"execute - failed to find the lepton container");
132 return StatusCode::FAILURE;
136 if (!h_vertices.isValid()){
138 return StatusCode::FAILURE;
147 if(
vertex->vertexType() == 1) {
153 if(!fittingInput.priVtx) {
154 ATH_MSG_INFO(
"Failed to find primary vertices - save empty containers");
155 return StatusCode::SUCCESS;
161 std::vector<const xAOD::TrackParticle *> priVtx_tracks;
162 priVtx_tracks.reserve(fittingInput.priVtx->nTrackParticles());
164 for(
unsigned k = 0;
k < fittingInput.priVtx->nTrackParticles(); ++
k) {
168 priVtx_tracks.push_back(
track);
174 fittingInput, priVtx_tracks,
175 fittingInput.priVtx->position(),
179 if(!refittedPriVtx) {
180 ATH_MSG_WARNING(
"Failed to refit primary vertex - save empty containers");
181 return StatusCode::SUCCESS;
187 fittingInput.refittedPriVtx = refittedPriVtx.get();
189 ATH_MSG_DEBUG(
"execute -- primary vertex NTrack = " << fittingInput.priVtx ->nTrackParticles());
190 ATH_MSG_DEBUG(
"execute -- refitted primary vertex NTrack = " << fittingInput.refittedPriVtx->nTrackParticles());
196 <<
"\n\t\t\t Size of lepton container: " << leptonContainer.
size()
197 <<
"\n-----------------------------------------------------------------");
220 if(
muon->inDetTrackParticleLink().isValid()) {
221 tracklep = *(
muon->inDetTrackParticleLink());
224 ATH_MSG_DEBUG(
"PrimaryVertexReFitter::execute - skip muon without valid inDetTrackParticleLink()");
230 ATH_MSG_WARNING(
"PrimaryVertexReFitter::execute - cannot find muon->inDetTrackParticleLink() nor electron->trackParticle()");
240 h_refitVtxContainer->push_back(std::move(refittedPriVtx));
247 return StatusCode::SUCCESS;
◆ 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
◆ extraOutputDeps()
const DataObjIDColl & AthAlgorithm::extraOutputDeps |
( |
| ) |
const |
|
overridevirtualinherited |
Return the list of extra output dependencies.
This list is extended to include symlinks implied by inheritance relations.
Definition at line 50 of file AthAlgorithm.cxx.
57 return Algorithm::extraOutputDeps();
◆ finalize()
StatusCode Prompt::PrimaryVertexReFitter::finalize |
( |
| ) |
|
|
overridevirtual |
◆ initialize()
StatusCode Prompt::PrimaryVertexReFitter::initialize |
( |
| ) |
|
|
overridevirtual |
◆ 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.
◆ 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.
◆ renounce()
◆ renounceArray()
◆ sysInitialize()
StatusCode AthAlgorithm::sysInitialize |
( |
| ) |
|
|
overridevirtualinherited |
◆ 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_detStore
◆ m_distToRefittedPriVtx
std::optional<accessorFloat_t> Prompt::PrimaryVertexReFitter::m_distToRefittedPriVtx |
|
private |
◆ m_distToRefittedPriVtxName
Gaudi::Property<std::string> Prompt::PrimaryVertexReFitter::m_distToRefittedPriVtxName |
|
private |
◆ m_evtStore
◆ m_extendedExtraObjects
DataObjIDColl AthAlgorithm::m_extendedExtraObjects |
|
privateinherited |
◆ m_inDetTracksKey
◆ m_lepRefittedVtxWithoutLeptonLinkName
◆ m_leptonContainerKey
Initial value:{
this,
"LeptonContainerName",
"lepContainerNameDefault", "Name of lepton container"
}
Definition at line 116 of file PrimaryVertexReFitter.h.
◆ m_normdistToRefittedPriVtx
std::optional<accessorFloat_t> Prompt::PrimaryVertexReFitter::m_normdistToRefittedPriVtx |
|
private |
◆ m_normDistToRefittedPriVtxName
Gaudi::Property<std::string> Prompt::PrimaryVertexReFitter::m_normDistToRefittedPriVtxName |
|
private |
◆ m_primaryVertexContainerKey
Initial value:{
this, "PriVertexContainerName", "PrimaryVertices",
"Name of primary vertex container"
}
Definition at line 121 of file PrimaryVertexReFitter.h.
◆ m_printTime
Gaudi::Property<bool> Prompt::PrimaryVertexReFitter::m_printTime {this, "PrintTime", false} |
|
private |
◆ m_reFitPrimaryVertexKey
◆ m_timerAll
TStopwatch Prompt::PrimaryVertexReFitter::m_timerAll |
|
private |
◆ m_timerExec
TStopwatch Prompt::PrimaryVertexReFitter::m_timerExec |
|
private |
◆ m_varHandleArraysDeclared
◆ m_vertexFitterTool
Initial value:{
this, "VertexFittingTool", "Prompt::VertexFittingTool/VertexFittingTool"
}
Definition at line 92 of file PrimaryVertexReFitter.h.
◆ m_vhka
The documentation for this class was generated from the following files:
virtual double pt() const override final
The transverse momentum ( ) of the particle.
bool decorateLepWithReFitPrimaryVertex(const FittingInput &input, const xAOD::TrackParticle *tracklep, const std::vector< const xAOD::TrackParticle * > &tracks, xAOD::VertexContainer &refitVtxContainer)
size_t nTrackParticles() const
Get the number of tracks associated with this vertex.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
ToolHandle< Prompt::VertexFittingTool > m_vertexFitterTool
SG::ReadHandleKey< xAOD::IParticleContainer > m_leptonContainerKey
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
SG::WriteHandleKey< xAOD::VertexContainer > m_reFitPrimaryVertexKey
const xAOD::TrackParticle * trackParticle(size_t index=0) const
Pointer to the xAOD::TrackParticle/s that match the electron candidate.
Class providing the definition of the 4-vector interface.
std::string PrintResetStopWatch(TStopwatch &watch)
Gaudi::Property< std::string > m_normDistToRefittedPriVtxName
SG::WriteDecorHandleKey< xAOD::IParticleContainer > m_lepRefittedVtxWithoutLeptonLinkName
def timer(name, disabled=False)
virtual void setOwner(IDataHandleHolder *o)=0
@ kRefittedPriVtxWithoutLep
double getNormDist(const Amg::Vector3D &PrimVtx, const Amg::Vector3D &SecVtx, const std::vector< float > &ErrorMatrix, MsgStream &msg)
virtual StatusCode sysInitialize() override
Override sysInitialize.
double getDistance(const xAOD::Vertex *vtx1, const xAOD::Vertex *vtx2)
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
Object reference supporting deferred reading from StoreGate.
::StatusCode StatusCode
StatusCode definition for legacy code.
Handle class for adding a decoration to an object.
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Gaudi::Property< bool > m_printTime
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
ElementLink implementation for ROOT usage.
std::optional< accessorFloat_t > m_normdistToRefittedPriVtx
value_type push_back(value_type pElem)
Add an element to the end of the collection.
const xAOD::TrackParticle * getOriginalTrackParticleFromGSF(const xAOD::TrackParticle *trkPar)
Helper function for getting the "Original" Track Particle (i.e before GSF) via the GSF Track Particle...
DataObjIDColl m_extendedExtraObjects
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_inDetTracksKey
SG::ReadHandleKey< xAOD::VertexContainer > m_primaryVertexContainerKey
Class describing a Vertex.
#define ATH_MSG_WARNING(x)
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
AthAlgorithm()
Default constructor:
Gaudi::Property< std::string > m_distToRefittedPriVtxName
Class describing a TrackParticle.
size_type size() const noexcept
Returns the number of elements in the collection.
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
std::optional< accessorFloat_t > m_distToRefittedPriVtx