15 #include <boost/shared_ptr.hpp>
25 bxMin_(iConfig.getParameter<int>(
"bxMin")),
26 bxMax_(iConfig.getParameter<int>(
"bxMax"))
28 produces<L1GctEmCandCollection>(
"isoEm");
29 produces<L1GctEmCandCollection>(
"nonIsoEm");
30 produces<L1GctJetCandCollection>(
"cenJets");
31 produces<L1GctJetCandCollection>(
"forJets");
32 produces<L1GctJetCandCollection>(
"tauJets");
33 produces<L1GctJetCandCollection>(
"isoTauJets");
34 produces<L1GctInternJetDataCollection>();
35 produces<L1GctEtTotalCollection>();
36 produces<L1GctEtHadCollection>();
37 produces<L1GctEtMissCollection>();
38 produces<L1GctHtMissCollection>();
39 produces<L1GctInternEtSumCollection>();
40 produces<L1GctInternHtMissCollection>();
41 produces<L1GctHFBitCountsCollection>();
42 produces<L1GctHFRingEtSumsCollection>();
66 LogDebug(
"l1t|stage 1 Converter") <<
"L1TCaloUpgradeToGCTConverter::produce function called...\n";
115 for(
int itBX=EGamma->getFirstBX(); itBX<=EGamma->getLastBX(); ++itBX){
117 if (itBX<bxMin_)
continue;
118 if (itBX>bxMax_)
continue;
126 itEGamma != EGamma->end(itBX); ++itEGamma){
127 bool iso = itEGamma->hwIso();
129 L1GctEmCand EmCand(itEGamma->hwPt(), itEGamma->hwPhi(), itEGamma->hwEta(),
137 isoEmResult->push_back(EmCand);
144 nonIsoEmResult->push_back(EmCand);
149 isoEmResult->resize(4*bxCounter);
150 nonIsoEmResult->resize(4*bxCounter);
154 for(
int itBX=RlxTau->getFirstBX(); itBX<=RlxTau->getLastBX(); ++itBX){
156 if (itBX<bxMin_)
continue;
157 if (itBX>bxMax_)
continue;
163 itTau != RlxTau->end(itBX); ++itTau){
165 const bool forward=
false;
167 L1GctJetCand TauCand(itTau->hwPt(), itTau->hwPhi(), itTau->hwEta(),
168 true, forward,0, 0, itBX);
172 tauJetResult->push_back(TauCand);
176 tauJetResult->resize(4*bxCounter);
180 for(
int itBX=IsoTau->getFirstBX(); itBX<=IsoTau->getLastBX(); ++itBX){
182 if (itBX<bxMin_)
continue;
183 if (itBX>bxMax_)
continue;
189 itTau != IsoTau->end(itBX); ++itTau){
191 const bool forward=
false;
193 L1GctJetCand TauCand(itTau->hwPt(), itTau->hwPhi(), itTau->hwEta(),
194 true, forward,0, 0, itBX);
197 if(isoTauCount != 4){
198 isoTauJetResult->push_back(TauCand);
202 isoTauJetResult->resize(4*bxCounter);
206 for(
int itBX=Jet->getFirstBX(); itBX<=Jet->getLastBX(); ++itBX){
208 if (itBX<bxMin_)
continue;
209 if (itBX>bxMax_)
continue;
216 itJet != Jet->end(itBX); ++itJet){
218 const bool forward = ((itJet->hwQual() & 0x2) != 0);
219 L1GctJetCand JetCand(itJet->hwPt(), itJet->hwPhi(), itJet->hwEta(),
220 false, forward,0, 0, itBX);
225 forJetResult->push_back(JetCand);
231 cenJetResult->push_back(JetCand);
236 forJetResult->resize(4*bxCounter);
237 cenJetResult->resize(4*bxCounter);
241 for(
int itBX=EtSum->getFirstBX(); itBX<=EtSum->getLastBX(); ++itBX){
243 if (itBX<bxMin_)
continue;
244 if (itBX>bxMax_)
continue;
249 itEtSum != EtSum->end(itBX); ++itEtSum){
251 if (EtSum::EtSumType::kMissingEt == itEtSum->getType()){
252 L1GctEtMiss Cand(itEtSum->hwPt(), itEtSum->hwPhi(), itEtSum->hwQual()&0x1, itBX);
253 etMissResult->push_back(Cand);
254 }
else if (EtSum::EtSumType::kMissingHt == itEtSum->getType()){
255 L1GctHtMiss Cand(itEtSum->hwPt(), itEtSum->hwPhi(), itEtSum->hwQual()&0x1, itBX);
256 htMissResult->push_back(Cand);
257 }
else if (EtSum::EtSumType::kTotalEt == itEtSum->getType()){
258 L1GctEtTotal Cand(itEtSum->hwPt(), itEtSum->hwQual()&0x1, itBX);
259 etTotResult->push_back(Cand);
260 }
else if (EtSum::EtSumType::kTotalHt == itEtSum->getType()){
261 L1GctEtHad Cand(itEtSum->hwPt(), itEtSum->hwQual()&0x1, itBX);
262 etHadResult->push_back(Cand);
264 LogError(
"l1t|stage 1 Converter") <<
" Unknown EtSumType --- EtSum collection will not be saved...\n ";
267 etMissResult->resize(1*bxCounter);
268 htMissResult->resize(1*bxCounter);
269 etTotResult->resize(1*bxCounter);
270 etHadResult->resize(1*bxCounter);
274 for(
int itBX=HfSums->getFirstBX(); itBX<=HfSums->getLastBX(); ++itBX){
276 if (itBX<bxMin_)
continue;
277 if (itBX>bxMax_)
continue;
286 itCaloSpare != HfSums->end(itBX); ++itCaloSpare){
300 for(
int i = 0;
i < 4;
i++)
305 hfRingEtSumResult->push_back(sum);
307 hfRingEtSumResult->resize(1*bxCounter);
309 hfBitCountResult->resize(1*bxCounter);
312 e.
put(isoEmResult,
"isoEm");
313 e.
put(nonIsoEmResult,
"nonIsoEm");
314 e.
put(cenJetResult,
"cenJets");
315 e.
put(forJetResult,
"forJets");
316 e.
put(tauJetResult,
"tauJets");
317 e.
put(isoTauJetResult,
"isoTauJets");
322 e.
put(hfBitCountResult);
323 e.
put(hfRingEtSumResult);
325 e.
put(internalJetResult);
326 e.
put(internalEtSumResult);
327 e.
put(internalHtMissResult);
359 desc.
add<
int>(
"bxMin",0);
360 desc.
add<
int>(
"bxMax",0);
366 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
T getParameter(std::string const &) const
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
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.
virtual void beginRun(Run const &iR, EventSetup const &iE)
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.
virtual void produce(Event &, EventSetup const &) override
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(ConfigurationDescriptions &descriptions)
std::vector< L1GctInternEtSum > L1GctInternEtSumCollection
EDGetToken HfCountsToken_
virtual void endRun(Run const &iR, EventSetup const &iE)
~L1TCaloUpgradeToGCTConverter()
L1TCaloUpgradeToGCTConverter(const ParameterSet &)
std::vector< EGamma >::const_iterator const_iterator
std::vector< L1GctEmCand > L1GctEmCandCollection