236 auto outDeDxC = std::make_unique<reco::DeDxHitInfoCollection>();
237 std::vector<int> dEdXass;
239 auto outPtrP = std::make_unique<std::vector<pat::IsolatedTrack>>();
242 for (
unsigned int igt = 0; igt < generalTracks->size(); igt++) {
256 bool isInPackedCands = (pcref.
isNonnull() && pcref.
id() == pc_h.
id() && pfCand->
charge() != 0);
257 bool isInLostTracks = (ltref.
isNonnull() && ltref.
id() == lt_h.
id());
262 int pdgId,
charge, fromPV;
263 float dz,
dxy, dzError, dxyError;
268 if (isInPackedCands) {
270 polarP4 = pfCand->
p4();
271 charge = pfCand->
charge();
272 pfCandInd = pcref.
key();
274 }
else if (isInLostTracks) {
275 p4 = lostTrack->
p4();
276 polarP4 = lostTrack->
p4();
277 charge = lostTrack->
charge();
279 ltCandInd = ltref.
key();
281 double m = 0.13957018;
282 double E =
sqrt(m * m + gentk.
p() * gentk.
p());
283 p4.SetPxPyPzE(gentk.
px(), gentk.
py(), gentk.
pz(), E);
284 polarP4.SetCoordinates(gentk.
pt(), gentk.
eta(), gentk.
phi(),
m);
292 const auto& dedxRef = (*gt2dedxHitInfo)[tkref];
293 if (dedxRef.isNonnull()) {
294 prescaled = (*gt2dedxHitInfoPrescale)[dedxRef];
298 if (polarP4.pt() <
pT_cut_ && prescaled <= 1)
306 getIsolation(polarP4, pc, pfCandInd, isolationDR03, miniIso);
316 if (isInPackedCands) {
317 pdgId = pfCand->
pdgId();
322 fromPV = pfCand->
fromPV();
324 }
else if (isInLostTracks) {
325 pdgId = lostTrack->
pdgId();
326 dz = lostTrack->
dz();
327 dxy = lostTrack->
dxy();
330 fromPV = lostTrack->
fromPV();
342 float caloJetEm, caloJetHad;
349 int refToNearestPF_idx = -1;
351 if (refToNearestPF_idx != -1)
355 int refToNearestLostTrack_idx = -1;
357 if (refToNearestLostTrack_idx != -1)
361 float dEdxPixel = -1, dEdxStrip = -1;
363 dEdxStrip = (*gt2dedxStrip)[tkref].dEdx();
364 }
else if (gt2dedxHitInfo.
isValid() && gt2dedxHitInfo->contains(tkref.
id())) {
366 dEdxStrip =
getDeDx(hitInfo,
false,
true);
369 dEdxPixel = (*gt2dedxPixel)[tkref].dEdx();
370 }
else if (gt2dedxHitInfo.
isValid() && gt2dedxHitInfo->contains(tkref.
id())) {
372 dEdxPixel =
getDeDx(hitInfo,
true,
false);
381 std::vector<uint32_t> crossedHcalStatus;
385 std::vector<uint16_t> crossedEcalStatus;
387 crossedEcalStatus.push_back(ecalS->
find(did.rawId())->getStatusCode());
425 refToNearestLostTrack));
426 outPtrP->back().setStatus(prescaled);
429 const auto& dedxRef = (*gt2dedxHitInfo)[tkref];
431 outDeDxC->push_back(*dedxRef);
432 dEdXass.push_back(outDeDxC->size() - 1);
434 dEdXass.push_back(-1);
442 for (
unsigned int ipc = 0; ipc < pc->size(); ipc++) {
448 if (pfref.
get()->trackRef().isNonnull() && pfref.
get()->trackRef().id() == gt_h.
id())
453 int pdgId,
charge, fromPV;
454 float dz,
dxy, dzError, dxyError;
475 pdgId = pfCand.
pdgId();
488 float caloJetEm, caloJetHad;
495 int refToNearestPF_idx = -1;
497 if (refToNearestPF_idx != -1)
501 int refToNearestLostTrack_idx = -1;
503 if (refToNearestLostTrack_idx != -1)
508 float dEdxPixel = -1, dEdxStrip = -1;
509 int trackQuality = 0;
510 std::vector<uint16_t> ecalStatus;
511 std::vector<uint32_t> hcalStatus;
539 refToNearestLostTrack));
541 dEdXass.push_back(-1);
547 auto dedxMatch = std::make_unique<reco::DeDxHitInfoAss>(dedxOH);
549 filler.insert(orphHandle, dEdXass.begin(), dEdXass.end());
virtual float dz(size_t ipv=0) const
dz with respect to the PV[ipv]
double p() const
momentum vector magnitude
const edm::EDGetTokenT< reco::TrackCollection > gt_
const edm::EDGetTokenT< edm::ValueMap< reco::DeDxData > > gt2dedxStrip_
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
bool isNonnull() const
Checks for non-null.
const edm::EDGetTokenT< edm::ValueMap< int > > gt2dedxHitInfoPrescale_
int charge() const override
electric charge
bool getByToken(EDGetToken token, Handle< PROD > &result) const
float getPFNeutralSum(const PolarLorentzVector &p4, const pat::PackedCandidateCollection *pc, int pc_idx) const
double dxyError() const
error on dxy
std::vector< DetId > crossedEcalIds
std::vector< pat::PackedCandidate > PackedCandidateCollection
std::vector< Track > TrackCollection
collection of Tracks
double phi() const
azimuthal angle of momentum vector
const PolarLorentzVector & polarP4() const override
four-momentum Lorentz vector
const Item * getValues(DetId fId, bool throwOnFail=true) const
key_type key() const
Accessor for product key.
double px() const
x coordinate of momentum vector
int pdgId() const override
PDG identifier.
const edm::EDGetTokenT< edm::Association< pat::PackedCandidateCollection > > gt2pc_
std::vector< DetId > crossedHcalIds
const Point & position() const
position
ProductID id() const
Accessor for product ID.
static const double deltaEta
const edm::EDGetTokenT< reco::DeDxHitInfoAss > gt2dedxHitInfo_
const bool useHighPurity_
bool getData(T &iHolder) const
pat::IsolatedTrack::PolarLorentzVector PolarLorentzVector
void getIsolation(const PolarLorentzVector &p4, const pat::PackedCandidateCollection *pc, int pc_idx, pat::PFIsolation &iso, pat::PFIsolation &miniiso) const
double eta() const
pseudorapidity of momentum vector
const edm::ESGetToken< EcalChannelStatus, EcalChannelStatusRcd > ecalSToken_
void getNearestPCRef(const PolarLorentzVector &p4, const pat::PackedCandidateCollection *pc, int pc_idx, int &pc_ref_idx) const
const PVAssoc fromPV(size_t ipv=0) const
float dzError() const override
uncertainty on dz
double pt() const
track transverse momentum
edm::Ref< pat::PackedCandidateCollection > PackedCandidateRef
math::XYZTLorentzVector LorentzVector
T const * get() const
Returns C++ pointer to the item.
float dxyError() const override
uncertainty on dxy
const bool addPrescaledDeDxTracks_
double pz() const
z coordinate of momentum vector
bool hasTrackDetails() const
Return true if a bestTrack can be extracted from this Candidate.
const float miniRelIso_cut_
double dz() const
dz parameter (= dsz/cos(lambda)). This is the track z0 w.r.t (0,0,0) only if the refPoint is close to...
double dzError() const
error on dz
const edm::EDGetTokenT< pat::PackedCandidateCollection > pc_
static TrackQuality qualityByName(const std::string &name)
StringCutObjectSelector< pat::IsolatedTrack > saveDeDxHitInfoCut_
T const * product() const
const HitPattern & hitPattern() const
Access the hit pattern, indicating in which Tracker layers the track has hits.
void getCaloJetEnergy(const PolarLorentzVector &, const reco::CaloJetCollection *, float &, float &) const
const edm::EDGetTokenT< edm::Association< reco::PFCandidateCollection > > pc2pf_
const edm::EDGetTokenT< pat::PackedCandidateCollection > lt_
edm::Ref< TrackCollection > TrackRef
persistent reference to a Track
const edm::EDGetTokenT< reco::VertexCollection > pv_
bool quality(const TrackQuality) const
Track quality.
const edm::EDGetTokenT< edm::Association< pat::PackedCandidateCollection > > gt2lt_
TrackDetMatchInfo getTrackDetMatchInfo(const edm::Event &, const edm::EventSetup &, const reco::Track &)
< trclass="colgroup">< tdclass="colgroup"colspan=5 > DT local reconstruction</td ></tr >< tr >< td >< ahref="classDTRecHit1DPair.html"> DTRecHit1DPair</a ></td >< td >< ahref="DataFormats_DTRecHit.html"> edm::RangeMap & lt
bool getPFLeptonOverlap(const PolarLorentzVector &p4, const pat::PackedCandidateCollection *pc) const
const_iterator find(uint32_t rawId) const
const edm::ESGetToken< HcalChannelQuality, HcalChannelQualityRcd > hcalQToken_
math::XYZPoint trkGlobPosAtEcal
Track position at different parts of the calorimeter.
const JetExtendedData & getValue(const Container &, const reco::JetBaseRef &)
get value for the association. Throw exception if no association found
const bool usePrecomputedDeDxStrip_
int charge() const
track electric charge
const float pT_cut_noIso_
virtual float dxy() const
dxy with respect to the PV ref
float chargedHadronIso() const
double dxy() const
dxy parameter. (This is the transverse impact parameter w.r.t. to (0,0,0) ONLY if refPoint is close t...
const LorentzVector & p4() const override
four-momentum Lorentz vecto r
const bool usePrecomputedDeDxPixel_
const edm::EDGetTokenT< reco::CaloJetCollection > caloJets_
double py() const
y coordinate of momentum vector
const bool saveDeDxHitInfo_
const edm::EDGetTokenT< edm::ValueMap< reco::DeDxData > > gt2dedxPixel_
float getDeDx(const reco::DeDxHitInfo *hitInfo, bool doPixel, bool doStrip) const