|
|
#include <GlobalTrackQualityProducer.h>
◆ GlobalTrackQualityProducer()
GlobalTrackQualityProducer::GlobalTrackQualityProducer |
( |
const edm::ParameterSet & |
iConfig | ) |
|
|
explicit |
Definition at line 28 of file GlobalTrackQualityProducer.cc.
54 produces<edm::ValueMap<reco::MuonQuality>>();
References Chi2MeasurementEstimator_cfi::Chi2MeasurementEstimator, edm::ParameterSet::getParameter(), glbMuonsToken, GlobalMuonRefitter_cff::GlobalMuonRefitter, HLT_FULL_cff::GlobalMuonTrackMatcher, inputCollection_, inputLinksCollection_, linkCollectionToken, beam_dqm_sourceclient-live_cfg::maxChi2, MuonServiceProxy_cff::MuonServiceProxy, HLTSiStripMonitoring_cff::nSigma, theEstimator, theGlbMatcher, theGlbRefitter, and theService.
◆ ~GlobalTrackQualityProducer()
GlobalTrackQualityProducer::~GlobalTrackQualityProducer |
( |
| ) |
|
|
override |
◆ fillDescriptions()
Definition at line 318 of file GlobalTrackQualityProducer.cc.
342 descGlbMuonRefitter.
add<
std::string>(
"Fitter",
"KFFitterForRefitInsideOut");
343 descGlbMuonRefitter.
add<
std::string>(
"Smoother",
"KFSmootherForRefitInsideOut");
344 descGlbMuonRefitter.
add<
std::string>(
"Propagator",
"SmartPropagatorAnyRK");
345 descGlbMuonRefitter.
add<
std::string>(
"TrackerRecHitBuilder",
"WithAngleAndTemplate");
346 descGlbMuonRefitter.
add<
std::string>(
"MuonRecHitBuilder",
"MuonRecHitBuilder");
347 descGlbMuonRefitter.
add<
bool>(
"DoPredictionsOnly",
false);
348 descGlbMuonRefitter.
add<
std::string>(
"RefitDirection",
"insideOut");
349 descGlbMuonRefitter.
add<
bool>(
"PropDirForCosmics",
false);
350 descGlbMuonRefitter.
add<
bool>(
"RefitRPCHits",
true);
352 descGlbMuonRefitter.
add<std::vector<int>>(
"DYTthrs", {10, 10});
353 descGlbMuonRefitter.
add<
int>(
"DYTselector", 1);
354 descGlbMuonRefitter.
add<
bool>(
"DYTupdator",
false);
355 descGlbMuonRefitter.
add<
bool>(
"DYTuseAPE",
false);
356 descGlbMuonRefitter.
add<
bool>(
"DYTuseThrsParametrization",
true);
359 descDYTthrs.
add<std::vector<double>>(
"eta0p8", {1, -0.919853, 0.990742});
360 descDYTthrs.
add<std::vector<double>>(
"eta1p2", {1, -0.897354, 0.987738});
361 descDYTthrs.
add<std::vector<double>>(
"eta2p0", {4, -0.986855, 0.998516});
362 descDYTthrs.
add<std::vector<double>>(
"eta2p2", {1, -0.940342, 0.992955});
363 descDYTthrs.
add<std::vector<double>>(
"eta2p4", {1, -0.947633, 0.993762});
367 descGlbMuonRefitter.
add<
int>(
"SkipStation", -1);
368 descGlbMuonRefitter.
add<
int>(
"TrackerSkipSystem", -1);
369 descGlbMuonRefitter.
add<
int>(
"TrackerSkipSection", -1);
370 descGlbMuonRefitter.
add<
bool>(
"RefitFlag",
true);
374 desc.add<
double>(
"nSigma", 3.0);
375 desc.add<
double>(
"MaxChi2", 100000.0);
377 descriptions.
add(
"globalTrackQualityProducer",
desc);
References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), submitPVResolutionJobs::desc, HLT_FULL_cff::InputTag, edm::ParameterSetDescription::setAllowAnything(), and AlCaHLTBitMon_QueryRunRegistry::string.
◆ kink()
std::pair< double, double > GlobalTrackQualityProducer::kink |
( |
Trajectory & |
muon | ) |
const |
|
privatevirtual |
Definition at line 183 of file GlobalTrackQualityProducer.cc.
184 const std::string theCategory =
"Muon|RecoMuon|GlobalTrackQualityProducer";
188 using namespace reco;
191 double resultGlb = 0.0;
195 typedef std::vector<TrajectoryMeasurement>::const_iterator TMI;
197 vector<TrajectoryMeasurement> meas =
muon.measurements();
199 for (TMI
m = meas.begin();
m != meas.end();
m++) {
204 RecHit rhit = (*m).recHit();
206 if (rhit->isValid()) {
215 if (tsos.
isValid() && rhit->isValid() && rhit->hit()->isValid() &&
221 phi1 = 2 *
M_PI + phi1;
223 double phi2 = rhit->globalPosition().phi();
225 phi2 = 2 *
M_PI + phi2;
227 double diff = fabs(phi1 - phi2);
245 return std::pair<double, double>(
result, resultGlb);
References change_name::diff, relativeConstraints::error, TrajectoryStateOnSurface::globalPosition(), edm::isNotFinite(), TrajectoryStateOnSurface::isValid(), visualization-live-secondInstance_cfg::m, M_PI, convertSQLiteXML::ok, PV3DBase< T, PVType, FrameType >::phi(), GlobalErrorBase< T, ErrorWeightType >::phierr(), mps_fire::result, alignCSCRings::s, AlCaHLTBitMon_QueryRunRegistry::string, and DetId::Tracker.
Referenced by produce().
◆ newChi2()
std::pair< double, double > GlobalTrackQualityProducer::newChi2 |
( |
Trajectory & |
muon | ) |
const |
|
privatevirtual |
◆ produce()
Definition at line 68 of file GlobalTrackQualityProducer.cc.
69 const std::string theCategory =
"Muon|RecoMuon|GlobalTrackQualityProducer";
88 std::vector<reco::MuonQuality> valuesQual;
89 valuesQual.reserve(glbMuons->size());
92 for (reco::TrackCollection::const_iterator
track = glbMuons->begin();
track != glbMuons->end();
93 ++
track, ++trackIndex) {
99 LogTrace(theCategory) <<
"GLBQual N refitted " << refitted.size();
101 std::pair<double, double> thisKink;
102 double relative_muon_chi2 = 0.0;
103 double relative_tracker_chi2 = 0.0;
104 double glbTrackProbability = 0.0;
105 if (!refitted.empty()) {
106 thisKink =
kink(refitted.front());
107 std::pair<double, double> chi =
newChi2(refitted.front());
108 relative_muon_chi2 = chi.second;
109 relative_tracker_chi2 = chi.first;
113 LogTrace(theCategory) <<
"GLBQual: Kink " << thisKink.first <<
" " << thisKink.second;
114 LogTrace(theCategory) <<
"GLBQual: Rel Chi2 " << relative_tracker_chi2 <<
" " << relative_muon_chi2;
115 LogTrace(theCategory) <<
"GLBQual: trackProbability " << glbTrackProbability;
118 float chi2,
d, dist, Rpos;
119 chi2 =
d = dist = Rpos = -1.0;
120 bool passTight =
false;
122 if (linkCollectionHandle.
isValid()) {
123 for (reco::MuonTrackLinksCollection::const_iterator
links = linkCollectionHandle->begin();
124 links != linkCollectionHandle->end();
126 if (
links->trackerTrack().isNull() ||
links->standAloneTrack().isNull() ||
links->globalTrack().isNull()) {
127 edm::LogWarning(theCategory) <<
"Global muon links to constituent tracks are invalid. There should be no "
128 "such object. Muon is skipped.";
131 if (
links->globalTrack() == glbRef) {
145 LogTrace(theCategory) <<
"GLBQual: Used UpdatedAtVtx : "
146 << (
iEvent.getProvenance(staTrack.
id()).productInstanceName() ==
154 muQual.
trkKink = thisKink.first > maxFloat01 ? maxFloat01 : thisKink.first;
155 muQual.
glbKink = thisKink.second > maxFloat01 ? maxFloat01 : thisKink.second;
156 muQual.
trkRelChi2 = relative_tracker_chi2 > maxFloat01 ? maxFloat01 : relative_tracker_chi2;
157 muQual.
staRelChi2 = relative_muon_chi2 > maxFloat01 ? maxFloat01 : relative_muon_chi2;
164 valuesQual.push_back(muQual);
174 auto outQual = std::make_unique<edm::ValueMap<reco::MuonQuality>>();
176 fillerQual.insert(glbMuons, valuesQual.begin(), valuesQual.end());
References hltPixelTracks_cff::chi2, reco::MuonQuality::chi2LocalMomentum, reco::MuonQuality::chi2LocalPosition, ztail::d, MuonServiceProxy::eventSetup(), edm::EventSetup::getData(), reco::MuonQuality::glbKink, glbMuonsToken, reco::MuonQuality::glbTrackProbability, reco::MuonQuality::globalDeltaEtaPhi, edm::Ref< C, T, F >::id(), iEvent, edm::Ref< C, T, F >::isNull(), edm::HandleBase::isValid(), kink(), linkCollectionToken, electronStore::links, reco::MuonQuality::localDistance, LogTrace, GlobalMuonTrackMatcher::match(), GlobalMuonTrackMatcher::matchTight(), SiStripPI::max, eostools::move(), newChi2(), GlobalMuonRefitter::refit(), GlobalMuonRefitter::setEvent(), GlobalMuonRefitter::setServices(), reco::MuonQuality::staRelChi2, AlCaHLTBitMon_QueryRunRegistry::string, theGlbMatcher, theGlbRefitter, theService, reco::MuonQuality::tightMatch, HLT_FULL_cff::track, HLT_FULL_cff::TrackCand, trackProbability(), reco::MuonQuality::trkKink, reco::MuonQuality::trkRelChi2, tTopoToken_, MuonServiceProxy::update(), and reco::MuonQuality::updatedSta.
◆ trackProbability()
double GlobalTrackQualityProducer::trackProbability |
( |
Trajectory & |
track | ) |
const |
|
privatevirtual |
◆ glbMuonsToken
◆ inputCollection_
◆ inputLinksCollection_
◆ linkCollectionToken
◆ theEstimator
◆ theGlbMatcher
◆ theGlbRefitter
◆ theService
◆ tTopoToken_
T phierr(const GlobalPoint &aPoint) const
ParameterDescriptionBase * add(U const &iLabel, T const &value)
GlobalMuonRefitter * theGlbRefitter
constexpr bool isNotFinite(T x)
float globalDeltaEtaPhi
global delta-Eta-Phi of STA-TK matching
bool isNull() const
Checks for null.
float trkRelChi2
chi2 value for the inner track stub with respect to the global track
double match(const TrackCand &sta, const TrackCand &track, int matchOption=0, int surfaceOption=1) const
GlobalPoint globalPosition() const
float localDistance
local distance seperation for STA-TK TSOS matching on same surface
float glbTrackProbability
the tail probability (-ln(P)) of the global fit
float chi2LocalPosition
chi2 value for the STA-TK matching of local position
MuonServiceProxy * theService
Log< level::Warning, false > LogWarning
edm::EDGetTokenT< reco::TrackCollection > glbMuonsToken
float staRelChi2
chi2 value for the outer track stub with respect to the global track
virtual HitReturnType estimate(const TrajectoryStateOnSurface &ts, const TrackingRecHit &hit) const =0
edm::InputTag inputCollection_
TransientTrackingRecHit::ConstRecHitPointer ConstRecHitPointer
bool updatedSta
bool returns true if standAloneMuon_updatedAtVtx was used in the fit
void add(std::string const &label, ParameterSetDescription const &psetDescription)
float LnChiSquaredProbability(double chiSquared, double nrDOF)
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken_
edm::Ref< TrackCollection > TrackRef
persistent reference to a Track
void update(const edm::EventSetup &setup, bool duringEvent=true)
update the services each event
const edm::EventSetup & eventSetup() const
float trkKink
value of the kink algorithm applied to the inner track stub
GlobalMuonTrackMatcher * theGlbMatcher
float glbKink
value of the kink algorithm applied to the global track
virtual std::pair< double, double > newChi2(Trajectory &muon) const
std::shared_ptr< TrackingRecHit const > ConstRecHitPointer
void setAllowAnything()
allow any parameter label/value pairs
void setServices(const edm::EventSetup &)
set the services needed by the TrackTransformer
bool getData(T &iHolder) const
ProductID id() const
Accessor for product ID.
edm::EDGetTokenT< reco::MuonTrackLinksCollection > linkCollectionToken
bool tightMatch
if the STA-TK matching passed the tighter matching criteria
virtual void setEvent(const edm::Event &)
pass the Event to the algo at each event
virtual std::pair< double, double > kink(Trajectory &muon) const
T getParameter(std::string const &) const
std::pair< const Trajectory *, reco::TrackRef > TrackCand
MeasurementEstimator * theEstimator
float chi2LocalMomentum
chi2 value for the STA-TK matching of local momentum
edm::InputTag inputLinksCollection_
std::vector< Trajectory > refit(const reco::Track &globalTrack, const int theMuonHitsOption, const TrackerTopology *tTopo) const
build combined trajectory from sta Track and tracker RecHits
Geom::Phi< T > phi() const
virtual double trackProbability(Trajectory &track) const
bool matchTight(const TrackCand &sta, const TrackCand &track) const
check if two tracks are compatible (less than Chi2Cut, DeltaDCut, DeltaRCut)