|
ATLAS Offline Software
|
#include <GaussianDensityTestAlg.h>
|
| GaussianDensityTestAlg (const std::string &name, ISvcLocator *pSvcLocator) |
| Constructor with parameters: More...
|
|
virtual | ~GaussianDensityTestAlg () |
| Destructor: More...
|
|
virtual StatusCode | initialize () |
|
virtual StatusCode | execute () |
|
virtual StatusCode | finalize () |
|
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 |
|
|
double | ipSignificance (const Trk::TrackParameters *params, const Amg::Vector3D *vertex) const |
|
StatusCode | findTruth (double mode, const std::vector< Trk::ITrackLink * > &trackVector, std::vector< Amg::Vector3D > &truth, TH1 *h_truthDensity, TH1 *h_modeCheck) const |
|
| GaussianDensityTestAlg () |
|
void | selectTracks (const xAOD::TrackParticleContainer *trackParticles, std::vector< Trk::ITrackLink * > &trackVector) |
|
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...
|
|
Definition at line 46 of file GaussianDensityTestAlg.h.
◆ StoreGateSvc_t
◆ GaussianDensityTestAlg() [1/2]
Trk::GaussianDensityTestAlg::GaussianDensityTestAlg |
( |
const std::string & |
name, |
|
|
ISvcLocator * |
pSvcLocator |
|
) |
| |
◆ ~GaussianDensityTestAlg()
Trk::GaussianDensityTestAlg::~GaussianDensityTestAlg |
( |
| ) |
|
|
virtualdefault |
◆ GaussianDensityTestAlg() [2/2]
Trk::GaussianDensityTestAlg::GaussianDensityTestAlg |
( |
| ) |
|
|
private |
◆ analyzeTracks()
Definition at line 124 of file GaussianDensityTestAlg.cxx.
127 for (
auto *seedtrkAtVtxIter : trackVector)
129 perigeeList.push_back( seedtrkAtVtxIter->parameters() );
◆ 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()
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ execute()
StatusCode Trk::GaussianDensityTestAlg::execute |
( |
| ) |
|
|
virtual |
Definition at line 82 of file GaussianDensityTestAlg.cxx.
89 std::vector<Trk::ITrackLink*> trackVector;
92 std::vector<const Trk::TrackParameters*> perigeeList;
96 std::unique_ptr<Trk::IVertexTrackDensityEstimator::ITrackDensity> dens;
101 for (
int i = 0;
i < 800;
i++)
103 double z = -200.0 + 0.25 +
i*0.5;
109 std::vector<Amg::Vector3D> truth;
117 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 Trk::GaussianDensityTestAlg::finalize |
( |
| ) |
|
|
virtual |
◆ findTruth()
StatusCode Trk::GaussianDensityTestAlg::findTruth |
( |
double |
mode, |
|
|
const std::vector< Trk::ITrackLink * > & |
trackVector, |
|
|
std::vector< Amg::Vector3D > & |
truth, |
|
|
TH1 * |
h_truthDensity, |
|
|
TH1 * |
h_modeCheck |
|
) |
| const |
|
private |
Definition at line 175 of file GaussianDensityTestAlg.cxx.
186 if ( signalEvents.isValid() )
192 if (vLink ==
nullptr){
193 ATH_MSG_ERROR(
"Invalid truthVertexLink from signalEvents in GaussianDensityTestAlg::findTruth");
194 return StatusCode::FAILURE;
198 for (
auto *trk : trackVector)
203 bool isAssoc = truthParticleAssoc(**(*lxtp)).
isValid();
206 const auto& assocParticle = truthParticleAssoc(**(*lxtp));
208 for (
const auto& truthParticle :
evt->truthParticleLinks())
210 if (!truthParticle.isValid())
continue;
211 if (assocParticle == truthParticle)
224 h_truthDensity->Fill(vLink->
z());
240 truth.push_back(vTruth);
241 if (abs(modeClosestDistance) > abs(
mode - vTruth[2]))
242 modeClosestDistance =
mode - vTruth[2];
252 if ( pileupEvents.isValid() )
258 if (vLink ==
nullptr) {
260 return StatusCode::FAILURE;
264 for (
auto *trk : trackVector)
269 bool isAssoc = truthParticleAssoc(**(*lxtp)).
isValid();
272 const auto& assocParticle = truthParticleAssoc(**(*lxtp));
274 for (
const auto& truthParticle :
evt->truthParticleLinks())
276 if (!truthParticle.isValid())
continue;
277 if (assocParticle == truthParticle)
290 h_truthDensity->Fill(vLink->
z());
306 truth.push_back(vTruth);
307 if (abs(modeClosestDistance) > abs(
mode - vTruth[2]))
308 modeClosestDistance =
mode - vTruth[2];
317 h_modeCheck->Fill( modeClosestDistance );
318 return StatusCode::SUCCESS;
◆ initialize()
StatusCode Trk::GaussianDensityTestAlg::initialize |
( |
| ) |
|
|
virtual |
◆ 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.
◆ ipSignificance()
Definition at line 321 of file GaussianDensityTestAlg.cxx.
325 v.makePrivateStore();
328 v.setFitQuality(0., 0.);
330 double significance = 0.0;
332 if ( ipas !=
nullptr )
334 if ( ipas->sigmad0 > 0 && ipas->sigmaz0 > 0)
336 significance = sqrt(
pow(ipas->IPd0/ipas->sigmad0,2) +
pow(ipas->IPz0/ipas->sigmaz0,2) );
◆ 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()
◆ selectTracks()
Definition at line 133 of file GaussianDensityTestAlg.cxx.
136 bool selectionPassed{
false};
140 if(beamSpotHandle.isValid()) beamspot = beamSpotHandle.retrieve();
142 for (
auto itr = trackParticles->
begin(); itr != trackParticles->
end(); ++itr) {
148 selectionPassed=
static_cast<bool>(
m_trackFilter->accept(**itr,&beamposition));
156 vertexError.setZero();
157 null.setCovariancePosition(vertexError);
166 trackVector.push_back(linkTT);
◆ 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_beamSpotKey
◆ m_detStore
◆ m_estimator
Initial value:{ this, "Estimator", "Trk::GaussianTrackDensity",
"Track density function" }
Definition at line 114 of file GaussianDensityTestAlg.h.
◆ m_evtStore
◆ m_extendedExtraObjects
DataObjIDColl AthAlgorithm::m_extendedExtraObjects |
|
privateinherited |
◆ m_firstEvent
bool Trk::GaussianDensityTestAlg::m_firstEvent |
|
private |
◆ m_h_density
TH1* Trk::GaussianDensityTestAlg::m_h_density {} |
|
private |
◆ m_h_modeCheck
TH1* Trk::GaussianDensityTestAlg::m_h_modeCheck {} |
|
private |
◆ m_h_truthDensity
TH1* Trk::GaussianDensityTestAlg::m_h_truthDensity {} |
|
private |
◆ m_h_truthVertices
TH1* Trk::GaussianDensityTestAlg::m_h_truthVertices {} |
|
private |
◆ m_ipEstimator
Initial value:{ this, "IPEstimator", "Trk::TrackToVertexIPEstimator",
"Impact point estimator" }
Definition at line 117 of file GaussianDensityTestAlg.h.
◆ m_iTHistSvc
ServiceHandle< ITHistSvc > Trk::GaussianDensityTestAlg::m_iTHistSvc |
|
private |
◆ m_pileupEventsKey
Initial value:{ this, "TruthPileupEvents", "TruthPileupEvents",
"Key for truth pileup event collection" }
Definition at line 132 of file GaussianDensityTestAlg.h.
◆ m_significanceTruthCut
Gaudi::Property<double> Trk::GaussianDensityTestAlg::m_significanceTruthCut |
|
private |
Initial value:{ this,
"SignificanceTruthCut",
3.0,
"Reco track must pass within this many sigma of pp vertex to be good" }
Definition at line 96 of file GaussianDensityTestAlg.h.
◆ m_trackFilter
Initial value:{ this, "TrackSelector",
"InDet::InDetTrackSelectionTool/InDetDetailedTrackSelectionTool",
"Track selection tool" }
Definition at line 110 of file GaussianDensityTestAlg.h.
◆ m_trackParticlesKey
Initial value:{ this, "TrackParticles", "InDetTrackParticles",
"Input track particle collection" }
Data handle keys.
Definition at line 126 of file GaussianDensityTestAlg.h.
◆ m_truthEventsKey
Initial value:{ this, "TruthEvents", "TruthEvents",
"Key for truth event collection" }
Definition at line 129 of file GaussianDensityTestAlg.h.
◆ m_truthVertexTracks
Gaudi::Property<int> Trk::GaussianDensityTestAlg::m_truthVertexTracks |
|
private |
Initial value:{ this,
"MinTruthVertexTracks",
2,
"Minimum associated reconstructed tracks for vertex to be considered visible" }
Definition at line 101 of file GaussianDensityTestAlg.h.
◆ m_useBeamConstraint
bool Trk::GaussianDensityTestAlg::m_useBeamConstraint |
|
private |
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files:
void setPosition(const Amg::Vector3D &position)
Sets the 3-position.
void selectTracks(const xAOD::TrackParticleContainer *trackParticles, std::vector< Trk::ITrackLink * > &trackVector)
@ z
global position (cartesian)
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.
StatusCode accept(const xAOD::Muon *mu)
ToolHandle< InDet::IInDetTrackSelectionTool > m_trackFilter
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
Helper class to provide constant type-safe access to aux data.
const Trk::RecVertex & beamVtx() const noexcept
#define ATH_MSG_VERBOSE(x)
ToolHandle< Trk::IVertexTrackDensityEstimator > m_estimator
bool isValid() const
Test to see if the link can be dereferenced.
float y() const
Vertex y displacement.
virtual void setOwner(IDataHandleHolder *o)=0
static void analyzeTracks(const std::vector< Trk::ITrackLink * > &trackVector, std::vector< const Trk::TrackParameters * > &perigeeList)
ServiceHandle< ITHistSvc > m_iTHistSvc
AmgSymMatrix(5) &GXFTrackState
virtual StatusCode sysInitialize() override
Override sysInitialize.
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_trackParticlesKey
Data handle keys.
::StatusCode StatusCode
StatusCode definition for legacy code.
Element link to XAOD TrackParticle.
#define CHECK(...)
Evaluate an expression and check for errors.
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
const Amg::Vector3D & position() const
return position of vertex
SG::ReadHandleKey< xAOD::TruthEventContainer > m_truthEventsKey
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
bool setElement(ElementType element)
Set to point to an element.
Gaudi::Property< double > m_significanceTruthCut
Base class describing a pile-up or signal truth event in the MC record.
Class describing a truth vertex in the MC record.
bool setStorableObject(BaseConstReference data, bool replace=false, IProxyDict *sg=0)
Set link to point to a new container (storable).
StatusCode initialize(bool used=true)
void makePrivateStore()
Create a new (empty) private store for this object.
Eigen::Matrix< double, 3, 1 > Vector3D
Gaudi::Property< int > m_truthVertexTracks
float x() const
Vertex x displacement.
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
StatusCode findTruth(double mode, const std::vector< Trk::ITrackLink * > &trackVector, std::vector< Amg::Vector3D > &truth, TH1 *h_truthDensity, TH1 *h_modeCheck) const
DataObjIDColl m_extendedExtraObjects
SG::ReadCondHandleKey< InDet::BeamSpotData > m_beamSpotKey
Class describing a Vertex.
SG::ReadHandleKey< xAOD::TruthPileupEventContainer > m_pileupEventsKey
#define ATH_MSG_WARNING(x)
float z() const
Vertex longitudinal distance along the beam line form the origin.
ToolHandle< Trk::ITrackToVertexIPEstimator > m_ipEstimator
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
AthAlgorithm()
Default constructor:
TH1 * m_h_density
Histograms and trees.
def TH1F(name, title, nxbins, bins_par2, bins_par3=None, path='', **kwargs)
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
void setCovariancePosition(const AmgSymMatrix(3)&covariancePosition)
Sets the vertex covariance matrix.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
double ipSignificance(const Trk::TrackParameters *params, const Amg::Vector3D *vertex) const