29 produces<l1t::EGammaBxCollection>();
30 produces<l1t::TauBxCollection>();
31 produces<l1t::JetBxCollection>();
32 produces<l1t::EtSumBxCollection>();
33 produces<l1t::CaloSpareBxCollection>();
67 iEvent.
getByToken(CaloSpareToken_, old_calospares);
79 int firstBX = old_egammas->getFirstBX();
80 int lastBX = old_egammas->getLastBX();
82 new_egammas->setBXRange(firstBX, lastBX);
83 new_taus->setBXRange(firstBX, lastBX);
84 new_jets->setBXRange(firstBX, lastBX);
85 new_taus->setBXRange(firstBX, lastBX);
86 new_calospares->setBXRange(firstBX, lastBX);
88 for(
int bx = firstBX; bx <= lastBX; ++bx)
91 itEGamma != old_egammas->end(bx); ++itEGamma)
94 const double et = emScale->et( itEGamma->hwPt() );
100 itEGamma->hwEta(), itEGamma->hwPhi(),
101 itEGamma->hwQual(), itEGamma->hwIso());
102 new_egammas->push_back(bx, *&eg);
108 itTau != old_taus->end(bx); ++itTau)
118 const double et = jetScale->et( itTau->hwPt() );
125 itTau->hwEta(), itTau->hwPhi(),
126 itTau->hwQual(), itTau->hwIso());
127 new_taus->push_back(bx, *&
tau);
132 itJet != old_jets->end(bx); ++itJet)
142 const double et = jetScale->et( itJet->hwPt() );
144 const bool forward = ((itJet->hwQual() & 0x2) != 0);
150 itJet->hwEta(), itJet->hwPhi(),
152 new_jets->push_back(bx, *&
jet);
157 itEtSum != old_etsums->end(bx); ++itEtSum)
159 double et = itEtSum->hwPt() * emScale->linearLsb();
163 if(sumType == EtSum::EtSumType::kMissingHt)
164 et = htMissScale->et( itEtSum->hwPt() );
172 itEtSum->hwEta(), itEtSum->hwPhi(),
174 new_etsums->push_back(bx, *&eg);
180 itCaloSpare != old_calospares->end(bx); ++itCaloSpare)
184 new_calospares->push_back(bx, *itCaloSpare);
188 iEvent.
put(new_egammas);
189 iEvent.
put(new_taus);
190 iEvent.
put(new_jets);
191 iEvent.
put(new_etsums);
192 iEvent.
put(new_calospares);
258 int centralGtEta[] = {11, 12, 13, 14, 15, 16, 17, -100, 10, 9, 8, 7, 6, 5, 4};
259 int forwardGtEta[] = {18, 19, 20, 21, -100, -100, -100, -100, 3, 2, 1, 0};
267 regionEta = centralGtEta[
gtEta];
269 regionEta = forwardGtEta[
gtEta];
271 if(regionEta == -100)
273 <<
"Bad eta index passed to PhysicalEtAdder::getRegionEta, " << gtEta << std::endl;
283 const double rgnEtaValues[11] = {
297 return -rgnEtaValues[-(etaIndex - 10)];
299 else if (etaIndex < 22) {
300 return rgnEtaValues[etaIndex - 11];
308 return 2. *
M_PI * phiIndex / 18.;
310 return -
M_PI + 2. *
M_PI * (phiIndex - 9) / 18.;
T getParameter(std::string const &) const
edm::EDGetToken EtSumToken_
double getPhysicalEta(int etaIndex, bool forward=false)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
edm::EDGetToken TauToken_
const unsigned int gtEta(const unsigned int iEta)
edm::EDGetToken CaloSpareToken_
PtEtaPhiMLorentzVectorD PtEtaPhiMLorentzVector
Lorentz vector with cartesian internal representation.
PhysicalEtAdder(const edm::ParameterSet &ps)
void addDefault(ParameterSetDescription const &psetDescription)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
virtual void endJob() override
int getRegionEta(int gtEta, bool forward)
double getPhysicalPhi(int phiIndex)
virtual void beginJob() override
edm::EDGetToken EGammaToken_
edm::EDGetToken JetToken_
virtual void produce(edm::Event &, const edm::EventSetup &) override
std::vector< EGamma >::const_iterator const_iterator