24 int getRegionEta(
int gtEta,
bool forward) {
28 int centralGtEta[] = {11, 12, 13, 14, 15, 16, 17, -100, 10, 9, 8, 7, 6, 5, 4};
29 int forwardGtEta[] = {18, 19, 20, 21, -100, -100, -100, -100, 3, 2, 1, 0};
36 regionEta = centralGtEta[
gtEta];
38 regionEta = forwardGtEta[
gtEta];
40 if (regionEta == -100)
41 edm::LogError(
"EtaIndexError") <<
"Bad eta index passed to L1TPhysicalEtAdder::getRegionEta, " << gtEta
48 double getPhysicalEta(
int gtEta,
bool forward =
false) {
49 int etaIndex = getRegionEta(gtEta, forward);
51 const double rgnEtaValues[11] = {0.174,
63 return -rgnEtaValues[-(etaIndex - 10)];
64 }
else if (etaIndex < 22) {
65 return rgnEtaValues[etaIndex - 11];
70 double getPhysicalPhi(
int phiIndex) {
72 return 2. *
M_PI * phiIndex / 18.;
74 return -
M_PI + 2. *
M_PI * (phiIndex - 9) / 18.;
83 produces<EGammaBxCollection>();
84 produces<TauBxCollection>(
"rlxTaus");
85 produces<TauBxCollection>(
"isoTaus");
86 produces<JetBxCollection>();
87 produces<JetBxCollection>(
"preGtJets");
88 produces<EtSumBxCollection>();
89 produces<CaloSpareBxCollection>(
"HFRingSums");
90 produces<CaloSpareBxCollection>(
"HFBitCounts");
129 iEvent.
getByToken(preGtJetToken_, old_preGtJets);
132 iEvent.
getByToken(HfCountsToken_, old_hfcounts);
147 new_egammas->setBXRange(firstBX, lastBX);
148 new_rlxtaus->setBXRange(firstBX, lastBX);
149 new_isotaus->setBXRange(firstBX, lastBX);
150 new_jets->setBXRange(firstBX, lastBX);
151 new_preGtJets->setBXRange(firstBX, lastBX);
152 new_etsums->setBXRange(firstBX, lastBX);
153 new_hfsums->setBXRange(firstBX, lastBX);
154 new_hfcounts->setBXRange(firstBX, lastBX);
160 const double et = emScale->
et(itEGamma->hwPt());
161 const double eta = getPhysicalEta(itEGamma->hwEta());
162 const double phi = getPhysicalPhi(itEGamma->hwPhi());
165 EGamma eg(*&p4, itEGamma->hwPt(), itEGamma->hwEta(), itEGamma->hwPhi(), itEGamma->hwQual(), itEGamma->hwIso());
166 new_egammas->push_back(
bx, *&eg);
178 const double et = jetScale->
et(itTau->hwPt());
180 const double eta = getPhysicalEta(itTau->hwEta());
181 const double phi = getPhysicalPhi(itTau->hwPhi());
184 Tau tau(*&p4, itTau->hwPt(), itTau->hwEta(), itTau->hwPhi(), itTau->hwQual(), itTau->hwIso());
185 new_rlxtaus->push_back(
bx, *&
tau);
197 const double et = jetScale->
et(itTau->hwPt());
199 const double eta = getPhysicalEta(itTau->hwEta());
200 const double phi = getPhysicalPhi(itTau->hwPhi());
203 Tau tau(*&p4, itTau->hwPt(), itTau->hwEta(), itTau->hwPhi(), itTau->hwQual(), itTau->hwIso());
204 new_isotaus->push_back(
bx, *&
tau);
216 const double et = jetScale->
et(itJet->hwPt());
218 const bool forward = ((itJet->hwQual() & 0x2) != 0);
219 const double eta = getPhysicalEta(itJet->hwEta(), forward);
220 const double phi = getPhysicalPhi(itJet->hwPhi());
223 Jet jet(*&p4, itJet->hwPt(), itJet->hwEta(), itJet->hwPhi(), itJet->hwQual());
224 new_jets->push_back(
bx, *&
jet);
233 const double et = itJet->hwPt() * emScale->
linearLsb();
238 const bool forward = ((itJet->hwQual() & 0x2) != 0);
239 const double eta = getPhysicalEta(itJet->hwEta(), forward);
240 const double phi = getPhysicalPhi(itJet->hwPhi());
243 Jet jet(*&p4, itJet->hwPt(), itJet->hwEta(), itJet->hwPhi(), itJet->hwQual());
244 new_preGtJets->push_back(
bx, *&
jet);
248 double et = itEtSum->hwPt() * emScale->
linearLsb();
253 const double eta = getPhysicalEta(itEtSum->hwEta());
254 double phi = getPhysicalPhi(itEtSum->hwPhi());
256 et = htMissScale->
et(itEtSum->hwPt());
258 phi = phi + (regionPhiWidth / 2.);
263 EtSum eg(*&p4, sumType, itEtSum->hwPt(), itEtSum->hwEta(), itEtSum->hwPhi(), itEtSum->hwQual());
264 new_etsums->push_back(
bx, *&eg);
271 new_hfsums->push_back(
bx, *itCaloSpare);
275 itCaloSpare != old_hfcounts->
end(
bx);
279 new_hfcounts->push_back(
bx, *itCaloSpare);
const_iterator end(int bx) const
T getParameter(std::string const &) const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
~L1TPhysicalEtAdder() override
const unsigned int gtEta(const unsigned int iEta)
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
double et(const uint16_t rank) const
convert from rank to physically meaningful quantity
double linearLsb() const
get LSB of linear input scale
L1TPhysicalEtAdder(const edm::ParameterSet &ps)
PtEtaPhiMLorentzVectorD PtEtaPhiMLorentzVector
Lorentz vector with cartesian internal representation.
std::vector< T >::const_iterator const_iterator
#define DEFINE_FWK_MODULE(type)
void addDefault(ParameterSetDescription const &psetDescription)
static const unsigned N_PHI
const_iterator begin(int bx) const
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)