|
|
Go to the documentation of this file.
24 #include <Math/DistFunc.h>
33 usePFCandMatching_(
cfg.getUntrackedParameter<
bool>(
"usePFCandMatching",
true)),
34 trkMatchPtMin_(
cfg.getUntrackedParameter<double>(
"trkMatchPtMin", 10.0)),
35 trkCompPtMin_(
cfg.getUntrackedParameter<double>(
"trkCompPtMin", 35.0)),
36 trkEtaMax_(
cfg.getUntrackedParameter<double>(
"trkEtaMax", 2.4)),
37 towerPtMin_(
cfg.getUntrackedParameter<double>(
"towerPtMin", 5.0)),
38 matchConeRadius_(
cfg.getUntrackedParameter<double>(
"matchConeRadius", 0.087)),
39 keepAllTracks_(
cfg.getUntrackedParameter<
bool>(
"keepAllTracks",
true)),
40 copyExtras_(
cfg.getUntrackedParameter<
bool>(
"copyExtras",
true)),
41 copyTrajectories_(
cfg.getUntrackedParameter<
bool>(
"copyTrajectories",
true)),
42 qualityToSet_(
cfg.getParameter<
std::
string>(
"qualityToSet")),
43 qualityToSkip_(
cfg.getParameter<
std::
string>(
"qualityToSkip")),
44 qualityToMatch_(
cfg.getParameter<
std::
string>(
"qualityToMatch")),
45 minimumQuality_(
cfg.getParameter<
std::
string>(
"minimumQuality")),
46 resetQuality_(
cfg.getUntrackedParameter<
bool>(
"resetQuality",
true)),
47 passMuons_(
cfg.getUntrackedParameter<
bool>(
"passMuons",
true)),
48 passElectrons_(
cfg.getUntrackedParameter<
bool>(
"passElectrons",
false)),
49 funcDeltaRTowerMatch_(
cfg.getParameter<
std::
string>(
"funcDeltaRTowerMatch")),
50 funcCaloComp_(
cfg.getParameter<
std::
string>(
"funcCaloComp")) {
52 produces<reco::TrackCollection>().setBranchAlias(
alias +
"Tracks");
54 produces<reco::TrackExtraCollection>().setBranchAlias(
alias +
"TrackExtras");
55 produces<TrackingRecHitCollection>().setBranchAlias(
alias +
"RecHits");
58 produces<std::vector<Trajectory>>().setBranchAlias(
alias +
"Trajectories");
59 produces<TrajTrackAssociationCollection>().setBranchAlias(
alias +
"TrajectoryTrackAssociations");
86 selTracks_ = std::make_unique<TrackCollection>();
90 selHits_ = std::make_unique<TrackingRecHitCollection>();
101 bool isPFThere =
false;
102 bool isTowerThere =
false;
110 for (
TI ti = hSrcTrack->begin(), ed = hSrcTrack->end(); ti != ed; ++ti, ++current) {
146 auto const firstHitIndex =
selHits_->size();
148 selHits_->push_back((*hit)->clone());
163 selTrajs_ = std::make_unique<std::vector<Trajectory>>();
165 selTTAss_ = std::make_unique<TrajTrackAssociationCollection>();
166 for (
size_t i = 0,
n = hTraj->size();
i <
n; ++
i) {
171 short oldKey = static_cast<short>(trkRef.
key());
204 double trkPt = trk.
pt();
210 unsigned int trackKey = ti - hSrcTrack->begin();
235 throw cms::Exception(
"Undefined case in HICaloCompatibleTrackSelector")
236 <<
"Undefined case in HICaloCompatibleTrackSelector";
261 if (caloEt > 0 && matchDr > matchConeRadius_pt)
278 double sum_ecal = 0.0, sum_hcal = 0.0;
297 unsigned candTrackRefKey =
cand.trackRef().key();
299 if (it == candTrackRefKey) {
328 sum_ecal += clusterRef->energy() / cosh(clusterRef->eta());
334 sum_hcal += clusterRef->energy() / cosh(clusterRef->eta());
350 return sum_ecal + sum_hcal;
360 for (
unsigned int i = 0;
i <
towers->size(); ++
i) {
const math::XYZPoint & outerPosition() const
position of the outermost hit
const math::XYZVector & outerMomentum() const
momentum vector at the outermost hit position
std::string funcDeltaRTowerMatch_
CovarianceMatrix outerStateCovariance() const
outermost trajectory state curvilinear errors
RefProd< PROD > getRefBeforePut()
~HICaloCompatibleTrackSelector() override
destructor
unsigned int outerDetId() const
DetId of the detector on which surface the outermost state is located.
const_iterator find(const key_type &k) const
find element with specified reference key
std::vector< reco::TrackRef > trackRefs_
edm::EDGetTokenT< reco::PFCandidateCollection > srcPFCands_
bool selectByTowers(TI ti, const edm::Handle< TrackCollection > hSrcTrack, const edm::Handle< CaloTowerCollection > towers, bool isTowerThere)
trackingRecHit_iterator recHitsBegin() const
Iterator to first hit on the track.
std::unique_ptr< TrajTrackAssociationCollection > selTTAss_
static const std::string emptyString("")
double matchPFCandToTrack(const edm::Handle< PFCandidateCollection > &pfCandidates, unsigned it, double trkPt)
std::unique_ptr< reco::TrackCollection > selTracks_
storage
const ElementsInBlocks & elementsInBlocks() const
bool outerOk() const
return true if the outermost hit is valid
TrackingRecHitRefProd rHits_
std::unique_ptr< TrackingRecHitCollection > selHits_
CovarianceMatrix innerStateCovariance() const
innermost trajectory state curvilinear errors
bool innerOk() const
return true if the innermost hit is valid
std::unique_ptr< reco::TrackExtraCollection > selTrackExtras_
bool selectByPFCands(TI ti, const edm::Handle< TrackCollection > hSrcTrack, const edm::Handle< PFCandidateCollection > pfCandidates, bool isPFThere)
double pt() const
track transverse momentum
const_iterator end() const
last iterator over the map (read only)
const math::XYZVector & innerMomentum() const
momentum vector at the innermost hit position
edm::RefProd< std::vector< Trajectory > > rTrajectories_
std::string qualityToSkip_
trackingRecHit_iterator recHitsEnd() const
Iterator to last hit on the track.
bool copyTrajectories_
copy also trajectories and trajectory->track associations
std::vector< TrackExtra > TrackExtraCollection
collection of TrackExtra objects
void produce(edm::Event &evt, const edm::EventSetup &es) override
process one event
bool getByToken(EDGetToken token, Handle< PROD > &result) const
edm::Ref< TrackCollection > TrackRef
persistent reference to a Track
edm::EDGetTokenT< TrajTrackAssociationCollection > srcTrackTrajAssoc_
friend struct const_iterator
const PropagationDirection & seedDirection() const
direction of how the hits were sorted in the original seed
reco::TrackCollection::const_iterator TI
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
edm::Ref< TrackExtraCollection > TrackExtraRef
persistent reference to a TrackExtra
const math::XYZPoint & innerPosition() const
position of the innermost hit
std::string minimumQuality_
edm::EDGetTokenT< CaloTowerCollection > srcTower_
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
unsigned int innerDetId() const
DetId of the detector on which surface the innermost state is located.
reco::TrackRefProd rTracks_
bool copyExtras_
copy only the tracks, not extras and rechits (for AOD)
static TrackQuality qualityByName(const std::string &name)
std::string qualityToMatch_
void matchByDrAllowReuse(const reco::Track &trk, const edm::Handle< CaloTowerCollection > &towers, double &bestdr, double &bestpt)
const edm::RefToBase< TrajectorySeed > & seedRef() const
std::string funcCaloComp_
std::vector< reco::PFCandidate > PFCandidateCollection
collection of PFCandidates
const TrackResiduals & residuals() const
get the residuals
std::string qualityToSet_
constexpr auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
reco::TrackExtraRefProd rTrackExtras_
Particle reconstructed by the particle flow algorithm.
key_type key() const
Accessor for product key.
std::unique_ptr< std::vector< Trajectory > > selTrajs_
edm::EDGetTokenT< reco::TrackCollection > srcTracks_
source collection label
edm::EDGetTokenT< std::vector< Trajectory > > srcTrackTrajs_
reco::PFCandidateCollection::const_iterator CI
bool quality(const TrackQuality) const
Track quality.
std::vector< Track > TrackCollection
collection of Tracks