25 : ChargedCandidateCollection_(
27 displacedvertexCollection_(
34 TrackIsoMap_(consumes<
edm::ValueMap<double>>(iConfig.getParameter<
edm::
InputTag>(
"TrackIsoMap"))),
35 muonPtCut(iConfig.getParameter<double>(
"muonPtCut")),
36 muonEtaCut(iConfig.getParameter<double>(
"muonEtaCut")),
37 minVtxProbCut(iConfig.getParameter<double>(
"minVtxProbCut")) {
39 produces<Run3ScoutingMuonCollection>();
40 produces<Run3ScoutingVertexCollection>(
"displacedVtx");
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(),
140 std::vector<int> vtxInd;
141 float minDR2 = 1
e-06;
144 for (
auto&
muon : *ChargedCandidateCollection) {
154 int validStandAloneMuonHits = 0;
155 int matchedStandAloneMuonStations = 0;
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;
174 int nRecoMuonChambers = 0;
175 int nRecoMuonChambersCSCorDT = 0;
176 int nRecoMuonMatches = 0;
177 int nRecoMuonMatchedStations = 0;
178 unsigned int nRecoMuonExpectedMatchedStations = 0;
179 unsigned int recoMuonStationMask = 0;
180 int nRecoMuonMatchedRPCLayers = 0;
181 unsigned int recoMuonRPClayerMask = 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();
194 nRecoMuonChambers = recoMu.numberOfChambers();
195 nRecoMuonChambersCSCorDT = recoMu.numberOfChambersCSCorDT();
196 nRecoMuonMatches = recoMu.numberOfMatches();
197 nRecoMuonMatchedStations = recoMu.numberOfMatchedStations();
198 nRecoMuonExpectedMatchedStations = recoMu.expectedNnumberOfMatchedStations();
199 recoMuonStationMask = recoMu.stationMask();
200 nRecoMuonMatchedRPCLayers = recoMu.numberOfMatchedRPCLayers();
201 recoMuonRPClayerMask = recoMu.RPClayerMask();
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,
247 nRecoMuonChambersCSCorDT,
249 nRecoMuonMatchedStations,
250 nRecoMuonExpectedMatchedStations,
252 nRecoMuonMatchedRPCLayers,
253 recoMuonRPClayerMask,
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),
308 edm::InputTag(
"hltMuonTkRelIsolationCut0p09MapNoVtx:combinedRelativeIsoDeposits"));
309 desc.add<
double>(
"muonPtCut", 3.0);
310 desc.add<
double>(
"muonEtaCut", 2.4);
311 desc.add<
double>(
"minVtxProbCut", 0.001);
313 descriptions.
add(
"hltScoutingMuonProducer",
desc);