24 int getRegionEta(
int gtEta,
bool forward)
29 int centralGtEta[] = {11, 12, 13, 14, 15, 16, 17, -100, 10, 9, 8, 7, 6, 5, 4};
30 int forwardGtEta[] = {18, 19, 20, 21, -100, -100, -100, -100, 3, 2, 1, 0};
38 regionEta = centralGtEta[
gtEta];
40 regionEta = forwardGtEta[
gtEta];
44 <<
"Bad eta index passed to L1TPhysicalEtAdder::getRegionEta, " << gtEta << std::endl;
50 double getPhysicalEta(
int gtEta,
bool forward =
false)
52 int etaIndex = getRegionEta(gtEta, forward);
54 const double rgnEtaValues[11] = {
68 return -rgnEtaValues[-(etaIndex - 10)];
70 else if (etaIndex < 22) {
71 return rgnEtaValues[etaIndex - 11];
76 double getPhysicalPhi(
int phiIndex)
79 return 2. *
M_PI * phiIndex / 18.;
81 return -
M_PI + 2. *
M_PI * (phiIndex - 9) / 18.;
91 produces<EGammaBxCollection>();
92 produces<TauBxCollection>(
"rlxTaus");
93 produces<TauBxCollection>(
"isoTaus");
94 produces<JetBxCollection>();
95 produces<JetBxCollection>(
"preGtJets");
96 produces<EtSumBxCollection>();
97 produces<CaloSpareBxCollection>(
"HFRingSums");
98 produces<CaloSpareBxCollection>(
"HFBitCounts");
141 iEvent.
getByToken(preGtJetToken_, old_preGtJets);
144 iEvent.
getByToken(HfCountsToken_, old_hfcounts);
159 new_egammas->setBXRange(firstBX, lastBX);
160 new_rlxtaus->setBXRange(firstBX, lastBX);
161 new_isotaus->setBXRange(firstBX, lastBX);
162 new_jets->setBXRange(firstBX, lastBX);
163 new_preGtJets->setBXRange(firstBX, lastBX);
164 new_etsums->setBXRange(firstBX, lastBX);
165 new_hfsums->setBXRange(firstBX, lastBX);
166 new_hfcounts->setBXRange(firstBX, lastBX);
168 for(
int bx = firstBX; bx <= lastBX; ++bx)
171 itEGamma != old_egammas->
end(bx); ++itEGamma)
174 const double et = emScale->
et( itEGamma->hwPt() );
175 const double eta = getPhysicalEta(itEGamma->hwEta());
176 const double phi = getPhysicalPhi(itEGamma->hwPhi());
179 EGamma eg(*&p4, itEGamma->hwPt(),
180 itEGamma->hwEta(), itEGamma->hwPhi(),
181 itEGamma->hwQual(), itEGamma->hwIso());
182 new_egammas->push_back(bx, *&eg);
188 itTau != old_rlxtaus->
end(bx); ++itTau)
198 const double et = jetScale->
et( itTau->hwPt() );
200 const double eta = getPhysicalEta(itTau->hwEta());
201 const double phi = getPhysicalPhi(itTau->hwPhi());
204 Tau tau(*&p4, itTau->hwPt(),
205 itTau->hwEta(), itTau->hwPhi(),
206 itTau->hwQual(), itTau->hwIso());
207 new_rlxtaus->push_back(bx, *&
tau);
212 itTau != old_isotaus->
end(bx); ++itTau)
222 const double et = jetScale->
et( itTau->hwPt() );
224 const double eta = getPhysicalEta(itTau->hwEta());
225 const double phi = getPhysicalPhi(itTau->hwPhi());
228 Tau tau(*&p4, itTau->hwPt(),
229 itTau->hwEta(), itTau->hwPhi(),
230 itTau->hwQual(), itTau->hwIso());
231 new_isotaus->push_back(bx, *&
tau);
236 itJet != old_jets->
end(bx); ++itJet)
246 const double et = jetScale->
et( itJet->hwPt() );
248 const bool forward = ((itJet->hwQual() & 0x2) != 0);
249 const double eta = getPhysicalEta(itJet->hwEta(), forward);
250 const double phi = getPhysicalPhi(itJet->hwPhi());
253 Jet jet(*&p4, itJet->hwPt(),
254 itJet->hwEta(), itJet->hwPhi(),
256 new_jets->push_back(bx, *&
jet);
261 itJet != old_preGtJets->
end(bx); ++itJet)
268 const double et = itJet->hwPt() * emScale->
linearLsb();
273 const bool forward = ((itJet->hwQual() & 0x2) != 0);
274 const double eta = getPhysicalEta(itJet->hwEta(), forward);
275 const double phi = getPhysicalPhi(itJet->hwPhi());
278 Jet jet(*&p4, itJet->hwPt(),
279 itJet->hwEta(), itJet->hwPhi(),
281 new_preGtJets->push_back(bx, *&
jet);
287 itEtSum != old_etsums->
end(bx); ++itEtSum)
289 double et = itEtSum->hwPt() * emScale->
linearLsb();
294 const double eta = getPhysicalEta(itEtSum->hwEta());
295 double phi = getPhysicalPhi(itEtSum->hwPhi());
297 et = htMissScale->
et( itEtSum->hwPt() );
299 phi=phi+(regionPhiWidth/2.);
305 EtSum eg(*&p4, sumType, itEtSum->hwPt(),
306 itEtSum->hwEta(), itEtSum->hwPhi(),
308 new_etsums->push_back(bx, *&eg);
314 itCaloSpare != old_hfsums->
end(bx); ++itCaloSpare)
318 new_hfsums->push_back(bx, *itCaloSpare);
322 itCaloSpare != old_hfcounts->
end(bx); ++itCaloSpare)
326 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
#define DEFINE_FWK_MODULE(type)
const unsigned int gtEta(const unsigned int iEta)
virtual 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.
void addDefault(ParameterSetDescription const &psetDescription)
et
define resolution functions of each parameter
static const unsigned N_PHI
const_iterator begin(int bx) const
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
std::vector< EGamma >::const_iterator const_iterator