60 std::pair<reco::RecoChargedCandidate, reco::RecoChargedCandidate> ivtxMuPair;
61 std::vector<std::pair<reco::RecoChargedCandidate, reco::RecoChargedCandidate>> vtxMuPair;
67 if (!dispvtx.isValid())
70 if ((dispvtx.chi2() >= 0.0) && (dispvtx.ndof() > 0))
71 vtxProb = TMath::Prob(dispvtx.chi2(), dispvtx.ndof());
76 auto trackIt = dispvtx.tracks_begin();
83 for (
auto const&
cand : *ChargedCandidateCollection) {
85 if (tkRef == vertextkRef1) {
86 ivtxMuPair.first =
cand;
89 if (tkRef == vertextkRef2) {
90 ivtxMuPair.second =
cand;
96 vtxMuPair.push_back(ivtxMuPair);
98 dispVertices->emplace_back(dispvtx.x(),
104 dispvtx.tracksSize(),
141 float minDR2 = 1
e-06;
144 for (
auto&
muon : *ChargedCandidateCollection) {
154 int validStandAloneMuonHits = 0;
155 int matchedStandAloneMuonStations = 0;
156 for (
auto const& link : *
links) {
157 const reco::Track& trackerTrack = *link.trackerTrack();
160 if (
track->pt() != 0)
161 dPt = dPt /
track->pt();
163 if (dR2 < 0.02 * 0.02 and dPt < 0.001) {
164 if (link.standAloneTrack().isNonnull()) {
165 validStandAloneMuonHits = link.standAloneTrack()->hitPattern().numberOfValidMuonHits();
166 matchedStandAloneMuonStations = link.standAloneTrack()->hitPattern().muonStationsWithValidHits();
171 unsigned int recoMuonType = 2;
173 int nRecoMuonValidMuonHits = 0;
183 float dR2 =
deltaR2(
muon.eta(),
muon.phi(), recoMu.eta(), recoMu.phi());
186 dPt = dPt /
muon.pt();
188 if (dR2 < 0.02 * 0.02 and dPt < 0.001) {
189 if (recoMu.globalTrack().isNonnull()) {
191 nRecoMuonValidMuonHits = recoMu.globalTrack()->hitPattern().numberOfValidMuonHits();
193 recoMuonType = recoMu.type();
210 double ecalisopf = -1.0;
212 ecalisopf = (*EcalPFClusterIsoMap)[muonRef];
215 double hcalisopf = -1.0;
217 hcalisopf = (*HcalPFClusterIsoMap)[muonRef];
220 double trackiso = -1.0;
222 trackiso = (*TrackIsoMap)[muonRef];
225 vtxInd.reserve(vtxMuPair.size());
226 for (
unsigned int i = 0;
i < vtxMuPair.size();
i++) {
229 if ((dr2_1 < minDR2) || (dr2_2 < minDR2))
233 outMuons->emplace_back(
muon.pt(),
243 validStandAloneMuonHits,
244 matchedStandAloneMuonStations,
245 nRecoMuonValidMuonHits,
254 track->hitPattern().numberOfValidPixelHits(),
255 track->hitPattern().numberOfValidStripHits(),
256 track->hitPattern().pixelLayersWithMeasurement(),
257 track->hitPattern().trackerLayersWithMeasurement(),
269 track->qoverpError(),
270 track->lambdaError(),
274 track->covariance(0, 1),
275 track->covariance(0, 2),
276 track->covariance(0, 3),
277 track->covariance(0, 4),
278 track->covariance(1, 2),
279 track->covariance(1, 3),
280 track->covariance(1, 4),
281 track->covariance(2, 3),
282 track->covariance(2, 4),
283 track->covariance(3, 4),
288 track->hitPattern().run3ScoutingHitPatternPOD());
helper::MatcherGetRef< C >::ref_type getRef(const Handle< C > &c, size_t k)
const double minVtxProbCut
std::vector< Run3ScoutingVertex > Run3ScoutingVertexCollection
const edm::EDGetTokenT< reco::MuonCollection > MuonCollection_
const edm::EDGetTokenT< RecoChargedCandMap > EcalPFClusterIsoMap_
nRecoMuonExpectedMatchedStations
const edm::EDGetTokenT< RecoChargedCandMap > HcalPFClusterIsoMap_
nRecoMuonMatchedRPCLayers
std::vector< Muon > MuonCollection
collection of Muon objects
U second(std::pair< T, U > const &p)
double pt() const
track transverse momentum
const edm::EDGetTokenT< edm::ValueMap< double > > TrackIsoMap_
Abs< T >::type abs(const T &t)
double phi() const
azimuthal angle of momentum vector
const edm::EDGetTokenT< reco::VertexCollection > displacedvertexCollection_
bool isNull() const
Checks for null.
double eta() const
pseudorapidity of momentum vector
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
const edm::EDGetTokenT< reco::RecoChargedCandidateCollection > ChargedCandidateCollection_
std::vector< Run3ScoutingMuon > Run3ScoutingMuonCollection
const edm::EDGetTokenT< reco::MuonTrackLinksCollection > linkToken_
displacedvertexCollection