90 : inputJetCollectionTag_{consumes<std::vector<reco::CaloJet> >(
92 sinPhi_(
iConfig.getParameter<std::vector<double> >(
"sinPhi")),
93 cosPhi_(
iConfig.getParameter<std::vector<double> >(
"cosPhi")),
94 nBinsPhi_(
iConfig.getParameter<
unsigned int>(
"nBinsPhi")),
95 phiLow_(
iConfig.getParameter<
double>(
"phiLow")),
96 phiUp_(
iConfig.getParameter<
double>(
"phiUp")),
97 htPtThreshold_(
iConfig.getParameter<
double>(
"htPtThreshold")),
98 mhtPtThreshold_(
iConfig.getParameter<
double>(
"mhtPtThreshold")),
99 htAbsEtaCut_(
iConfig.getParameter<
double>(
"htAbsEtaCut")),
100 mhtAbsEtaCut_(
iConfig.getParameter<
double>(
"mhtAbsEtaCut")),
101 ptlsb_(
iConfig.getParameter<
double>(
"ptlsb")),
103 phiStep_ = (phiUp_ - phiLow_) / nBinsPhi_;
104 produces<std::vector<l1t::EtSum> >(outputCollectionName_).setBranchAlias(outputCollectionName_);
118 std::unique_ptr<std::vector<l1t::EtSum> > lSumVectorPtr(
new std::vector<l1t::EtSum>(0));
119 lSumVectorPtr->push_back(lHT);
120 lSumVectorPtr->push_back(lMHT);
129 double lJetPt =
jet.pt();
130 double lJetPhi =
jet.phi();
131 double lJetEta =
jet.eta();
139 lHTVector.SetPt(lHT);
150 std::vector<unsigned int> jetPtInPhiBins(
nBinsPhi_, 0);
153 double lJetPhi =
jet.phi();
161 unsigned int digiJetPt = floor(
jet.pt() /
ptlsb_);
162 jetPtInPhiBins[iPhi] += digiJetPt;
166 for (
unsigned int iPhi = 0; iPhi < jetPtInPhiBins.size(); ++iPhi) {
167 unsigned int digiJetPtSum = jetPtInPhiBins[iPhi];
170 double lSinPhi =
sinPhi_[iPhi];
171 double lCosPhi =
cosPhi_[iPhi];
174 lTotalJetPx +=
trunc(digiJetPtSum * lCosPhi);
175 lTotalJetPy +=
trunc(digiJetPtSum * lSinPhi);
178 double lMHT = floor(
sqrt(lTotalJetPx * lTotalJetPx + lTotalJetPy * lTotalJetPy)) *
ptlsb_;
188 edm::InputTag(
"Phase1L1TJetCalibrator",
"Phase1L1TJetFromPfCandidates"));
189 desc.
add<std::vector<double> >(
"sinPhi");
190 desc.
add<std::vector<double> >(
"cosPhi");
191 desc.
add<
unsigned int>(
"nBinsPhi", 72);
192 desc.
add<
double>(
"phiLow", -
M_PI);
193 desc.
add<
double>(
"phiUp",
M_PI);
194 desc.
add<
double>(
"htPtThreshold", 30);
195 desc.
add<
double>(
"mhtPtThreshold", 30);
196 desc.
add<
double>(
"htAbsEtaCut", 3);
197 desc.
add<
double>(
"mhtAbsEtaCut", 3);
198 desc.
add<
double>(
"ptlsb", 0.25), desc.
add<
string>(
"outputCollectionName",
"Sums");
199 descriptions.
add(
"Phase1L1TJetSumsProducer", desc);
l1t::EtSum computeMHT(const edm::Handle< std::vector< reco::CaloJet > > inputJets) const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
PtEtaPhiMLorentzVectorD PtEtaPhiMLorentzVector
Lorentz vector with cartesian internal representation.
std::string outputCollectionName_
std::vector< double > sinPhi_
~Phase1L1TJetSumsProducer() override
std::vector< double > cosPhi_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Phase1L1TJetSumsProducer(const edm::ParameterSet &)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
T getParameter(std::string const &) const
void add(std::string const &label, ParameterSetDescription const &psetDescription)
l1t::EtSum computeHT(const edm::Handle< std::vector< reco::CaloJet > > inputJets) const
void produce(edm::Event &, const edm::EventSetup &) override
edm::EDGetTokenT< std::vector< reco::CaloJet > > inputJetCollectionTag_
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.