80 std::pair<reco::RecoChargedCandidate, reco::RecoChargedCandidate> ivtxMuPair;
81 std::vector<std::pair<reco::RecoChargedCandidate, reco::RecoChargedCandidate>> vtxMuPair;
86 for (
auto& dispvtx : *displacedvertexCollection) {
87 if (!dispvtx.isValid())
90 if ((dispvtx.chi2() >= 0.0) && (dispvtx.ndof() > 0))
91 vtxProb = TMath::Prob(dispvtx.chi2(), dispvtx.ndof());
96 auto trackIt = dispvtx.tracks_begin();
103 for (
auto const&
cand : *ChargedCandidateCollection) {
105 if (tkRef == vertextkRef1) {
106 ivtxMuPair.first =
cand;
109 if (tkRef == vertextkRef2) {
110 ivtxMuPair.second =
cand;
116 vtxMuPair.push_back(ivtxMuPair);
118 dispVertices->emplace_back(dispvtx.x(),
124 dispvtx.tracksSize(),
132 std::vector<int> vtxInd;
133 float minDR2 = 1
e-06;
140 for (
auto&
muon : *ChargedCandidateCollection) {
152 for (
auto const&
link : *links) {
154 float dR2 =
deltaR2(track->eta(), track->phi(), trackerTrack.
eta(), trackerTrack.
phi());
155 float dPt =
std::abs(track->pt() - trackerTrack.
pt());
156 if (track->pt() != 0)
157 dPt = dPt / track->pt();
159 if (dR2 < 0.02 * 0.02 and dPt < 0.001) {
161 validmuhit = staTrack->hitPattern().numberOfValidMuonHits();
162 matchedsta = staTrack->hitPattern().muonStationsWithValidHits();
171 double ecalisopf = -1.0;
172 if (EcalPFClusterIsoMap.
isValid()) {
173 ecalisopf = (*EcalPFClusterIsoMap)[muonRef];
176 double hcalisopf = -1.0;
177 if (HcalPFClusterIsoMap.
isValid()) {
178 hcalisopf = (*HcalPFClusterIsoMap)[muonRef];
181 vtxInd.reserve(vtxMuPair.size());
182 for (
unsigned int i = 0;
i < vtxMuPair.size();
i++) {
185 if ((dr2_1 < minDR2) || (dr2_2 < minDR2))
189 outMuons->emplace_back(
muon.pt(),
195 (*TrackIsoMap)[muonRef],
202 track->hitPattern().numberOfValidPixelHits(),
204 track->hitPattern().trackerLayersWithMeasurement(),
206 track->hitPattern().numberOfValidStripHits(),
214 track->qoverpError(),
215 track->lambdaError(),
helper::MatcherGetRef< C >::ref_type getRef(const Handle< C > &c, size_t k)
const double minVtxProbCut
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::vector< Track > TrackCollection
collection of Tracks
const edm::EDGetTokenT< RecoChargedCandMap > EcalPFClusterIsoMap_
const edm::EDGetTokenT< reco::TrackCollection > TrackCollection_
const edm::EDGetTokenT< RecoChargedCandMap > HcalPFClusterIsoMap_
double phi() const
azimuthal angle of momentum vector
displacedvertexCollection
U second(std::pair< T, U > const &p)
std::vector< ScoutingVertex > ScoutingVertexCollection
double eta() const
pseudorapidity of momentum vector
const edm::EDGetTokenT< edm::ValueMap< double > > TrackIsoMap_
double pt() const
track transverse momentum
Abs< T >::type abs(const T &t)
std::vector< ScoutingMuon > ScoutingMuonCollection
const edm::EDGetTokenT< reco::VertexCollection > displacedvertexCollection_
bool isNull() const
Checks for null.
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
const edm::EDGetTokenT< reco::RecoChargedCandidateCollection > ChargedCandidateCollection_
const edm::EDGetTokenT< reco::MuonTrackLinksCollection > linkToken_