50 declareInterface<Trk::IFillNtupleTool>(
this);
82 ATH_MSG_FATAL(
"m_alignModuleTool is empty in DetailedIDNtupleTool::initialize()");
83 return StatusCode::FAILURE;
87 return StatusCode::SUCCESS;
96 return StatusCode::SUCCESS;
102 return StatusCode::SUCCESS;
119 if (
evtStore()->retrieve(eventInfo).isFailure()) {
127 constexpr double invalidParameterValue{-999.};
128 m_d0 = invalidParameterValue;
129 m_z0 = invalidParameterValue;
130 m_phi0 = invalidParameterValue;
131 m_theta = invalidParameterValue;
133 m_pt = invalidParameterValue;
134 m_eta = invalidParameterValue;
135 constexpr double invalidChiSq{-1e12};
138 constexpr int invalidDegreesOfFreedom{-999};
140 m_ndof = invalidDegreesOfFreedom;
141 m_xvtx = invalidParameterValue;
142 m_yvtx = invalidParameterValue;
143 m_zvtx = invalidParameterValue;
198 ATH_MSG_ERROR(
"Could not get Trk::Perigee of the alignTrack");
207 const AmgSymMatrix(5) * locCov = aMeasPer->covariance();
227 if (not fitQual)
ATH_MSG_ERROR(
"No fit quality assigned to the track");
246 ATH_MSG_ERROR(
" Seems the pseudo-measuremnt in the alignTrack not exist!");
247 ATH_MSG_ERROR(
" this pseudo-measurement has been rejected as outlier in the refitting!");
253 ATH_MSG_DEBUG(
" the pseudo-measurement position: " << refPoint);
257 if (!originalMeasPer) {
266 const AmgSymMatrix(5) * locError = originalMeasPer->covariance();
282 if (not originalFitQual)
ATH_MSG_ERROR(
"No fit quality assigned to the track");
300 if (!originalPerigeeAtRef) {
302 if (originalTrackPerigee && ((originalTrackPerigee->
associatedSurface())) == persf) {
303 ATH_MSG_DEBUG(
"Perigee of Track is already expressed to given vertex, a copy is returned.");
304 originalPerigeeAtRef = originalTrackPerigee->
clone();
305 }
else ATH_MSG_DEBUG(
"Extrapolation to Perigee failed, NULL pointer is returned.");
308 if (originalPerigeeAtRef) {
309 std::unique_ptr<const Trk::Perigee > originalMeasPerAtRef(originalPerigeeAtRef);
322 ATH_MSG_DEBUG(
"Perigee of AlignTrack is already expressed to given vertex, a copy is returned.");
323 PerigeeAtRef = alignTrackPerigee->
clone();
324 }
else ATH_MSG_DEBUG(
"Extrapolation to Perigee failed, NULL pointer is returned.");
329 std::unique_ptr<const Trk::Perigee > MeasPerAtRef((PerigeeAtRef));
362 " reconstructed tracks from storegate");
364 ATH_MSG_WARNING(
"RecCollection is null pointer in DetailedIDNtupleTool::retrieveTruthInfo");
376 "Track Truth Collection with name " <<
m_tracksTruthName <<
" with size " << TruthMap->size() <<
377 " found in StoreGate");
384 if (measPer ==
nullptr) {
385 ATH_MSG_DEBUG(
"No measured perigee parameters assigned to the track");
394 TrackTruthCollection::const_iterator found = TruthMap->find(tracklink2);
395 if ((found != TruthMap->end()) && (found->second.probability() >
m_matchProbability)) {
403 const HepMC::GenParticle* genparptr = HMPL.
cptr();
407 if (genparptr->production_vertex()) {
408 if (genparptr->pdg_id() == 0) {
409 ATH_MSG_INFO(
"PDG ID is zero in DetailedIDNtupleTool::retrieveTruthInfo");
412 if (!generatedTrackPerigee)
ATH_MSG_WARNING(
"Unable to extrapolate genparticle to perigee!");
416 generatedTrackPerigee->parameters()[
Trk::theta]);
427 delete generatedTrackPerigee;
449 aMeasPer = (i->trackParameters());
454 ATH_MSG_ERROR(
"Could not get Trk::MeasuredPerigee of the alignTrack");
477 m_tree =
new TTree(
"IDAlign",
"Inner Detector Alignment Ntuple");
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
#define AmgSymMatrix(dim)
DataVector< Trk::Track > TrackCollection
This typedef represents a collection of Trk::Track objects.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
ServiceHandle< StoreGateSvc > & evtStore()
size_type size() const noexcept
Returns the number of elements in the collection.
ElementLink implementation for ROOT usage.
bool setElement(ElementType element)
Set link to point to an Element (slowest).
bool setStorableObject(BaseConstReference data, bool replace=false)
Set link storable to data object pointed by data (slower).
a link optimized in size for a GenParticle in a McEventCollection
bool isValid() const
Validity check.
HepMC::ConstGenParticlePtr cptr() const
Dereference.
HepMC::ConstGenParticlePtr scptr() const
Dereference/smart pointer.
MC particle associated with a reco track + the quality of match.
const HepMcParticleLink & particleLink() const
const Track * originalTrack() const
retrieve pointer to original track
@ NormalRefitted
normally refitted, without adding any pseudo-measurement
@ BeamspotConstrained
refitted with beamspot constraint
AlignTrackType type() const
get and set the refit type
Class to represent and store fit qualities from track reconstruction in terms of and number of degre...
int numberDoF() const
returns the number of degrees of freedom of the overall track or vertex fit as integer
double chiSquared() const
returns the of the overall track fit
This class is the pure abstract base class for all fittable tracking measurements.
virtual const Surface & associatedSurface() const =0
Interface method to get the associated Surface.
double eta() const
Access method for pseudorapidity - from momentum.
const Amg::Vector3D & momentum() const
Access method for the momentum.
const Amg::Vector3D & position() const
Access method for the position.
virtual ParametersT< DIM, T, S > * clone() const override final
Virtual clone.
virtual const S & associatedSurface() const override final
Access to the Surface method.
Class describing the Line to which the Perigee refers to.
const Amg::Vector3D & center() const
Returns the center position of the Surface.
@ Perigee
This represents a perigee, and so will contain a Perigee object only.
const Trk::TrackStates * trackStateOnSurfaces() const
return a pointer to a const DataVector of const TrackStateOnSurfaces.
const DataVector< const MeasurementBase > * measurementsOnTrack() const
return a pointer to a vector of MeasurementBase (NOT including any that come from outliers).
const Perigee * perigeeParameters() const
return Perigee.
const FitQuality * fitQuality() const
return a pointer to the fit quality const-overload
Class to handle Vertex On Tracks, it inherits from the common MeasurementBase.
uint32_t runNumber() const
The current event's run number.
uint64_t eventNumber() const
The current event's event number.
static std::string release
double error(const Amg::MatrixX &mat, int index)
return diagonal error of the matrix caller should ensure the matrix is symmetric and the index is in ...
Eigen::Matrix< double, 3, 1 > Vector3D
const GenParticle * ConstGenParticlePtr
ParametersT< TrackParametersDim, Charged, PerigeeSurface > Perigee
ParametersBase< TrackParametersDim, Charged > TrackParameters
EventInfo_v1 EventInfo
Definition of the latest event info version.