15 #include <boost/shared_ptr.hpp>
35 bxMin_( iConfig.getParameter<int>(
"bxMin") ),
36 bxMax_( iConfig.getParameter<int>(
"bxMax") )
38 produces<L1GctEmCandCollection>(
"isoEm");
39 produces<L1GctEmCandCollection>(
"nonIsoEm");
40 produces<L1GctJetCandCollection>(
"cenJets");
41 produces<L1GctJetCandCollection>(
"forJets");
42 produces<L1GctJetCandCollection>(
"tauJets");
43 produces<L1GctJetCandCollection>(
"isoTauJets");
44 produces<L1GctInternJetDataCollection>();
45 produces<L1GctEtTotalCollection>();
46 produces<L1GctEtHadCollection>();
47 produces<L1GctEtMissCollection>();
48 produces<L1GctHtMissCollection>();
49 produces<L1GctInternEtSumCollection>();
50 produces<L1GctInternHtMissCollection>();
51 produces<L1GctHFBitCountsCollection>();
52 produces<L1GctHFRingEtSumsCollection>();
60 LogDebug(
"l1t|stage 1 Converter") <<
"L1TCaloUpgradeToGCTConverter::produce function called...\n";
109 for(
int itBX=EGamma->getFirstBX(); itBX<=EGamma->getLastBX(); ++itBX){
111 if (itBX<bxMin_)
continue;
112 if (itBX>bxMax_)
continue;
120 itEGamma != EGamma->end(itBX); ++itEGamma){
121 bool iso = itEGamma->hwIso();
123 L1GctEmCand EmCand(itEGamma->hwPt(), itEGamma->hwPhi(), itEGamma->hwEta(),
131 isoEmResult->push_back(EmCand);
138 nonIsoEmResult->push_back(EmCand);
143 isoEmResult->resize(4*bxCounter);
144 nonIsoEmResult->resize(4*bxCounter);
148 for(
int itBX=RlxTau->getFirstBX(); itBX<=RlxTau->getLastBX(); ++itBX){
150 if (itBX<bxMin_)
continue;
151 if (itBX>bxMax_)
continue;
157 itTau != RlxTau->end(itBX); ++itTau){
159 const bool forward=
false;
161 L1GctJetCand TauCand(itTau->hwPt(), itTau->hwPhi(), itTau->hwEta(),
162 true, forward,0, 0, itBX);
166 tauJetResult->push_back(TauCand);
170 tauJetResult->resize(4*bxCounter);
174 for(
int itBX=IsoTau->getFirstBX(); itBX<=IsoTau->getLastBX(); ++itBX){
176 if (itBX<bxMin_)
continue;
177 if (itBX>bxMax_)
continue;
183 itTau != IsoTau->end(itBX); ++itTau){
185 const bool forward=
false;
187 L1GctJetCand TauCand(itTau->hwPt(), itTau->hwPhi(), itTau->hwEta(),
188 true, forward,0, 0, itBX);
191 if(isoTauCount != 4){
192 isoTauJetResult->push_back(TauCand);
196 isoTauJetResult->resize(4*bxCounter);
200 for(
int itBX=Jet->getFirstBX(); itBX<=Jet->getLastBX(); ++itBX){
202 if (itBX<bxMin_)
continue;
203 if (itBX>bxMax_)
continue;
210 itJet != Jet->end(itBX); ++itJet){
212 const bool forward = ((itJet->hwQual() & 0x2) != 0);
213 L1GctJetCand JetCand(itJet->hwPt(), itJet->hwPhi(), itJet->hwEta(),
214 false, forward,0, 0, itBX);
219 forJetResult->push_back(JetCand);
225 cenJetResult->push_back(JetCand);
230 forJetResult->resize(4*bxCounter);
231 cenJetResult->resize(4*bxCounter);
235 for(
int itBX=EtSum->getFirstBX(); itBX<=EtSum->getLastBX(); ++itBX){
237 if (itBX<bxMin_)
continue;
238 if (itBX>bxMax_)
continue;
243 itEtSum != EtSum->end(itBX); ++itEtSum){
246 L1GctEtMiss Cand(itEtSum->hwPt(), itEtSum->hwPhi(), itEtSum->hwQual()&0x1, itBX);
247 etMissResult->push_back(Cand);
249 L1GctHtMiss Cand(itEtSum->hwPt(), itEtSum->hwPhi(), itEtSum->hwQual()&0x1, itBX);
250 htMissResult->push_back(Cand);
252 L1GctEtTotal Cand(itEtSum->hwPt(), itEtSum->hwQual()&0x1, itBX);
253 etTotResult->push_back(Cand);
255 L1GctEtHad Cand(itEtSum->hwPt(), itEtSum->hwQual()&0x1, itBX);
256 etHadResult->push_back(Cand);
258 LogError(
"l1t|stage 1 Converter") <<
" Unknown EtSumType --- EtSum collection will not be saved...\n ";
261 etMissResult->resize(1*bxCounter);
262 htMissResult->resize(1*bxCounter);
263 etTotResult->resize(1*bxCounter);
264 etHadResult->resize(1*bxCounter);
268 for(
int itBX=HfSums->getFirstBX(); itBX<=HfSums->getLastBX(); ++itBX){
270 if (itBX<bxMin_)
continue;
271 if (itBX>bxMax_)
continue;
280 itCaloSpare != HfSums->end(itBX); ++itCaloSpare){
294 for(
int i = 0;
i < 4;
i++)
299 hfRingEtSumResult->push_back(sum);
301 hfRingEtSumResult->resize(1*bxCounter);
305 for(
int itBX=HfCounts->getFirstBX(); itBX<=HfCounts->getLastBX(); ++itBX){
307 if (itBX<bxMin_)
continue;
308 if (itBX>bxMax_)
continue;
317 itCaloSpare != HfCounts->end(itBX); ++itCaloSpare){
318 for(
int i = 0;
i < 4;
i++)
323 hfBitCountResult->push_back(count);
324 hfBitCountResult->resize(1*bxCounter);
328 e.
put(isoEmResult,
"isoEm");
329 e.
put(nonIsoEmResult,
"nonIsoEm");
330 e.
put(cenJetResult,
"cenJets");
331 e.
put(forJetResult,
"forJets");
332 e.
put(tauJetResult,
"tauJets");
333 e.
put(isoTauJetResult,
"isoTauJets");
338 e.
put(hfBitCountResult);
339 e.
put(hfRingEtSumResult);
341 e.
put(internalJetResult);
342 e.
put(internalEtSumResult);
343 e.
put(internalHtMissResult);
350 desc.
add<
int>(
"bxMin",0);
351 desc.
add<
int>(
"bxMax",0);
357 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
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 &)