|
ATLAS Offline Software
|
Go to the documentation of this file.
27 declareInterface<MuPatHitTool>(
this);
41 return StatusCode::SUCCESS;
59 const std::vector<const Trk::MeasurementBase*>& measVec,
MuPatHitList& hitList)
const {
78 std::unique_ptr<const Trk::TrackParameters> exPars;
80 exPars =
pars.uniqueClone();
81 ATH_MSG_VERBOSE(
" start parameters and measurement expressed at same surface, cloning parameters ");
84 if (!exPars) {
continue; }
89 std::unique_ptr<MuPatHit> hit = std::make_unique<MuPatHit>(std::move(exPars), meas->uniqueClone(), std::move(broadMeas), hitInfo);
90 hitList.push_back(std::move(hit));
94 std::stable_sort(hitList.begin(), hitList.end(), isLargerCal);
133 std::unique_ptr<MuPatHit> hit = std::make_unique<MuPatHit>(
pars->uniqueClone(), meas->
uniqueClone(), std::move(broadMeas), hitInfo);
138 hitList.push_back(std::move(hit));
143 std::stable_sort(hitList.begin(), hitList.end(), isLargerCal);
151 tmpList.reserve(hitList1.size() + hitList2.size());
153 if (!hitList1.empty()) {
156 std::merge(hitList1.begin(), hitList1.end(), hitList2.begin(), hitList2.end(),
157 std::back_inserter(tmpList), isLargerCal);
162 outList.reserve(tmpList.size());
163 std::set<Identifier> used_hits{};
165 std::copy_if(std::make_move_iterator(tmpList.begin()), std::make_move_iterator(tmpList.end()), std::back_inserter(
outList),
166 [&used_hits](
const MuPatHitPtr& pathit) { return used_hits.insert(pathit->info().id).second; });
174 measVec.reserve(hitList.size());
179 const Trk::MeasurementBase* meas = usePreciseHits ? &hit->preciseMeasurement() : &hit->broadMeasurement();
180 measVec.push_back(meas);
187 MuPatHitIt lit = hitList.begin(), lit_end = hitList.end();
188 for (; lit != lit_end; ++lit) {
190 if (hit.
info().
id ==
id) {
202 MuPatHitIt lit = hitList.begin(), lit_end = hitList.end();
203 for (; lit != lit_end; ++lit) {
237 hitInfo.measuresPhi =
true;
240 if (hitInfo.id.is_valid() &&
m_idHelperSvc->isMuon(hitInfo.id)) {
242 hitInfo.measuresPhi =
m_idHelperSvc->measuresPhi(hitInfo.id);
257 ATH_MSG_WARNING(
" found hit with a MDT Identifier that is not a MdtDriftCircleOnTrack "
263 return std::unique_ptr<const Trk::MeasurementBase>(
m_mdtRotCreator->updateError(*mdt));
277 return std::unique_ptr<const Trk::MeasurementBase>(
287 if (!measurements)
return false;
289 std::set<Identifier>
ids;
293 for (; mit != mit_end; ++mit) {
295 if (!
id.is_valid())
continue;
303 MuPatHitIt lit = hitList.begin(), lit_end = hitList.end();
304 for (; lit != lit_end; ++lit) {
315 std::ostringstream sout;
319 std::vector<std::string> idStrings;
320 std::vector<std::string> dataStrings;
321 idStrings.reserve(hitList.size());
322 unsigned int idWidth = 0;
323 std::string
result =
"first ";
324 bool isLarger =
true;
333 if (itNext != it_end) ++itNext;
334 for (;
it != it_end; ++
it, ++itNext) {
337 std::string idStr =
id.is_valid() ?
m_idHelperSvc->toString(
id) :
"pseudo-measurement";
338 idStrings.push_back(idStr);
339 if (idStr.length() > idWidth) idWidth = idStr.length();
341 std::ostringstream dataOss;
343 dataOss <<
"r " << std::fixed << std::setprecision(0) << std::setw(5) <<
pars.position().perp() <<
" z " << std::fixed
344 << std::setprecision(0) << std::setw(6) <<
pars.position().z();
347 dataOss <<
" theta " << std::fixed << std::setprecision(5) << std::setw(7) <<
pars.momentum().theta() <<
" phi "
348 << std::fixed << std::setprecision(3) << std::setw(6) <<
pars.momentum().phi();
351 dataOss <<
" q*p(GeV) " << std::scientific << std::setprecision(3) << std::setw(10)
352 <<
pars.momentum().mag() *
pars.charge() / 1000.;
357 dataStrings.push_back(dataOss.str());
358 if (itNext != it_end) {
359 isLarger = isLargerCal(*
it, *itNext);
362 result = isLarger ?
"larger " :
"smaller";
364 if (isLarger == isLargerCal(*itNext, *
it)) {
366 }
else if (!isLarger) {
367 result +=
" sorting problem ";
373 unsigned int n = idStrings.size();
374 for (
unsigned int i = 0;
i <
n; ++
i) {
375 sout <<
" " << std::left << std::setw(idWidth) << idStrings[
i] << std::right <<
" " << dataStrings[
i];
376 if (
i !=
n - 1) sout << std::endl;
385 if (itNext != it_end) ++itNext;
386 bool isLarger =
true;
389 for (; itNext != it_end; ++
it, ++itNext) {
390 isLarger = isLargerCal(*
it, *itNext);
391 bool sameSurface = (isLarger == isLargerCal(*
it, *itNext));
392 if (!isLarger && !sameSurface)
return false;
393 if (sameSurface)
return false;
398 double& residualPull)
const {
399 std::optional<Trk::ResidualPull> resPull(
402 residual = resPull->residual().front();
403 residualPull = resPull->pull().front();
const TrackParameters * trackParameters() const
return ptr to trackparameters const overload
virtual const Amg::Vector3D & globalPosition() const override
Returns global position.
const Info & info() const
returns a reference to the hit info
@ Unbiased
RP with track state that has measurement not included.
const MeasurementBase * measurementOnTrack() const
returns MeasurementBase const overload
#define ATH_MSG_VERBOSE(x)
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
@ Outlier
This TSoS contains an outlier, that is, it contains a MeasurementBase/RIO_OnTrack which was not used ...
@ Hole
A hole on the track - this is defined in the following way.
const Trk::MeasurementBase & broadMeasurement() const
returns broad measurement
MuPatHitList::const_iterator MuPatHitCit
std::unique_ptr< MeasurementBase > uniqueClone() const
NVI Clone giving up unique pointer.
::StatusCode StatusCode
StatusCode definition for legacy code.
Default for both collision and cosmic parameter sorting.
const std::vector< const Trk::MeasurementBase * > & containedMeasurements() const
returns the vector of Trk::MeasurementBase objects
Status status
Flag whether the hit is on Tack or not.
Out copy_if(In first, const In &last, Out res, const Pred &p)
std::shared_ptr< MuPatHit > MuPatHitPtr
MuPatHitList::iterator MuPatHitIt
represents the track state (measurement, material, fit parameters and quality) at a surface.
virtual const Surface & associatedSurface() const =0
Interface method to get the associated Surface.
This class represents the corrected MDT measurements, where the corrections include the effects of wi...
double charge(const T &p)
std::vector< MuPatHitPtr > MuPatHitList
virtual const CscPrepData * prepRawData() const override final
Returns the CscPrepData - is a CscPrepData in this scope.
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
Type type
Measurement type as defined above.
Class to represent the calibrated clusters created from CSC strips.
#define ATH_MSG_WARNING(x)
const Trk::MeasurementBase & preciseMeasurement() const
returns precise measurement
def merge(input_file_pattern, output_file)
Merge many input LHE files into a single output file.
Identifier id
Identifier of the measurement. Is invalid in cases of pseudo measurements.
@ Scatterer
This represents a scattering point on the track, and so will contain TrackParameters and MaterialEffe...
float distance(const Amg::Vector3D &p1, const Amg::Vector3D &p2)
calculates the distance between two point in 3D space
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
bool measuresPhi
Does the hit constrain phi?