25 : ChargedCandidateCollection_(
30 TrackIsoMap_(consumes<
edm::ValueMap<double>>(iConfig.getParameter<
edm::
InputTag>(
"TrackIsoMap"))),
31 displacedvertexCollection_(
33 muonPtCut(iConfig.getParameter<double>(
"muonPtCut")),
34 muonEtaCut(iConfig.getParameter<double>(
"muonEtaCut")),
38 produces<ScoutingMuonCollection>();
39 produces<ScoutingVertexCollection>(
"displacedVtx");
80 std::pair<reco::RecoChargedCandidate, reco::RecoChargedCandidate> ivtxMuPair;
81 std::vector<std::pair<reco::RecoChargedCandidate, reco::RecoChargedCandidate>> vtxMuPair;
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) {
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;
173 ecalisopf = (*EcalPFClusterIsoMap)[muonRef];
176 double hcalisopf = -1.0;
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(),
237 desc.
add<
double>(
"muonPtCut", 3.0);
238 desc.
add<
double>(
"muonEtaCut", 2.4);
239 desc.
add<
double>(
"minVtxProbCut", 0.001);
242 descriptions.
add(
"hltScoutingMuonProducer", desc);