Skip to content

Commit 4cbf9c4

Browse files
committed
Update CICADA emulator element pieces to create BX Vectors
This change is done in preparation for updating the unpacker to handle multiple BX's worth of CICADA information
1 parent 4fec71b commit 4cbf9c4

File tree

9 files changed

+28
-11
lines changed

9 files changed

+28
-11
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#ifndef DataFormats_L1Trigger_CICADA_h
2+
#define DataFormats_L1Trigger_CICADA_h
3+
4+
#include "DataFormats/L1Trigger/interface/BXVector.h"
5+
6+
namespace l1t {
7+
typedef BXVector<float> CICADABxCollection;
8+
}
9+
10+
#endif

DataFormats/L1CaloTrigger/src/classes.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
#include <vector>
33
#include "DataFormats/L1CaloTrigger/interface/L1CaloCollections.h"
44
#include "DataFormats/Common/interface/Wrapper.h"
5+
#include "DataFormats/L1CaloTrigger/interface/CICADA.h"

DataFormats/L1CaloTrigger/src/classes_def.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,8 @@
1313
<class name="std::vector<L1CaloRegion>"/>
1414
<class name="edm::Wrapper<std::vector<L1CaloEmCand>>" splitLevel="0"/>
1515
<class name="edm::Wrapper<std::vector<L1CaloRegion>>" splitLevel="0"/>
16+
17+
<class name="l1t::CICADABxCollection"/>
18+
<class name="BXVector<float>"/>
19+
<class name="edm::Wrapper<BXVector<float>>"/>
1620
</lcgdict>

L1Trigger/L1TCaloLayer1/plugins/L1TCaloSummary.cc

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151

5252
#include "DataFormats/L1CaloTrigger/interface/L1CaloCollections.h"
5353
#include "DataFormats/L1CaloTrigger/interface/L1CaloRegion.h"
54+
#include "DataFormats/L1CaloTrigger/interface/CICADA.h"
5455

5556
#include "DataFormats/Math/interface/LorentzVector.h"
5657

@@ -166,7 +167,7 @@ L1TCaloSummary<INPUT, OUTPUT>::L1TCaloSummary(const edm::ParameterSet& iConfig)
166167

167168
//anomaly trigger loading
168169
model = loader.load_model();
169-
produces<float>("CICADAScore");
170+
produces<l1t::CICADABxCollection>("CICADAScore");
170171
}
171172

172173
//
@@ -180,7 +181,8 @@ void L1TCaloSummary<INPUT, OUTPUT>::produce(edm::Event& iEvent, const edm::Event
180181

181182
std::unique_ptr<L1JetParticleCollection> bJetCands(new L1JetParticleCollection);
182183

183-
std::unique_ptr<float> CICADAScore = std::make_unique<float>();
184+
std::unique_ptr<l1t::CICADABxCollection> CICADAScore = std::make_unique<l1t::CICADABxCollection>();
185+
CICADAScore->setBXRange(-2,2);
184186

185187
UCTGeometry g;
186188

@@ -254,10 +256,10 @@ void L1TCaloSummary<INPUT, OUTPUT>::produce(edm::Event& iEvent, const edm::Event
254256
model->predict();
255257
model->read_result(modelResult);
256258

257-
*CICADAScore = modelResult[0].to_float();
259+
CICADAScore->push_back(0, modelResult[0].to_float());
258260

259261
if (overwriteWithTestPatterns)
260-
edm::LogInfo("L1TCaloSummary") << "Test Pattern Output: " << *CICADAScore;
262+
edm::LogInfo("L1TCaloSummary") << "Test Pattern Output: " << CICADAScore->at(0, 0);
261263

262264
summaryCard.setRegionData(inputRegions);
263265

L1Trigger/L1TGlobal/interface/GlobalBoard.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ namespace l1t {
6969
const edm::EDGetTokenT<BXVector<l1t::Jet>>&,
7070
const edm::EDGetTokenT<BXVector<l1t::EtSum>>&,
7171
const edm::EDGetTokenT<BXVector<l1t::EtSum>>&,
72-
const edm::EDGetTokenT<float>&,
72+
const edm::EDGetTokenT<BXVector<float>>&,
7373
const bool receiveEG,
7474
const int nrL1EG,
7575
const bool receiveTau,

L1Trigger/L1TGlobal/plugins/L1TGlobalProducer.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ L1TGlobalProducer::L1TGlobalProducer(const edm::ParameterSet& parSet)
139139
m_jetInputToken = consumes<BXVector<Jet>>(m_jetInputTag);
140140
m_sumInputToken = consumes<BXVector<EtSum>>(m_sumInputTag);
141141
m_sumZdcInputToken = consumes<BXVector<EtSum>>(m_sumZdcInputTag);
142-
m_CICADAInputToken = consumes<float>(m_CICADAInputTag);
142+
m_CICADAInputToken = consumes<BXVector<float>>(m_CICADAInputTag);
143143
m_muInputToken = consumes<BXVector<Muon>>(m_muInputTag);
144144
if (m_useMuonShowers)
145145
m_muShowerInputToken = consumes<BXVector<MuonShower>>(m_muShowerInputTag);

L1Trigger/L1TGlobal/plugins/L1TGlobalProducer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ class L1TGlobalProducer : public edm::stream::EDProducer<> {
133133
edm::EDGetTokenT<BXVector<l1t::Jet>> m_jetInputToken;
134134
edm::EDGetTokenT<BXVector<l1t::EtSum>> m_sumInputToken;
135135
edm::EDGetTokenT<BXVector<l1t::EtSum>> m_sumZdcInputToken;
136-
edm::EDGetTokenT<float> m_CICADAInputToken;
136+
edm::EDGetTokenT<BXVector<float>> m_CICADAInputToken;
137137

138138
/// input tag for external conditions
139139
edm::InputTag m_extInputTag;

L1Trigger/L1TGlobal/src/CICADACondition.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ l1t::CICADACondition& l1t::CICADACondition::operator=(const l1t::CICADACondition
4141

4242
const bool l1t::CICADACondition::evaluateCondition(const int bxEval) const {
4343
bool condResult = false;
44-
const float cicadaScore = m_uGtB->getCICADAScore(); //needs to be implemented
44+
const float cicadaScore = m_uGtB->getCICADAScore();
4545

4646
// This gets rid of a GT emulator convention "iCondition".
4747
// This usually indexes the next line, which is somewhat concerning

L1Trigger/L1TGlobal/src/GlobalBoard.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ void l1t::GlobalBoard::receiveCaloObjectData(const edm::Event& iEvent,
146146
const edm::EDGetTokenT<BXVector<l1t::Jet>>& jetInputToken,
147147
const edm::EDGetTokenT<BXVector<l1t::EtSum>>& sumInputToken,
148148
const edm::EDGetTokenT<BXVector<l1t::EtSum>>& sumZdcInputToken,
149-
const edm::EDGetTokenT<float>& CICADAInputToken,
149+
const edm::EDGetTokenT<BXVector<float>>& CICADAInputToken,
150150
const bool receiveEG,
151151
const int nrL1EG,
152152
const bool receiveTau,
@@ -347,7 +347,7 @@ void l1t::GlobalBoard::receiveCaloObjectData(const edm::Event& iEvent,
347347
}
348348
}
349349
if (receiveCICADA) {
350-
edm::Handle<float> cicadaScoreHandle;
350+
edm::Handle<BXVector<float>> cicadaScoreHandle;
351351
iEvent.getByToken(CICADAInputToken, cicadaScoreHandle);
352352
if (not cicadaScoreHandle.isValid()) {
353353
if (m_verbosity) {
@@ -357,7 +357,7 @@ void l1t::GlobalBoard::receiveCaloObjectData(const edm::Event& iEvent,
357357
setCICADAScore(0.0);
358358
}
359359
} else
360-
setCICADAScore(*cicadaScoreHandle);
360+
setCICADAScore(cicadaScoreHandle->at(0, 0)); //CICADA emulation will only provide a central BX, and one value. Unpacking may have more values, but that can't be guaranteed.
361361
}
362362
}
363363

0 commit comments

Comments
 (0)