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
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () const final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () 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
 
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)
 
 ~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
 
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::vector< ModuleDescription const * > &modules, 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
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Attributes

L1MuGMTCancelOutUnitm_CancelOutUnit [4]
 
std::vector< L1MuGMTExtendedCandm_ExtendedCands
 
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
 
bool m_writeLUTsAndRegs
 

Static Private Attributes

static L1MuGMTConfigm_config = 0
 
static L1MuGMTDebugBlockm_db = 0
 

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::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
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 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)
 

Detailed Description

Definition at line 50 of file L1MuGlobalMuonTrigger.h.

Constructor & Destructor Documentation

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

Definition at line 69 of file L1MuGlobalMuonTrigger.cc.

References edm::EDConsumerBase::consumesCollector(), L1MuGMTConfig::Debug(), L1MuGMTConfig::getBxMax(), L1MuGMTConfig::getBxMin(), edm::ParameterSet::getUntrackedParameter(), m_CancelOutUnit, m_config, m_db, m_ExtendedCands, m_L1CaloGeometryCacheID, m_L1MuGMTChannelMaskCacheID, m_L1MuGMTParametersCacheID, m_L1MuGMTScalesCacheID, m_L1MuTriggerPtScaleCacheID, m_L1MuTriggerScalesCacheID, m_Matcher, m_Merger, m_MipIsoAU, m_PSB, m_sendMipIso, m_Sorter, and m_writeLUTsAndRegs.

69  {
70  produces<std::vector<L1MuGMTCand> >();
71  produces<L1MuGMTReadoutCollection>();
72  m_sendMipIso = ps.getUntrackedParameter<bool>("SendMipIso",false);
73  if( m_sendMipIso ) {
74  produces<std::vector<unsigned> >();
75  }
76 
83 
84  m_ExtendedCands.reserve(20);
85 
86  // set configuration parameters
87  if(!m_config) m_config = new L1MuGMTConfig(ps);
88  m_writeLUTsAndRegs = ps.getUntrackedParameter<bool>("WriteLUTsAndRegs",false);
89 
90  // build GMT
91  if ( L1MuGMTConfig::Debug(1) ) edm::LogVerbatim("GMT_info");
92  if ( L1MuGMTConfig::Debug(1) ) edm::LogVerbatim("GMT_info") << "**** L1GlobalMuonTrigger building ****";
93  if ( L1MuGMTConfig::Debug(1) ) edm::LogVerbatim("GMT_info");
94 
95  // create new PSB
96  if ( L1MuGMTConfig::Debug(2) ) edm::LogVerbatim("GMT_info") << "creating GMT PSB";
97  m_PSB = new L1MuGMTPSB(*this,consumesCollector());
98 
99  // create new matcher
100  if ( L1MuGMTConfig::Debug(2) ) edm::LogVerbatim("GMT_info") << "creating GMT Matcher (0,1)";
101  m_Matcher[0] = new L1MuGMTMatcher(*this,0); // barrel
102  m_Matcher[1] = new L1MuGMTMatcher(*this,1); // endcap
103 
104  // create new cancel-out units
105  if ( L1MuGMTConfig::Debug(2) ) edm::LogVerbatim("GMT_info") << "creating GMT Cancel Out Unit (0,1,2,3)";
106  m_CancelOutUnit[0] = new L1MuGMTCancelOutUnit(*this,0); // barrel
107  m_CancelOutUnit[1] = new L1MuGMTCancelOutUnit(*this,1); // endcap
108  m_CancelOutUnit[2] = new L1MuGMTCancelOutUnit(*this,2); // CSC/bRPC
109  m_CancelOutUnit[3] = new L1MuGMTCancelOutUnit(*this,3); // DT/fRPC
110 
111  // create new MIP & ISO bit assignment units
112  if ( L1MuGMTConfig::Debug(2) ) edm::LogVerbatim("GMT_info") << "creating GMT MIP & ISO bit Assigment Unit (0,1)";
113  m_MipIsoAU[0] = new L1MuGMTMipIsoAU(*this,0); // barrel
114  m_MipIsoAU[1] = new L1MuGMTMipIsoAU(*this,1); // endcap
115 
116  // create new Merger
117  if ( L1MuGMTConfig::Debug(2) ) edm::LogVerbatim("GMT_info") << "creating GMT Merger (0,1)";
118  m_Merger[0] = new L1MuGMTMerger(*this,0); // barrel
119  m_Merger[1] = new L1MuGMTMerger(*this,1); // endcap
120 
121  // create new sorter
122  if ( L1MuGMTConfig::Debug(2) ) edm::LogVerbatim("GMT_info") << "creating GMT Sorter";
123  m_Sorter = new L1MuGMTSorter(*this); // barrel
124 
126  usesResource("L1MuGlobalMuonTrigger");
127 }
T getUntrackedParameter(std::string const &, T const &) const
unsigned long long m_L1MuTriggerScalesCacheID
unsigned long long m_L1MuGMTChannelMaskCacheID
std::vector< L1MuGMTExtendedCand > m_ExtendedCands
unsigned long long m_L1CaloGeometryCacheID
unsigned long long m_L1MuTriggerPtScaleCacheID
static bool Debug()
L1MuGMTMipIsoAU * m_MipIsoAU[2]
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
L1MuGMTMatcher * m_Matcher[2]
L1MuGMTMerger * m_Merger[2]
unsigned long long m_L1MuGMTScalesCacheID
static int getBxMin()
L1MuGMTCancelOutUnit * m_CancelOutUnit[4]
static L1MuGMTConfig * m_config
unsigned long long m_L1MuGMTParametersCacheID
static int getBxMax()
static L1MuGMTDebugBlock * m_db
L1MuGlobalMuonTrigger::~L1MuGlobalMuonTrigger ( )
override

Definition at line 132 of file L1MuGlobalMuonTrigger.cc.

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

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

Member Function Documentation

void L1MuGlobalMuonTrigger::beginJob ( void  )
overridevirtual

Reimplemented from edm::one::EDProducerBase.

Definition at line 165 of file L1MuGlobalMuonTrigger.cc.

165  {
166 
167 }
const L1MuGMTCancelOutUnit* L1MuGlobalMuonTrigger::CancelOutUnit ( int  id) const
inline

return pointer to Cancel Out Unit

Definition at line 69 of file L1MuGlobalMuonTrigger.h.

References triggerObjects_cff::id, and m_CancelOutUnit.

Referenced by L1MuGMTMerger::merge().

69 { return m_CancelOutUnit[id]; }
L1MuGMTCancelOutUnit * m_CancelOutUnit[4]
L1MuGMTReadoutRecord* L1MuGlobalMuonTrigger::currentReadoutRecord ( ) const
inline

return a reference to the current record in the ring buffer

Definition at line 87 of file L1MuGlobalMuonTrigger.h.

References m_ReadoutRingbuffer.

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

87 { return m_ReadoutRingbuffer.back(); };
std::vector< L1MuGMTReadoutRecord * > m_ReadoutRingbuffer
const L1MuGMTPSB* L1MuGlobalMuonTrigger::Data ( ) const
inline

return pointer to PSB

Definition at line 63 of file L1MuGlobalMuonTrigger.h.

References m_PSB.

Referenced by L1MuGMTMipIsoAU::assignISO(), L1MuGMTMipIsoAU::assignMIP(), L1MuGMTMatcher::load(), L1MuGMTMipIsoAU::load(), and L1MuGMTMerger::load().

63 { return m_PSB; }
L1MuGMTDebugBlock* L1MuGlobalMuonTrigger::DebugBlockForFill ( ) const
inline
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 385 of file L1MuGlobalMuonTrigger.cc.

References L1MuGMTConfig::getBxMaxRo(), L1MuGMTConfig::getBxMinRo(), m_config, m_db, and m_ReadoutRingbuffer.

Referenced by produce(), and Sorter().

385  {
386 
387  int bx_min_ro = L1MuGMTConfig::getBxMinRo();
388  int bx_max_ro = L1MuGMTConfig::getBxMaxRo();
389  int bx_size = bx_max_ro - bx_min_ro + 1;
390 
391  std::unique_ptr<L1MuGMTReadoutCollection> rrc(new L1MuGMTReadoutCollection(bx_size));
392 
393  for (int bx = bx_min_ro; bx <= bx_max_ro; bx++) {
394  std::vector<L1MuGMTReadoutRecord*>::const_iterator iter = m_ReadoutRingbuffer.begin();
395 
396  for ( ;iter!=m_ReadoutRingbuffer.end(); iter++) {
397 
398  if ( (*iter)->getBxInEvent() == bx ) {
399  rrc->addRecord(**iter);
400  break;
401  }
402  }
403 
404  }
405 
406  return rrc;
407 }
std::vector< L1MuGMTReadoutRecord * > m_ReadoutRingbuffer
static int getBxMaxRo()
static int getBxMinRo()
const L1MuGMTMatcher* L1MuGlobalMuonTrigger::Matcher ( int  id) const
inline

return pointer to Matcher

Definition at line 66 of file L1MuGlobalMuonTrigger.h.

References triggerObjects_cff::id, and m_Matcher.

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

66 { return m_Matcher[id]; }
L1MuGMTMatcher * m_Matcher[2]
const L1MuGMTMerger* L1MuGlobalMuonTrigger::Merger ( int  id) const
inline

return pointer to Merger

Definition at line 75 of file L1MuGlobalMuonTrigger.h.

References triggerObjects_cff::id, and m_Merger.

Referenced by L1MuGMTSorter::run().

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

return pointer to MIP & ISO bit assignment unit

Definition at line 72 of file L1MuGlobalMuonTrigger.h.

References triggerObjects_cff::id, and m_MipIsoAU.

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

72 { return m_MipIsoAU[id]; }
L1MuGMTMipIsoAU * m_MipIsoAU[2]
void L1MuGlobalMuonTrigger::produce ( edm::Event e,
const edm::EventSetup es 
)
override

Definition at line 169 of file L1MuGlobalMuonTrigger.cc.

References L1MuGMTSorter::Cands(), L1MuGMTConfig::clearLUTsRegs(), L1MuGMTConfig::createLUTsRegs(), L1MuGMTConfig::Debug(), TauDecayModes::dec, dir, L1MuGMTConfig::dumpLUTs(), L1MuGMTConfig::dumpRegs(), L1MuGMTPSB::empty(), edm::EventSetup::get(), L1MuGMTConfig::getBxMax(), L1MuGMTConfig::getBxMin(), L1MuGMTConfig::getGMTChanMask(), getReadoutCollection(), L1MuGMTChannelMask::getSubsystemMask(), mps_fire::i, L1MuGMTDebugBlock::IsMIPISO(), m_CancelOutUnit, m_config, m_db, m_ExtendedCands, 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_writeLUTsAndRegs, RecoTauDiscriminantConfiguration::mask, eostools::mkdir(), eostools::move(), L1MuGMTSorter::numberOfCands(), L1MuGMTSorter::print(), L1MuGMTMatcher::print(), L1MuGMTPSB::print(), L1MuGMTMipIsoAU::print(), L1MuGMTMerger::print(), L1MuGMTCancelOutUnit::print(), edm::ESHandle< T >::product(), edm::Event::put(), L1MuGMTPSB::receiveData(), L1MuGMTDebugBlock::reset(), reset(), L1MuGMTSorter::run(), L1MuGMTMatcher::run(), L1MuGMTMipIsoAU::run(), L1MuGMTMerger::run(), L1MuGMTCancelOutUnit::run(), L1MuGMTDebugBlock::SetBX(), L1MuGMTConfig::setCaloGeom(), L1MuGMTConfig::setDefaults(), L1MuGMTConfig::setGMTChanMask(), L1MuGMTConfig::setGMTParams(), L1MuGMTConfig::setGMTScales(), L1MuGMTConfig::setTriggerPtScale(), L1MuGMTConfig::setTriggerScales(), and AlCaHLTBitMon_QueryRunRegistry::string.

169  {
170 
171  // configure from the event setup
172 
173  unsigned long long L1MuGMTScalesCacheID = es.get< L1MuGMTScalesRcd >().cacheIdentifier();
174  if(L1MuGMTScalesCacheID != m_L1MuGMTScalesCacheID) {
175  edm::ESHandle< L1MuGMTScales > gmtscales_h;
176  es.get< L1MuGMTScalesRcd >().get( gmtscales_h );
177  m_config->setGMTScales( gmtscales_h.product() );
178  }
179 
180  unsigned long long L1MuTriggerScalesCacheID = es.get< L1MuTriggerScalesRcd >().cacheIdentifier();
181  if(L1MuTriggerScalesCacheID != m_L1MuTriggerScalesCacheID) {
183  es.get< L1MuTriggerScalesRcd >().get( trigscales_h );
184  m_config->setTriggerScales( trigscales_h.product() );
185  }
186 
187  unsigned long long L1MuTriggerPtScaleCacheID = es.get< L1MuTriggerPtScaleRcd >().cacheIdentifier();
188  if(L1MuTriggerPtScaleCacheID != m_L1MuTriggerPtScaleCacheID) {
190  es.get< L1MuTriggerPtScaleRcd >().get( trigptscale_h );
191  m_config->setTriggerPtScale( trigptscale_h.product() );
192  }
193 
194  unsigned long long L1MuGMTParametersCacheID = es.get< L1MuGMTParametersRcd >().cacheIdentifier();
195  if(L1MuGMTParametersCacheID != m_L1MuGMTParametersCacheID) {
197  es.get< L1MuGMTParametersRcd >().get( gmtparams_h );
198  m_config->setGMTParams( gmtparams_h.product() );
200  }
201 
202  unsigned long long L1MuGMTChannelMaskCacheID = es.get< L1MuGMTChannelMaskRcd >().cacheIdentifier();
203  if(L1MuGMTChannelMaskCacheID != m_L1MuGMTChannelMaskCacheID) {
205  es.get< L1MuGMTChannelMaskRcd >().get( gmtchanmask_h );
206  m_config->setGMTChanMask( gmtchanmask_h.product() );
207  if ( L1MuGMTConfig::Debug(1) ) {
208  std::string onoff;
209  const L1MuGMTChannelMask* theChannelMask = L1MuGMTConfig::getGMTChanMask();
210  unsigned mask = theChannelMask->getSubsystemMask();
211 
212  edm::LogVerbatim("GMT_info");
213  edm::LogVerbatim("GMT_info") << " GMT input Channel Mask:" << std::hex << mask << std::dec;
214  onoff = mask&1 ? "OFF" : "ON";
215  edm::LogVerbatim("GMT_info") << " DT input " << onoff;
216  onoff = mask&2 ? "OFF" : "ON";
217  edm::LogVerbatim("GMT_info") << " RPCb input " << onoff;
218  onoff = mask&4 ? "OFF" : "ON";
219  edm::LogVerbatim("GMT_info") << " CSC input " << onoff;
220  onoff = mask&8 ? "OFF" : "ON";
221  edm::LogVerbatim("GMT_info") << " RPCf input " << onoff;
222  edm::LogVerbatim("GMT_info");
223  }
224  }
225 
226  unsigned long long L1CaloGeometryCacheID = es.get< L1CaloGeometryRecord >().cacheIdentifier();
227  if(L1CaloGeometryCacheID != m_L1CaloGeometryCacheID) {
229  es.get< L1CaloGeometryRecord >().get( caloGeom_h ) ;
230  m_config->setCaloGeom( caloGeom_h.product() ) ;
231  }
232 
234 
235  // write LUTs and Regs if required
236 
237  if(m_writeLUTsAndRegs) {
238  std::string dir = "gmtconfig";
239 
240  mkdir(dir.c_str(), S_ISUID|S_ISGID|S_ISVTX|S_IRUSR|S_IWUSR|S_IXUSR);
241 
242  m_config->dumpLUTs(dir);
243  m_config->dumpRegs(dir);
244  }
245 
246  // process the event
247  if ( L1MuGMTConfig::Debug(2) ) edm::LogVerbatim("GMT_info");
248  if ( L1MuGMTConfig::Debug(2) ) edm::LogVerbatim("GMT_info") << "**** L1GlobalMuonTrigger processing ****";
249  if ( L1MuGMTConfig::Debug(2) ) edm::LogVerbatim("GMT_info");
250 
251  int bx_min = L1MuGMTConfig::getBxMin();
252  int bx_max = L1MuGMTConfig::getBxMax();
253 
254  m_ExtendedCands.clear();
255 
256  // clear readout ring buffer
257  std::vector<L1MuGMTReadoutRecord*>::iterator irr = m_ReadoutRingbuffer.begin();
258  for ( ;irr!=m_ReadoutRingbuffer.end(); irr++) delete (*irr);
259  m_ReadoutRingbuffer.clear();
260 
261  if(m_db) 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
267  m_ReadoutRingbuffer.push_back( new L1MuGMTReadoutRecord(bx) );
268 
269  if ( L1MuGMTConfig::Debug(2) ) edm::LogVerbatim("GMT_info") << "L1GlobalMuonTrigger processing bunch-crossing : " << bx;
270 
271  // get data into the data buffer
272  if ( L1MuGMTConfig::Debug(2) ) edm::LogVerbatim("GMT_info") << "running GMT PSB";
273  if ( m_PSB ) {
274  m_PSB->receiveData(e,bx);
275  if ( L1MuGMTConfig::Debug(4) ) m_PSB->print();
276  }
277 
278  if ( m_PSB && !m_PSB->empty() ) {
279 
280  // run matcher
281  if ( L1MuGMTConfig::Debug(2) ) edm::LogVerbatim("GMT_info") << "running GMT barrel Matcher";
282  if ( m_Matcher[0] ) m_Matcher[0]->run();
283  if ( L1MuGMTConfig::Debug(3) && m_Matcher[0] ) m_Matcher[0]->print();
284  if ( L1MuGMTConfig::Debug(2) ) edm::LogVerbatim("GMT_info") << "running GMT endcap Matcher";
285  if ( m_Matcher[1] ) m_Matcher[1]->run();
286  if ( L1MuGMTConfig::Debug(3) && m_Matcher[1] ) m_Matcher[1]->print();
287 
288  // run cancel-out units
289  if ( L1MuGMTConfig::Debug(2) ) edm::LogVerbatim("GMT_info") << "running GMT barrel Cancel Out Unit";
290  if ( m_CancelOutUnit[0] ) m_CancelOutUnit[0]->run();
292 
293  if ( L1MuGMTConfig::Debug(2) ) edm::LogVerbatim("GMT_info") << "running GMT endcap Cancel Out Unit";
294  if ( m_CancelOutUnit[1] ) m_CancelOutUnit[1]->run();
296 
297  if ( L1MuGMTConfig::Debug(2) ) edm::LogVerbatim("GMT_info") << "running GMT CSC/fRPC Cancel Out Unit";
298  if ( m_CancelOutUnit[2] ) m_CancelOutUnit[2]->run();
300 
301  if ( L1MuGMTConfig::Debug(2) ) edm::LogVerbatim("GMT_info") << "running GMT DT/bRPC Cancel Out Unit";
302  if ( m_CancelOutUnit[3] ) m_CancelOutUnit[3]->run();
304 
305  // run MIP & ISO bit assignment units
306  if ( L1MuGMTConfig::Debug(2) ) edm::LogVerbatim("GMT_info") << "running GMT barrel MIP & ISO bit Assignment Unit";
307  if ( m_MipIsoAU[0] ) m_MipIsoAU[0]->run();
308  if ( L1MuGMTConfig::Debug(3) && m_MipIsoAU[0] ) m_MipIsoAU[0]->print();
309  if ( L1MuGMTConfig::Debug(2) ) edm::LogVerbatim("GMT_info") << "running GMT endcap MIP & ISO bit Assignment Unit";
310  if ( m_MipIsoAU[1] ) m_MipIsoAU[1]->run();
311  if ( L1MuGMTConfig::Debug(3) && m_MipIsoAU[1] ) m_MipIsoAU[1]->print();
312 
313  // run Merger
314  if ( L1MuGMTConfig::Debug(2) ) edm::LogVerbatim("GMT_info") << "running GMT barrel Merger";
315  if ( m_Merger[0] ) m_Merger[0]->run();
316  if ( L1MuGMTConfig::Debug(3) && m_Merger[0] ) m_Merger[0]->print();
317  if ( L1MuGMTConfig::Debug(2) ) edm::LogVerbatim("GMT_info") << "running GMT endcap Merger";
318  if ( m_Merger[1] ) m_Merger[1]->run();
319  if ( L1MuGMTConfig::Debug(3) && m_Merger[1] ) m_Merger[1]->print();
320 
321  // run sorter
322  if ( L1MuGMTConfig::Debug(2) ) edm::LogVerbatim("GMT_info") << "running GMT Sorter";
323  if ( m_Sorter ) m_Sorter->run();
325 
326  // store found track candidates in a container
327  if ( m_Sorter->numberOfCands() > 0 ) {
328  const std::vector<const L1MuGMTExtendedCand*>& gmt_cont = m_Sorter->Cands();
329  std::vector<const L1MuGMTExtendedCand*>::const_iterator iexc;
330  for ( iexc = gmt_cont.begin(); iexc != gmt_cont.end(); iexc++ ) {
331  if ( *iexc ) m_ExtendedCands.push_back( **iexc );
332  }
333  }
334 
335  // reset GMT
336  reset();
337 
338  }
339  }
340 
341  // produce the output
342  std::unique_ptr<std::vector<L1MuGMTCand> > GMTCands(new std::vector<L1MuGMTCand>);
343  std::vector<L1MuGMTExtendedCand>::const_iterator iexc;
344  for(iexc=m_ExtendedCands.begin(); iexc!=m_ExtendedCands.end(); iexc++) {
345  GMTCands->push_back(*iexc);
346  }
347  e.put(std::move(GMTCands));
348 
349  std::unique_ptr<L1MuGMTReadoutCollection> GMTRRC(getReadoutCollection());
350  e.put(std::move(GMTRRC));
351 
352  if( m_sendMipIso ) {
353  std::unique_ptr<std::vector<unsigned> > mipiso(new std::vector<unsigned>);
354  for(int i=0; i<32; i++) {
355  mipiso->push_back(m_db->IsMIPISO(0,i));
356  }
357  e.put(std::move(mipiso));
358  }
359 
360 // delete registers and LUTs
362 }
void setGMTChanMask(const L1MuGMTChannelMask *gmtchanmask)
unsigned long long m_L1MuTriggerScalesCacheID
std::vector< L1MuGMTReadoutRecord * > m_ReadoutRingbuffer
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:137
unsigned long long m_L1MuGMTChannelMaskCacheID
void print() const
print PSB
Definition: L1MuGMTPSB.cc:219
void SetBX(int bx)
Set the current bunch crossing.
void setTriggerPtScale(const L1MuTriggerPtScale *trigptscale)
void dumpRegs(std::string dir)
std::vector< L1MuGMTExtendedCand > m_ExtendedCands
void print() const
print results after MIP & ISO bit assignment
void print()
print cancel-out bits
bool empty() const
are there any data in the PSB
Definition: L1MuGMTPSB.cc:311
unsigned getSubsystemMask() const
void run()
run Matcher
void print()
print matching results
const std::vector< const L1MuGMTExtendedCand * > & Cands() const
return std::vector with all muon candidates
Definition: L1MuGMTSorter.h:64
unsigned long long m_L1CaloGeometryCacheID
virtual void run()
run Sorter
void run()
run GMT MIP & ISO bit assignment unit
void setGMTScales(const L1MuGMTScales *gmtscales)
unsigned long long m_L1MuTriggerPtScaleCacheID
static bool Debug()
L1MuGMTMipIsoAU * m_MipIsoAU[2]
static const L1MuGMTChannelMask * getGMTChanMask()
std::unique_ptr< L1MuGMTReadoutCollection > getReadoutCollection()
unsigned IsMIPISO(int bx, int idx)
Get stored MIP/ISO select bits.
L1MuGMTMatcher * m_Matcher[2]
void dumpLUTs(std::string dir)
L1MuGMTMerger * m_Merger[2]
void setCaloGeom(const L1CaloGeometry *caloGeom)
void print() const
print results after selection
unsigned long long m_L1MuGMTScalesCacheID
static int getBxMin()
void print()
print results after sorting
L1MuGMTCancelOutUnit * m_CancelOutUnit[4]
void run()
run GMT Merger
void setGMTParams(const L1MuGMTParameters *gmtparams)
def mkdir(path)
Definition: eostools.py:250
void clearLUTsRegs()
void receiveData(edm::Event &e, int bx)
receive muon candidates
Definition: L1MuGMTPSB.cc:90
T get() const
Definition: EventSetup.h:63
void reset()
Reset the debug block.
static L1MuGMTConfig * m_config
unsigned long long m_L1MuGMTParametersCacheID
void createLUTsRegs()
static int getBxMax()
static L1MuGMTDebugBlock * m_db
dbl *** dir
Definition: mlp_gen.cc:35
void setTriggerScales(const L1MuTriggerScales *trigscales)
void run()
run cancel-out unit
T const * product() const
Definition: ESHandle.h:86
int numberOfCands() const
return number of found muon candidates after sorter
Definition: L1MuGMTSorter.h:61
def move(src, dest)
Definition: eostools.py:510
void L1MuGlobalMuonTrigger::reset ( void  )

Definition at line 367 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().

367  {
368 
369  if ( m_PSB ) m_PSB->reset();
370  if ( m_Matcher[0] ) m_Matcher[0]->reset();
371  if ( m_Matcher[1] ) m_Matcher[1]->reset();
372  if ( m_CancelOutUnit[0] ) m_CancelOutUnit[0]->reset();
373  if ( m_CancelOutUnit[1] ) m_CancelOutUnit[1]->reset();
374  if ( m_CancelOutUnit[2] ) m_CancelOutUnit[2]->reset();
375  if ( m_CancelOutUnit[3] ) m_CancelOutUnit[3]->reset();
376  if ( m_MipIsoAU[0] ) m_MipIsoAU[0]->reset();
377  if ( m_MipIsoAU[1] ) m_MipIsoAU[1]->reset();
378  if ( m_Merger[0] ) m_Merger[0]->reset();
379  if ( m_Merger[1] ) m_Merger[1]->reset();
380  if ( m_Sorter) m_Sorter->reset();
381 
382 }
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:198
L1MuGMTMipIsoAU * m_MipIsoAU[2]
L1MuGMTMatcher * m_Matcher[2]
L1MuGMTMerger * m_Merger[2]
void reset()
clear Merger
L1MuGMTCancelOutUnit * m_CancelOutUnit[4]
void reset()
clear Matcher
const L1MuGMTSorter* L1MuGlobalMuonTrigger::Sorter ( ) const
inline

return pointer to Sorter

Definition at line 78 of file L1MuGlobalMuonTrigger.h.

References getReadoutCollection(), and m_Sorter.

78 { return m_Sorter; }

Member Data Documentation

L1MuGMTCancelOutUnit* L1MuGlobalMuonTrigger::m_CancelOutUnit[4]
private
L1MuGMTConfig * L1MuGlobalMuonTrigger::m_config = 0
staticprivate
L1MuGMTDebugBlock * L1MuGlobalMuonTrigger::m_db = 0
staticprivate
std::vector<L1MuGMTExtendedCand> L1MuGlobalMuonTrigger::m_ExtendedCands
private

Definition at line 102 of file L1MuGlobalMuonTrigger.h.

Referenced by L1MuGlobalMuonTrigger(), and produce().

unsigned long long L1MuGlobalMuonTrigger::m_L1CaloGeometryCacheID
private

Definition at line 117 of file L1MuGlobalMuonTrigger.h.

Referenced by L1MuGlobalMuonTrigger(), and produce().

unsigned long long L1MuGlobalMuonTrigger::m_L1MuGMTChannelMaskCacheID
private

Definition at line 116 of file L1MuGlobalMuonTrigger.h.

Referenced by L1MuGlobalMuonTrigger(), and produce().

unsigned long long L1MuGlobalMuonTrigger::m_L1MuGMTParametersCacheID
private

Definition at line 115 of file L1MuGlobalMuonTrigger.h.

Referenced by L1MuGlobalMuonTrigger(), and produce().

unsigned long long L1MuGlobalMuonTrigger::m_L1MuGMTScalesCacheID
private

Definition at line 112 of file L1MuGlobalMuonTrigger.h.

Referenced by L1MuGlobalMuonTrigger(), and produce().

unsigned long long L1MuGlobalMuonTrigger::m_L1MuTriggerPtScaleCacheID
private

Definition at line 114 of file L1MuGlobalMuonTrigger.h.

Referenced by L1MuGlobalMuonTrigger(), and produce().

unsigned long long L1MuGlobalMuonTrigger::m_L1MuTriggerScalesCacheID
private

Definition at line 113 of file L1MuGlobalMuonTrigger.h.

Referenced by L1MuGlobalMuonTrigger(), and produce().

L1MuGMTMatcher* L1MuGlobalMuonTrigger::m_Matcher[2]
private
L1MuGMTMerger* L1MuGlobalMuonTrigger::m_Merger[2]
private
L1MuGMTMipIsoAU* L1MuGlobalMuonTrigger::m_MipIsoAU[2]
private
L1MuGMTPSB* L1MuGlobalMuonTrigger::m_PSB
private
std::vector<L1MuGMTReadoutRecord*> L1MuGlobalMuonTrigger::m_ReadoutRingbuffer
private
bool L1MuGlobalMuonTrigger::m_sendMipIso
private

Definition at line 106 of file L1MuGlobalMuonTrigger.h.

Referenced by L1MuGlobalMuonTrigger(), and produce().

L1MuGMTSorter* L1MuGlobalMuonTrigger::m_Sorter
private
bool L1MuGlobalMuonTrigger::m_writeLUTsAndRegs
private

Definition at line 105 of file L1MuGlobalMuonTrigger.h.

Referenced by L1MuGlobalMuonTrigger(), and produce().