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;
158 float dR2 =
deltaR2(track->eta(), track->phi(), trackerTrack.
eta(), trackerTrack.
phi());
159 float dPt =
std::abs(track->pt() - trackerTrack.
pt());
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()) {
190 normalizedChi2 = recoMu.globalTrack()->normalizedChi2();
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),
288 track->hitPattern().run3ScoutingHitPatternPOD());
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);
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.
std::vector< Run3ScoutingVertex > Run3ScoutingVertexCollection
const edm::EDGetTokenT< reco::MuonCollection > MuonCollection_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
void produce(edm::StreamID sid, edm::Event &iEvent, edm::EventSetup const &setup) const final
#define DEFINE_FWK_MODULE(type)
std::vector< Track > TrackCollection
collection of Tracks
const edm::EDGetTokenT< RecoChargedCandMap > EcalPFClusterIsoMap_
const edm::EDGetTokenT< RecoChargedCandMap > HcalPFClusterIsoMap_
double phi() const
azimuthal angle of momentum vector
std::vector< Vertex > VertexCollection
std::vector< Muon > MuonCollection
collection of Muon objects
std::vector< MuonTrackLinks > MuonTrackLinksCollection
collection of MuonTrackLinks
U second(std::pair< T, U > const &p)
tuple EcalPFClusterIsoMap
double eta() const
pseudorapidity of momentum vector
const edm::EDGetTokenT< edm::ValueMap< double > > TrackIsoMap_
tuple displacedvertexCollection
double pt() const
track transverse momentum
Abs< T >::type abs(const T &t)
~HLTScoutingMuonProducer() override
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
T const * get() const
Returns C++ pointer to the item.
const edm::EDGetTokenT< reco::VertexCollection > displacedvertexCollection_
ParameterDescriptionBase * add(U const &iLabel, T const &value)
bool isNull() const
Checks for null.
std::vector< RecoChargedCandidate > RecoChargedCandidateCollection
collectin of RecoChargedCandidate objects
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
const edm::EDGetTokenT< reco::RecoChargedCandidateCollection > ChargedCandidateCollection_
void add(std::string const &label, ParameterSetDescription const &psetDescription)
tuple HcalPFClusterIsoMap
std::vector< Run3ScoutingMuon > Run3ScoutingMuonCollection
const edm::EDGetTokenT< reco::MuonTrackLinksCollection > linkToken_
HLTScoutingMuonProducer(const edm::ParameterSet &)