|
ATLAS Offline Software
|
Go to the documentation of this file.
7 #include "GaudiKernel/ConcurrencyFlags.h"
8 #include "GaudiKernel/IIncidentSvc.h"
9 #include "GaudiKernel/ITHistSvc.h"
29 constexpr
float SIG_VEL = 4.80000;
30 constexpr
float C_VEL = 3.33564;
37 m_segmentHitSummaryTool(
"Muon::MuonSegmentHitSummaryTool/MuonSegmentHitSummaryTool"),
38 m_hitSummaryTool(
"Muon::MuonHitSummaryTool/MuonHitSummaryTool"),
39 m_truthSummaryTool(
"Muon::MuonTruthSummaryTool/MuonTruthSummaryTool"),
40 m_extrapolator(
"Trk::Extrapolation/AtlasExtrapolator"),
41 m_matchingTool(
"MuTagMatchingTool/MuTagMatchingTool"),
42 m_hitTimingTool(
"Muon::MuonHitTimingTool/MuonHitTimingTool"),
43 m_incidentSvc(
"IncidentSvc",
n),
44 m_candidateCounter(0) {
45 declareInterface<IMuonRecoValidationTool>(
this);
59 ATH_MSG_ERROR(
"This tool cannot be used in multi-threaded mode");
60 return StatusCode::FAILURE;
75 SmartIF<ITHistSvc> thistSvc{service(
"THistSvc")};
78 m_tree =
new TTree(
"data",
"RecoValidation");
87 return StatusCode::SUCCESS;
99 if (inc.type() == IncidentType::EndEvent) {
118 truthParticleLinkAcc(
"truthParticleLink");
119 if (truthParticleLinkAcc.
isAvailable(indetTrackParticle)) {
120 const ElementTruthLink_t link = truthParticleLinkAcc(indetTrackParticle);
121 if (link.isValid()) {
122 pdg = (*link)->pdgId();
124 beta = (*link)->p4().Beta();
142 const std::vector<Muon::MuonSystemExtension::Intersection>& layerIntersections = muonSystemExtension.
layerIntersections();
143 ATH_MSG_DEBUG(
"Adding ID track: pt " << indetTrackParticle.
pt() <<
" eta " << indetTrackParticle.
eta() <<
" phi "
144 << indetTrackParticle.
phi() <<
" layers " << layerIntersections.size());
146 for (std::vector<Muon::MuonSystemExtension::Intersection>::const_iterator
it = layerIntersections.begin();
147 it != layerIntersections.end(); ++
it) {
158 std::map<int, int> counters;
159 for (std::set<Identifier>::const_iterator
it =
ids.begin();
it !=
ids.end(); ++
it) {
168 if (
it->second >
max) {
188 for (
const auto& stauHit : stauHits) {
191 double r = sqrt(stauHit.x * stauHit.x + stauHit.y * stauHit.y);
192 double tof = muonBetaCalculationUtils.
calculateTof(1, sqrt(
r *
r + stauHit.z * stauHit.z));
201 stauHit.error, stauHit.propagationTime, stauHit.e, tof, 0., stauHit.shift, 1000 *
m_candidateCounter);
216 const Amg::Vector3D& gpos,
float time,
float errorTime)
const {
239 float segmentTimeCorrection = 0.;
253 std::set<Identifier>
ids;
254 std::vector<const MuonClusterOnTrack*>
clusters;
286 double correct_time_along_strip = 0;
294 double av_correct_time_along_strip = 0;
296 av_correct_time_along_strip = rpc_readout_element->
distanceToEtaReadout(posi) / 1000. * SIG_VEL;
298 av_correct_time_along_strip = rpc_readout_element->
distanceToPhiReadout(posi) / 1000. * SIG_VEL;
302 double real_TOF_onRPCgap = GP.mag() / 1000. * C_VEL;
303 double nominal_TOF_onRPCgap = posi.mag() / 1000. * C_VEL;
306 double correct_time_tot = real_TOF_onRPCgap - nominal_TOF_onRPCgap + correct_time_along_strip - av_correct_time_along_strip;
310 rpc->
globalPosition().z(), rpc->
time(), 2., correct_time_along_strip, av_correct_time_along_strip,
311 real_TOF_onRPCgap, nominal_TOF_onRPCgap, correct_time_tot);
320 const EventContext& ctx = Gaudi::Hive::currentContext();
332 float t0Error =
segment.hasFittedT0() ?
segment.errorTime() : -99999;
337 std::set<Identifier>
ids;
338 std::vector<const MuonClusterOnTrack*>
clusters;
362 std::shared_ptr<Trk::TrackParameters> exPars(
376 std::shared_ptr<Trk::AtaPlane> ataPlane = std::dynamic_pointer_cast<Trk::AtaPlane>(exPars);
418 std::set<Identifier>
ids;
420 MuonHough::HitVec::const_iterator hit = maximum.
hits.begin();
421 MuonHough::HitVec::const_iterator hit_end = maximum.
hits.end();
422 for (; hit != hit_end; ++hit) {
425 for (
const auto& prd : (*hit)->tgc->etaCluster)
ids.insert(prd->identify());
426 }
else if ((*hit)->prd) {
427 ids.insert((*hit)->prd->identify());
443 float expos_err)
const {
455 float sign = expos < 0 ? -1. : 1.;
463 std::vector<const MuonClusterOnTrack*>&
clusters)
const {
465 std::vector<const Trk::MeasurementBase*>::const_iterator mit =
segment.containedMeasurements().begin();
466 std::vector<const Trk::MeasurementBase*>::const_iterator mit_end =
segment.containedMeasurements().end();
467 for (; mit != mit_end; ++mit) {
470 if (!
id.is_valid())
continue;
502 nprec =
summary.nprecisionLayers;
504 ntrigEta =
summary.ntrigEtaLayers;
JetConstituentVector::iterator iterator
float errorTime() const
access to the error on the measured time
virtual double pt() const override final
The transverse momentum ( ) of the particle.
double segErrorYZ
error from segment on angle in bending plane
std::vector< float > * phi
double pullXZ
pull on angle in non-bending plane
std::vector< float > * pt
void fill(int sector_, int chIndex_)
MuonValidationTruthBlock truth
MuonValidationCandidateBlock candidateBlock
virtual const Amg::Vector3D & globalPosition() const override
Returns global position.
std::string find(const std::string &s)
return a remapped string
void fill(int type_, unsigned int gasgapId_, float r_, float z_, float time_, float err_, float timeProp_=0., float avTimeProp_=0., float tof_=0., float avTof_=0., float timeCor_=0., int stage_=0)
double resCY
residual on combined local position Y and angle YZ
double exErrorX
error from extrapolation on residual in non-bending plane
std::vector< int > * ntrigEtaHits
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
RegionDescriptor m_descriptor
double dangleXZ
angular residual in the Local coordinate non-bending plane
MuonValidationTrackBlock track
MuonValidationTrackBlock track
void fill(int pdg_, int barcode_, float beta_=1.)
const Amg::MatrixX & localCovariance() const
return const ref to the error matrix
constexpr int INVALID_PARTICLE_ID
double segErrorXZ
error from segment on angle in non-bending plane
std::vector< int > * quality
An RpcReadoutElement corresponds to a single RPC module; therefore typicaly a barrel muon station con...
Class to represent calibrated clusters formed from RPC strips.
Helper class to provide constant type-safe access to aux data.
MuonValidationResidualBlock combinedYZ
#define ATH_MSG_VERBOSE(x)
MuonValidationResidualBlock residuals
This class provides conversion from CSC RDO data to CSC Digits.
std::vector< std::string > intersection(std::vector< std::string > &v1, std::vector< std::string > &v2)
void combinedTrack(long int ICH, double *pv0, double *covi, double BMAG, double *par, double *covo)
bool hasFittedT0() const
returns whether the segment has a fitted t0
MuonValidationHoughBlock houghBlock
MuonValidationResidualBlock xresiduals
std::vector< float > * t0
std::vector< float > * t0Error
MuonValidationResidualBlock residuals
double pullY
pull on residual in bending plane
struct representing the maximum in the hough space
std::vector< float > * maximum
double distanceToPhiReadout(const Amg::Vector3D &P) const
void fill(const Trk::MeasurementBase &hit, const MuonSystemExtension::Intersection &intersection, Trk::ParamDefs par)
Class to represent RPC measurements.
virtual const MuonGM::RpcReadoutElement * detectorElement() const override final
Returns the detector element corresponding to this PRD.
MuonValidationTrackParticleBlock trackParticleBlock
::StatusCode StatusCode
StatusCode definition for legacy code.
MuonValidationTrackBlock track
Tracking class to hold the extrapolation from a particle from the calo entry to the end of muon syste...
Muon::MuonStationIndex::ChIndex chIndex
std::vector< float > * eta
int quality
hit count summary
MuonValidationTruthBlock truth
MuonValidationResidualBlock yresiduals
double segErrorX
error from segment on residual in non-bending plane
MuonValidationResidualBlock angleYZ
std::vector< float > * t0TrigError
const MuonLayerHough * hough
double exErrorY
error from extrapolation on residual in bending plane
ElementLink implementation for ROOT usage.
virtual const RpcPrepData * prepRawData() const override final
Returns the RpcPrepData - is a TRT_DriftCircle in this scope.
Identifier identify() const
return the identifier
void fill(int ntimes_, float beta_, float chi2ndof_, int nseg_, int nprec_, int ntrigPhi_, int ntrigEta_, int stage_)
float qOverP() const
Returns the parameter.
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 ...
Amg::Vector3D stripPos(const Identifier &id) const
const Amg::Vector2D & localPosition() const
return the local position reference
float time() const
Return the time (ns)
double resY
residual track - segment in Local coordinate in bending plane
const std::vector< const MuonClusterOnTrack * > & containedROTs() const
returns the vector of SCT_ClusterOnTrack objects .
Eigen::Matrix< double, 3, 1 > Vector3D
double dangleYZ
angular residual in the Local coordinate bending plane
std::vector< int > * ntrigPhiHits
std::vector< int > * nmdtHits
MuonValidationHitBlock hitBlock
double segErrorY
error from segment on residual in bending plane
MuonValidationTruthBlock truth
double exErrorXZ
error from extrapolation on angle in non-bending plane
double pullYZ
pull on angle in bending plane
std::vector< float > * t0Trig
#define ATH_MSG_WARNING(x)
double pullX
pull on residual in non-bending plane
std::vector< int > * stage
double pullCY
pull on combined local position Y and angle YZ
Identifier identify() const
return the identifier -extends MeasurementBase
const std::vector< Intersection > & layerIntersections() const
access to the intersections with the layers.
MuonValidationTruthBlock truth
MuonValidationSegmentBlock segmentBlock
MuonValidationTimeBlock timeBlock
MuonValidationTrackBlock track
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
virtual const Amg::Vector3D & globalPosition() const override final
global position
double distanceToEtaReadout(const Amg::Vector3D &P) const
Class describing a TrackParticle.
float time() const
access to the measured time
double exErrorYZ
error from extrapolation on angle in bending plane
Helper class to provide constant type-safe access to aux data.
MuonValidationResidualBlock angleXZ
void init(const std::string &prefix, TTree *, bool write=true)
void fillResPull(float res_, float pull_, int status=1)
MuonValidationTruthBlock truth
double resX
residual track - segment in Local coordinate non-bending plane
float distance(const Amg::Vector3D &p1, const Amg::Vector3D &p2)
calculates the distance between two point in 3D space
std::vector< StauHit > StauHits
std::vector< MuonLayerIntersection > layerIntersections
MuonLayerIntersections.
float calculateTof(float beta, float dist)
Base class for Muon cluster RIO_OnTracks.
virtual double phi() const override final
The azimuthal angle ( ) of the particle (has range to .)
Muon::NSW_PadTriggerSegment segment(const NSWL1::PadTrigger &data)
MuonValidationTrackBlock track