CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes | Static Private Attributes
L1MuGlobalMuonTrigger Class Reference

#include <L1MuGlobalMuonTrigger.h>

Inheritance diagram for L1MuGlobalMuonTrigger:
edm::one::EDProducer< edm::one::SharedResources > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

void beginJob () override
 
const L1MuGMTCancelOutUnitCancelOutUnit (int id) const
 return pointer to Cancel Out Unit More...
 
L1MuGMTReadoutRecordcurrentReadoutRecord () const
 return a reference to the current record in the ring buffer More...
 
const L1MuGMTPSBData () const
 return pointer to PSB More...
 
L1MuGMTDebugBlockDebugBlockForFill () const
 for debug: return the debug block (in order to fill it) More...
 
std::unique_ptr< L1MuGMTReadoutCollectiongetReadoutCollection ()
 
 L1MuGlobalMuonTrigger (const edm::ParameterSet &)
 
const L1MuGMTMatcherMatcher (int id) const
 return pointer to Matcher More...
 
const L1MuGMTMergerMerger (int id) const
 return pointer to Merger More...
 
const L1MuGMTMipIsoAUMipIsoAU (int id) const
 return pointer to MIP & ISO bit assignment unit More...
 
void produce (edm::Event &, const edm::EventSetup &) override
 
void reset ()
 
const L1MuGMTSorterSorter () const
 return pointer to Sorter More...
 
 ~L1MuGlobalMuonTrigger () override
 
- Public Member Functions inherited from edm::one::EDProducer< edm::one::SharedResources >
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
std::vector< bool > const & recordProvenanceList () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::array< std::vector< ModuleDescription const *> *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const *> const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Attributes

edm::ESGetToken< L1CaloGeometry, L1CaloGeometryRecordm_caloGeomToken
 
L1MuGMTCancelOutUnitm_CancelOutUnit [4]
 
std::vector< L1MuGMTExtendedCandm_ExtendedCands
 
edm::ESGetToken< L1MuGMTChannelMask, L1MuGMTChannelMaskRcdm_gmtChanMaskToken
 
edm::ESGetToken< L1MuGMTParameters, L1MuGMTParametersRcdm_gmtParamsToken
 
edm::ESGetToken< L1MuGMTScales, L1MuGMTScalesRcdm_gmtScalesToken
 
unsigned long long m_L1CaloGeometryCacheID
 
unsigned long long m_L1MuGMTChannelMaskCacheID
 
unsigned long long m_L1MuGMTParametersCacheID
 
unsigned long long m_L1MuGMTScalesCacheID
 
unsigned long long m_L1MuTriggerPtScaleCacheID
 
unsigned long long m_L1MuTriggerScalesCacheID
 
L1MuGMTMatcherm_Matcher [2]
 
L1MuGMTMergerm_Merger [2]
 
L1MuGMTMipIsoAUm_MipIsoAU [2]
 
L1MuGMTPSBm_PSB
 
std::vector< L1MuGMTReadoutRecord * > m_ReadoutRingbuffer
 
bool m_sendMipIso
 
L1MuGMTSorterm_Sorter
 
edm::ESGetToken< L1MuTriggerPtScale, L1MuTriggerPtScaleRcdm_trigPtScaleToken
 
edm::ESGetToken< L1MuTriggerScales, L1MuTriggerScalesRcdm_trigScalesToken
 
bool m_writeLUTsAndRegs
 

Static Private Attributes

static std::shared_ptr< L1MuGMTConfigm_config
 
static std::shared_ptr< L1MuGMTDebugBlockm_db
 

Additional Inherited Members

- Public Types inherited from edm::one::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex > >
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::ProducerBase
template<Transition Tr = Transition::Event>
auto produces (std::string instanceName) noexcept
 declare what type of product will make and with which optional label More...
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
template<Transition Tr = Transition::Event>
auto produces () noexcept
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
void resetItemsToGetFrom (BranchType iType)
 

Detailed Description

Definition at line 66 of file L1MuGlobalMuonTrigger.h.

Constructor & Destructor Documentation

◆ L1MuGlobalMuonTrigger()

L1MuGlobalMuonTrigger::L1MuGlobalMuonTrigger ( const edm::ParameterSet ps)
explicit

EventSetup Tokens

Definition at line 56 of file L1MuGlobalMuonTrigger.cc.

References edm::EDConsumerBase::consumesCollector(), L1MuGMTConfig::Debug(), relativeConstraints::empty, edm::ParameterSet::getUntrackedParameter(), m_caloGeomToken, m_CancelOutUnit, m_config, m_db, m_ExtendedCands, m_gmtChanMaskToken, m_gmtParamsToken, m_gmtScalesToken, m_L1CaloGeometryCacheID, m_L1MuGMTChannelMaskCacheID, m_L1MuGMTParametersCacheID, m_L1MuGMTScalesCacheID, m_L1MuTriggerPtScaleCacheID, m_L1MuTriggerScalesCacheID, m_Matcher, m_Merger, m_MipIsoAU, m_PSB, m_sendMipIso, m_Sorter, m_trigPtScaleToken, m_trigScalesToken, m_writeLUTsAndRegs, and groupFilesInBlocks::temp.

56  {
57  produces<std::vector<L1MuGMTCand> >();
58  produces<L1MuGMTReadoutCollection>();
59  m_sendMipIso = ps.getUntrackedParameter<bool>("SendMipIso", false);
60  if (m_sendMipIso) {
61  produces<std::vector<unsigned> >();
62  }
63 
70 
71  m_ExtendedCands.reserve(20);
72 
73  // set configuration parameters
74  if (not m_config) {
75  auto temp = std::make_shared<L1MuGMTConfig>(ps);
76  std::shared_ptr<L1MuGMTConfig> empty;
77  std::atomic_compare_exchange_strong(&m_config, &empty, temp);
78  }
79  m_writeLUTsAndRegs = ps.getUntrackedParameter<bool>("WriteLUTsAndRegs", false);
80 
81  // build GMT
82  if (L1MuGMTConfig::Debug(1))
83  edm::LogVerbatim("GMT_info");
84  if (L1MuGMTConfig::Debug(1))
85  edm::LogVerbatim("GMT_info") << "**** L1GlobalMuonTrigger building ****";
86  if (L1MuGMTConfig::Debug(1))
87  edm::LogVerbatim("GMT_info");
88 
89  // create new PSB
90  if (L1MuGMTConfig::Debug(2))
91  edm::LogVerbatim("GMT_info") << "creating GMT PSB";
92  m_PSB = new L1MuGMTPSB(*this, consumesCollector());
93 
94  // create new matcher
95  if (L1MuGMTConfig::Debug(2))
96  edm::LogVerbatim("GMT_info") << "creating GMT Matcher (0,1)";
97  m_Matcher[0] = new L1MuGMTMatcher(*this, 0); // barrel
98  m_Matcher[1] = new L1MuGMTMatcher(*this, 1); // endcap
99 
100  // create new cancel-out units
101  if (L1MuGMTConfig::Debug(2))
102  edm::LogVerbatim("GMT_info") << "creating GMT Cancel Out Unit (0,1,2,3)";
103  m_CancelOutUnit[0] = new L1MuGMTCancelOutUnit(*this, 0); // barrel
104  m_CancelOutUnit[1] = new L1MuGMTCancelOutUnit(*this, 1); // endcap
105  m_CancelOutUnit[2] = new L1MuGMTCancelOutUnit(*this, 2); // CSC/bRPC
106  m_CancelOutUnit[3] = new L1MuGMTCancelOutUnit(*this, 3); // DT/fRPC
107 
108  // create new MIP & ISO bit assignment units
109  if (L1MuGMTConfig::Debug(2))
110  edm::LogVerbatim("GMT_info") << "creating GMT MIP & ISO bit Assigment Unit (0,1)";
111  m_MipIsoAU[0] = new L1MuGMTMipIsoAU(*this, 0); // barrel
112  m_MipIsoAU[1] = new L1MuGMTMipIsoAU(*this, 1); // endcap
113 
114  // create new Merger
115  if (L1MuGMTConfig::Debug(2))
116  edm::LogVerbatim("GMT_info") << "creating GMT Merger (0,1)";
117  m_Merger[0] = new L1MuGMTMerger(*this, 0); // barrel
118  m_Merger[1] = new L1MuGMTMerger(*this, 1); // endcap
119 
120  // create new sorter
121  if (L1MuGMTConfig::Debug(2))
122  edm::LogVerbatim("GMT_info") << "creating GMT Sorter";
123  m_Sorter = new L1MuGMTSorter(*this); // barrel
124 
125  if (not m_db) {
126  auto temp = std::make_shared<L1MuGMTDebugBlock>(m_config->getBxMin(), m_config->getBxMax());
127  std::shared_ptr<L1MuGMTDebugBlock> empty;
128  std::atomic_compare_exchange_strong(&m_db, &empty, temp);
129  }
130  usesResource("L1MuGlobalMuonTrigger");
132  m_gmtScalesToken = esConsumes<L1MuGMTScales, L1MuGMTScalesRcd>();
133  m_trigScalesToken = esConsumes<L1MuTriggerScales, L1MuTriggerScalesRcd>();
134  m_trigPtScaleToken = esConsumes<L1MuTriggerPtScale, L1MuTriggerPtScaleRcd>();
135  m_gmtParamsToken = esConsumes<L1MuGMTParameters, L1MuGMTParametersRcd>();
136  m_gmtChanMaskToken = esConsumes<L1MuGMTChannelMask, L1MuGMTChannelMaskRcd>();
137  m_caloGeomToken = esConsumes<L1CaloGeometry, L1CaloGeometryRecord>();
138 }
Log< level::Info, true > LogVerbatim
static std::shared_ptr< L1MuGMTDebugBlock > m_db
edm::ESGetToken< L1MuTriggerPtScale, L1MuTriggerPtScaleRcd > m_trigPtScaleToken
unsigned long long m_L1MuTriggerScalesCacheID
unsigned long long m_L1MuGMTChannelMaskCacheID
edm::ESGetToken< L1MuGMTParameters, L1MuGMTParametersRcd > m_gmtParamsToken
std::vector< L1MuGMTExtendedCand > m_ExtendedCands
edm::ESGetToken< L1MuTriggerScales, L1MuTriggerScalesRcd > m_trigScalesToken
unsigned long long m_L1CaloGeometryCacheID
T getUntrackedParameter(std::string const &, T const &) const
unsigned long long m_L1MuTriggerPtScaleCacheID
static bool Debug()
L1MuGMTMipIsoAU * m_MipIsoAU[2]
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
edm::ESGetToken< L1MuGMTScales, L1MuGMTScalesRcd > m_gmtScalesToken
edm::ESGetToken< L1CaloGeometry, L1CaloGeometryRecord > m_caloGeomToken
L1MuGMTMatcher * m_Matcher[2]
L1MuGMTMerger * m_Merger[2]
unsigned long long m_L1MuGMTScalesCacheID
L1MuGMTCancelOutUnit * m_CancelOutUnit[4]
edm::ESGetToken< L1MuGMTChannelMask, L1MuGMTChannelMaskRcd > m_gmtChanMaskToken
unsigned long long m_L1MuGMTParametersCacheID
static std::shared_ptr< L1MuGMTConfig > m_config

◆ ~L1MuGlobalMuonTrigger()

L1MuGlobalMuonTrigger::~L1MuGlobalMuonTrigger ( )
override

Definition at line 143 of file L1MuGlobalMuonTrigger.cc.

References m_CancelOutUnit, m_Matcher, m_Merger, m_MipIsoAU, m_PSB, m_ReadoutRingbuffer, and m_Sorter.

143  {
144  delete m_Sorter;
145  delete m_Merger[1]; // endcap Merger
146  delete m_Merger[0]; // barrel Merger
147  delete m_MipIsoAU[1]; // barrel MIP & ISO bit assignment unit
148  delete m_MipIsoAU[0]; // barrel MIP & ISO bit assignment unit
149  delete m_CancelOutUnit[3]; // DT/fRPC cancel-out unit (in endcap chip)
150  delete m_CancelOutUnit[2]; // CSC/bRPC cancel-out unit (in barrel chip)
151  delete m_CancelOutUnit[1]; // endcap DT/CSC cancel out unit
152  delete m_CancelOutUnit[0]; // barrel DT/CSC cancel out unit
153  delete m_Matcher[1]; // endcap matcher
154  delete m_Matcher[0]; // barrel matcher
155  delete m_PSB;
156 
157  // copied from produce() by Jim B, 7 Aug 2007
158  std::vector<L1MuGMTReadoutRecord*>::iterator irr = m_ReadoutRingbuffer.begin();
159  for (; irr != m_ReadoutRingbuffer.end(); irr++)
160  delete (*irr);
161  m_ReadoutRingbuffer.clear();
162  // end Jim B edit
163 }
std::vector< L1MuGMTReadoutRecord * > m_ReadoutRingbuffer
L1MuGMTMipIsoAU * m_MipIsoAU[2]
L1MuGMTMatcher * m_Matcher[2]
L1MuGMTMerger * m_Merger[2]
L1MuGMTCancelOutUnit * m_CancelOutUnit[4]

Member Function Documentation

◆ beginJob()

void L1MuGlobalMuonTrigger::beginJob ( void  )
overridevirtual

Reimplemented from edm::one::EDProducerBase.

Definition at line 169 of file L1MuGlobalMuonTrigger.cc.

169 {}

◆ CancelOutUnit()

const L1MuGMTCancelOutUnit* L1MuGlobalMuonTrigger::CancelOutUnit ( int  id) const
inline

return pointer to Cancel Out Unit

Definition at line 83 of file L1MuGlobalMuonTrigger.h.

References triggerObjects_cff::id, and m_CancelOutUnit.

Referenced by L1MuGMTMerger::merge().

83 { return m_CancelOutUnit[id]; }
L1MuGMTCancelOutUnit * m_CancelOutUnit[4]

◆ currentReadoutRecord()

L1MuGMTReadoutRecord* L1MuGlobalMuonTrigger::currentReadoutRecord ( ) const
inline

return a reference to the current record in the ring buffer

Definition at line 100 of file L1MuGlobalMuonTrigger.h.

References m_ReadoutRingbuffer.

Referenced by L1MuGMTPSB::getCalo(), L1MuGMTPSB::receiveData(), and L1MuGMTSorter::run().

100 { return m_ReadoutRingbuffer.back(); };
std::vector< L1MuGMTReadoutRecord * > m_ReadoutRingbuffer

◆ Data()

const L1MuGMTPSB* L1MuGlobalMuonTrigger::Data ( ) const
inline

◆ DebugBlockForFill()

L1MuGMTDebugBlock* L1MuGlobalMuonTrigger::DebugBlockForFill ( ) const
inline

for debug: return the debug block (in order to fill it)

Definition at line 103 of file L1MuGlobalMuonTrigger.h.

Referenced by L1MuGMTMipIsoAU::assignISO(), L1MuGMTMipIsoAU::assignMIP(), L1MuGMTCancelOutUnit::decide(), L1MuGMTMatcher::match(), L1MuGMTSorter::run(), L1MuGMTEtaProjectionUnit::run(), and L1MuGMTPhiProjectionUnit::run().

103 { return m_db.get(); };
static std::shared_ptr< L1MuGMTDebugBlock > m_db

◆ getReadoutCollection()

std::unique_ptr< L1MuGMTReadoutCollection > L1MuGlobalMuonTrigger::getReadoutCollection ( )

get the GMT readout data for the triggered bx readout data contains input and output muons as well as MIP and Quiet bits for 3 or 5 bx around the triggered bx

Definition at line 430 of file L1MuGlobalMuonTrigger.cc.

References simKBmtfDigis_cfi::bx, L1MuGMTConfig::getBxMaxRo(), L1MuGMTConfig::getBxMinRo(), and m_ReadoutRingbuffer.

Referenced by produce().

430  {
431  int bx_min_ro = L1MuGMTConfig::getBxMinRo();
432  int bx_max_ro = L1MuGMTConfig::getBxMaxRo();
433  int bx_size = bx_max_ro - bx_min_ro + 1;
434 
435  std::unique_ptr<L1MuGMTReadoutCollection> rrc(new L1MuGMTReadoutCollection(bx_size));
436 
437  for (int bx = bx_min_ro; bx <= bx_max_ro; bx++) {
438  std::vector<L1MuGMTReadoutRecord*>::const_iterator iter = m_ReadoutRingbuffer.begin();
439 
440  for (; iter != m_ReadoutRingbuffer.end(); iter++) {
441  if ((*iter)->getBxInEvent() == bx) {
442  rrc->addRecord(**iter);
443  break;
444  }
445  }
446  }
447 
448  return rrc;
449 }
std::vector< L1MuGMTReadoutRecord * > m_ReadoutRingbuffer
static int getBxMaxRo()
static int getBxMinRo()

◆ Matcher()

const L1MuGMTMatcher* L1MuGlobalMuonTrigger::Matcher ( int  id) const
inline

return pointer to Matcher

Definition at line 80 of file L1MuGlobalMuonTrigger.h.

References triggerObjects_cff::id, and m_Matcher.

Referenced by L1MuGMTCancelOutUnit::decide(), and L1MuGMTMerger::merge().

◆ Merger()

const L1MuGMTMerger* L1MuGlobalMuonTrigger::Merger ( int  id) const
inline

return pointer to Merger

Definition at line 89 of file L1MuGlobalMuonTrigger.h.

References triggerObjects_cff::id, and m_Merger.

Referenced by L1MuGMTSorter::run().

◆ MipIsoAU()

const L1MuGMTMipIsoAU* L1MuGlobalMuonTrigger::MipIsoAU ( int  id) const
inline

return pointer to MIP & ISO bit assignment unit

Definition at line 86 of file L1MuGlobalMuonTrigger.h.

References triggerObjects_cff::id, and m_MipIsoAU.

Referenced by L1MuGMTMerger::createDTCSCCand(), L1MuGMTMerger::createMergedCand(), and L1MuGMTMerger::createRPCCand().

86 { return m_MipIsoAU[id]; }
L1MuGMTMipIsoAU * m_MipIsoAU[2]

◆ produce()

void L1MuGlobalMuonTrigger::produce ( edm::Event e,
const edm::EventSetup es 
)
overridevirtual

Implements edm::one::EDProducerBase.

Definition at line 171 of file L1MuGlobalMuonTrigger.cc.

References simKBmtfDigis_cfi::bx, L1MuGMTSorter::Cands(), L1MuGMTConfig::Debug(), TauDecayModes::dec, DeadROC_duringRun::dir, MillePedeFileConverter_cfg::e, L1MuGMTPSB::empty(), edm::EventSetup::get(), L1MuGMTConfig::getBxMax(), L1MuGMTConfig::getBxMin(), L1MuGMTConfig::getGMTChanMask(), edm::EventSetup::getHandle(), getReadoutCollection(), L1MuGMTChannelMask::getSubsystemMask(), mps_fire::i, m_caloGeomToken, m_CancelOutUnit, m_config, m_db, m_ExtendedCands, m_gmtChanMaskToken, m_gmtParamsToken, m_gmtScalesToken, m_L1CaloGeometryCacheID, m_L1MuGMTChannelMaskCacheID, m_L1MuGMTParametersCacheID, m_L1MuGMTScalesCacheID, m_L1MuTriggerPtScaleCacheID, m_L1MuTriggerScalesCacheID, m_Matcher, m_Merger, m_MipIsoAU, m_PSB, m_ReadoutRingbuffer, m_sendMipIso, m_Sorter, m_trigPtScaleToken, m_trigScalesToken, m_writeLUTsAndRegs, eostools::mkdir(), eostools::move(), L1MuGMTSorter::numberOfCands(), L1MuGMTSorter::print(), L1MuGMTMatcher::print(), L1MuGMTPSB::print(), L1MuGMTMipIsoAU::print(), L1MuGMTMerger::print(), L1MuGMTCancelOutUnit::print(), edm::ESHandle< T >::product(), L1MuGMTPSB::receiveData(), reset(), L1MuGMTSorter::run(), L1MuGMTMatcher::run(), L1MuGMTMipIsoAU::run(), L1MuGMTMerger::run(), L1MuGMTCancelOutUnit::run(), and AlCaHLTBitMon_QueryRunRegistry::string.

171  {
172  // configure from the event setup
173 
174  unsigned long long L1MuGMTScalesCacheID = es.get<L1MuGMTScalesRcd>().cacheIdentifier();
175  if (L1MuGMTScalesCacheID != m_L1MuGMTScalesCacheID) {
177  m_config->setGMTScales(gmtscales_h.product());
178  }
179 
180  unsigned long long L1MuTriggerScalesCacheID = es.get<L1MuTriggerScalesRcd>().cacheIdentifier();
181  if (L1MuTriggerScalesCacheID != m_L1MuTriggerScalesCacheID) {
183  m_config->setTriggerScales(trigscales_h.product());
184  }
185 
186  unsigned long long L1MuTriggerPtScaleCacheID = es.get<L1MuTriggerPtScaleRcd>().cacheIdentifier();
187  if (L1MuTriggerPtScaleCacheID != m_L1MuTriggerPtScaleCacheID) {
189  m_config->setTriggerPtScale(trigptscale_h.product());
190  }
191 
192  unsigned long long L1MuGMTParametersCacheID = es.get<L1MuGMTParametersRcd>().cacheIdentifier();
193  if (L1MuGMTParametersCacheID != m_L1MuGMTParametersCacheID) {
195  m_config->setGMTParams(gmtparams_h.product());
196  m_config->setDefaults();
197  }
198 
199  unsigned long long L1MuGMTChannelMaskCacheID = es.get<L1MuGMTChannelMaskRcd>().cacheIdentifier();
200  if (L1MuGMTChannelMaskCacheID != m_L1MuGMTChannelMaskCacheID) {
202  m_config->setGMTChanMask(gmtchanmask_h.product());
203  if (L1MuGMTConfig::Debug(1)) {
204  std::string onoff;
205  const L1MuGMTChannelMask* theChannelMask = L1MuGMTConfig::getGMTChanMask();
206  unsigned mask = theChannelMask->getSubsystemMask();
207 
208  edm::LogVerbatim("GMT_info");
209  edm::LogVerbatim("GMT_info") << " GMT input Channel Mask:" << std::hex << mask << std::dec;
210  onoff = mask & 1 ? "OFF" : "ON";
211  edm::LogVerbatim("GMT_info") << " DT input " << onoff;
212  onoff = mask & 2 ? "OFF" : "ON";
213  edm::LogVerbatim("GMT_info") << " RPCb input " << onoff;
214  onoff = mask & 4 ? "OFF" : "ON";
215  edm::LogVerbatim("GMT_info") << " CSC input " << onoff;
216  onoff = mask & 8 ? "OFF" : "ON";
217  edm::LogVerbatim("GMT_info") << " RPCf input " << onoff;
218  edm::LogVerbatim("GMT_info");
219  }
220  }
221 
222  unsigned long long L1CaloGeometryCacheID = es.get<L1CaloGeometryRecord>().cacheIdentifier();
223  if (L1CaloGeometryCacheID != m_L1CaloGeometryCacheID) {
225  m_config->setCaloGeom(caloGeom_h.product());
226  }
227 
228  m_config->createLUTsRegs();
229 
230  // write LUTs and Regs if required
231 
232  if (m_writeLUTsAndRegs) {
233  std::string dir = "gmtconfig";
234 
235  mkdir(dir.c_str(), S_ISUID | S_ISGID | S_ISVTX | S_IRUSR | S_IWUSR | S_IXUSR);
236 
237  m_config->dumpLUTs(dir);
238  m_config->dumpRegs(dir);
239  }
240 
241  // process the event
242  if (L1MuGMTConfig::Debug(2))
243  edm::LogVerbatim("GMT_info");
244  if (L1MuGMTConfig::Debug(2))
245  edm::LogVerbatim("GMT_info") << "**** L1GlobalMuonTrigger processing ****";
246  if (L1MuGMTConfig::Debug(2))
247  edm::LogVerbatim("GMT_info");
248 
249  int bx_min = L1MuGMTConfig::getBxMin();
250  int bx_max = L1MuGMTConfig::getBxMax();
251 
252  m_ExtendedCands.clear();
253 
254  // clear readout ring buffer
255  std::vector<L1MuGMTReadoutRecord*>::iterator irr = m_ReadoutRingbuffer.begin();
256  for (; irr != m_ReadoutRingbuffer.end(); irr++)
257  delete (*irr);
258  m_ReadoutRingbuffer.clear();
259 
260  if (m_db)
261  m_db->reset(); // reset debug block
262 
263  for (int bx = bx_min; bx <= bx_max; bx++) {
264  m_db->SetBX(bx);
265 
266  // create new element in readout ring buffer
268 
269  if (L1MuGMTConfig::Debug(2))
270  edm::LogVerbatim("GMT_info") << "L1GlobalMuonTrigger processing bunch-crossing : " << bx;
271 
272  // get data into the data buffer
273  if (L1MuGMTConfig::Debug(2))
274  edm::LogVerbatim("GMT_info") << "running GMT PSB";
275  if (m_PSB) {
276  m_PSB->receiveData(e, bx);
277  if (L1MuGMTConfig::Debug(4))
278  m_PSB->print();
279  }
280 
281  if (m_PSB && !m_PSB->empty()) {
282  // run matcher
283  if (L1MuGMTConfig::Debug(2))
284  edm::LogVerbatim("GMT_info") << "running GMT barrel Matcher";
285  if (m_Matcher[0])
286  m_Matcher[0]->run();
287  if (L1MuGMTConfig::Debug(3) && m_Matcher[0])
288  m_Matcher[0]->print();
289  if (L1MuGMTConfig::Debug(2))
290  edm::LogVerbatim("GMT_info") << "running GMT endcap Matcher";
291  if (m_Matcher[1])
292  m_Matcher[1]->run();
293  if (L1MuGMTConfig::Debug(3) && m_Matcher[1])
294  m_Matcher[1]->print();
295 
296  // run cancel-out units
297  if (L1MuGMTConfig::Debug(2))
298  edm::LogVerbatim("GMT_info") << "running GMT barrel Cancel Out Unit";
299  if (m_CancelOutUnit[0])
300  m_CancelOutUnit[0]->run();
302  m_CancelOutUnit[0]->print();
303 
304  if (L1MuGMTConfig::Debug(2))
305  edm::LogVerbatim("GMT_info") << "running GMT endcap Cancel Out Unit";
306  if (m_CancelOutUnit[1])
307  m_CancelOutUnit[1]->run();
309  m_CancelOutUnit[1]->print();
310 
311  if (L1MuGMTConfig::Debug(2))
312  edm::LogVerbatim("GMT_info") << "running GMT CSC/fRPC Cancel Out Unit";
313  if (m_CancelOutUnit[2])
314  m_CancelOutUnit[2]->run();
316  m_CancelOutUnit[2]->print();
317 
318  if (L1MuGMTConfig::Debug(2))
319  edm::LogVerbatim("GMT_info") << "running GMT DT/bRPC Cancel Out Unit";
320  if (m_CancelOutUnit[3])
321  m_CancelOutUnit[3]->run();
323  m_CancelOutUnit[3]->print();
324 
325  // run MIP & ISO bit assignment units
326  if (L1MuGMTConfig::Debug(2))
327  edm::LogVerbatim("GMT_info") << "running GMT barrel MIP & ISO bit Assignment Unit";
328  if (m_MipIsoAU[0])
329  m_MipIsoAU[0]->run();
330  if (L1MuGMTConfig::Debug(3) && m_MipIsoAU[0])
331  m_MipIsoAU[0]->print();
332  if (L1MuGMTConfig::Debug(2))
333  edm::LogVerbatim("GMT_info") << "running GMT endcap MIP & ISO bit Assignment Unit";
334  if (m_MipIsoAU[1])
335  m_MipIsoAU[1]->run();
336  if (L1MuGMTConfig::Debug(3) && m_MipIsoAU[1])
337  m_MipIsoAU[1]->print();
338 
339  // run Merger
340  if (L1MuGMTConfig::Debug(2))
341  edm::LogVerbatim("GMT_info") << "running GMT barrel Merger";
342  if (m_Merger[0])
343  m_Merger[0]->run();
344  if (L1MuGMTConfig::Debug(3) && m_Merger[0])
345  m_Merger[0]->print();
346  if (L1MuGMTConfig::Debug(2))
347  edm::LogVerbatim("GMT_info") << "running GMT endcap Merger";
348  if (m_Merger[1])
349  m_Merger[1]->run();
350  if (L1MuGMTConfig::Debug(3) && m_Merger[1])
351  m_Merger[1]->print();
352 
353  // run sorter
354  if (L1MuGMTConfig::Debug(2))
355  edm::LogVerbatim("GMT_info") << "running GMT Sorter";
356  if (m_Sorter)
357  m_Sorter->run();
358  if (L1MuGMTConfig::Debug(1) && m_Sorter)
359  m_Sorter->print();
360 
361  // store found track candidates in a container
362  if (m_Sorter->numberOfCands() > 0) {
363  const std::vector<const L1MuGMTExtendedCand*>& gmt_cont = m_Sorter->Cands();
364  std::vector<const L1MuGMTExtendedCand*>::const_iterator iexc;
365  for (iexc = gmt_cont.begin(); iexc != gmt_cont.end(); iexc++) {
366  if (*iexc)
367  m_ExtendedCands.push_back(**iexc);
368  }
369  }
370 
371  // reset GMT
372  reset();
373  }
374  }
375 
376  // produce the output
377  std::unique_ptr<std::vector<L1MuGMTCand> > GMTCands(new std::vector<L1MuGMTCand>);
378  std::vector<L1MuGMTExtendedCand>::const_iterator iexc;
379  for (iexc = m_ExtendedCands.begin(); iexc != m_ExtendedCands.end(); iexc++) {
380  GMTCands->push_back(*iexc);
381  }
382  e.put(std::move(GMTCands));
383 
384  std::unique_ptr<L1MuGMTReadoutCollection> GMTRRC(getReadoutCollection());
385  e.put(std::move(GMTRRC));
386 
387  if (m_sendMipIso) {
388  std::unique_ptr<std::vector<unsigned> > mipiso(new std::vector<unsigned>);
389  for (int i = 0; i < 32; i++) {
390  mipiso->push_back(m_db->IsMIPISO(0, i));
391  }
392  e.put(std::move(mipiso));
393  }
394 
395  // delete registers and LUTs
396  m_config->clearLUTsRegs();
397 }
Log< level::Info, true > LogVerbatim
static std::shared_ptr< L1MuGMTDebugBlock > m_db
int numberOfCands() const
return number of found muon candidates after sorter
Definition: L1MuGMTSorter.h:57
edm::ESGetToken< L1MuTriggerPtScale, L1MuTriggerPtScaleRcd > m_trigPtScaleToken
unsigned long long m_L1MuTriggerScalesCacheID
std::vector< L1MuGMTReadoutRecord * > m_ReadoutRingbuffer
unsigned long long m_L1MuGMTChannelMaskCacheID
edm::ESGetToken< L1MuGMTParameters, L1MuGMTParametersRcd > m_gmtParamsToken
std::vector< L1MuGMTExtendedCand > m_ExtendedCands
edm::ESGetToken< L1MuTriggerScales, L1MuTriggerScalesRcd > m_trigScalesToken
void print()
print cancel-out bits
void print() const
print results after MIP & ISO bit assignment
void print() const
print PSB
Definition: L1MuGMTPSB.cc:212
void run()
run Matcher
void print()
print matching results
unsigned long long m_L1CaloGeometryCacheID
virtual void run()
run Sorter
void run()
run GMT MIP & ISO bit assignment unit
unsigned long long m_L1MuTriggerPtScaleCacheID
T const * product() const
Definition: ESHandle.h:86
static bool Debug()
void print() const
print results after selection
L1MuGMTMipIsoAU * m_MipIsoAU[2]
unsigned getSubsystemMask() const
edm::ESGetToken< L1MuGMTScales, L1MuGMTScalesRcd > m_gmtScalesToken
edm::ESGetToken< L1CaloGeometry, L1CaloGeometryRecord > m_caloGeomToken
static const L1MuGMTChannelMask * getGMTChanMask()
T get() const
Definition: EventSetup.h:82
std::unique_ptr< L1MuGMTReadoutCollection > getReadoutCollection()
L1MuGMTMatcher * m_Matcher[2]
L1MuGMTMerger * m_Merger[2]
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:151
unsigned long long m_L1MuGMTScalesCacheID
static int getBxMin()
const std::vector< const L1MuGMTExtendedCand * > & Cands() const
return std::vector with all muon candidates
Definition: L1MuGMTSorter.h:60
void print()
print results after sorting
L1MuGMTCancelOutUnit * m_CancelOutUnit[4]
void run()
run GMT Merger
bool empty() const
are there any data in the PSB
Definition: L1MuGMTPSB.cc:287
def mkdir(path)
Definition: eostools.py:251
void receiveData(edm::Event &e, int bx)
receive muon candidates
Definition: L1MuGMTPSB.cc:86
edm::ESGetToken< L1MuGMTChannelMask, L1MuGMTChannelMaskRcd > m_gmtChanMaskToken
unsigned long long m_L1MuGMTParametersCacheID
static std::shared_ptr< L1MuGMTConfig > m_config
static int getBxMax()
void run()
run cancel-out unit
def move(src, dest)
Definition: eostools.py:511

◆ reset()

void L1MuGlobalMuonTrigger::reset ( void  )

Definition at line 402 of file L1MuGlobalMuonTrigger.cc.

References m_CancelOutUnit, m_Matcher, m_Merger, m_MipIsoAU, m_PSB, m_Sorter, L1MuGMTSorter::reset(), L1MuGMTMatcher::reset(), L1MuGMTPSB::reset(), L1MuGMTMipIsoAU::reset(), L1MuGMTMerger::reset(), and L1MuGMTCancelOutUnit::reset().

Referenced by produce().

402  {
403  if (m_PSB)
404  m_PSB->reset();
405  if (m_Matcher[0])
406  m_Matcher[0]->reset();
407  if (m_Matcher[1])
408  m_Matcher[1]->reset();
409  if (m_CancelOutUnit[0])
410  m_CancelOutUnit[0]->reset();
411  if (m_CancelOutUnit[1])
412  m_CancelOutUnit[1]->reset();
413  if (m_CancelOutUnit[2])
414  m_CancelOutUnit[2]->reset();
415  if (m_CancelOutUnit[3])
416  m_CancelOutUnit[3]->reset();
417  if (m_MipIsoAU[0])
418  m_MipIsoAU[0]->reset();
419  if (m_MipIsoAU[1])
420  m_MipIsoAU[1]->reset();
421  if (m_Merger[0])
422  m_Merger[0]->reset();
423  if (m_Merger[1])
424  m_Merger[1]->reset();
425  if (m_Sorter)
426  m_Sorter->reset();
427 }
void reset()
clear cancel-out unit
virtual void reset()
reset Sorter
void reset()
clear MIP & ISO bit assignment unit
void reset()
clear PSB
Definition: L1MuGMTPSB.cc:191
L1MuGMTMipIsoAU * m_MipIsoAU[2]
L1MuGMTMatcher * m_Matcher[2]
L1MuGMTMerger * m_Merger[2]
void reset()
clear Merger
L1MuGMTCancelOutUnit * m_CancelOutUnit[4]
void reset()
clear Matcher

◆ Sorter()

const L1MuGMTSorter* L1MuGlobalMuonTrigger::Sorter ( ) const
inline

return pointer to Sorter

Definition at line 92 of file L1MuGlobalMuonTrigger.h.

References m_Sorter.

92 { return m_Sorter; }

Member Data Documentation

◆ m_caloGeomToken

edm::ESGetToken<L1CaloGeometry, L1CaloGeometryRecord> L1MuGlobalMuonTrigger::m_caloGeomToken
private

Definition at line 135 of file L1MuGlobalMuonTrigger.h.

Referenced by L1MuGlobalMuonTrigger(), and produce().

◆ m_CancelOutUnit

L1MuGMTCancelOutUnit* L1MuGlobalMuonTrigger::m_CancelOutUnit[4]
private

◆ m_config

std::shared_ptr< L1MuGMTConfig > L1MuGlobalMuonTrigger::m_config
staticprivate

Definition at line 119 of file L1MuGlobalMuonTrigger.h.

Referenced by L1MuGlobalMuonTrigger(), and produce().

◆ m_db

std::shared_ptr< L1MuGMTDebugBlock > L1MuGlobalMuonTrigger::m_db
staticprivate

Definition at line 121 of file L1MuGlobalMuonTrigger.h.

Referenced by L1MuGlobalMuonTrigger(), and produce().

◆ m_ExtendedCands

std::vector<L1MuGMTExtendedCand> L1MuGlobalMuonTrigger::m_ExtendedCands
private

Definition at line 113 of file L1MuGlobalMuonTrigger.h.

Referenced by L1MuGlobalMuonTrigger(), and produce().

◆ m_gmtChanMaskToken

edm::ESGetToken<L1MuGMTChannelMask, L1MuGMTChannelMaskRcd> L1MuGlobalMuonTrigger::m_gmtChanMaskToken
private

Definition at line 134 of file L1MuGlobalMuonTrigger.h.

Referenced by L1MuGlobalMuonTrigger(), and produce().

◆ m_gmtParamsToken

edm::ESGetToken<L1MuGMTParameters, L1MuGMTParametersRcd> L1MuGlobalMuonTrigger::m_gmtParamsToken
private

Definition at line 133 of file L1MuGlobalMuonTrigger.h.

Referenced by L1MuGlobalMuonTrigger(), and produce().

◆ m_gmtScalesToken

edm::ESGetToken<L1MuGMTScales, L1MuGMTScalesRcd> L1MuGlobalMuonTrigger::m_gmtScalesToken
private

Definition at line 130 of file L1MuGlobalMuonTrigger.h.

Referenced by L1MuGlobalMuonTrigger(), and produce().

◆ m_L1CaloGeometryCacheID

unsigned long long L1MuGlobalMuonTrigger::m_L1CaloGeometryCacheID
private

Definition at line 128 of file L1MuGlobalMuonTrigger.h.

Referenced by L1MuGlobalMuonTrigger(), and produce().

◆ m_L1MuGMTChannelMaskCacheID

unsigned long long L1MuGlobalMuonTrigger::m_L1MuGMTChannelMaskCacheID
private

Definition at line 127 of file L1MuGlobalMuonTrigger.h.

Referenced by L1MuGlobalMuonTrigger(), and produce().

◆ m_L1MuGMTParametersCacheID

unsigned long long L1MuGlobalMuonTrigger::m_L1MuGMTParametersCacheID
private

Definition at line 126 of file L1MuGlobalMuonTrigger.h.

Referenced by L1MuGlobalMuonTrigger(), and produce().

◆ m_L1MuGMTScalesCacheID

unsigned long long L1MuGlobalMuonTrigger::m_L1MuGMTScalesCacheID
private

Definition at line 123 of file L1MuGlobalMuonTrigger.h.

Referenced by L1MuGlobalMuonTrigger(), and produce().

◆ m_L1MuTriggerPtScaleCacheID

unsigned long long L1MuGlobalMuonTrigger::m_L1MuTriggerPtScaleCacheID
private

Definition at line 125 of file L1MuGlobalMuonTrigger.h.

Referenced by L1MuGlobalMuonTrigger(), and produce().

◆ m_L1MuTriggerScalesCacheID

unsigned long long L1MuGlobalMuonTrigger::m_L1MuTriggerScalesCacheID
private

Definition at line 124 of file L1MuGlobalMuonTrigger.h.

Referenced by L1MuGlobalMuonTrigger(), and produce().

◆ m_Matcher

L1MuGMTMatcher* L1MuGlobalMuonTrigger::m_Matcher[2]
private

◆ m_Merger

L1MuGMTMerger* L1MuGlobalMuonTrigger::m_Merger[2]
private

◆ m_MipIsoAU

L1MuGMTMipIsoAU* L1MuGlobalMuonTrigger::m_MipIsoAU[2]
private

◆ m_PSB

L1MuGMTPSB* L1MuGlobalMuonTrigger::m_PSB
private

◆ m_ReadoutRingbuffer

std::vector<L1MuGMTReadoutRecord*> L1MuGlobalMuonTrigger::m_ReadoutRingbuffer
private

◆ m_sendMipIso

bool L1MuGlobalMuonTrigger::m_sendMipIso
private

Definition at line 117 of file L1MuGlobalMuonTrigger.h.

Referenced by L1MuGlobalMuonTrigger(), and produce().

◆ m_Sorter

L1MuGMTSorter* L1MuGlobalMuonTrigger::m_Sorter
private

◆ m_trigPtScaleToken

edm::ESGetToken<L1MuTriggerPtScale, L1MuTriggerPtScaleRcd> L1MuGlobalMuonTrigger::m_trigPtScaleToken
private

Definition at line 132 of file L1MuGlobalMuonTrigger.h.

Referenced by L1MuGlobalMuonTrigger(), and produce().

◆ m_trigScalesToken

edm::ESGetToken<L1MuTriggerScales, L1MuTriggerScalesRcd> L1MuGlobalMuonTrigger::m_trigScalesToken
private

Definition at line 131 of file L1MuGlobalMuonTrigger.h.

Referenced by L1MuGlobalMuonTrigger(), and produce().

◆ m_writeLUTsAndRegs

bool L1MuGlobalMuonTrigger::m_writeLUTsAndRegs
private

Definition at line 116 of file L1MuGlobalMuonTrigger.h.

Referenced by L1MuGlobalMuonTrigger(), and produce().