15 #include <boost/shared_ptr.hpp>
36 bxMin_(iConfig.getParameter<int>(
"bxMin")),
37 bxMax_(iConfig.getParameter<int>(
"bxMax"))
39 produces<L1GctEmCandCollection>(
"isoEm");
40 produces<L1GctEmCandCollection>(
"nonIsoEm");
41 produces<L1GctJetCandCollection>(
"cenJets");
42 produces<L1GctJetCandCollection>(
"forJets");
43 produces<L1GctJetCandCollection>(
"tauJets");
44 produces<L1GctJetCandCollection>(
"isoTauJets");
45 produces<L1GctInternJetDataCollection>();
46 produces<L1GctEtTotalCollection>();
47 produces<L1GctEtHadCollection>();
48 produces<L1GctEtMissCollection>();
49 produces<L1GctHtMissCollection>();
50 produces<L1GctInternEtSumCollection>();
51 produces<L1GctInternHtMissCollection>();
52 produces<L1GctHFBitCountsCollection>();
53 produces<L1GctHFRingEtSumsCollection>();
68 LogDebug(
"l1t|stage 1 Converter") <<
"L1TCaloUpgradeToGCTConverter::produce function called...\n";
117 for(
int itBX=EGamma->getFirstBX(); itBX<=EGamma->getLastBX(); ++itBX){
119 if (itBX<bxMin_)
continue;
120 if (itBX>bxMax_)
continue;
128 itEGamma != EGamma->end(itBX); ++itEGamma){
129 bool iso = itEGamma->hwIso();
131 L1GctEmCand EmCand(itEGamma->hwPt(), itEGamma->hwPhi(), itEGamma->hwEta(),
139 isoEmResult->push_back(EmCand);
146 nonIsoEmResult->push_back(EmCand);
151 isoEmResult->resize(4*bxCounter);
152 nonIsoEmResult->resize(4*bxCounter);
156 for(
int itBX=RlxTau->getFirstBX(); itBX<=RlxTau->getLastBX(); ++itBX){
158 if (itBX<bxMin_)
continue;
159 if (itBX>bxMax_)
continue;
165 itTau != RlxTau->end(itBX); ++itTau){
167 const bool forward=
false;
169 L1GctJetCand TauCand(itTau->hwPt(), itTau->hwPhi(), itTau->hwEta(),
170 true, forward,0, 0, itBX);
174 tauJetResult->push_back(TauCand);
178 tauJetResult->resize(4*bxCounter);
182 for(
int itBX=IsoTau->getFirstBX(); itBX<=IsoTau->getLastBX(); ++itBX){
184 if (itBX<bxMin_)
continue;
185 if (itBX>bxMax_)
continue;
191 itTau != IsoTau->end(itBX); ++itTau){
193 const bool forward=
false;
195 L1GctJetCand TauCand(itTau->hwPt(), itTau->hwPhi(), itTau->hwEta(),
196 true, forward,0, 0, itBX);
199 if(isoTauCount != 4){
200 isoTauJetResult->push_back(TauCand);
204 isoTauJetResult->resize(4*bxCounter);
208 for(
int itBX=Jet->getFirstBX(); itBX<=Jet->getLastBX(); ++itBX){
210 if (itBX<bxMin_)
continue;
211 if (itBX>bxMax_)
continue;
218 itJet != Jet->end(itBX); ++itJet){
220 const bool forward = ((itJet->hwQual() & 0x2) != 0);
221 L1GctJetCand JetCand(itJet->hwPt(), itJet->hwPhi(), itJet->hwEta(),
222 false, forward,0, 0, itBX);
227 forJetResult->push_back(JetCand);
233 cenJetResult->push_back(JetCand);
238 forJetResult->resize(4*bxCounter);
239 cenJetResult->resize(4*bxCounter);
243 for(
int itBX=EtSum->getFirstBX(); itBX<=EtSum->getLastBX(); ++itBX){
245 if (itBX<bxMin_)
continue;
246 if (itBX>bxMax_)
continue;
251 itEtSum != EtSum->end(itBX); ++itEtSum){
253 if (EtSum::EtSumType::kMissingEt == itEtSum->getType()){
254 L1GctEtMiss Cand(itEtSum->hwPt(), itEtSum->hwPhi(), itEtSum->hwQual()&0x1, itBX);
255 etMissResult->push_back(Cand);
256 }
else if (EtSum::EtSumType::kMissingHt == itEtSum->getType()){
257 L1GctHtMiss Cand(itEtSum->hwPt(), itEtSum->hwPhi(), itEtSum->hwQual()&0x1, itBX);
258 htMissResult->push_back(Cand);
259 }
else if (EtSum::EtSumType::kTotalEt == itEtSum->getType()){
260 L1GctEtTotal Cand(itEtSum->hwPt(), itEtSum->hwQual()&0x1, itBX);
261 etTotResult->push_back(Cand);
262 }
else if (EtSum::EtSumType::kTotalHt == itEtSum->getType()){
263 L1GctEtHad Cand(itEtSum->hwPt(), itEtSum->hwQual()&0x1, itBX);
264 etHadResult->push_back(Cand);
266 LogError(
"l1t|stage 1 Converter") <<
" Unknown EtSumType --- EtSum collection will not be saved...\n ";
269 etMissResult->resize(1*bxCounter);
270 htMissResult->resize(1*bxCounter);
271 etTotResult->resize(1*bxCounter);
272 etHadResult->resize(1*bxCounter);
276 for(
int itBX=HfSums->getFirstBX(); itBX<=HfSums->getLastBX(); ++itBX){
278 if (itBX<bxMin_)
continue;
279 if (itBX>bxMax_)
continue;
288 itCaloSpare != HfSums->end(itBX); ++itCaloSpare){
302 for(
int i = 0;
i < 4;
i++)
307 hfRingEtSumResult->push_back(sum);
309 hfRingEtSumResult->resize(1*bxCounter);
313 for(
int itBX=HfCounts->getFirstBX(); itBX<=HfCounts->getLastBX(); ++itBX){
322 itCaloSpare != HfCounts->end(itBX); ++itCaloSpare){
323 for(
int i = 0;
i < 4;
i++)
328 hfBitCountResult->push_back(count);
329 hfBitCountResult->resize(1*bxCounter);
333 e.
put(isoEmResult,
"isoEm");
334 e.
put(nonIsoEmResult,
"nonIsoEm");
335 e.
put(cenJetResult,
"cenJets");
336 e.
put(forJetResult,
"forJets");
337 e.
put(tauJetResult,
"tauJets");
338 e.
put(isoTauJetResult,
"isoTauJets");
343 e.
put(hfBitCountResult);
344 e.
put(hfRingEtSumResult);
346 e.
put(internalJetResult);
347 e.
put(internalEtSumResult);
348 e.
put(internalHtMissResult);
355 desc.
add<
int>(
"bxMin",0);
356 desc.
add<
int>(
"bxMax",0);
362 descriptions.
add(
"L1TCaloUpgradeToGCTConverter", desc);
static L1GctHFRingEtSums fromGctEmulator(const int16_t bx, const uint16_t etSumPosEtaRing1, const uint16_t etSumNegEtaRing1, const uint16_t etSumPosEtaRing2, const uint16_t etSumNegEtaRing2)
named ctor for GCT emulator
std::vector< L1GctEtMiss > L1GctEtMissCollection
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::vector< L1GctHFRingEtSums > L1GctHFRingEtSumsCollection
#define DEFINE_FWK_MODULE(type)
std::vector< L1GctEtHad > L1GctEtHadCollection
Level-1 Trigger jet candidate.
std::vector< L1GctInternHtMiss > L1GctInternHtMissCollection
void setBitCount(unsigned i, uint16_t c)
set a sum
Persistable copy of missing Et measured at Level-1.
Level-1 Trigger EM candidate at output of GCT.
std::vector< L1GctEtTotal > L1GctEtTotalCollection
std::vector< L1GctHFBitCounts > L1GctHFBitCountsCollection
std::vector< L1GctJetCand > L1GctJetCandCollection
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Persistable copy of total Et measured at Level-1.
void setEtSum(unsigned i, uint16_t et)
set a sum
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Persistable copy of total Ht measured at Level-1.
std::vector< L1GctHtMiss > L1GctHtMissCollection
Persistable copy of missing Et measured at Level-1.
void add(std::string const &label, ParameterSetDescription const &psetDescription)
std::vector< L1GctInternJetData > L1GctInternJetDataCollection
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
std::vector< L1GctInternEtSum > L1GctInternEtSumCollection
virtual void produce(edm::StreamID, edm::Event &, edm::EventSetup const &) const override
~L1TCaloUpgradeToGCTConverter()
static L1GctHFBitCounts fromGctEmulator(const int16_t bx, const uint16_t bitCountPosEtaRing1, const uint16_t bitCountNegEtaRing1, const uint16_t bitCountPosEtaRing2, const uint16_t bitCountNegEtaRing2)
named ctor for GCT emulator
std::vector< EGamma >::const_iterator const_iterator
std::vector< L1GctEmCand > L1GctEmCandCollection
L1TCaloUpgradeToGCTConverter(const edm::ParameterSet &)