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
MuDTTPGPhiFlatTableProducer Class Reference

#include <DPGAnalysis/MuonTools/src/MuDTTPGPhiFlatTableProducer.cc>

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

Public Types

enum  TriggerTag { TriggerTag::TM_IN = 0, TriggerTag::TM_OUT, 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

 MuDTTPGPhiFlatTableProducer (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 event. More...
 
void getFromES (const edm::Run &, const edm::EventSetup &) final
 Get info from the ES by run. 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::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< L1MuDTChambPhContainerm_token
 The trigger-primitive token. More...
 
nano_mu::DTTrigGeomUtils m_trigGeomUtils
 The class to perform DT local trigger coordinate conversions. 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 22 of file MuDTTPGPhiFlatTableProducer.cc.

Member Enumeration Documentation

◆ TriggerTag

Enumerator
TM_IN 
TM_OUT 
BMTF_IN 

Definition at line 24 of file MuDTTPGPhiFlatTableProducer.cc.

24 { TM_IN = 0, TM_OUT, BMTF_IN };

Constructor & Destructor Documentation

◆ MuDTTPGPhiFlatTableProducer()

MuDTTPGPhiFlatTableProducer::MuDTTPGPhiFlatTableProducer ( const edm::ParameterSet config)

Constructor.

Definition at line 54 of file MuDTTPGPhiFlatTableProducer.cc.

57  m_token{config, consumesCollector(), "src"},
58  m_trigGeomUtils{consumesCollector()} {
59  produces<nanoaod::FlatTable>();
60 }
nano_mu::DTTrigGeomUtils m_trigGeomUtils
The class to perform DT local trigger coordinate conversions.
Definition: config.py:1
nano_mu::EDTokenHandle< L1MuDTChambPhContainer > m_token
The trigger-primitive token.
dictionary config
Read in AllInOne config in JSON format.
Definition: DiMuonV_cfg.py:30
TriggerTag getTag(const edm::ParameterSet &)
Helper function translating config parameter into TriggerTag.

Member Function Documentation

◆ fillDescriptions()

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

Fill descriptors.

Definition at line 62 of file MuDTTPGPhiFlatTableProducer.cc.

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

62  {
64 
65  desc.add<std::string>("name", "ltBmtfIn");
66  desc.ifValue(edm::ParameterDescription<std::string>("tag", "BMTF_IN", true),
67  edm::allowedValues<std::string>("BMTF_IN", "TM_IN", "TM_OUT"));
68  desc.add<edm::InputTag>("src", edm::InputTag{"bmtfDigis"});
69 
70  descriptions.addWithDefaultLabel(desc);
71 }
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)

◆ fillTable()

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

Fill tree branches for a given event.

Implements MuBaseFlatTableProducer.

Definition at line 77 of file MuDTTPGPhiFlatTableProducer.cc.

References MuBaseFlatTableProducer::addColumn(), BMTF_IN, nano_mu_digi_cff::bx, nano_mu::EDTokenHandle< T >::conditionalGet(), DeadROC_duringRun::dir, makeMEIFBenchmarkPlots::ev, MuBaseFlatTableProducer::m_name, m_tag, m_token, m_trigGeomUtils, eostools::move(), phi, nano_mu_local_reco_cff::posLoc_x, quality, nano_mu_digi_cff::sector, relativeConstraints::station, TableParser::table, TM_IN, TM_OUT, ClusterTask_cfi::trig, nano_mu::DTTrigGeomUtils::trigToReco(), makeMuonMisalignmentScenario::wheel, and x.

77  {
78  unsigned int nTrigs{0};
79 
80  std::vector<int16_t> wheel;
81  std::vector<int16_t> sector;
82  std::vector<int16_t> station;
83 
84  std::vector<int16_t> quality;
85  std::vector<int16_t> rpcBit;
86 
87  std::vector<int> phi;
88  std::vector<int> phiB;
89 
90  std::vector<float> posLoc_x;
91  std::vector<float> dirLoc_phi;
92 
93  std::vector<int16_t> bx;
94  std::vector<int16_t> is2nd;
95 
96  auto trigColl = m_token.conditionalGet(ev);
97 
98  if (trigColl.isValid()) {
99  const auto trigs = trigColl->getContainer();
100  for (const auto& trig : (*trigs)) {
101  if (trig.code() != 7) {
102  wheel.push_back(trig.whNum());
103  sector.push_back(trig.scNum() + (m_tag != TriggerTag::BMTF_IN ? 1 : 0));
104  station.push_back(trig.stNum());
105 
106  quality.push_back(trig.code());
107 
108  if (m_tag == TriggerTag::TM_OUT)
109  rpcBit.push_back(trig.RpcBit());
110 
111  phi.push_back(trig.phi());
112  phiB.push_back(trig.phiB());
113 
114  auto [x, dir] = m_trigGeomUtils.trigToReco(&trig);
115 
116  posLoc_x.push_back(x);
117  dirLoc_phi.push_back(dir);
118 
119  bx.push_back(trig.bxNum() - (m_tag == TriggerTag::TM_IN && trig.Ts2Tag() ? 1 : 0));
120  is2nd.push_back(trig.Ts2Tag());
121 
122  ++nTrigs;
123  }
124  }
125  }
126 
127  auto table = std::make_unique<nanoaod::FlatTable>(nTrigs, m_name, false, false);
128 
129  table->setDoc("Barrel trigger primitive information (phi view)");
130 
131  addColumn(table, "wheel", wheel, "wheel - [-2:2] range");
133  "sector",
134  sector,
135  "sector"
136  "<br /> - [1:12] range for TwinMux"
137  "<br /> - [0:11] range for BMTF input"
138  "<br /> - double MB4 stations are part of S4 and S10 in TwinMux"
139  "<br /> - double MB4 stations are part of S3 and S9 in BMTF input");
140  addColumn(table, "station", station, "station - [1:4] range");
142  "quality",
143  quality,
144  "quality - [0:6] range"
145  "<br /> - [0:1] : uncorrelated L triggers"
146  "<br /> - [2:3] : uncorrelated H triggers"
147  "<br /> - 4 : correlated LL triggers"
148  "<br /> - 5 : correlated HL triggers"
149  "<br /> - 6 : correlated HH triggers");
150  if (m_tag == TriggerTag::TM_OUT) {
152  "rpcBit",
153  rpcBit,
154  "use of RPC - [0:2] range"
155  "<br /> - 0 : RPC not used"
156  "<br /> - 1 : RPC+DT combined trigger"
157  "<br /> - 2 : RPC-only trigger");
158  }
159 
161  "phi",
162  phi,
163  "phi - scale and range:"
164  "<br /> - 4096 correstpond to 1 rad"
165  "<br /> - 0 is @ (DT sector - 1) * 30 deg in global CMS phi");
167  "phiB",
168  phiB,
169  "phiB - scale and range:"
170  "<br /> - 512 correstpond to 1 rad"
171  "<br /> - 0 is a muon with infinite pT (straight line)");
172  addColumn(table, "posLoc_x", posLoc_x, "position x in chamber local coordinates - cm");
173  addColumn(table, "dirLoc_phi", dirLoc_phi, "direction phi angle in chamber local coordinates - deg");
175  "bx",
176  bx,
177  "bx:"
178  "<br /> - BX = 0 is the one where the event is collected"
179  "<br /> - TwinMux range [X:Y]"
180  "<br /> - BMT input range [X:Y]");
181  addColumn(table, "is2nd", is2nd, "1st/2nd track flag - [0:1]");
182 
183  ev.put(std::move(table));
184 }
nano_mu::DTTrigGeomUtils m_trigGeomUtils
The class to perform DT local trigger coordinate conversions.
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)
string quality
std::string m_name
The label name of the FlatTableProducer.
nano_mu::EDTokenHandle< L1MuDTChambPhContainer > m_token
The trigger-primitive token.
def move(src, dest)
Definition: eostools.py:511
chambCoord trigToReco(const L1MuDTChambPhDigi *trig)
Return local position and direction in chamber RF - legacy.

◆ getFromES()

void MuDTTPGPhiFlatTableProducer::getFromES ( const edm::Run run,
const edm::EventSetup environment 
)
finalprotectedvirtual

Get info from the ES by run.

Reimplemented from MuBaseFlatTableProducer.

Definition at line 73 of file MuDTTPGPhiFlatTableProducer.cc.

References reco_calib_source_client_cfg::environment, nano_mu::DTTrigGeomUtils::getFromES(), m_trigGeomUtils, and writedatasetfile::run.

73  {
75 }
nano_mu::DTTrigGeomUtils m_trigGeomUtils
The class to perform DT local trigger coordinate conversions.
void getFromES(const edm::Run &run, const edm::EventSetup &environment)
Update EventSetup information.

◆ getTag()

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

Helper function translating config parameter into TriggerTag.

Definition at line 186 of file MuDTTPGPhiFlatTableProducer.cc.

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

186  {
187  auto tag{TriggerTag::TM_IN};
188 
189  auto tagName = config.getParameter<std::string>("tag");
190 
191  if (tagName != "TM_IN" && tagName != "TM_OUT" && tagName != "BMTF_IN")
192  edm::LogError("") << "[MuDTTPGPhiFlatTableProducer]::getTag: " << tagName
193  << " is not a valid tag, defaulting to TM_IN";
194 
195  if (tagName == "TM_OUT") {
197  } else if (tagName == "BMTF_IN") {
199  }
200 
201  return tag;
202 }
Definition: config.py:1
Log< level::Error, false > LogError

Member Data Documentation

◆ m_tag

TriggerTag MuDTTPGPhiFlatTableProducer::m_tag
private

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

Definition at line 42 of file MuDTTPGPhiFlatTableProducer.cc.

Referenced by fillTable().

◆ m_token

nano_mu::EDTokenHandle<L1MuDTChambPhContainer> MuDTTPGPhiFlatTableProducer::m_token
private

The trigger-primitive token.

Definition at line 45 of file MuDTTPGPhiFlatTableProducer.cc.

Referenced by fillTable().

◆ m_trigGeomUtils

nano_mu::DTTrigGeomUtils MuDTTPGPhiFlatTableProducer::m_trigGeomUtils
private

The class to perform DT local trigger coordinate conversions.

Definition at line 48 of file MuDTTPGPhiFlatTableProducer.cc.

Referenced by fillTable(), and getFromES().