Skip to content

Commit

Permalink
introduce L1TGlobalProducer::beginRun and GlobalBoard::initTriggerCon…
Browse files Browse the repository at this point in the history
…ditions

Move per-run operations which are currently
in L1TGlobalProducer::produce to L1TGlobalProducer::beginRun.

In particular, the creation of the "trigger conditions"
which is currently implemented in the method GlobalBoard::runGTL
is moved to a separate method named GlobalBoard::initTriggerConditions,
which is to be executed once per run
(as opposed to GlobalBoard::runGTL, which is executed once per event).
  • Loading branch information
missirol committed Jan 5, 2025
1 parent ab76956 commit 9dc135c
Show file tree
Hide file tree
Showing 13 changed files with 327 additions and 480 deletions.
5 changes: 2 additions & 3 deletions L1Trigger/L1TGlobal/interface/AlgorithmEvaluation.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

#include <iostream>
#include <map>
#include <memory>
#include <queue>
#include <stack>
#include <string>
Expand Down Expand Up @@ -55,9 +56,7 @@ namespace l1t {
// virtual ~AlgorithmEvaluation();

//typedef std::map<std::string, ConditionEvaluation*> ConditionEvaluationMap;
typedef std::unordered_map<std::string, ConditionEvaluation*> ConditionEvaluationMap;
typedef ConditionEvaluationMap::const_iterator CItEvalMap;
typedef ConditionEvaluationMap::iterator ItEvalMap;
typedef std::unordered_map<std::string, std::unique_ptr<ConditionEvaluation>> ConditionEvaluationMap;

public:
/// get / set the result of the algorithm
Expand Down
11 changes: 1 addition & 10 deletions L1Trigger/L1TGlobal/interface/ConditionEvaluation.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,13 @@
*
*/

// system include files
#include <cstdint>
#include <iostream>

#include <string>
#include <vector>

// user include files

// base class

//
#include "DataFormats/L1TGlobal/interface/GlobalObjectMapFwd.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include <cstdint>

// forward declarations

namespace l1t {

Expand Down
13 changes: 6 additions & 7 deletions L1Trigger/L1TGlobal/interface/CorrCondition.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,11 @@ namespace l1t {
CorrCondition();

/// from base template condition (from event setup usually)
CorrCondition(const GlobalCondition*, const GlobalCondition*, const GlobalCondition*, const GlobalBoard*

);
CorrCondition(const GlobalCondition*,
const GlobalCondition*,
const GlobalCondition*,
const GlobalBoard*,
const GlobalScales*);

// copy constructor
CorrCondition(const CorrCondition&);
Expand All @@ -63,16 +65,13 @@ namespace l1t {
void print(std::ostream& myCout) const override;

public:
/// get / set the pointer to a Condition
inline const CorrelationTemplate* gtCorrelationTemplate() const { return m_gtCorrelationTemplate; }

void setGtCorrelationTemplate(const CorrelationTemplate*);

/// get / set the pointer to uGt GlobalBoard
inline const GlobalBoard* getuGtB() const { return m_uGtB; }

void setuGtB(const GlobalBoard*);

inline const GlobalScales* getScales() const { return m_gtScales; }
void setScales(const GlobalScales*);

/* //BLW Comment out for now
Expand Down
10 changes: 3 additions & 7 deletions L1Trigger/L1TGlobal/interface/CorrThreeBodyCondition.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,8 @@ namespace l1t {
const GlobalCondition*,
const GlobalCondition*,
const GlobalCondition*,
const GlobalBoard*

);
const GlobalBoard*,
const GlobalScales*);

// copy constructor
CorrThreeBodyCondition(const CorrThreeBodyCondition&);
Expand All @@ -67,18 +66,15 @@ namespace l1t {
void print(std::ostream& myCout) const override;

public:
/// get / set the pointer to a Condition
inline const CorrelationThreeBodyTemplate* gtCorrelationThreeBodyTemplate() const {
return m_gtCorrelationThreeBodyTemplate;
}

void setGtCorrelationThreeBodyTemplate(const CorrelationThreeBodyTemplate*);

/// get / set the pointer to uGt GlobalBoard
inline const GlobalBoard* getuGtB() const { return m_uGtB; }

void setuGtB(const GlobalBoard*);

inline const GlobalScales* getScales() const { return m_gtScales; }
void setScales(const GlobalScales*);

private:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,8 @@ namespace l1t {
const GlobalCondition*,
const GlobalCondition*,
const GlobalCondition*,
const GlobalBoard*

);
const GlobalBoard*,
const GlobalScales*);

// copy constructor
CorrWithOverlapRemovalCondition(const CorrWithOverlapRemovalCondition&);
Expand All @@ -68,18 +67,16 @@ namespace l1t {
void print(std::ostream& myCout) const override;

public:
/// get / set the pointer to a Condition
inline const CorrelationWithOverlapRemovalTemplate* gtCorrelationWithOverlapRemovalTemplate() const {
return m_gtCorrelationWithOverlapRemovalTemplate;
}

void setGtCorrelationWithOverlapRemovalTemplate(const CorrelationWithOverlapRemovalTemplate*);

/// get / set the pointer to uGt GlobalBoard
inline const GlobalBoard* getuGtB() const { return m_uGtB; }

void setuGtB(const GlobalBoard*);

inline const GlobalScales* getScales() const { return m_gtScales; }
void setScales(const GlobalScales*);

/* //BLW Comment out for now
Expand Down
58 changes: 16 additions & 42 deletions L1Trigger/L1TGlobal/interface/GlobalBoard.h
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
#ifndef GtBoard_h
#define GtBoard_h
#ifndef L1Trigger_L1TGlobal_GlobalBoard_h
#define L1Trigger_L1TGlobal_GlobalBoard_h

/**
* \class GlobalBoard
*
*
* Description: Global Trigger Logic board.
*
* Implementation:
* <TODO: enter implementation details>
*
*/

// system include files
Expand All @@ -18,6 +15,7 @@
#include <vector>
#include <cmath>
#include <memory>
#include <string>

// user include files
#include "FWCore/Utilities/interface/typedefs.h"
Expand Down Expand Up @@ -46,11 +44,6 @@

// forward declarations
class TriggerMenu;
class L1CaloGeometry;
class L1MuTriggerScales;
//class L1GtEtaPhiConversions;

// class declaration

namespace l1t {

Expand Down Expand Up @@ -107,19 +100,23 @@ namespace l1t {
int bxFirst,
int bxLast);

/// run the uGT GTL (Conditions and Algorithms)
/// initialise Trigger Conditions
void initTriggerConditions(const edm::EventSetup& evSetup,
const TriggerMenu* m_l1GtMenu,
const int nrL1Mu,
const int nrL1MuShower,
const int nrL1EG,
const int nrL1Tau,
const int nrL1Jet);

/// run the uGT GTL (Algorithms, per-event decisions)
void runGTL(const edm::Event& iEvent,
const edm::EventSetup& evSetup,
const TriggerMenu* m_l1GtMenu,
const bool produceL1GtObjectMapRecord,
const int iBxInEvent,
std::unique_ptr<GlobalObjectMapRecord>& gtObjectMapRecord, //GTO
const unsigned int numberPhysTriggers,
const int nrL1Mu,
const int nrL1MuShower,
const int nrL1EG,
const int nrL1Tau,
const int nrL1Jet);
const unsigned int numberPhysTriggers);

/// run the uGT FDL (Apply Prescales and Veto)
void runFDL(const edm::Event& iEvent,
Expand Down Expand Up @@ -220,23 +217,6 @@ namespace l1t {

inline void enableAXOScoreSaving(bool savescore) { m_saveAXOScore = savescore; }

private:
// cached stuff

// trigger menu
const TriggerMenu* m_l1GtMenu;
unsigned long long m_l1GtMenuCacheID;

// L1 scales (phi, eta) for Mu, Calo and EnergySum objects
const L1CaloGeometry* m_l1CaloGeometry;
unsigned long long m_l1CaloGeometryCacheID;

const L1MuTriggerScales* m_l1MuTriggerScales;
unsigned long long m_l1MuTriggerScalesCacheID;

// conversions for eta and phi
// L1GtEtaPhiConversions* m_gtEtaPhiConversions;

private:
BXVector<const l1t::Muon*>* m_candL1Mu;
BXVector<std::shared_ptr<l1t::MuonShower>>* m_candL1MuShower;
Expand Down Expand Up @@ -264,8 +244,9 @@ namespace l1t {

//for optional software-only saving of axol1tl score
AXOL1TLScore m_uGtAXOScore; //score dataformat
float m_storedAXOScore = -999.0; //score from cond class
float m_storedAXOScore = -999.f; //score from cond class
bool m_saveAXOScore = false;
std::string m_axoScoreConditionName;

// cache of maps
std::vector<AlgorithmEvaluation::ConditionEvaluationMap> m_conditionResultMaps;
Expand All @@ -284,13 +265,6 @@ namespace l1t {
bool m_algFinalOr;
bool m_algFinalOrVeto;

// Counter for number of events seen by this board
unsigned int m_boardEventCount;

// Information about board
int m_uGtBoardNumber;
bool m_uGtFinalBoard;

// whether we reset the prescales each lumi or not
bool m_resetPSCountersEachLumiSec = false;

Expand Down
Loading

0 comments on commit 9dc135c

Please sign in to comment.