25 #include "TLorentzVector.h" 65 desc.addUntracked<
double>(
"maxEta", 2.4);
66 desc.addUntracked<
double>(
"minPt", 5);
67 desc.addUntracked<
double>(
"maxNormChi2", 1000);
68 desc.addUntracked<
double>(
"maxD0", 0.02);
69 desc.addUntracked<
double>(
"maxDz", 20.);
70 desc.addUntracked<uint32_t>(
"minPixelHits", 1);
71 desc.addUntracked<uint32_t>(
"minStripHits", 8);
72 desc.addUntracked<uint32_t>(
"minChambers", 2);
73 desc.addUntracked<uint32_t>(
"minMatches", 2);
74 desc.addUntracked<
double>(
"minMatchedStations", 2);
75 desc.addUntracked<
double>(
"maxIso", 0.3);
76 desc.addUntracked<
double>(
"minPtHighest", 24);
77 desc.addUntracked<
double>(
"minInvMass", 75);
78 desc.addUntracked<
double>(
"maxInvMass", 105);
87 maxEta_(ps.getUntrackedParameter<double>(
"maxEta", 2.4)),
88 minPt_(ps.getUntrackedParameter<double>(
"minPt", 5)),
89 maxNormChi2_(ps.getUntrackedParameter<double>(
"maxNormChi2", 1000)),
90 maxD0_(ps.getUntrackedParameter<double>(
"maxD0", 0.02)),
91 maxDz_(ps.getUntrackedParameter<double>(
"maxDz", 20.)),
92 minPixelHits_(ps.getUntrackedParameter<uint32_t>(
"minPixelHits", 1)),
93 minStripHits_(ps.getUntrackedParameter<uint32_t>(
"minStripHits", 8)),
94 minChambers_(ps.getUntrackedParameter<uint32_t>(
"minChambers", 2)),
95 minMatches_(ps.getUntrackedParameter<uint32_t>(
"minMatches", 2)),
96 minMatchedStations_(ps.getUntrackedParameter<double>(
"minMatchedStations", 2)),
97 maxIso_(ps.getUntrackedParameter<double>(
"maxIso", 0.3)),
98 minPtHighest_(ps.getUntrackedParameter<double>(
"minPtHighest", 24)),
99 minInvMass_(ps.getUntrackedParameter<double>(
"minInvMass", 75)),
100 maxInvMass_(ps.getUntrackedParameter<double>(
"maxInvMass", 105)) {
101 produces<reco::TrackCollection>(
"");
115 std::vector<TLorentzVector> list;
117 for (
auto const&
mu : *muonColl) {
118 if (!
mu.isGlobalMuon())
128 double chi2 = gtk->chi2();
129 double ndof = gtk->ndof();
136 double trkd0 = -(tk->dxy(
beamSpot->position()));
139 double trkdz = tk->dz(
beamSpot->position());
143 edm::LogError(
"ZtoMMMuonTrackProducer") <<
"Error >> Failed to get BeamSpot for label: " <<
bsTag_;
164 double absiso =
pfIso04.sumChargedHadronPt +
170 lv.SetPtEtaPhiE(
mu.pt(),
mu.eta(),
mu.phi(),
mu.energy());
173 outputTColl->push_back(*tk);
176 edm::LogError(
"ZtoMMMuonTrackProducer") <<
"Error >> Failed to get MuonCollection for label: " <<
muonTag_;
int numberOfValidPixelHits() const
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
const int minMatchedStations_
const edm::InputTag bsTag_
std::vector< Track > TrackCollection
collection of Tracks
const edm::EDGetTokenT< reco::MuonCollection > muonToken_
Log< level::Error, false > LogError
const edm::EDGetTokenT< reco::BeamSpot > bsToken_
std::vector< Muon > MuonCollection
collection of Muon objects
int numberOfValidStripHits() const
~ZtoMMMuonTrackProducer() override=default
Abs< T >::type abs(const T &t)
#define DEFINE_FWK_MODULE(type)
void produce(edm::StreamID streamID, edm::Event &iEvent, edm::EventSetup const &iSetup) const override
bool isGoodMuon(const reco::Muon &muon, SelectionType type, reco::Muon::ArbitrationType arbitrationType=reco::Muon::SegmentAndTrackArbitration)
main GoodMuon wrapper call
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
ZtoMMMuonTrackProducer(const edm::ParameterSet &)
const edm::InputTag muonTag_
const double maxNormChi2_
const double minPtHighest_