Skip to content
Closed
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
2 changes: 2 additions & 0 deletions DataFormats/L1TGlobal/interface/GlobalObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ namespace l1t {
gtCentrality6,
gtCentrality7,
gtExternal,
gtZDCP,
gtZDCM,
ObjNull
};

Expand Down
10 changes: 10 additions & 0 deletions DataFormats/L1TGlobal/src/GlobalObject.cc
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ l1t::GlobalObject l1TGtObjectStringToEnum(const std::string& label) {
{"CENT6", gtCentrality6},
{"CENT7", gtCentrality7},
{"External", gtExternal},
{"ZDCP", gtZDCP},
{"ZDCM", gtZDCM},
{"ObjNull", ObjNull},
{nullptr, (GlobalObject)-1}};

Expand Down Expand Up @@ -200,6 +202,14 @@ std::string l1t::l1TGtObjectEnumToString(const GlobalObject& gtObject) {
gtObjectString = "External";
} break;

case gtZDCP: {
gtObjectString = "ZDCP";
} break;

case gtZDCM: {
gtObjectString = "ZDCM";
} break;

case ObjNull: {
gtObjectString = "ObjNull";
edm::LogInfo("L1TGlobal") << "\n ObjNull means no valid GlobalObject defined!";
Expand Down
2 changes: 2 additions & 0 deletions DataFormats/L1Trigger/interface/EtSum.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ namespace l1t {
kAsymHt,
kAsymEtHF,
kAsymHtHF,
kZDCP,
kZDCM,
kUninitialized
};

Expand Down
12 changes: 9 additions & 3 deletions L1Trigger/L1TGlobal/interface/GlobalBoard.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,15 @@ namespace l1t {
const edm::EDGetTokenT<BXVector<l1t::Tau>>&,
const edm::EDGetTokenT<BXVector<l1t::Jet>>&,
const edm::EDGetTokenT<BXVector<l1t::EtSum>>&,
const edm::EDGetTokenT<BXVector<l1t::EtSum>>&,
const bool receiveEG,
const int nrL1EG,
const bool receiveTau,
const int nrL1Tau,
const bool receiveJet,
const int nrL1Jet,
const bool receiveEtSums);
const bool receiveEtSums,
const bool receiveZdcEtSums);

void receiveMuonObjectData(const edm::Event&,
const edm::EDGetTokenT<BXVector<l1t::Muon>>&,
Expand Down Expand Up @@ -161,10 +163,13 @@ namespace l1t {
/// pointer to Tau data list
inline const BXVector<const l1t::L1Candidate*>* getCandL1Tau() const { return m_candL1Tau; }

/// pointer to Tau data list
/// pointer to EtSum data list
inline const BXVector<const l1t::EtSum*>* getCandL1EtSum() const { return m_candL1EtSum; }

/// pointer to Tau data list
/// pointer to ZDC EtSum data list
inline const BXVector<const l1t::EtSum*>* getCandL1ZdcEtSum() const { return m_candL1ZdcEtSum; }

/// pointer to External data list
inline const BXVector<const GlobalExtBlk*>* getCandL1External() const { return m_candL1External; }

/* Drop individual EtSums for Now
Expand Down Expand Up @@ -226,6 +231,7 @@ namespace l1t {
BXVector<const l1t::L1Candidate*>* m_candL1Tau;
BXVector<const l1t::L1Candidate*>* m_candL1Jet;
BXVector<const l1t::EtSum*>* m_candL1EtSum;
BXVector<const l1t::EtSum*>* m_candL1ZdcEtSum;
BXVector<const GlobalExtBlk*>* m_candL1External;

// BXVector<const l1t::EtSum*>* m_candETM;
Expand Down
3 changes: 3 additions & 0 deletions L1Trigger/L1TGlobal/interface/GlobalDefinitions.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ namespace l1t {
TypeMinBiasHFM0,
TypeMinBiasHFP1,
TypeMinBiasHFM1,
TypeZDCP,
TypeZDCM,
TypeETTem,
TypeExternal,
Type2corWithOverlapRemoval,
Expand Down Expand Up @@ -96,6 +98,7 @@ namespace l1t {
CondMuon,
CondCalo,
CondEnergySum,
CondZdcEnergySum,
CondCorrelation,
CondExternal,
CondCorrelationWithOverlapRemoval,
Expand Down
11 changes: 11 additions & 0 deletions L1Trigger/L1TGlobal/interface/TriggerMenu.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#include "L1Trigger/L1TGlobal/interface/MuonShowerTemplate.h"
#include "L1Trigger/L1TGlobal/interface/CaloTemplate.h"
#include "L1Trigger/L1TGlobal/interface/EnergySumTemplate.h"
#include "L1Trigger/L1TGlobal/interface/ZdcEnergySumTemplate.h"
#include "L1Trigger/L1TGlobal/interface/ExternalTemplate.h"
#include "L1Trigger/L1TGlobal/interface/CorrelationTemplate.h"
#include "L1Trigger/L1TGlobal/interface/CorrelationThreeBodyTemplate.h"
Expand All @@ -57,6 +58,7 @@ class TriggerMenu {
const std::vector<std::vector<MuonShowerTemplate> >&,
const std::vector<std::vector<CaloTemplate> >&,
const std::vector<std::vector<EnergySumTemplate> >&,
const std::vector<std::vector<ZdcEnergySumTemplate> >&,
const std::vector<std::vector<ExternalTemplate> >&,
const std::vector<std::vector<CorrelationTemplate> >&,
const std::vector<std::vector<CorrelationThreeBodyTemplate> >&,
Expand Down Expand Up @@ -130,6 +132,14 @@ class TriggerMenu {

void setVecEnergySumTemplate(const std::vector<std::vector<EnergySumTemplate> >&);

//
inline const std::vector<std::vector<ZdcEnergySumTemplate> >& vecZdcEnergySumTemplate() const {
return m_vecZdcEnergySumTemplate;
}

void setVecZdcEnergySumTemplate(const std::vector<std::vector<ZdcEnergySumTemplate> >&);

//
inline const std::vector<std::vector<ExternalTemplate> >& vecExternalTemplate() const {
return m_vecExternalTemplate;
}
Expand Down Expand Up @@ -230,6 +240,7 @@ class TriggerMenu {
std::vector<std::vector<MuonShowerTemplate> > m_vecMuonShowerTemplate;
std::vector<std::vector<CaloTemplate> > m_vecCaloTemplate;
std::vector<std::vector<EnergySumTemplate> > m_vecEnergySumTemplate;
std::vector<std::vector<ZdcEnergySumTemplate> > m_vecZdcEnergySumTemplate;

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

Expand Down
86 changes: 86 additions & 0 deletions L1Trigger/L1TGlobal/interface/ZdcEnergySumCondition.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
#ifndef L1Trigger_L1TGlobal_ZdcEnergySumCondition_h
#define L1Trigger_L1TGlobal_ZdcEnergySumCondition_h

/**
* \class ZdcEnergySumCondition
*
*
* Description: evaluation of a CondZdcEnergySum condition.
*
* Implementation:
* <TODO: enter implementation details>
*
* \author: Vasile Mihai Ghete - HEPHY Vienna
*
*
*/

// system include files
#include <iosfwd>
#include <string>

// user include files
// base classes
#include "L1Trigger/L1TGlobal/interface/ConditionEvaluation.h"

// forward declarations
class GlobalCondition;
class ZdcEnergySumTemplate;

namespace l1t {

class L1Candidate;

class GlobalBoard;

// class declaration
class ZdcEnergySumCondition : public ConditionEvaluation {
public:
/// constructors
/// default
ZdcEnergySumCondition();

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

// copy constructor
ZdcEnergySumCondition(const ZdcEnergySumCondition&);

// destructor
~ZdcEnergySumCondition() override;

// assign operator
ZdcEnergySumCondition& operator=(const ZdcEnergySumCondition&);

public:
/// the core function to check if the condition matches
const bool evaluateCondition(const int bxEval) const override;

/// print condition
void print(std::ostream& myCout) const override;

public:
/// get / set the pointer to a L1GtCondition
inline const ZdcEnergySumTemplate* gtZdcEnergySumTemplate() const { return m_gtZdcEnergySumTemplate; }

void setGtZdcEnergySumTemplate(const ZdcEnergySumTemplate*);

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

void setuGtB(const GlobalBoard*);

private:
/// copy function for copy constructor and operator=
void copy(const ZdcEnergySumCondition& cp);

private:
/// pointer to a ZdcEnergySumTemplate
const ZdcEnergySumTemplate* m_gtZdcEnergySumTemplate;

/// pointer to uGt GlobalBoard, to be able to get the trigger objects
const GlobalBoard* m_uGtB;
};

} // namespace l1t
#endif
79 changes: 79 additions & 0 deletions L1Trigger/L1TGlobal/interface/ZdcEnergySumTemplate.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
#ifndef L1Trigger_L1TGlobal_ZdcEnergySumTemplate_h
#define L1Trigger_L1TGlobal_ZdcEnergySumTemplate_h

/**
* \class ZdcEnergySumTemplate
*
*
* Description: L1 Global Trigger energy-sum template.
*
* Implementation:
* <TODO: enter implementation details>
*
* \author: Vasile Mihai Ghete - HEPHY Vienna
*
* $Date$
* $Revision$
*
*/

// system include files
#include <string>
#include <iosfwd>

// user include files

// base class
#include "L1Trigger/L1TGlobal/interface/GlobalCondition.h"

// forward declarations

// class declaration
class ZdcEnergySumTemplate : public GlobalCondition {
public:
// constructor
ZdcEnergySumTemplate();

// constructor
ZdcEnergySumTemplate(const std::string&);

// constructor
ZdcEnergySumTemplate(const std::string&, const l1t::GtConditionType&);

// copy constructor
ZdcEnergySumTemplate(const ZdcEnergySumTemplate&);

// destructor
~ZdcEnergySumTemplate() override;

// assign operator
ZdcEnergySumTemplate& operator=(const ZdcEnergySumTemplate&);

public:
struct ObjectParameter {
unsigned int etLowThreshold;
unsigned int etHighThreshold;
};

public:
inline const std::vector<ObjectParameter>* objectParameter() const { return &m_objectParameter; }

/// set functions
void setConditionParameter(const std::vector<ObjectParameter>&);

/// print the condition
void print(std::ostream& myCout) const override;

/// output stream operator
friend std::ostream& operator<<(std::ostream&, const ZdcEnergySumTemplate&);

private:
/// copy function for copy constructor and operator=
void copy(const ZdcEnergySumTemplate& cp);

private:
/// variables containing the parameters
std::vector<ObjectParameter> m_objectParameter;
};

#endif
10 changes: 9 additions & 1 deletion L1Trigger/L1TGlobal/plugins/L1TGlobalProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ void L1TGlobalProducer::fillDescriptions(edm::ConfigurationDescriptions& descrip
->setComment("InputTag for Calo Trigger Jet (required parameter: default value is invalid)");
desc.add<edm::InputTag>("EtSumInputTag", edm::InputTag(""))
->setComment("InputTag for Calo Trigger EtSum (required parameter: default value is invalid)");
desc.add<edm::InputTag>("ZdcEtSumInputTag", edm::InputTag(""))
->setComment("InputTag for ZDC EtSums Plus and Minus (required parameter: default value is invalid)");
desc.add<edm::InputTag>("ExtInputTag", edm::InputTag(""))
->setComment("InputTag for external conditions (not required, but recommend to specify explicitly in config)");
desc.add<edm::InputTag>("AlgoBlkInputTag", edm::InputTag("hltGtStage2Digis"))
Expand Down Expand Up @@ -103,6 +105,7 @@ L1TGlobalProducer::L1TGlobalProducer(const edm::ParameterSet& parSet)
m_tauInputTag(parSet.getParameter<edm::InputTag>("TauInputTag")),
m_jetInputTag(parSet.getParameter<edm::InputTag>("JetInputTag")),
m_sumInputTag(parSet.getParameter<edm::InputTag>("EtSumInputTag")),
m_zdcEtSumInputTag(parSet.getParameter<edm::InputTag>("ZdcEtSumInputTag")),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What should be the value of this new InputTag in the instance of the L1T emulator used inside the HLT menu [1] ?

As far as I understand, in principle it should be a product coming from the L1T unpacker, e.g. something like "hltGtStage2Digis:ZdcEtSum", but I'm not seeing where this is produced. Is there a L1T unpacker for ZDC ? (sorry if the question is naive)

[1]

process.hltGtStage2ObjectMap = cms.EDProducer( "L1TGlobalProducer",
    MuonInputTag = cms.InputTag( 'hltGtStage2Digis','Muon' ),
    MuonShowerInputTag = cms.InputTag( 'hltGtStage2Digis','MuonShower' ),
    EGammaInputTag = cms.InputTag( 'hltGtStage2Digis','EGamma' ),
    TauInputTag = cms.InputTag( 'hltGtStage2Digis','Tau' ),
    JetInputTag = cms.InputTag( 'hltGtStage2Digis','Jet' ),
    EtSumInputTag = cms.InputTag( 'hltGtStage2Digis','EtSum' ),
    ExtInputTag = cms.InputTag( "hltGtStage2Digis" ),
    AlgoBlkInputTag = cms.InputTag( "hltGtStage2Digis" ),
    GetPrescaleColumnFromData = cms.bool( False ),
    AlgorithmTriggersUnprescaled = cms.bool( True ),
    RequireMenuToMatchAlgoBlkInput = cms.bool( True ),
    AlgorithmTriggersUnmasked = cms.bool( True ),
    useMuonShowers = cms.bool( True ),
    resetPSCountersEachLumiSec = cms.bool( True ),
    semiRandomInitialPSCounters = cms.bool( False ),
    ProduceL1GtDaqRecord = cms.bool( True ),
    ProduceL1GtObjectMapRecord = cms.bool( True ),
    EmulateBxInEvent = cms.int32( 1 ),
    L1DataBxInEvent = cms.int32( 5 ),
    AlternativeNrBxBoardDaq = cms.uint32( 0 ),
    BstLengthBytes = cms.int32( -1 ),
    PrescaleSet = cms.uint32( 1 ),
    Verbosity = cms.untracked.int32( 0 ),
    PrintL1Menu = cms.untracked.bool( False ),
    TriggerMenuLuminosity = cms.string( "startup" )
)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @missirol, for the moment we are not having (and we are not going to have in a very short term) an unpacker for ZDC. The plan was to implement something at a later stage (as discussed with @aloeliger @dinyar and HI people). Most likely the inputTag coming from L1 and used in the HLT menu will be the same one that we are going to use in the uGT, that after some discussion it looks that it will be simCaloStage2Digis. The idea is to save the EtSum value from the ZDC producer in the same output collection that contains all EtSum values from CaloLayer2. I ask @bundocka or any other L1 expert to correct me if I am wrong.

Copy link
Contributor

@Martin-Grunewald Martin-Grunewald Aug 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

simCaloStage2Digis looks like simulation - what about real data?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe that sim refers to the fact that we are simulating the trigger decision, but the inputs are real data - I've put a snippet from an edmConfigDump below of a python file I run over 2018 PbPb data to test the code. Please correct me if I've misunderstood, however

`
process.simCaloStage2Digis = cms.EDProducer("L1TStage2Layer2Producer",
firmware = cms.int32(1),
towerToken = cms.InputTag("simCaloStage2Layer1Digis"),
useStaticConfig = cms.bool(False)
)

process.simCaloStage2Layer1Digis = cms.EDProducer("L1TCaloLayer1",
ecalToken = cms.InputTag("ecalDigis","EcalTriggerPrimitives"),
firmwareVersion = cms.int32(3),
hcalToken = cms.InputTag("hcalDigis"),
unpackEcalMask = cms.bool(False),
unpackHcalMask = cms.bool(False),
useCalib = cms.bool(True),
useECALLUT = cms.bool(True),
useHCALFBLUT = cms.bool(False),
useHCALLUT = cms.bool(True),
useHFLUT = cms.bool(True),
useLSB = cms.bool(True),
verbose = cms.untracked.bool(False)
)
`

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea is to save the EtSum value from the ZDC producer in the same output collection that contains all EtSum values from CaloLayer2

What happens if one run the L1T unpackers and uGT emulator on data that does not contain the ZDC ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Andrea,
my understanding of the L1 Trigger emulation is that unpackers for objects are running only if there is something to unpack (= ZDC FED present in the run). I let L1T experts comment more though.

On my end, I quickly tried to run the current emulator on a data file from 2022A (that doesn't contain ZDC) but I have an error at earlier emulation stages. Not sure if that's relevant.

----- Begin Fatal Exception 24-Aug-2023 22:00:55 CEST-----------------------
An exception of category 'Conditions mismatch' occurred while
   [0] Processing  Event run: 362219 lumi: 1 event: 14289 stream: 0
   [1] Running path 'L1TReEmulPath'
   [2] Prefetching for module HcalTrigPrimDigiProducer/'simHcalTriggerPrimitiveDigis'
   [3] Calling method for EventSetup module HcalTPGCoderULUT/''
Exception Message:
Requested conditions of type HcalChannelQuality for cell (0x43280401) (HB 1,1,2) got conditions for cell (0x0) 
----- End Fatal Exception -------------------------------------------------

Any suggestion about how we can test this effect (and prevent issues) more in detail?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cms-sw/l1-l2 can you suggest how to try running this version of the uGT emulator on older data that does not contain the ZDC ?

m_extInputTag(parSet.getParameter<edm::InputTag>("ExtInputTag")),

m_produceL1GtDaqRecord(parSet.getParameter<bool>("ProduceL1GtDaqRecord")),
Expand Down Expand Up @@ -132,6 +135,7 @@ L1TGlobalProducer::L1TGlobalProducer(const edm::ParameterSet& parSet)
m_tauInputToken = consumes<BXVector<Tau>>(m_tauInputTag);
m_jetInputToken = consumes<BXVector<Jet>>(m_jetInputTag);
m_sumInputToken = consumes<BXVector<EtSum>>(m_sumInputTag);
m_zdcEtSumInputToken = consumes<BXVector<EtSum>>(m_zdcEtSumInputTag);
m_muInputToken = consumes<BXVector<Muon>>(m_muInputTag);
if (m_useMuonShowers)
m_muShowerInputToken = consumes<BXVector<MuonShower>>(m_muShowerInputTag);
Expand Down Expand Up @@ -369,6 +373,7 @@ void L1TGlobalProducer::produce(edm::Event& iEvent, const edm::EventSetup& evSet
gtParser.vecMuonShowerTemplate(),
gtParser.vecCaloTemplate(),
gtParser.vecEnergySumTemplate(),
gtParser.vecZdcEnergySumTemplate(),
gtParser.vecExternalTemplate(),
gtParser.vecCorrelationTemplate(),
gtParser.vecCorrelationThreeBodyTemplate(),
Expand Down Expand Up @@ -513,6 +518,7 @@ void L1TGlobalProducer::produce(edm::Event& iEvent, const edm::EventSetup& evSet
bool receiveTau = true;
bool receiveJet = true;
bool receiveEtSums = true;
bool receiveZdcEtSums = true;
bool receiveExt = true;

/* *** Boards need redefining *****
Expand Down Expand Up @@ -602,13 +608,15 @@ void L1TGlobalProducer::produce(edm::Event& iEvent, const edm::EventSetup& evSet
m_tauInputToken,
m_jetInputToken,
m_sumInputToken,
m_zdcEtSumInputToken,
receiveEG,
m_nrL1EG,
receiveTau,
m_nrL1Tau,
receiveJet,
m_nrL1Jet,
receiveEtSums);
receiveEtSums,
receiveZdcEtSums);

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

Expand Down
6 changes: 4 additions & 2 deletions L1Trigger/L1TGlobal/plugins/L1TGlobalProducer.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,21 +115,23 @@ class L1TGlobalProducer : public edm::stream::EDProducer<> {

std::unique_ptr<l1t::GlobalBoard> m_uGtBrd;

/// input tag for muon collection from GMT
/// input tag for muon collection from the Global Muon Trigger (GMT)
edm::InputTag m_muInputTag;
edm::InputTag m_muShowerInputTag;
edm::EDGetTokenT<BXVector<l1t::Muon>> m_muInputToken;
edm::EDGetTokenT<BXVector<l1t::MuonShower>> m_muShowerInputToken;

/// input tag for calorimeter collections from GCT
/// input tag for calorimeter collections from Calo Layer 2 (GCT) or Zero Degree Calorimeter (ZDC)
edm::InputTag m_egInputTag;
edm::InputTag m_tauInputTag;
edm::InputTag m_jetInputTag;
edm::InputTag m_sumInputTag;
edm::InputTag m_zdcEtSumInputTag;
edm::EDGetTokenT<BXVector<l1t::EGamma>> m_egInputToken;
edm::EDGetTokenT<BXVector<l1t::Tau>> m_tauInputToken;
edm::EDGetTokenT<BXVector<l1t::Jet>> m_jetInputToken;
edm::EDGetTokenT<BXVector<l1t::EtSum>> m_sumInputToken;
edm::EDGetTokenT<BXVector<l1t::EtSum>> m_zdcEtSumInputToken;

/// input tag for external conditions
edm::InputTag m_extInputTag;
Expand Down
Loading