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;
109 const EventContext& ctx = Gaudi::Hive::currentContext();
120 if (
evtStore()->retrieve(eventInfo).isFailure()) {
128 constexpr double invalidParameterValue{-999.};
129 m_d0 = invalidParameterValue;
130 m_z0 = invalidParameterValue;
131 m_phi0 = invalidParameterValue;
132 m_theta = invalidParameterValue;
134 m_pt = invalidParameterValue;
135 m_eta = invalidParameterValue;
136 constexpr double invalidChiSq{-1e12};
139 constexpr int invalidDegreesOfFreedom{-999};
141 m_ndof = invalidDegreesOfFreedom;
142 m_xvtx = invalidParameterValue;
143 m_yvtx = invalidParameterValue;
144 m_zvtx = invalidParameterValue;
199 ATH_MSG_ERROR(
"Could not get Trk::Perigee of the alignTrack");
208 const AmgSymMatrix(5) * locCov = aMeasPer->covariance();
228 if (not fitQual)
ATH_MSG_ERROR(
"No fit quality assigned to the track");
247 ATH_MSG_ERROR(
" Seems the pseudo-measuremnt in the alignTrack not exist!");
248 ATH_MSG_ERROR(
" this pseudo-measurement has been rejected as outlier in the refitting!");
254 ATH_MSG_DEBUG(
" the pseudo-measurement position: " << refPoint);
258 if (!originalMeasPer) {
267 const AmgSymMatrix(5) * locError = originalMeasPer->covariance();
283 if (not originalFitQual)
ATH_MSG_ERROR(
"No fit quality assigned to the track");
301 if (!originalPerigeeAtRef) {
303 if (originalTrackPerigee && ((originalTrackPerigee->
associatedSurface())) == persf) {
304 ATH_MSG_DEBUG(
"Perigee of Track is already expressed to given vertex, a copy is returned.");
305 originalPerigeeAtRef = originalTrackPerigee->
clone();
306 }
else ATH_MSG_DEBUG(
"Extrapolation to Perigee failed, NULL pointer is returned.");
309 if (originalPerigeeAtRef) {
310 std::unique_ptr<const Trk::Perigee > originalMeasPerAtRef(originalPerigeeAtRef);
323 ATH_MSG_DEBUG(
"Perigee of AlignTrack is already expressed to given vertex, a copy is returned.");
324 PerigeeAtRef = alignTrackPerigee->
clone();
325 }
else ATH_MSG_DEBUG(
"Extrapolation to Perigee failed, NULL pointer is returned.");
330 std::unique_ptr<const Trk::Perigee > MeasPerAtRef((PerigeeAtRef));
363 " reconstructed tracks from storegate");
365 ATH_MSG_WARNING(
"RecCollection is null pointer in DetailedIDNtupleTool::retrieveTruthInfo");
377 "Track Truth Collection with name " <<
m_tracksTruthName <<
" with size " << TruthMap->size() <<
378 " found in StoreGate");
385 if (measPer ==
nullptr) {
386 ATH_MSG_DEBUG(
"No measured perigee parameters assigned to the track");
395 TrackTruthCollection::const_iterator found = TruthMap->find(tracklink2);
396 if ((found != TruthMap->end()) && (found->second.probability() >
m_matchProbability)) {
404 const HepMC::GenParticle* genparptr = HMPL.
cptr();
408 if (genparptr->production_vertex()) {
409 if (genparptr->pdg_id() == 0) {
410 ATH_MSG_INFO(
"PDG ID is zero in DetailedIDNtupleTool::retrieveTruthInfo");
413 if (!generatedTrackPerigee)
ATH_MSG_WARNING(
"Unable to extrapolate genparticle to perigee!");
417 generatedTrackPerigee->parameters()[
Trk::theta]);
428 delete generatedTrackPerigee;
450 aMeasPer = (i->trackParameters());
455 ATH_MSG_ERROR(
"Could not get Trk::MeasuredPerigee of the alignTrack");
478 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 to point to an element.
bool setStorableObject(BaseConstReference data, bool replace=false, IProxyDict *sg=0)
Set link to point to a new container (storable).
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.