19 usePt_ ( iConfig.getParameter<
bool>(
"usePt") ),
20 useTracks_ ( iConfig.getParameter<
bool>(
"useTracks") ),
21 usePFRecTracks_ ( iConfig.getParameter<
bool>(
"usePFRecTracks") ),
22 usePFCandidatesCharged_ ( iConfig.getParameter<
bool>(
"usePFCandidatesCharged") ),
23 usePFCandidates_ ( iConfig.getParameter<
bool>(
"usePFCandidates") ),
24 excludePFMuons_ ( iConfig.getParameter<
bool>(
"excludePFMuons") ),
25 minNJet_ ( iConfig.getParameter<
int>(
"minNJet") ),
26 minPtJet_ ( iConfig.getParameter<double>(
"minPtJet") ),
27 maxEtaJet_ ( iConfig.getParameter<double>(
"maxEtaJet") ),
28 jetsLabel_ ( iConfig.getParameter<
edm::InputTag>(
"jetsLabel") ),
29 tracksLabel_ ( iConfig.getParameter<
edm::InputTag>(
"tracksLabel") ),
30 pfRecTracksLabel_ ( iConfig.getParameter<
edm::InputTag>(
"pfRecTracksLabel") ),
31 pfCandidatesLabel_ ( iConfig.getParameter<
edm::InputTag>(
"pfCandidatesLabel") ) {
38 produces<reco::METCollection>();
48 desc.
add<
bool>(
"usePt",
true);
49 desc.
add<
bool>(
"useTracks",
false);
50 desc.
add<
bool>(
"usePFRecTracks",
false);
51 desc.
add<
bool>(
"usePFCandidatesCharged",
true);
52 desc.
add<
bool>(
"usePFCandidates",
false);
53 desc.
add<
bool>(
"excludePFMuons",
false);
54 desc.
add<
int>(
"minNJet",0);
55 desc.
add<
double>(
"minPtJet", 0.);
56 desc.
add<
double>(
"maxEtaJet", 999.);
61 descriptions.
add(
"hltTrackMETProducer", desc);
92 double sumet = 0., mhx = 0., mhy = 0.;
94 if (useJets && !jets->
empty()) {
96 double pt =
usePt_ ? j->pt() : j->et();
97 double eta = j->eta();
98 double phi = j->phi();
99 double px =
usePt_ ? j->px() : j->et() *
cos(phi);
100 double py =
usePt_ ? j->py() : j->et() *
sin(phi);
111 for (
auto const & j : *tracks) {
115 double eta = j.eta();
126 for (
auto const & j : *pfRecTracks) {
127 double pt = j.trackRef()->pt();
128 double px = j.trackRef()->px();
129 double py = j.trackRef()->py();
130 double eta = j.trackRef()->eta();
141 for (
auto const & j : *pfCandidates) {
146 double eta = j.eta();
158 for (
auto const & j : *pfCandidates) {
166 if (nj <
minNJet_) { sumet = 0; mhx = 0; mhy = 0; }
171 result->push_back(mht);
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
edm::EDGetTokenT< reco::TrackCollection > m_theTrackToken
bool usePFCandidates_
Use PF candidates as input instead of jets.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
edm::InputTag pfRecTracksLabel_
Sin< T >::type sin(const T &t)
edm::InputTag pfCandidatesLabel_
std::vector< reco::MET > METCollection
collection of MET objects
edm::InputTag tracksLabel_
const_iterator begin() const
bool usePFCandidatesCharged_
edm::EDGetTokenT< reco::PFCandidateCollection > m_thePFCandidateToken
Cos< T >::type cos(const T &t)
Abs< T >::type abs(const T &t)
edm::InputTag jetsLabel_
Input jet, track, PFRecTrack, PFCandidate collections.
double minPtJet_
Minimum pt requirement for jets (or objects used as input)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
edm::EDGetTokenT< reco::PFRecTrackCollection > m_theRecTrackToken
void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override
~HLTTrackMETProducer() override
HLTTrackMETProducer(const edm::ParameterSet &iConfig)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
math::XYZTLorentzVector LorentzVector
Lorentz vector.
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
edm::EDGetTokenT< reco::JetView > m_theJetToken
math::XYZPoint Point
point in the space
const_iterator end() const
double maxEtaJet_
Maximum (abs) eta requirement for jets (or objects used as input)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)