Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions L1Trigger/L1TGlobal/interface/GlobalBoard.h
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,8 @@ namespace l1t {
/// pointer to External data list
inline const BXVector<const GlobalExtBlk*>* getCandL1External() const { return m_candL1External; }

inline const float getCICADAScore() const { return m_cicadaScore; }
/// pointer to CICADA-score data list
inline const BXVector<float>* getCandL1CICADAScore() const { return m_candL1CICADAScore; }

/* Drop individual EtSums for Now
/// pointer to ETM data list
Expand Down Expand Up @@ -208,8 +209,6 @@ namespace l1t {
void setResetPSCountersEachLumiSec(bool val) { m_resetPSCountersEachLumiSec = val; }
void setSemiRandomInitialPSCounters(bool val) { m_semiRandomInitialPSCounters = val; }

void setCICADAScore(float val) { m_cicadaScore = val; }

public:
inline void setVerbosity(const int verbosity) { m_verbosity = verbosity; }

Expand All @@ -224,6 +223,7 @@ namespace l1t {
BXVector<const l1t::EtSum*>* m_candL1EtSum;
BXVector<const l1t::EtSum*>* m_candL1EtSumZdc;
BXVector<const GlobalExtBlk*>* m_candL1External;
BXVector<float>* m_candL1CICADAScore;

// BXVector<const l1t::EtSum*>* m_candETM;
// BXVector<const l1t::EtSum*>* m_candETT;
Expand All @@ -233,8 +233,6 @@ namespace l1t {
int m_bxFirst_;
int m_bxLast_;

float m_cicadaScore = 0.0;

std::bitset<GlobalAlgBlk::maxPhysicsTriggers> m_gtlAlgorithmOR;
std::bitset<GlobalAlgBlk::maxPhysicsTriggers> m_gtlDecisionWord;

Expand Down
20 changes: 11 additions & 9 deletions L1Trigger/L1TGlobal/src/CICADACondition.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,22 +40,24 @@ l1t::CICADACondition& l1t::CICADACondition::operator=(const l1t::CICADACondition
}

const bool l1t::CICADACondition::evaluateCondition(const int bxEval) const {
bool condResult = false;
const float cicadaScore = m_uGtB->getCICADAScore();
auto const* cicadaScoreBXVec = m_uGtB->getCandL1CICADAScore();

int const useBx = bxEval + m_gtCICADATemplate->condRelativeBx();

if (cicadaScoreBXVec->isEmpty(useBx)) {
return false;
}

float const cicadaScore = cicadaScoreBXVec->at(useBx, 0);

// This gets rid of a GT emulator convention "iCondition".
// This usually indexes the next line, which is somewhat concerning
// AXOL1TL operates this way, but it should be checked
const CICADATemplate::ObjectParameter objPar = (*(m_gtCICADATemplate->objectParameter()))[0];

bool condGEqVal = m_gtCICADATemplate->condGEq();
bool passCondition = false;

passCondition = checkCut(objPar.minCICADAThreshold, cicadaScore, condGEqVal);

condResult |= passCondition;
bool const condGEqVal = m_gtCICADATemplate->condGEq();

return condResult;
return checkCut(objPar.minCICADAThreshold, cicadaScore, condGEqVal);
}

void l1t::CICADACondition::print(std::ostream& myCout) const {
Expand Down
40 changes: 22 additions & 18 deletions L1Trigger/L1TGlobal/src/GlobalBoard.cc
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ l1t::GlobalBoard::GlobalBoard()
m_candL1EtSum(new BXVector<const l1t::EtSum*>),
m_candL1EtSumZdc(new BXVector<const l1t::EtSum*>),
m_candL1External(new BXVector<const GlobalExtBlk*>),
m_candL1CICADAScore(new BXVector<float>),
m_currentLumi(0),
m_isDebugEnabled(edm::isDebugEnabled()) {
m_uGtAlgBlk.reset();
Expand All @@ -98,6 +99,7 @@ l1t::GlobalBoard::~GlobalBoard() {
delete m_candL1EtSum;
delete m_candL1EtSumZdc;
delete m_candL1External;
delete m_candL1CICADAScore;
}

// Operations
Expand All @@ -124,6 +126,7 @@ void l1t::GlobalBoard::init(const int numberPhysTriggers,
m_candL1EtSum->setBXRange(m_bxFirst_, m_bxLast_);
m_candL1EtSumZdc->setBXRange(m_bxFirst_, m_bxLast_);
m_candL1External->setBXRange(m_bxFirst_, m_bxLast_);
m_candL1CICADAScore->setBXRange(m_bxFirst_, m_bxLast_);

m_uGtAlgBlk.reset();

Expand Down Expand Up @@ -338,26 +341,26 @@ void l1t::GlobalBoard::receiveCaloObjectData(const edm::Event& iEvent,
}
}
if (receiveCICADA) {
edm::Handle<BXVector<float>> cicadaScoreHandle;
iEvent.getByToken(CICADAInputToken, cicadaScoreHandle);
if (not cicadaScoreHandle.isValid()) {
if (m_verbosity) {
edm::LogWarning("L1Tglobal") << "\nWarning: Input tag for the CICADA score"
<< "\nrequested in configuration, but not found in the event.\n"
<< "\nSetting score to 0.0";
}
setCICADAScore(0.0);
} else if (cicadaScoreHandle->isEmpty(0)) {
edm::Handle<BXVector<float>> cicadaScoreData;
iEvent.getByToken(CICADAInputToken, cicadaScoreData);

if (!cicadaScoreData.isValid()) {
if (m_verbosity) {
edm::LogWarning("L1Tglobal")
<< "\nWarning: CICADA score had a valid input tag, but an empty BX collection"
<< "\nThe CICADA score will be filled with 0.0 to prevent any failure of uGT emulation";
edm::LogWarning("L1TGlobal") << "\nWarning: Input tag for the CICADA-score collection"
<< "\nrequested in configuration, but not found in the event.\n";
}
setCICADAScore(0.0);
} else {
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.
for (int i = cicadaScoreData->getFirstBX(); i <= cicadaScoreData->getLastBX(); ++i) {
// Prevent from pushing back bx that is outside of allowed range
if (i < m_bxFirst_ || i > m_bxLast_)
continue;

for (std::vector<float>::const_iterator cicadaScore = cicadaScoreData->begin(i);
cicadaScore != cicadaScoreData->end(i);
++cicadaScore) {
m_candL1CICADAScore->push_back(i, *cicadaScore);
}
} //end loop over Bx
}
}
}
Expand Down Expand Up @@ -1183,13 +1186,14 @@ void l1t::GlobalBoard::resetCalo() {
m_candL1Jet->clear();
m_candL1EtSum->clear();
m_candL1EtSumZdc->clear();
m_cicadaScore = 0.0;
m_candL1CICADAScore->clear();

m_candL1EG->setBXRange(m_bxFirst_, m_bxLast_);
m_candL1Tau->setBXRange(m_bxFirst_, m_bxLast_);
m_candL1Jet->setBXRange(m_bxFirst_, m_bxLast_);
m_candL1EtSum->setBXRange(m_bxFirst_, m_bxLast_);
m_candL1EtSumZdc->setBXRange(m_bxFirst_, m_bxLast_);
m_candL1CICADAScore->setBXRange(m_bxFirst_, m_bxLast_);
}

void l1t::GlobalBoard::resetExternal() {
Expand Down