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(),
108 dispvtx.covariance(0, 1),
109 dispvtx.covariance(0, 2),
110 dispvtx.covariance(1, 2));
144 float minDR2 = 1
e-06;
147 for (
auto&
muon : *ChargedCandidateCollection) {
157 int validStandAloneMuonHits = 0;
158 int matchedStandAloneMuonStations = 0;
159 for (
auto const& link : *
links) {
160 const reco::Track& trackerTrack = *link.trackerTrack();
163 if (
track->pt() != 0)
164 dPt = dPt /
track->pt();
166 if (
dR2 < 0.02 * 0.02 and dPt < 0.001) {
167 if (link.standAloneTrack().isNonnull()) {
168 validStandAloneMuonHits = link.standAloneTrack()->hitPattern().numberOfValidMuonHits();
169 matchedStandAloneMuonStations = link.standAloneTrack()->hitPattern().muonStationsWithValidHits();
174 unsigned int recoMuonType = 2;
176 int nRecoMuonValidMuonHits = 0;
189 dPt = dPt /
muon.pt();
191 if (
dR2 < 0.02 * 0.02 and dPt < 0.001) {
192 if (recoMu.globalTrack().isNonnull()) {
194 nRecoMuonValidMuonHits = recoMu.globalTrack()->hitPattern().numberOfValidMuonHits();
196 recoMuonType = recoMu.type();
213 double ecalisopf = -1.0;
215 ecalisopf = (*EcalPFClusterIsoMap)[muonRef];
218 double hcalisopf = -1.0;
220 hcalisopf = (*HcalPFClusterIsoMap)[muonRef];
223 double trackiso = -1.0;
225 trackiso = (*TrackIsoMap)[muonRef];
228 vtxInd.reserve(vtxMuPair.size());
229 for (
unsigned int i = 0;
i < vtxMuPair.size();
i++) {
232 if ((dr2_1 < minDR2) || (dr2_2 < minDR2))
236 outMuons->emplace_back(
muon.pt(),
246 validStandAloneMuonHits,
247 matchedStandAloneMuonStations,
248 nRecoMuonValidMuonHits,
257 track->hitPattern().numberOfValidPixelHits(),
258 track->hitPattern().numberOfValidStripHits(),
259 track->hitPattern().pixelLayersWithMeasurement(),
260 track->hitPattern().trackerLayersWithMeasurement(),
272 track->qoverpError(),
273 track->lambdaError(),
277 track->covariance(0, 1),
278 track->covariance(0, 2),
279 track->covariance(0, 3),
280 track->covariance(0, 4),
281 track->covariance(1, 2),
282 track->covariance(1, 3),
283 track->covariance(1, 4),
284 track->covariance(2, 3),
285 track->covariance(2, 4),
286 track->covariance(3, 4),
291 track->hitPattern().run3ScoutingHitPatternPOD());
311 edm::InputTag(
"hltMuonTkRelIsolationCut0p09MapNoVtx:combinedRelativeIsoDeposits"));
312 desc.add<
double>(
"muonPtCut", 3.0);
313 desc.add<
double>(
"muonEtaCut", 2.4);
314 desc.add<
double>(
"minVtxProbCut", 0.001);
316 descriptions.
add(
"hltScoutingMuonProducer",
desc);
helper::MatcherGetRef< C >::ref_type getRef(const Handle< C > &c, size_t k)
const double minVtxProbCut
displacedvertexCollection
std::vector< Run3ScoutingVertex > Run3ScoutingVertexCollection
const edm::EDGetTokenT< reco::MuonCollection > MuonCollection_
void produce(edm::StreamID sid, edm::Event &iEvent, edm::EventSetup const &setup) const final
std::vector< Track > TrackCollection
collection of Tracks
const edm::EDGetTokenT< RecoChargedCandMap > EcalPFClusterIsoMap_
nRecoMuonExpectedMatchedStations
const edm::EDGetTokenT< RecoChargedCandMap > HcalPFClusterIsoMap_
std::vector< Vertex > VertexCollection
nRecoMuonMatchedRPCLayers
std::vector< Muon > MuonCollection
collection of Muon objects
std::vector< MuonTrackLinks > MuonTrackLinksCollection
collection of MuonTrackLinks
U second(std::pair< T, U > const &p)
double pt() const
track transverse momentum
const edm::EDGetTokenT< edm::ValueMap< double > > TrackIsoMap_
ALPAKA_FN_ACC static ALPAKA_FN_INLINE float dR2(Position4 pos1, Position4 pos2)
Abs< T >::type abs(const T &t)
~HLTScoutingMuonProducer() override
double phi() const
azimuthal angle of momentum vector
#define DEFINE_FWK_MODULE(type)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
const edm::EDGetTokenT< reco::VertexCollection > displacedvertexCollection_
bool isNull() const
Checks for null.
std::vector< RecoChargedCandidate > RecoChargedCandidateCollection
collectin of RecoChargedCandidate objects
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_
void add(std::string const &label, ParameterSetDescription const &psetDescription)
std::vector< Run3ScoutingMuon > Run3ScoutingMuonCollection
const edm::EDGetTokenT< reco::MuonTrackLinksCollection > linkToken_
HLTScoutingMuonProducer(const edm::ParameterSet &)