CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
MuDTTPGThetaFlatTableProducer Class Reference

#include <DPGAnalysis/MuonTools/plugins/MuDTTPGThetaFlatTableProducer.cc>

Inheritance diagram for MuDTTPGThetaFlatTableProducer:
MuBaseFlatTableProducer edm::stream::EDProducer<>

Public Types

enum  TriggerTag { TriggerTag::TM_IN = 0, TriggerTag::BMTF_IN }
 
- Public Types inherited from edm::stream::EDProducer<>
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

Public Member Functions

 MuDTTPGThetaFlatTableProducer (const edm::ParameterSet &)
 Constructor. More...
 
- Public Member Functions inherited from MuBaseFlatTableProducer
void beginRun (const edm::Run &run, const edm::EventSetup &config) final
 Configure event setup for each run. More...
 
void endRun (const edm::Run &, const edm::EventSetup &) final
 Empty, needed by interface. More...
 
 MuBaseFlatTableProducer (const edm::ParameterSet &)
 Constructor. More...
 
void produce (edm::Event &, const edm::EventSetup &) final
 Fill ntuples event by event. More...
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
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
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &)
 Fill descriptors. More...
 

Protected Member Functions

void fillTable (edm::Event &) final
 Fill tree branches for a given events. More...
 
- Protected Member Functions inherited from MuBaseFlatTableProducer
template<typename T >
void addColumn (std::unique_ptr< nanoaod::FlatTable > &table, const std::string name, const std::vector< T > &vec, const std::string descr)
 
virtual void getFromES (const edm::Run &run, const edm::EventSetup &environment)
 Get info from the ES by run. More...
 
virtual void getFromES (const edm::EventSetup &environment)
 Get info from the ES for a given event. More...
 

Private Member Functions

TriggerTag getTag (const edm::ParameterSet &)
 Helper function translating config parameter into TriggerTag. More...
 

Private Attributes

TriggerTag m_tag
 
nano_mu::EDTokenHandle< L1MuDTChambThContainerm_token
 The trigger-primitive token. More...
 

Additional Inherited Members

- Protected Attributes inherited from MuBaseFlatTableProducer
std::string m_name
 The label name of the FlatTableProducer. More...
 
- Static Protected Attributes inherited from MuBaseFlatTableProducer
static constexpr double DEFAULT_DOUBLE_VAL {-999.0}
 Definition of default values for float variables. More...
 
static constexpr double DEFAULT_DOUBLE_VAL_POS {-1.0}
 Definition of default values for positive float variables. More...
 
static constexpr int8_t DEFAULT_INT8_VAL {-99}
 Definition of default values for int8 variables. More...
 
static constexpr int DEFAULT_INT_VAL {-999}
 Definition of default values for int variables. More...
 
static constexpr int DEFAULT_INT_VAL_POS {-1}
 Definition of default values for positive int variables. More...
 

Detailed Description

Helper class : the Phase-1 local trigger FlatTableProducer for TwinMux in/out and BMTF in (the DataFormat is the same)

Author
C. Battilana (INFN BO)

Definition at line 21 of file MuDTTPGThetaFlatTableProducer.cc.

Member Enumeration Documentation

◆ TriggerTag

Enumerator
TM_IN 
BMTF_IN 

Definition at line 23 of file MuDTTPGThetaFlatTableProducer.cc.

23 { TM_IN = 0, BMTF_IN };

Constructor & Destructor Documentation

◆ MuDTTPGThetaFlatTableProducer()

MuDTTPGThetaFlatTableProducer::MuDTTPGThetaFlatTableProducer ( const edm::ParameterSet config)

Constructor.

Definition at line 47 of file MuDTTPGThetaFlatTableProducer.cc.

48  : MuBaseFlatTableProducer{config}, m_tag{getTag(config)}, m_token{config, consumesCollector(), "src"} {
49  produces<nanoaod::FlatTable>();
50 }
nano_mu::EDTokenHandle< L1MuDTChambThContainer > m_token
The trigger-primitive token.
Definition: config.py:1
TriggerTag getTag(const edm::ParameterSet &)
Helper function translating config parameter into TriggerTag.
dictionary config
Read in AllInOne config in JSON format.
Definition: DiMuonV_cfg.py:30

Member Function Documentation

◆ fillDescriptions()

void MuDTTPGThetaFlatTableProducer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Fill descriptors.

Definition at line 52 of file MuDTTPGThetaFlatTableProducer.cc.

References edm::ConfigurationDescriptions::addWithDefaultLabel(), submitPVResolutionJobs::desc, and AlCaHLTBitMon_QueryRunRegistry::string.

52  {
54 
55  desc.add<std::string>("name", "ltBmtfInTh");
56  desc.ifValue(edm::ParameterDescription<std::string>("tag", "BMTF_IN", true),
57  edm::allowedValues<std::string>("BMTF_IN", "TM_IN"));
58  desc.add<edm::InputTag>("src", edm::InputTag{"bmtfDigis"});
59 
60  descriptions.addWithDefaultLabel(desc);
61 }
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)

◆ fillTable()

void MuDTTPGThetaFlatTableProducer::fillTable ( edm::Event ev)
finalprotectedvirtual

Fill tree branches for a given events.

Implements MuBaseFlatTableProducer.

Definition at line 63 of file MuDTTPGThetaFlatTableProducer.cc.

References MuBaseFlatTableProducer::addColumn(), BMTF_IN, nano_mu_digi_cff::bx, nano_mu::EDTokenHandle< T >::conditionalGet(), makeMEIFBenchmarkPlots::ev, MuBaseFlatTableProducer::m_name, m_tag, m_token, eostools::move(), nano_mu_digi_cff::sector, relativeConstraints::station, TableParser::table, ClusterTask_cfi::trig, makeMuonMisalignmentScenario::wheel, and testProducerWithPsetDescEmpty_cfi::x1.

63  {
64  unsigned int nTrigs{0};
65 
66  std::vector<int16_t> wheel;
67  std::vector<int16_t> sector;
68  std::vector<int16_t> station;
69 
70  std::vector<int16_t> bx;
71  std::vector<uint32_t> hitMap;
72 
73  auto trigColl = m_token.conditionalGet(ev);
74 
75  if (trigColl.isValid()) {
76  const auto trigs = trigColl->getContainer();
77  for (const auto& trig : (*trigs)) {
78  bool hasData = false;
79  for (int pos = 0; pos < 7; ++pos) {
80  if (trig.code(pos)) {
81  hasData = true;
82  break;
83  }
84  }
85 
86  if (!hasData)
87  continue;
88 
89  wheel.push_back(trig.whNum());
90  sector.push_back(trig.scNum() + (m_tag != TriggerTag::BMTF_IN ? 1 : 0));
91  station.push_back(trig.stNum());
92 
93  bx.push_back(trig.bxNum());
94 
95  uint32_t hitMapCh = 0;
96  for (int pos = 0; pos < 7; ++pos)
97  if (trig.code(pos))
98  hitMapCh = hitMapCh | (0x1 << pos);
99 
100  hitMap.push_back(hitMapCh);
101 
102  ++nTrigs;
103  }
104  }
105 
106  auto table = std::make_unique<nanoaod::FlatTable>(nTrigs, m_name, false, false);
107 
108  table->setDoc("Barrel trigger primitive information (theta view)");
109 
110  addColumn(table, "wheel", wheel, "wheel - [-2:2] range");
112  "sector",
113  sector,
114  "sector"
115  "<br /> - [1:12] range for TwinMux"
116  "<br /> - [0:11] range for BMTF input"
117  "<br /> - double MB4 stations are part of S4 and S10 in TwinMux"
118  "<br /> - double MB4 stations are part of S3 and S9 in BMTF input");
119  addColumn(table, "station", station, "station - [1:3] range");
121  "bx",
122  bx,
123  "bx:"
124  "<br /> - BX = 0 is the one where the event is collected"
125  "<br /> - TwinMux range [X:Y]"
126  "<br /> - BMTF input range [X:Y]");
128  "hitMap",
129  hitMap,
130  "Map groups of BTIs that fired (unsigned int):"
131  "<br /> there are 7 groups of BTI per chamber, the first one"
132  "<br /> being the less significant bit of the map [CHECK]");
133 
134  ev.put(std::move(table));
135 }
nano_mu::EDTokenHandle< L1MuDTChambThContainer > m_token
The trigger-primitive token.
auto conditionalGet(const edm::Event &ev) const
Definition: MuNtupleUtils.h:49
void addColumn(std::unique_ptr< nanoaod::FlatTable > &table, const std::string name, const std::vector< T > &vec, const std::string descr)
std::string m_name
The label name of the FlatTableProducer.
def move(src, dest)
Definition: eostools.py:511

◆ getTag()

MuDTTPGThetaFlatTableProducer::TriggerTag MuDTTPGThetaFlatTableProducer::getTag ( const edm::ParameterSet config)
private

Helper function translating config parameter into TriggerTag.

Definition at line 137 of file MuDTTPGThetaFlatTableProducer.cc.

References BMTF_IN, AlCaHLTBitMon_QueryRunRegistry::string, makeGlobalPositionRcd_cfg::tag, dcs_print_summary_cfg::tagName, and TM_IN.

137  {
138  auto tag{TriggerTag::TM_IN};
139 
140  auto tagName = config.getParameter<std::string>("tag");
141 
142  if (tagName != "TM_IN" && tagName != "BMTF_IN")
143  edm::LogError("") << "[MuDTTPGThetaFlatTableProducer]::getTag: " << tagName
144  << " is not a valid tag, defaulting to TM_IN";
145 
146  if (tagName == "BMTF_IN")
148 
149  return tag;
150 }
Definition: config.py:1
Log< level::Error, false > LogError

Member Data Documentation

◆ m_tag

TriggerTag MuDTTPGThetaFlatTableProducer::m_tag
private

Enum to activate "flavour-by-flavour" changes in the filling logic

Definition at line 38 of file MuDTTPGThetaFlatTableProducer.cc.

Referenced by fillTable().

◆ m_token

nano_mu::EDTokenHandle<L1MuDTChambThContainer> MuDTTPGThetaFlatTableProducer::m_token
private

The trigger-primitive token.

Definition at line 41 of file MuDTTPGThetaFlatTableProducer.cc.

Referenced by fillTable().