31 produces<EGammaBxCollection>();
32 produces<TauBxCollection>(
"rlxTaus");
33 produces<TauBxCollection>(
"isoTaus");
34 produces<JetBxCollection>();
35 produces<JetBxCollection>(
"preGtJets");
36 produces<EtSumBxCollection>();
37 produces<CaloSpareBxCollection>(
"HFRingSums");
38 produces<CaloSpareBxCollection>(
"HFBitCounts");
81 iEvent.
getByToken(preGtJetToken_, old_preGtJets);
84 iEvent.
getByToken(HfCountsToken_, old_hfcounts);
96 int firstBX = old_egammas->getFirstBX();
97 int lastBX = old_egammas->getLastBX();
99 new_egammas->setBXRange(firstBX, lastBX);
100 new_rlxtaus->setBXRange(firstBX, lastBX);
101 new_isotaus->setBXRange(firstBX, lastBX);
102 new_jets->setBXRange(firstBX, lastBX);
103 new_preGtJets->setBXRange(firstBX, lastBX);
104 new_etsums->setBXRange(firstBX, lastBX);
105 new_hfsums->setBXRange(firstBX, lastBX);
106 new_hfcounts->setBXRange(firstBX, lastBX);
108 for(
int bx = firstBX; bx <= lastBX; ++bx)
111 itEGamma != old_egammas->end(bx); ++itEGamma)
114 const double et = emScale->et( itEGamma->hwPt() );
119 EGamma eg(*&p4, itEGamma->hwPt(),
120 itEGamma->hwEta(), itEGamma->hwPhi(),
121 itEGamma->hwQual(), itEGamma->hwIso());
122 new_egammas->push_back(bx, *&eg);
128 itTau != old_rlxtaus->end(bx); ++itTau)
138 const double et = jetScale->et( itTau->hwPt() );
144 Tau tau(*&p4, itTau->hwPt(),
145 itTau->hwEta(), itTau->hwPhi(),
146 itTau->hwQual(), itTau->hwIso());
147 new_rlxtaus->push_back(bx, *&
tau);
152 itTau != old_isotaus->end(bx); ++itTau)
162 const double et = jetScale->et( itTau->hwPt() );
168 Tau tau(*&p4, itTau->hwPt(),
169 itTau->hwEta(), itTau->hwPhi(),
170 itTau->hwQual(), itTau->hwIso());
171 new_isotaus->push_back(bx, *&
tau);
176 itJet != old_jets->end(bx); ++itJet)
186 const double et = jetScale->et( itJet->hwPt() );
188 const bool forward = ((itJet->hwQual() & 0x2) != 0);
193 Jet jet(*&p4, itJet->hwPt(),
194 itJet->hwEta(), itJet->hwPhi(),
196 new_jets->push_back(bx, *&
jet);
201 itJet != old_preGtJets->end(bx); ++itJet)
208 const double et = itJet->hwPt() * emScale->linearLsb();
213 const bool forward = ((itJet->hwQual() & 0x2) != 0);
218 Jet jet(*&p4, itJet->hwPt(),
219 itJet->hwEta(), itJet->hwPhi(),
221 new_preGtJets->push_back(bx, *&
jet);
227 itEtSum != old_etsums->end(bx); ++itEtSum)
229 double et = itEtSum->hwPt() * emScale->linearLsb();
236 if(sumType == EtSum::EtSumType::kMissingHt){
237 et = htMissScale->et( itEtSum->hwPt() );
239 phi=phi+(regionPhiWidth/2.);
245 EtSum eg(*&p4, sumType, itEtSum->hwPt(),
246 itEtSum->hwEta(), itEtSum->hwPhi(),
248 new_etsums->push_back(bx, *&eg);
254 itCaloSpare != old_hfsums->end(bx); ++itCaloSpare)
258 new_hfsums->push_back(bx, *itCaloSpare);
262 itCaloSpare != old_hfcounts->end(bx); ++itCaloSpare)
266 new_hfcounts->push_back(bx, *itCaloSpare);
271 iEvent.
put(new_egammas);
272 iEvent.
put(new_rlxtaus,
"rlxTaus");
273 iEvent.
put(new_isotaus,
"isoTaus");
274 iEvent.
put(new_jets);
275 iEvent.
put(new_preGtJets,
"preGtJets");
276 iEvent.
put(new_etsums);
277 iEvent.
put(new_hfsums,
"HFRingSums");
278 iEvent.
put(new_hfcounts,
"HFBitCounts");
344 int centralGtEta[] = {11, 12, 13, 14, 15, 16, 17, -100, 10, 9, 8, 7, 6, 5, 4};
345 int forwardGtEta[] = {18, 19, 20, 21, -100, -100, -100, -100, 3, 2, 1, 0};
353 regionEta = centralGtEta[
gtEta];
355 regionEta = forwardGtEta[
gtEta];
357 if(regionEta == -100)
359 <<
"Bad eta index passed to L1TPhysicalEtAdder::getRegionEta, " << gtEta << std::endl;
369 const double rgnEtaValues[11] = {
383 return -rgnEtaValues[-(etaIndex - 10)];
385 else if (etaIndex < 22) {
386 return rgnEtaValues[etaIndex - 11];
394 return 2. *
M_PI * phiIndex / 18.;
396 return -
M_PI + 2. *
M_PI * (phiIndex - 9) / 18.;
T getParameter(std::string const &) const
virtual void produce(edm::Event &, const edm::EventSetup &) override
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
const unsigned int gtEta(const unsigned int iEta)
L1TPhysicalEtAdder(const edm::ParameterSet &ps)
PtEtaPhiMLorentzVectorD PtEtaPhiMLorentzVector
Lorentz vector with cartesian internal representation.
void addDefault(ParameterSetDescription const &psetDescription)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
int getRegionEta(int gtEta, bool forward)
virtual void beginJob() override
double getPhysicalPhi(int phiIndex)
virtual void endJob() override
double getPhysicalEta(int etaIndex, bool forward=false)
static const unsigned N_PHI
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
std::vector< EGamma >::const_iterator const_iterator