89 : inputJetCollectionTag_{consumes<std::vector<reco::CaloJet> >(
91 sinPhi_(iConfig.getParameter<std::vector<double> >(
"sinPhi")),
92 cosPhi_(iConfig.getParameter<std::vector<double> >(
"cosPhi")),
93 nBinsPhi_(iConfig.getParameter<
unsigned int>(
"nBinsPhi")),
94 phiLow_(iConfig.getParameter<
double>(
"phiLow")),
95 phiUp_(iConfig.getParameter<
double>(
"phiUp")),
96 phiStep_((phiUp_ - phiLow_) / nBinsPhi_),
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")),
102 outputCollectionName_(iConfig.getParameter<
std::string>(
"outputCollectionName")) {
103 usesResource(
"TFileService");
104 produces<std::vector<l1t::EtSum> >(outputCollectionName_).setBranchAlias(outputCollectionName_);
115 std::unique_ptr<std::vector<l1t::EtSum> > lSumVectorPtr(
new std::vector<l1t::EtSum>(0));
116 lSumVectorPtr->push_back(lHT);
117 lSumVectorPtr->push_back(lMHT);
126 double lJetPt =
jet.pt();
127 double lJetPhi =
jet.phi();
128 double lJetEta =
jet.eta();
136 lHTVector.SetPt(lHT);
147 std::vector<unsigned int> jetPtInPhiBins(
nBinsPhi_, 0);
150 double lJetPhi =
jet.phi();
158 unsigned int digiJetPt = floor(
jet.pt() /
ptlsb_);
159 jetPtInPhiBins[iPhi] += digiJetPt;
163 for (
unsigned int iPhi = 0; iPhi < jetPtInPhiBins.size(); ++iPhi) {
164 unsigned int digiJetPtSum = jetPtInPhiBins[iPhi];
167 double lSinPhi =
sinPhi_[iPhi];
168 double lCosPhi =
cosPhi_[iPhi];
171 lTotalJetPx +=
trunc(digiJetPtSum * lCosPhi);
172 lTotalJetPy +=
trunc(digiJetPtSum * lSinPhi);
175 double lMHT = floor(
sqrt(lTotalJetPx * lTotalJetPx + lTotalJetPy * lTotalJetPy)) *
ptlsb_;
185 edm::InputTag(
"Phase1L1TJetCalibrator",
"Phase1L1TJetFromPfCandidates"));
186 desc.add<std::vector<double> >(
"sinPhi");
187 desc.add<std::vector<double> >(
"cosPhi");
188 desc.add<
unsigned int>(
"nBinsPhi", 72);
191 desc.add<
double>(
"htPtThreshold", 30);
192 desc.add<
double>(
"mhtPtThreshold", 30);
193 desc.add<
double>(
"htAbsEtaCut", 3);
194 desc.add<
double>(
"mhtAbsEtaCut", 3);
195 desc.add<
double>(
"ptlsb", 0.25),
desc.add<
string>(
"outputCollectionName",
"Sums");
196 descriptions.
add(
"Phase1L1TJetSumsProducer",
desc);
const double mhtPtThreshold_
const double htAbsEtaCut_
T getParameter(std::string const &) const
#define DEFINE_FWK_MODULE(type)
l1t::EtSum computeHT(const edm::Handle< std::vector< reco::CaloJet > > inputJets) const
const std::vector< double > sinPhi_
l1t::EtSum computeMHT(const edm::Handle< std::vector< reco::CaloJet > > inputJets) const
const std::string outputCollectionName_
PtEtaPhiMLorentzVectorD PtEtaPhiMLorentzVector
Lorentz vector with cartesian internal representation.
const double htPtThreshold_
const std::vector< double > cosPhi_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Phase1L1TJetSumsProducer(const edm::ParameterSet &)
const edm::EDGetTokenT< std::vector< reco::CaloJet > > inputJetCollectionTag_
void add(std::string const &label, ParameterSetDescription const &psetDescription)
~Phase1L1TJetSumsProducer() override=default
const double mhtAbsEtaCut_
void produce(edm::Event &, const edm::EventSetup &) override
const unsigned int nBinsPhi_
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.