CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
dqmBmtfAlgoSelector::L1TBMTFAlgoSelector Class Reference

#include <L1TBMTFAlgoSelector.h>

Inheritance diagram for dqmBmtfAlgoSelector::L1TBMTFAlgoSelector:
edm::stream::EDProducer<>

Public Member Functions

 L1TBMTFAlgoSelector (const edm::ParameterSet &ps)
 
 ~L1TBMTFAlgoSelector () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

Private Member Functions

void produce (edm::Event &, const edm::EventSetup &) override
 

Private Attributes

edm::EDGetToken bmtfKalmanToken
 
edm::EDGetToken bmtfLegacyToken
 
edm::EDGetToken fedToken
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 

Detailed Description

Definition at line 39 of file L1TBMTFAlgoSelector.h.

Constructor & Destructor Documentation

◆ L1TBMTFAlgoSelector()

dqmBmtfAlgoSelector::L1TBMTFAlgoSelector::L1TBMTFAlgoSelector ( const edm::ParameterSet ps)
explicit

Definition at line 9 of file L1TBMTFAlgoSelector.cc.

9  {
10  bmtfKalmanToken = consumes<l1t::RegionalMuonCandBxCollection>(ps.getParameter<edm::InputTag>("bmtfKalman"));
11  bmtfLegacyToken = consumes<l1t::RegionalMuonCandBxCollection>(ps.getParameter<edm::InputTag>("bmtfLegacy"));
12  fedToken = consumes<FEDRawDataCollection>(ps.getParameter<edm::InputTag>("feds"));
13 
14  produces<l1t::RegionalMuonCandBxCollection>("BMTF");
15  produces<l1t::RegionalMuonCandBxCollection>("BMTF2");
16 }

References bmtfKalmanToken, bmtfLegacyToken, fedToken, and edm::ParameterSet::getParameter().

◆ ~L1TBMTFAlgoSelector()

dqmBmtfAlgoSelector::L1TBMTFAlgoSelector::~L1TBMTFAlgoSelector ( )
override

Definition at line 18 of file L1TBMTFAlgoSelector.cc.

18 {}

Member Function Documentation

◆ produce()

void dqmBmtfAlgoSelector::L1TBMTFAlgoSelector::produce ( edm::Event eve,
const edm::EventSetup eveSetup 
)
overrideprivate

Definition at line 20 of file L1TBMTFAlgoSelector.cc.

20  {
21  //Declare the Handlers
23  eve.getByToken(fedToken, feds);
28 
29  //----> Make RegMuonCand Copies
30  auto *bmtfKalman_copy = new l1t::RegionalMuonCandBxCollection(*bmtfKalman);
31  auto *bmtfLegacy_copy = new l1t::RegionalMuonCandBxCollection(*bmtfLegacy);
32  edm::LogInfo("L1TDQM") << "copy RegionalMuonCandBxCollections created";
33  edm::LogInfo("L1TDQM") << "bmtfKalman_copy address: " << bmtfKalman_copy;
34  edm::LogInfo("L1TDQM") << "bmtfLegacy_copy address: " << bmtfLegacy_copy;
35 
36  //-----> Get the fw-ver
37  int nonEmptyFed = 0;
38  if (feds->FEDData(1376).size() > 0)
39  nonEmptyFed = 1376;
40  else if (feds->FEDData(1377).size() > 0)
41  nonEmptyFed = 1377;
42  else {
43  edm::LogError("L1TDQM") << "[L1TBMTFAlgoSelector] Both BMTF feds (1376, 1377) seem empty."
44  << "Using Default Configuration."
45  << "Will be wrong if this is Kalman triggering and ZS is enabled";
46  //Define the default configuration
47  std::unique_ptr<l1t::RegionalMuonCandBxCollection> bmtfTriggering, bmtfSecondary;
48  bmtfTriggering.reset(bmtfLegacy_copy);
49  bmtfSecondary.reset(bmtfKalman_copy);
50  //Print in log the addresses
51  edm::LogInfo("L1TDQM") << "Triggering and Secondary pointers filled:";
52  edm::LogInfo("L1TDQM") << "bmtfTriggering address: " << bmtfTriggering.get();
53  edm::LogInfo("L1TDQM") << "bmtfSecondary address: " << bmtfSecondary.get();
54  //Produce the products
55  eve.put(std::move(bmtfTriggering), "BMTF");
56  eve.put(std::move(bmtfSecondary), "BMTF2");
57  return;
58  }
59 
60  const FEDRawData &l1tRcd = feds->FEDData(nonEmptyFed);
61  ;
62  edm::LogInfo("L1TDQM") << "L1T Rcd taken from the FEDData.";
63  edm::LogInfo("L1TDQM") << "l1tRcd.size=" << l1tRcd.size() << " for fed:" << nonEmptyFed;
64 
65  const unsigned char *data = l1tRcd.data();
67  edm::LogInfo("L1TDQM") << "header and data extracted from the Rcd.";
68 
69  amc13::Packet packet;
70  if (!packet.parse((const uint64_t *)data,
71  (const uint64_t *)(data + 8),
72  (l1tRcd.size()) / 8,
73  header.lvl1ID(),
74  header.bxID(),
75  false,
76  false)) {
77  edm::LogError("L1TDQM") << "Could not extract AMC13 Packet.";
78  return;
79  }
80 
81  edm::LogInfo("L1TDQM") << "AMC13-packet-payload size = " << packet.payload().size();
82  unsigned algo_ver;
83  if (!packet.payload().empty()) {
84  auto payload64 = (packet.payload().at(0)).data();
85  const uint32_t *start = (const uint32_t *)payload64.get();
86  const uint32_t *end = start + (packet.payload().at(0).size() * 2);
87 
89  algo_ver = payload.getAlgorithmFWVersion();
90 
91  edm::LogInfo("L1TDQM") << "algo-ver = " << algo_ver << std::endl;
92  } else {
93  edm::LogError("L1TDQM") << "amc13 payload is empty, cannot extract AMC13 Packet...";
94  return;
95  }
96 
97  //----->Make the Decision which Algo Triggers
98  std::unique_ptr<l1t::RegionalMuonCandBxCollection> bmtfTriggering, bmtfSecondary;
99  if (algo_ver >= 2499805536) { //95000160(hex)
100  // kalman triggers
101  bmtfTriggering.reset(bmtfKalman_copy);
102  bmtfSecondary.reset(bmtfLegacy_copy);
103  } else {
104  // legacy triggers
105  bmtfTriggering.reset(bmtfLegacy_copy);
106  bmtfSecondary.reset(bmtfKalman_copy);
107  }
108 
109  edm::LogInfo("L1TDQM") << "Triggering and Secondary pointers filled:";
110  edm::LogInfo("L1TDQM") << "bmtfTriggering address: " << bmtfTriggering.get();
111  edm::LogInfo("L1TDQM") << "bmtfSecondary address: " << bmtfSecondary.get();
112 
113  eve.put(std::move(bmtfTriggering), "BMTF");
114  eve.put(std::move(bmtfSecondary), "BMTF2");
115 
116  return;
117 }

References L1TBMTFAlgoSelector_cfi::bmtfKalman, L1TBMTFAlgoSelector_cfi::bmtfLegacy, FEDRawData::data(), data, end, l1tstage2emulator_dqm_sourceclient-live_cfg::feds, edm::Event::getByToken(), RecoTauValidation_cfi::header, eostools::move(), amc13::Packet::parse(), jets_cff::payload, amc13::Packet::payload(), edm::Event::put(), and FEDRawData::size().

Member Data Documentation

◆ bmtfKalmanToken

edm::EDGetToken dqmBmtfAlgoSelector::L1TBMTFAlgoSelector::bmtfKalmanToken
private

Definition at line 51 of file L1TBMTFAlgoSelector.h.

Referenced by L1TBMTFAlgoSelector().

◆ bmtfLegacyToken

edm::EDGetToken dqmBmtfAlgoSelector::L1TBMTFAlgoSelector::bmtfLegacyToken
private

Definition at line 52 of file L1TBMTFAlgoSelector.h.

Referenced by L1TBMTFAlgoSelector().

◆ fedToken

edm::EDGetToken dqmBmtfAlgoSelector::L1TBMTFAlgoSelector::fedToken
private

Definition at line 53 of file L1TBMTFAlgoSelector.h.

Referenced by L1TBMTFAlgoSelector().

l1tstage2emulator_dqm_sourceclient-live_cfg.feds
feds
Definition: l1tstage2emulator_dqm_sourceclient-live_cfg.py:153
start
Definition: start.py:1
L1TBMTFAlgoSelector_cfi.bmtfKalman
bmtfKalman
Definition: L1TBMTFAlgoSelector_cfi.py:6
amc13::Packet::parse
bool parse(const uint64_t *start, const uint64_t *data, unsigned int size, unsigned int lv1, unsigned int bx, bool legacy_mc=false, bool mtf7_mode=false)
Definition: AMC13Spec.cc:60
dqmBmtfAlgoSelector::L1TBMTFAlgoSelector::bmtfKalmanToken
edm::EDGetToken bmtfKalmanToken
Definition: L1TBMTFAlgoSelector.h:51
edm::LogInfo
Definition: MessageLogger.h:254
edm::Handle
Definition: AssociativeIterator.h:50
amc13::Packet::payload
std::vector< amc::Packet > payload() const
Definition: AMC13Spec.h:92
FEDRawData::data
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
Definition: FEDRawData.cc:24
end
#define end
Definition: vmac.h:39
FEDRawData
Definition: FEDRawData.h:19
amc13::Packet
Definition: AMC13Spec.h:69
jets_cff.payload
payload
Definition: jets_cff.py:34
edm::Event::getByToken
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:528
l1t::MP7Payload
Definition: Block.h:106
edm::LogError
Definition: MessageLogger.h:183
edm::Event::put
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:132
l1t::RegionalMuonCandBxCollection
BXVector< RegionalMuonCand > RegionalMuonCandBxCollection
Definition: RegionalMuonCandFwd.h:9
FEDRawData::size
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:45
dqmBmtfAlgoSelector::L1TBMTFAlgoSelector::fedToken
edm::EDGetToken fedToken
Definition: L1TBMTFAlgoSelector.h:53
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
eostools.move
def move(src, dest)
Definition: eostools.py:511
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
RecoTauValidation_cfi.header
header
Definition: RecoTauValidation_cfi.py:292
cond::uint64_t
unsigned long long uint64_t
Definition: Time.h:13
L1TBMTFAlgoSelector_cfi.bmtfLegacy
bmtfLegacy
Definition: L1TBMTFAlgoSelector_cfi.py:7
FEDHeader
Definition: FEDHeader.h:14
dqmBmtfAlgoSelector::L1TBMTFAlgoSelector::bmtfLegacyToken
edm::EDGetToken bmtfLegacyToken
Definition: L1TBMTFAlgoSelector.h:52
edm::InputTag
Definition: InputTag.h:15