Skip to content

Commit d9d5e0e

Browse files
committed
CICADA-uGT emulator additions
1 parent c8632b4 commit d9d5e0e

17 files changed

+387
-3
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#ifndef L1Trigger_L1TGlobal_CICADACondition_h
2+
#define L1Trigger_L1TGlobal_CICADACondition_h
3+
4+
#include <iosfwd>
5+
#include <string>
6+
7+
#include "L1Trigger/L1TGlobal/interface/ConditionEvaluation.h"
8+
9+
class GlobalCondition;
10+
class CICADATemplate;
11+
12+
namespace l1t {
13+
class GlobalBoard;
14+
15+
class CICADACondition : public ConditionEvaluation {
16+
public:
17+
CICADACondition();
18+
CICADACondition(const GlobalCondition*, const GlobalBoard*);
19+
CICADACondition(const CICADACondition&);
20+
~CICADACondition() override = default;
21+
22+
CICADACondition& operator=(const CICADACondition&);
23+
24+
const bool evaluateCondition(const int bxEval) const override;
25+
26+
void print(std::ostream& myCout) const override;
27+
28+
inline const CICADATemplate* gtCICADATemplate() const { return m_gtCICADATemplate; }
29+
30+
void setGtCICADATemplate(const CICADATemplate* cicadaTemplate) { m_gtCICADATemplate = cicadaTemplate; }
31+
32+
inline const GlobalBoard* getuGtB() const { return m_uGtB; }
33+
34+
void setuGtB(const GlobalBoard* ptrGTB) { m_uGtB = ptrGTB; }
35+
36+
private:
37+
void copy(const CICADACondition& cp);
38+
39+
const CICADATemplate* m_gtCICADATemplate;
40+
41+
const GlobalBoard* m_uGtB;
42+
};
43+
} // namespace l1t
44+
#endif
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#ifndef L1Trigger_L1TGlobal_CICADATemplate_h
2+
#define L1Trigger_L1TGlobal_CICADATemplate_h
3+
4+
#include <string>
5+
#include <iosfwd>
6+
7+
#include "L1Trigger/L1TGlobal/interface/GlobalCondition.h"
8+
9+
class CICADATemplate : public GlobalCondition {
10+
public:
11+
CICADATemplate();
12+
CICADATemplate(const std::string&);
13+
CICADATemplate(const std::string&, const l1t::GtConditionType&);
14+
CICADATemplate(const CICADATemplate&);
15+
~CICADATemplate() = default;
16+
17+
CICADATemplate& operator=(const CICADATemplate&);
18+
19+
struct ObjectParameter {
20+
float minCICADAThreshold;
21+
float maxCICADAThreshold;
22+
};
23+
inline const std::vector<ObjectParameter>* objectParameter() const { return &m_objectParameter; }
24+
25+
void setConditionParameter(const std::vector<ObjectParameter>& objParameter) { m_objectParameter = objParameter; }
26+
27+
void print(std::ostream& myCout) const override;
28+
29+
friend std::ostream& operator<<(std::ostream&, const CICADATemplate&);
30+
31+
private:
32+
void copy(const CICADATemplate& cp);
33+
std::vector<ObjectParameter> m_objectParameter;
34+
};
35+
36+
#endif

L1Trigger/L1TGlobal/interface/GlobalBoard.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,16 @@ 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>&,
7273
const bool receiveEG,
7374
const int nrL1EG,
7475
const bool receiveTau,
7576
const int nrL1Tau,
7677
const bool receiveJet,
7778
const int nrL1Jet,
7879
const bool receiveEtSums,
79-
const bool receiveEtSumsZdc);
80+
const bool receiveEtSumsZdc,
81+
const bool receiveCICADA);
8082

8183
void receiveMuonObjectData(const edm::Event&,
8284
const edm::EDGetTokenT<BXVector<l1t::Muon>>&,
@@ -172,6 +174,8 @@ namespace l1t {
172174
/// pointer to External data list
173175
inline const BXVector<const GlobalExtBlk*>* getCandL1External() const { return m_candL1External; }
174176

177+
inline const float getCICADAScore() const { return m_cicadaScore; }
178+
175179
/* Drop individual EtSums for Now
176180
/// pointer to ETM data list
177181
inline const l1t::EtSum* getCandL1ETM() const
@@ -204,6 +208,8 @@ namespace l1t {
204208
void setResetPSCountersEachLumiSec(bool val) { m_resetPSCountersEachLumiSec = val; }
205209
void setSemiRandomInitialPSCounters(bool val) { m_semiRandomInitialPSCounters = val; }
206210

211+
void setCICADAScore(float val) { m_cicadaScore = val; }
212+
207213
public:
208214
inline void setVerbosity(const int verbosity) { m_verbosity = verbosity; }
209215

@@ -242,6 +248,8 @@ namespace l1t {
242248
int m_bxFirst_;
243249
int m_bxLast_;
244250

251+
float m_cicadaScore = 0.0;
252+
245253
std::bitset<GlobalAlgBlk::maxPhysicsTriggers> m_gtlAlgorithmOR;
246254
std::bitset<GlobalAlgBlk::maxPhysicsTriggers> m_gtlDecisionWord;
247255

L1Trigger/L1TGlobal/interface/GlobalDefinitions.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ namespace l1t {
8282
TypeZDCP,
8383
TypeZDCM,
8484
TypeAXOL1TL,
85+
TypeCICADA,
8586
GtConditionTypeInvalid = -1
8687
};
8788

@@ -106,6 +107,7 @@ namespace l1t {
106107
CondMuonShower,
107108
CondEnergySumZdc,
108109
CondAXOL1TL,
110+
CondCICADA,
109111
GtConditionCategoryInvalid = -1
110112
};
111113

L1Trigger/L1TGlobal/interface/TriggerMenu.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
#include "L1Trigger/L1TGlobal/interface/EnergySumTemplate.h"
3838
#include "L1Trigger/L1TGlobal/interface/EnergySumZdcTemplate.h"
3939
#include "L1Trigger/L1TGlobal/interface/AXOL1TLTemplate.h"
40+
#include "L1Trigger/L1TGlobal/interface/CICADATemplate.h"
4041
#include "L1Trigger/L1TGlobal/interface/ExternalTemplate.h"
4142
#include "L1Trigger/L1TGlobal/interface/CorrelationTemplate.h"
4243
#include "L1Trigger/L1TGlobal/interface/CorrelationThreeBodyTemplate.h"
@@ -61,6 +62,7 @@ class TriggerMenu {
6162
const std::vector<std::vector<EnergySumTemplate> >&,
6263
const std::vector<std::vector<EnergySumZdcTemplate> >&,
6364
const std::vector<std::vector<AXOL1TLTemplate> >&,
65+
const std::vector<std::vector<CICADATemplate> >&,
6466
const std::vector<std::vector<ExternalTemplate> >&,
6567
const std::vector<std::vector<CorrelationTemplate> >&,
6668
const std::vector<std::vector<CorrelationThreeBodyTemplate> >&,
@@ -146,6 +148,11 @@ class TriggerMenu {
146148

147149
void setVecAXOL1TLTemplate(const std::vector<std::vector<AXOL1TLTemplate> >&);
148150

151+
//
152+
inline const std::vector<std::vector<CICADATemplate> >& vecCICADATemplate() const { return m_vecCICADATemplate; }
153+
154+
void setVecCICADATemplate(const std::vector<std::vector<CICADATemplate> >&);
155+
149156
//
150157
inline const std::vector<std::vector<ExternalTemplate> >& vecExternalTemplate() const {
151158
return m_vecExternalTemplate;
@@ -249,6 +256,7 @@ class TriggerMenu {
249256
std::vector<std::vector<EnergySumTemplate> > m_vecEnergySumTemplate;
250257
std::vector<std::vector<EnergySumZdcTemplate> > m_vecEnergySumZdcTemplate;
251258
std::vector<std::vector<AXOL1TLTemplate> > m_vecAXOL1TLTemplate;
259+
std::vector<std::vector<CICADATemplate> > m_vecCICADATemplate;
252260

253261
std::vector<std::vector<ExternalTemplate> > m_vecExternalTemplate;
254262

L1Trigger/L1TGlobal/plugins/L1TGlobalProducer.cc

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ void L1TGlobalProducer::fillDescriptions(edm::ConfigurationDescriptions& descrip
5151
->setComment("InputTag for Calo Trigger EtSum (required parameter: default value is invalid)");
5252
desc.add<edm::InputTag>("EtSumZdcInputTag", edm::InputTag(""))
5353
->setComment("InputTag for ZDC EtSums Plus and Minus (required parameter: default value is invalid)");
54+
desc.add<edm::InputTag>("CICADAInputTag", edm::InputTag(""))
55+
->setComment("InputTag for CICADA Anomaly Detection (required parameter: default value is invalid)");
5456
desc.add<edm::InputTag>("ExtInputTag", edm::InputTag(""))
5557
->setComment("InputTag for external conditions (not required, but recommend to specify explicitly in config)");
5658
desc.add<edm::InputTag>("AlgoBlkInputTag", edm::InputTag("hltGtStage2Digis"))
@@ -106,6 +108,7 @@ L1TGlobalProducer::L1TGlobalProducer(const edm::ParameterSet& parSet)
106108
m_jetInputTag(parSet.getParameter<edm::InputTag>("JetInputTag")),
107109
m_sumInputTag(parSet.getParameter<edm::InputTag>("EtSumInputTag")),
108110
m_sumZdcInputTag(parSet.getParameter<edm::InputTag>("EtSumZdcInputTag")),
111+
m_CICADAInputTag(parSet.getParameter<edm::InputTag>("CICADAInputTag")),
109112
m_extInputTag(parSet.getParameter<edm::InputTag>("ExtInputTag")),
110113

111114
m_produceL1GtDaqRecord(parSet.getParameter<bool>("ProduceL1GtDaqRecord")),
@@ -136,6 +139,7 @@ L1TGlobalProducer::L1TGlobalProducer(const edm::ParameterSet& parSet)
136139
m_jetInputToken = consumes<BXVector<Jet>>(m_jetInputTag);
137140
m_sumInputToken = consumes<BXVector<EtSum>>(m_sumInputTag);
138141
m_sumZdcInputToken = consumes<BXVector<EtSum>>(m_sumZdcInputTag);
142+
m_CICADAInputToken = consumes<float>(m_CICADAInputTag);
139143
m_muInputToken = consumes<BXVector<Muon>>(m_muInputTag);
140144
if (m_useMuonShowers)
141145
m_muShowerInputToken = consumes<BXVector<MuonShower>>(m_muShowerInputTag);
@@ -375,6 +379,7 @@ void L1TGlobalProducer::produce(edm::Event& iEvent, const edm::EventSetup& evSet
375379
gtParser.vecEnergySumTemplate(),
376380
gtParser.vecEnergySumZdcTemplate(),
377381
gtParser.vecAXOL1TLTemplate(),
382+
gtParser.vecCICADATemplate(),
378383
gtParser.vecExternalTemplate(),
379384
gtParser.vecCorrelationTemplate(),
380385
gtParser.vecCorrelationThreeBodyTemplate(),
@@ -520,6 +525,7 @@ void L1TGlobalProducer::produce(edm::Event& iEvent, const edm::EventSetup& evSet
520525
bool receiveJet = true;
521526
bool receiveEtSums = true;
522527
bool receiveEtSumsZdc = true;
528+
bool receiveCICADA = true;
523529
bool receiveExt = true;
524530

525531
/* *** Boards need redefining *****
@@ -610,14 +616,16 @@ void L1TGlobalProducer::produce(edm::Event& iEvent, const edm::EventSetup& evSet
610616
m_jetInputToken,
611617
m_sumInputToken,
612618
m_sumZdcInputToken,
619+
m_CICADAInputToken,
613620
receiveEG,
614621
m_nrL1EG,
615622
receiveTau,
616623
m_nrL1Tau,
617624
receiveJet,
618625
m_nrL1Jet,
619626
receiveEtSums,
620-
receiveEtSumsZdc);
627+
receiveEtSumsZdc,
628+
receiveCICADA);
621629

622630
m_uGtBrd->receiveMuonObjectData(iEvent, m_muInputToken, receiveMu, m_nrL1Mu);
623631

L1Trigger/L1TGlobal/plugins/L1TGlobalProducer.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,11 +127,13 @@ class L1TGlobalProducer : public edm::stream::EDProducer<> {
127127
edm::InputTag m_jetInputTag;
128128
edm::InputTag m_sumInputTag;
129129
edm::InputTag m_sumZdcInputTag;
130+
edm::InputTag m_CICADAInputTag;
130131
edm::EDGetTokenT<BXVector<l1t::EGamma>> m_egInputToken;
131132
edm::EDGetTokenT<BXVector<l1t::Tau>> m_tauInputToken;
132133
edm::EDGetTokenT<BXVector<l1t::Jet>> m_jetInputToken;
133134
edm::EDGetTokenT<BXVector<l1t::EtSum>> m_sumInputToken;
134135
edm::EDGetTokenT<BXVector<l1t::EtSum>> m_sumZdcInputToken;
136+
edm::EDGetTokenT<float> m_CICADAInputToken;
135137

136138
/// input tag for external conditions
137139
edm::InputTag m_extInputTag;

L1Trigger/L1TGlobal/plugins/TriggerMenuParser.cc

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,10 @@ void l1t::TriggerMenuParser::setVecAXOL1TLTemplate(const std::vector<std::vector
147147
m_vecAXOL1TLTemplate = vecAXOL1TLTempl;
148148
}
149149

150+
void l1t::TriggerMenuParser::setVecCICADATemplate(const std::vector<std::vector<CICADATemplate> >& vecCICADATempl) {
151+
m_vecCICADATemplate = vecCICADATempl;
152+
}
153+
150154
void l1t::TriggerMenuParser::setVecExternalTemplate(
151155
const std::vector<std::vector<ExternalTemplate> >& vecExternalTempl) {
152156
m_vecExternalTemplate = vecExternalTempl;
@@ -227,6 +231,7 @@ void l1t::TriggerMenuParser::parseCondFormats(const L1TUtmTriggerMenu* utmMenu)
227231
m_vecEnergySumTemplate.resize(m_numberConditionChips);
228232
m_vecEnergySumZdcTemplate.resize(m_numberConditionChips);
229233
m_vecAXOL1TLTemplate.resize(m_numberConditionChips);
234+
m_vecCICADATemplate.resize(m_numberConditionChips);
230235
m_vecExternalTemplate.resize(m_numberConditionChips);
231236

232237
m_vecCorrelationTemplate.resize(m_numberConditionChips);
@@ -326,6 +331,9 @@ void l1t::TriggerMenuParser::parseCondFormats(const L1TUtmTriggerMenu* utmMenu)
326331
condition.getType() == esConditionType::AnomalyDetectionTrigger) {
327332
parseAXOL1TL(condition, chipNr);
328333

334+
//parse CICADA
335+
} else if (condition.getType() == esConditionType::CicadaTrigger) {
336+
parseCICADA(condition, chipNr);
329337
//parse Muons
330338
} else if (condition.getType() == esConditionType::SingleMuon ||
331339
condition.getType() == esConditionType::DoubleMuon ||
@@ -2903,6 +2911,75 @@ bool l1t::TriggerMenuParser::parseExternal(L1TUtmCondition condExt, unsigned int
29032911
return true;
29042912
}
29052913

2914+
// Parse the CICADA condition and insert the entry into the conditions mapping
2915+
bool l1t::TriggerMenuParser::parseCICADA(L1TUtmCondition condCICADA, unsigned int chipNr) {
2916+
using namespace tmeventsetup;
2917+
2918+
std::string condition = "cicada";
2919+
std::string type = l1t2string(condCICADA.getType());
2920+
std::string name = l1t2string(condCICADA.getName());
2921+
2922+
LogDebug("TriggerMenuParser") << " ****************************************** " << std::endl
2923+
<< " (in parseCICADA) " << std::endl
2924+
<< " condition = " << condition << std::endl
2925+
<< " type = " << type << std::endl
2926+
<< " name = " << name << std::endl;
2927+
const int nrObj = 1;
2928+
GtConditionType cType = TypeCICADA;
2929+
2930+
std::vector<CICADATemplate::ObjectParameter> objParameter(nrObj);
2931+
2932+
if (int(condCICADA.getObjects().size()) != nrObj) {
2933+
edm::LogError("TriggerMenuParser") << " condCICADA objects: nrObj = " << nrObj
2934+
<< "condCICADA.getObjects().size() = " << condCICADA.getObjects().size()
2935+
<< std::endl;
2936+
return false;
2937+
}
2938+
2939+
L1TUtmObject object = condCICADA.getObjects().at(0);
2940+
int relativeBx = object.getBxOffset();
2941+
bool gEq = (object.getComparisonOperator() == esComparisonOperator::GE);
2942+
2943+
float lowerThresholdInd = 0; //May need to be float to match CICADA?
2944+
float upperThresholdInd = -1;
2945+
2946+
const std::vector<L1TUtmCut>& cuts = object.getCuts();
2947+
for (size_t kk = 0; kk < cuts.size(); kk++) {
2948+
const L1TUtmCut& cut = cuts.at(kk);
2949+
2950+
switch (cut.getCutType()) {
2951+
case esCutType::CicadaScore:
2952+
lowerThresholdInd = cut.getMinimum().value;
2953+
upperThresholdInd = cut.getMaximum().value;
2954+
}
2955+
}
2956+
2957+
objParameter[0].minCICADAThreshold = lowerThresholdInd;
2958+
objParameter[0].maxCICADAThreshold = upperThresholdInd;
2959+
2960+
CICADATemplate cicadaCond(name);
2961+
cicadaCond.setCondType(cType);
2962+
cicadaCond.setCondGEq(gEq);
2963+
cicadaCond.setCondChipNr(chipNr);
2964+
cicadaCond.setCondRelativeBx(relativeBx);
2965+
cicadaCond.setConditionParameter(objParameter);
2966+
2967+
if (edm::isDebugEnabled()) {
2968+
std::ostringstream myCoutStream;
2969+
cicadaCond.print(myCoutStream);
2970+
LogTrace("TriggerMenuParser") << myCoutStream.str() << "\n" << std::endl;
2971+
}
2972+
2973+
if (!insertConditionIntoMap(cicadaCond, chipNr)) {
2974+
edm::LogError("TriggerMenuParser") << " Error: duplicate CICADA condition (" << name << ")" << std::endl;
2975+
return false;
2976+
}
2977+
2978+
(m_vecCICADATemplate[chipNr]).push_back(cicadaCond);
2979+
2980+
return true;
2981+
}
2982+
29062983
/**
29072984
* parseCorrelation Parse a correlation condition and
29082985
* insert an entry to the conditions map

L1Trigger/L1TGlobal/plugins/TriggerMenuParser.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
#include "L1Trigger/L1TGlobal/interface/EnergySumTemplate.h"
3939
#include "L1Trigger/L1TGlobal/interface/EnergySumZdcTemplate.h"
4040
#include "L1Trigger/L1TGlobal/interface/AXOL1TLTemplate.h"
41+
#include "L1Trigger/L1TGlobal/interface/CICADATemplate.h"
4142
#include "L1Trigger/L1TGlobal/interface/CorrelationTemplate.h"
4243
#include "L1Trigger/L1TGlobal/interface/CorrelationThreeBodyTemplate.h"
4344
#include "L1Trigger/L1TGlobal/interface/CorrelationWithOverlapRemovalTemplate.h"
@@ -157,6 +158,10 @@ namespace l1t {
157158
inline const std::vector<std::vector<AXOL1TLTemplate> >& vecAXOL1TLTemplate() const { return m_vecAXOL1TLTemplate; }
158159
void setVecAXOL1TLTemplate(const std::vector<std::vector<AXOL1TLTemplate> >&);
159160

161+
//
162+
inline const std::vector<std::vector<CICADATemplate> >& vecCICADATemplate() const { return m_vecCICADATemplate; }
163+
void setVecCICADATemplate(const std::vector<std::vector<CICADATemplate> >&);
164+
160165
//
161166
inline const std::vector<std::vector<ExternalTemplate> >& vecExternalTemplate() const {
162167
return m_vecExternalTemplate;
@@ -309,6 +314,8 @@ namespace l1t {
309314

310315
bool parseAXOL1TL(L1TUtmCondition condAXOL1TL, unsigned int chipNr = 0);
311316

317+
bool parseCICADA(L1TUtmCondition condCICADA, unsigned int chipNr = 0);
318+
312319
bool parseEnergySumCorr(const L1TUtmObject* corrESum, unsigned int chipNr = 0);
313320

314321
bool parseExternal(L1TUtmCondition condExt, unsigned int chipNr = 0);
@@ -416,6 +423,7 @@ namespace l1t {
416423
std::vector<std::vector<EnergySumTemplate> > m_vecEnergySumTemplate;
417424
std::vector<std::vector<EnergySumZdcTemplate> > m_vecEnergySumZdcTemplate;
418425
std::vector<std::vector<AXOL1TLTemplate> > m_vecAXOL1TLTemplate;
426+
std::vector<std::vector<CICADATemplate> > m_vecCICADATemplate;
419427
std::vector<std::vector<ExternalTemplate> > m_vecExternalTemplate;
420428

421429
std::vector<std::vector<CorrelationTemplate> > m_vecCorrelationTemplate;

0 commit comments

Comments
 (0)