20 int getRegionEta(
int gtEta,
bool forward) {
24 int centralGtEta[] = {11, 12, 13, 14, 15, 16, 17, -100, 10, 9, 8, 7, 6, 5, 4};
25 int forwardGtEta[] = {18, 19, 20, 21, -100, -100, -100, -100, 3, 2, 1, 0};
32 regionEta = centralGtEta[
gtEta];
34 regionEta = forwardGtEta[
gtEta];
36 if (regionEta == -100)
37 edm::LogError(
"EtaIndexError") <<
"Bad eta index passed to L1TPhysicalEtAdder::getRegionEta, " <<
gtEta 44 double getPhysicalEta(
int gtEta,
bool forward =
false) {
45 int etaIndex = getRegionEta(
gtEta, forward);
47 const double rgnEtaValues[11] = {0.174,
58 if (0 <= etaIndex && etaIndex < 11) {
59 return -rgnEtaValues[-(etaIndex - 10)];
60 }
else if (etaIndex < 22) {
61 return rgnEtaValues[etaIndex - 11];
66 double getPhysicalPhi(
int phiIndex) {
68 return 2. *
M_PI * phiIndex / 18.;
70 return -
M_PI + 2. *
M_PI * (phiIndex - 9) / 18.;
79 produces<EGammaBxCollection>();
80 produces<TauBxCollection>(
"rlxTaus");
81 produces<TauBxCollection>(
"isoTaus");
82 produces<JetBxCollection>();
83 produces<JetBxCollection>(
"preGtJets");
84 produces<EtSumBxCollection>();
85 produces<CaloSpareBxCollection>(
"HFRingSums");
86 produces<CaloSpareBxCollection>(
"HFBitCounts");
96 emScaleToken_ = esConsumes<L1CaloEtScale, L1EmEtScaleRcd>();
97 jetScaleToken_ = esConsumes<L1CaloEtScale, L1JetEtScaleRcd>();
98 htMissScaleToken_ = esConsumes<L1CaloEtScale, L1HtMissScaleRcd>();
124 iEvent.getByToken(EGammaToken_, old_egammas);
125 iEvent.getByToken(RlxTauToken_, old_rlxtaus);
126 iEvent.getByToken(IsoTauToken_, old_isotaus);
127 iEvent.getByToken(JetToken_, old_jets);
128 iEvent.getByToken(preGtJetToken_, old_preGtJets);
129 iEvent.getByToken(EtSumToken_, old_etsums);
130 iEvent.getByToken(HfSumsToken_, old_hfsums);
131 iEvent.getByToken(HfCountsToken_, old_hfcounts);
156 const double et = emScale->
et(itEGamma->hwPt());
157 const double eta = getPhysicalEta(itEGamma->hwEta());
158 const double phi = getPhysicalPhi(itEGamma->hwPhi());
161 EGamma eg(*&p4, itEGamma->hwPt(), itEGamma->hwEta(), itEGamma->hwPhi(), itEGamma->hwQual(), itEGamma->hwIso());
162 new_egammas->push_back(
bx, *&eg);
174 const double et =
jetScale->et(itTau->hwPt());
176 const double eta = getPhysicalEta(itTau->hwEta());
177 const double phi = getPhysicalPhi(itTau->hwPhi());
180 Tau tau(*&p4, itTau->hwPt(), itTau->hwEta(), itTau->hwPhi(), itTau->hwQual(), itTau->hwIso());
181 new_rlxtaus->push_back(
bx, *&
tau);
193 const double et =
jetScale->et(itTau->hwPt());
195 const double eta = getPhysicalEta(itTau->hwEta());
196 const double phi = getPhysicalPhi(itTau->hwPhi());
199 Tau tau(*&p4, itTau->hwPt(), itTau->hwEta(), itTau->hwPhi(), itTau->hwQual(), itTau->hwIso());
200 new_isotaus->push_back(
bx, *&
tau);
212 const double et =
jetScale->et(itJet->hwPt());
214 const bool forward = ((itJet->hwQual() & 0x2) != 0);
215 const double eta = getPhysicalEta(itJet->hwEta(), forward);
216 const double phi = getPhysicalPhi(itJet->hwPhi());
219 Jet jet(*&p4, itJet->hwPt(), itJet->hwEta(), itJet->hwPhi(), itJet->hwQual());
220 new_jets->push_back(
bx, *&
jet);
229 const double et = itJet->hwPt() * emScale->
linearLsb();
234 const bool forward = ((itJet->hwQual() & 0x2) != 0);
235 const double eta = getPhysicalEta(itJet->hwEta(), forward);
236 const double phi = getPhysicalPhi(itJet->hwPhi());
239 Jet jet(*&p4, itJet->hwPt(), itJet->hwEta(), itJet->hwPhi(), itJet->hwQual());
240 new_preGtJets->push_back(
bx, *&
jet);
244 double et = itEtSum->hwPt() * emScale->
linearLsb();
249 const double eta = getPhysicalEta(itEtSum->hwEta());
250 double phi = getPhysicalPhi(itEtSum->hwPhi());
252 et = htMissScale->
et(itEtSum->hwPt());
254 phi = phi + (regionPhiWidth / 2.);
259 EtSum eg(*&p4, sumType, itEtSum->hwPt(), itEtSum->hwEta(), itEtSum->hwPhi(), itEtSum->hwQual());
260 new_etsums->push_back(
bx, *&eg);
267 new_hfsums->push_back(
bx, *itCaloSpare);
271 itCaloSpare != old_hfcounts->
end(
bx);
275 new_hfcounts->push_back(
bx, *itCaloSpare);
T getParameter(std::string const &) const
~L1TPhysicalEtAdder() override
const unsigned int gtEta(const unsigned int iEta)
Log< level::Error, false > LogError
L1TPhysicalEtAdder(const edm::ParameterSet &ps)
const_iterator begin(int bx) const
PtEtaPhiMLorentzVectorD PtEtaPhiMLorentzVector
Lorentz vector with cartesian internal representation.
std::vector< T >::const_iterator const_iterator
void addDefault(ParameterSetDescription const &psetDescription)
double et(const uint16_t rank) const
convert from rank to physically meaningful quantity
double linearLsb() const
get LSB of linear input scale
#define DEFINE_FWK_MODULE(type)
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
const_iterator end(int bx) const
static const unsigned N_PHI
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)