CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Attributes
MuGEMMuonExtTableProducer Class Reference
Inheritance diagram for MuGEMMuonExtTableProducer:
MuBaseFlatTableProducer edm::stream::EDProducer<>

Public Member Functions

 MuGEMMuonExtTableProducer (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...
 
void getFromES (const edm::EventSetup &) final
 Get info from the ES for a given event. 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)
 

Private Attributes

bool m_fillPropagated
 Fill matches table. More...
 
nano_mu::ESTokenHandle< GEMGeometry, MuonGeometryRecord, edm::Transition::BeginRunm_gemGeometry
 GEM Geometry. More...
 
std::unique_ptr< MuonServiceProxym_muonSP
 Muon service proxy. More...
 
nano_mu::EDTokenHandle< edm::View< reco::Muon > > m_token
 The RECO mu token. More...
 
nano_mu::ESTokenHandle< TransientTrackBuilder, TransientTrackRecordm_transientTrackBuilder
 Transient Track Builder. More...
 

Additional Inherited Members

- 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
 
- 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

Definition at line 27 of file MuGEMMuonExtTableProducer.cc.

Constructor & Destructor Documentation

◆ MuGEMMuonExtTableProducer()

MuGEMMuonExtTableProducer::MuGEMMuonExtTableProducer ( const edm::ParameterSet config)

Constructor.

Definition at line 62 of file MuGEMMuonExtTableProducer.cc.

64  m_token{config, consumesCollector(), "src"},
65  m_fillPropagated{config.getParameter<bool>("fillPropagated")},
66  m_gemGeometry{consumesCollector()},
67  m_transientTrackBuilder{consumesCollector(), "TransientTrackBuilder"},
68  m_muonSP{std::make_unique<MuonServiceProxy>(config.getParameter<edm::ParameterSet>("ServiceParameters"),
69  consumesCollector())} {
70  produces<nanoaod::FlatTable>();
71 
72  if (m_fillPropagated) {
73  produces<nanoaod::FlatTable>("propagated");
74  }
75 }
std::unique_ptr< MuonServiceProxy > m_muonSP
Muon service proxy.
dictionary config
Read in AllInOne config in JSON format.
Definition: DMR_cfg.py:21
Definition: config.py:1
nano_mu::ESTokenHandle< TransientTrackBuilder, TransientTrackRecord > m_transientTrackBuilder
Transient Track Builder.
bool m_fillPropagated
Fill matches table.
nano_mu::ESTokenHandle< GEMGeometry, MuonGeometryRecord, edm::Transition::BeginRun > m_gemGeometry
GEM Geometry.
nano_mu::EDTokenHandle< edm::View< reco::Muon > > m_token
The RECO mu token.

Member Function Documentation

◆ fillDescriptions()

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

Fill descriptors.

Definition at line 77 of file MuGEMMuonExtTableProducer.cc.

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

77  {
79 
80  desc.add<std::string>("name", "muon");
81  desc.add<edm::InputTag>("src", edm::InputTag{"patMuons"});
82 
83  desc.add<bool>("fillPropagated", true);
84  desc.setAllowAnything();
85 
86  descriptions.addWithDefaultLabel(desc);
87 }
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)

◆ fillTable()

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

Fill tree branches for a given event.

muon.outerTrack().isNull()

Implements MuBaseFlatTableProducer.

Definition at line 98 of file MuGEMMuonExtTableProducer.cc.

References MuBaseFlatTableProducer::addColumn(), TransientTrackBuilder::build(), GEMDetId::chamber(), nano_mu::EDTokenHandle< T >::conditionalGet(), MuonSubdetId::CSC, MuBaseFlatTableProducer::DEFAULT_DOUBLE_VAL, hcalRecHitTable_cff::detId, GEMGeometry::etaPartitions(), makeMEIFBenchmarkPlots::ev, reco::TransientTrack::hitPattern(), mps_fire::i, GeomDetEnumerators::isCSC(), nano_mu::ESTokenHandle< T, R, TR >::isValid(), GEMDetId::layer(), m_fillPropagated, m_gemGeometry, m_muonSP, MuBaseFlatTableProducer::m_name, m_token, m_transientTrackBuilder, eostools::move(), DetId::Muon, PDWG_BPHSkim_cff::muons, nHits, custom_jme_cff::nMuons, PV3DBase< T, PVType, FrameType >::perp(), PV3DBase< T, PVType, FrameType >::phi(), GlobalErrorBase< T, ErrorWeightType >::phierr(), TrackCandidateProducer_cfi::propagator, GEMDetId::region(), GlobalErrorBase< T, ErrorWeightType >::rerr(), GEMDetId::roll(), mathSSE::sqrt(), std::swap(), TableParser::table, HLT_2023v12_cff::track, ErrorFrameTransformer::transform(), PV3DBase< T, PVType, FrameType >::x(), geometryCSVtoXML::xx, LocalError::xx(), geometryCSVtoXML::xy, PV3DBase< T, PVType, FrameType >::y(), geometryCSVtoXML::yy, LocalError::yy(), and PV3DBase< T, PVType, FrameType >::z().

98  {
99  unsigned int nMuons{0};
100 
101  std::vector<bool> isCSC;
102  std::vector<bool> isME11;
103 
104  std::vector<float> innermost_x;
105  std::vector<float> innermost_y;
106  std::vector<float> innermost_z;
107 
108  std::vector<float> outermost_x;
109  std::vector<float> outermost_y;
110  std::vector<float> outermost_z;
111 
112  unsigned int nProp{0};
113 
114  std::vector<uint32_t> propagated_muIdx;
115 
116  std::vector<bool> propagated_isincoming;
117  std::vector<bool> propagated_isinsideout;
118  std::vector<int8_t> propagated_region;
119  std::vector<int8_t> propagated_layer;
120  std::vector<int8_t> propagated_chamber;
121  std::vector<int8_t> propagated_etaP;
122 
123  std::vector<float> propagatedLoc_x;
124  std::vector<float> propagatedLoc_y;
125  std::vector<float> propagatedLoc_z;
126  std::vector<float> propagatedLoc_r;
127  std::vector<float> propagatedLoc_phi;
128  std::vector<float> propagatedLoc_dirX;
129  std::vector<float> propagatedLoc_dirY;
130  std::vector<float> propagatedLoc_dirZ;
131  std::vector<float> propagatedLoc_errX;
132  std::vector<float> propagatedLoc_errY;
133 
134  std::vector<float> propagatedGlb_x;
135  std::vector<float> propagatedGlb_y;
136  std::vector<float> propagatedGlb_z;
137  std::vector<float> propagatedGlb_r;
138  std::vector<float> propagatedGlb_phi;
139  std::vector<float> propagatedGlb_errX;
140  std::vector<float> propagatedGlb_errY;
141  std::vector<float> propagatedGlb_phierr;
142  std::vector<float> propagatedGlb_rerr;
143 
144  std::vector<float> propagated_EtaPartition_centerX;
145  std::vector<float> propagated_EtaPartition_centerY;
146  std::vector<float> propagated_EtaPartition_phiMax;
147  std::vector<float> propagated_EtaPartition_phiMin;
148  std::vector<float> propagated_EtaPartition_rMax;
149  std::vector<float> propagated_EtaPartition_rMin;
150 
151  std::vector<int8_t> propagated_nME1hits;
152  std::vector<int8_t> propagated_nME2hits;
153  std::vector<int8_t> propagated_nME3hits;
154  std::vector<int8_t> propagated_nME4hits;
155 
156  auto muons = m_token.conditionalGet(ev);
157 
158  // edm::ESHandle<Propagator>
159  auto&& propagator_any = m_muonSP->propagator("SteppingHelixPropagatorAny");
160  auto&& propagator_along = m_muonSP->propagator("SteppingHelixPropagatorAlong");
161  auto&& propagator_opposite = m_muonSP->propagator("SteppingHelixPropagatorOpposite");
162 
163  if (!propagator_any.isValid() || !propagator_along.isValid() || !propagator_opposite.isValid()) {
164  return;
165  }
166 
167  if (muons.isValid() && m_transientTrackBuilder.isValid()) {
168  //loop on recoMuons
169  for (const auto& muon : (*muons)) {
170  ++nMuons;
171 
172  bool is_csc = false;
173  bool is_me11 = false;
174 
175  if (!muon.outerTrack().isNull()) {
176  const auto track = muon.outerTrack().get();
177  const auto outerTrackRef = muon.outerTrack();
178 
179  float p2_in = track->innerMomentum().mag2();
180  float p2_out = track->outerMomentum().mag2();
181  float pos_out = track->outerPosition().mag2();
182  float pos_in = track->innerPosition().mag2();
183 
184  bool is_insideout = pos_in > pos_out;
185 
186  if (is_insideout) {
187  std::swap(pos_in, pos_out);
188  std::swap(p2_in, p2_out);
189  }
190 
191  bool is_incoming = p2_out > p2_in;
192 
193  const auto&& transient_track = m_transientTrackBuilder->build(track);
194  const auto& htp = transient_track.hitPattern();
195 
196  if (transient_track.isValid()) {
197  const auto innerPosGlb{transient_track.innermostMeasurementState().globalPosition()};
198  const auto outerPosGlb{transient_track.outermostMeasurementState().globalPosition()};
199 
200  innermost_x.push_back(innerPosGlb.x());
201  innermost_y.push_back(innerPosGlb.y());
202  innermost_z.push_back(innerPosGlb.z());
203  outermost_x.push_back(outerPosGlb.x());
204  outermost_y.push_back(outerPosGlb.y());
205  outermost_z.push_back(outerPosGlb.z());
206  } else {
207  innermost_x.push_back(DEFAULT_DOUBLE_VAL);
208  innermost_y.push_back(DEFAULT_DOUBLE_VAL);
209  innermost_z.push_back(DEFAULT_DOUBLE_VAL);
210  outermost_x.push_back(DEFAULT_DOUBLE_VAL);
211  outermost_y.push_back(DEFAULT_DOUBLE_VAL);
212  outermost_z.push_back(DEFAULT_DOUBLE_VAL);
213  continue;
214  }
215 
216  const auto&& start_state =
217  is_insideout ? transient_track.outermostMeasurementState() : transient_track.innermostMeasurementState();
218  auto& propagator = is_incoming ? propagator_along : propagator_opposite;
219 
220  auto recHitMu = outerTrackRef->recHitsBegin();
221  auto recHitMuEnd = outerTrackRef->recHitsEnd();
222 
223  //loop on recHits which form the outerTrack
224  for (; recHitMu != recHitMuEnd; ++recHitMu) {
225  DetId detId{(*recHitMu)->geographicalId()};
226 
227  if (detId.det() == DetId::Muon && detId.subdetId() == MuonSubdetId::CSC) {
228  is_csc = true;
229 
230  const CSCDetId csc_id{detId};
231  // ME11 chambers consist of 2 subchambers: ME11a, ME11b.
232  // In CMSSW they are referred as Stat. 1 Ring 1, Stat. 1 Ring. 4 respectively
233  if (csc_id.station() == 1 && ((csc_id.ring() == 1) || (csc_id.ring() == 4)))
234  is_me11 = true;
235  }
236  } //loop on recHits
237 
238  //if at least one CSC hit is found, perform propagation
239  if (is_csc) {
240  // CSC Hits
241  int8_t nME1_hits = 0;
242  int8_t nME2_hits = 0;
243  int8_t nME3_hits = 0;
244  int8_t nME4_hits = 0;
245 
246  int nHits{htp.numberOfAllHits(htp.TRACK_HITS)};
247 
248  for (int i = 0; i != nHits; ++i) {
249  uint32_t hit = htp.getHitPattern(htp.TRACK_HITS, i);
250  int substructure = htp.getSubStructure(hit);
251  int hittype = htp.getHitType(hit);
252 
253  if (substructure == 2 && hittype == 0) { // CSC Hits
254  int CSC_station = htp.getMuonStation(hit);
255 
256  switch (CSC_station) {
257  case 1:
258  ++nME1_hits;
259  break;
260  case 2:
261  ++nME2_hits;
262  break;
263  case 3:
264  ++nME3_hits;
265  break;
266  case 4:
267  ++nME4_hits;
268  break;
269  default:
270  // do nothing
271  break;
272  }
273  }
274  }
275  //loop on GEM etaPartitions
276  for (const auto& eta_partition : m_gemGeometry->etaPartitions()) {
277  if (eta_partition->id().station() != 1) {
278  continue; //Only takes GE1/1
279  }
280  const GEMDetId&& gem_id = eta_partition->id();
281 
282  bool is_opposite_region = muon.eta() * gem_id.region() < 0;
283  if (is_incoming xor is_opposite_region) {
284  continue; //Check on muon direction
285  }
286  const BoundPlane& bound_plane = eta_partition->surface();
287 
288  const auto& dest_state = propagator->propagate(start_state, bound_plane);
289  if (!dest_state.isValid()) {
290  // std::cout << "failed to propagate" << std::endl;
291  continue;
292  }
293  const GlobalPoint&& dest_global_pos = dest_state.globalPosition();
294  const LocalPoint&& local_point = eta_partition->toLocal(dest_global_pos);
295  const LocalPoint local_point_2d{local_point.x(), local_point.y(), 0.0f};
296 
297  if (eta_partition->surface().bounds().inside(local_point_2d)) {
299  // X,Y
300  double xx = dest_state.curvilinearError().matrix()(3, 3);
301  double yy = dest_state.curvilinearError().matrix()(4, 4);
302  double xy = dest_state.curvilinearError().matrix()(4, 3);
303  double dest_glob_error_x = sqrt(0.5 * (xx + yy - sqrt((xx - yy) * (xx - yy) + 4 * xy * xy)));
304  double dest_glob_error_y = sqrt(0.5 * (xx + yy + sqrt((xx - yy) * (xx - yy) + 4 * xy * xy)));
305 
306  // R,Phi
307  const LocalPoint&& dest_local_pos = eta_partition->toLocal(dest_global_pos);
308  const LocalError&& dest_local_err = dest_state.localError().positionError();
309  const GlobalError& dest_global_err =
310  ErrorFrameTransformer().transform(dest_local_err, eta_partition->surface());
311  const double dest_global_r_err = std::sqrt(dest_global_err.rerr(dest_global_pos));
312  const double dest_global_phi_err = std::sqrt(dest_global_err.phierr(dest_global_pos));
313 
314  ++nProp;
315 
316  propagated_muIdx.push_back(nMuons - 1);
317 
318  propagated_nME1hits.push_back(nME1_hits);
319  propagated_nME2hits.push_back(nME2_hits);
320  propagated_nME3hits.push_back(nME3_hits);
321  propagated_nME4hits.push_back(nME4_hits);
322 
323  const auto& eta_partition_pos{eta_partition->position()};
324  const auto& eta_partition_surf{eta_partition->surface()};
325  propagated_EtaPartition_centerX.push_back(eta_partition_pos.x());
326  propagated_EtaPartition_centerY.push_back(eta_partition_pos.y());
327  propagated_EtaPartition_rMin.push_back(eta_partition_surf.rSpan().first);
328  propagated_EtaPartition_rMax.push_back(eta_partition_surf.rSpan().second);
329  propagated_EtaPartition_phiMin.push_back(eta_partition_surf.phiSpan().first);
330  propagated_EtaPartition_phiMax.push_back(eta_partition_surf.phiSpan().second);
331 
332  propagatedGlb_x.push_back(dest_global_pos.x());
333  propagatedGlb_y.push_back(dest_global_pos.y());
334  propagatedGlb_z.push_back(dest_global_pos.z());
335  propagatedGlb_r.push_back(dest_global_pos.perp());
336  propagatedGlb_phi.push_back(dest_global_pos.phi());
337 
338  const auto dest_local_dir{dest_state.localDirection()};
339  propagatedLoc_x.push_back(dest_local_pos.x());
340  propagatedLoc_y.push_back(dest_local_pos.y());
341  propagatedLoc_z.push_back(dest_local_pos.z());
342  propagatedLoc_r.push_back(dest_local_pos.perp());
343  propagatedLoc_phi.push_back(dest_local_pos.phi());
344  propagatedLoc_dirX.push_back(dest_local_dir.x());
345  propagatedLoc_dirY.push_back(dest_local_dir.y());
346  propagatedLoc_dirZ.push_back(dest_local_dir.z());
347 
348  propagatedLoc_errX.push_back(dest_local_err.xx());
349  propagatedLoc_errY.push_back(dest_local_err.yy());
350 
351  propagatedGlb_errX.push_back(dest_glob_error_x);
352  propagatedGlb_errY.push_back(dest_glob_error_y);
353  propagatedGlb_rerr.push_back(dest_global_r_err);
354  propagatedGlb_phierr.push_back(dest_global_phi_err);
355 
356  propagated_region.push_back(gem_id.region());
357  propagated_layer.push_back(gem_id.layer());
358  propagated_chamber.push_back(gem_id.chamber());
359  propagated_etaP.push_back(gem_id.roll());
360 
361  propagated_isinsideout.push_back(is_insideout);
362  propagated_isincoming.push_back(is_incoming);
363 
364  } //propagation is inside boundaries
365  } //loop on EtaPartitions
366  } //is_csc therefore perform propagation
367  } else {
368  innermost_x.push_back(DEFAULT_DOUBLE_VAL);
369  innermost_y.push_back(DEFAULT_DOUBLE_VAL);
370  innermost_z.push_back(DEFAULT_DOUBLE_VAL);
371  outermost_x.push_back(DEFAULT_DOUBLE_VAL);
372  outermost_y.push_back(DEFAULT_DOUBLE_VAL);
373  outermost_z.push_back(DEFAULT_DOUBLE_VAL);
374  }
375  isCSC.push_back(is_csc);
376  isME11.push_back(is_me11);
377 
378  } //loop on reco muons
379  }
380 
381  auto table = std::make_unique<nanoaod::FlatTable>(nMuons, m_name, false, true);
382 
383  //table->setDoc("RECO muon information");
384 
385  addColumn(table, "innermost_x", innermost_x, "");
386  addColumn(table, "innermost_y", innermost_y, "");
387  addColumn(table, "innermost_z", innermost_z, "");
388 
389  addColumn(table, "outermost_x", outermost_x, "");
390  addColumn(table, "outermost_y", outermost_y, "");
391  addColumn(table, "outermost_z", outermost_z, "");
392  ev.put(std::move(table));
393 
394  if (m_fillPropagated) {
395  auto tabProp = std::make_unique<nanoaod::FlatTable>(nProp, m_name + "_propagated", false, false);
396 
397  addColumn(tabProp, "propagated_muIdx", propagated_muIdx, "");
398 
399  addColumn(tabProp,
400  "propagated_nME1hits",
401  propagated_nME1hits,
402  "number of hits in the CSC ME1 station"
403  "in the STA muon track extrapolated to GE11");
404  addColumn(tabProp,
405  "propagated_nME2hits",
406  propagated_nME2hits,
407  "number of hits in the CSC ME2 station"
408  "in the STA muon track extrapolated to GE11");
409  addColumn(tabProp,
410  "propagated_nME3hits",
411  propagated_nME3hits,
412  "number of hits in the CSC ME3 station"
413  "in the STA muon track extrapolated to GE11");
414  addColumn(tabProp,
415  "propagated_nME4hits",
416  propagated_nME4hits,
417  "number of hits in the CSC ME4 station"
418  "in the STA muon track extrapolated to GE11");
419 
420  addColumn(
421  tabProp, "propagated_isincoming", propagated_isincoming, "bool, condition on the muon STA track direction");
422  addColumn(
423  tabProp, "propagated_isinsideout", propagated_isinsideout, "bool, condition on the muon STA track direction");
424  addColumn(tabProp,
425  "propagated_region",
426  propagated_region,
427  "GE11 region where the extrapolated muon track falls"
428  "<br />(int, positive endcap: +1, negative endcap: -1");
429  addColumn(tabProp,
430  "propagated_layer",
431  propagated_layer,
432  "GE11 layer where the extrapolated muon track falls"
433  "<br />(int, layer1: 1, layer2: 2");
434  addColumn(tabProp,
435  "propagated_chamber",
436  propagated_chamber,
437  "GE11 superchamber where the extrapolated muon track falls"
438  "<br />(int, chambers numbered from 0 to 35");
439  addColumn(tabProp,
440  "propagated_etaP",
441  propagated_etaP,
442  "GE11 eta partition where the extrapolated muon track falls"
443  "<br />(int, partitions numbered from 1 to 8");
444 
445  addColumn(tabProp,
446  "propagatedLoc_x",
447  propagatedLoc_x,
448  "expected position of muon track extrapolated to GE11 surface"
449  "<br />(float, local layer x coordinates, cm)");
450  addColumn(tabProp,
451  "propagatedLoc_y",
452  propagatedLoc_y,
453  "expected position of muon track extrapolated to GE11 surface"
454  "<br />(float, local layer y coordinates, cm)");
455  addColumn(tabProp,
456  "propagatedLoc_z",
457  propagatedLoc_z,
458  "expected position of muon track extrapolated to GE11 surface"
459  "<br />(float, local layer z coordinates, cm)");
460  addColumn(tabProp,
461  "propagatedLoc_r",
462  propagatedLoc_r,
463  "expected position of muon track extrapolated to GE11 surface"
464  "<br />(float, local layer radial coordinate, cm)");
465  addColumn(tabProp,
466  "propagatedLoc_phi",
467  propagatedLoc_phi,
468  "expected position of muon track extrapolated to GE11 surface"
469  "<br />(float, local layer phi coordinates, rad)");
470 
471  addColumn(tabProp,
472  "propagatedLoc_dirX",
473  propagatedLoc_dirX,
474  "direction cosine of angle between local x axis and GE11 plane"
475  "<br />(float, dir. cosine)");
476  addColumn(tabProp,
477  "propagatedLoc_dirY",
478  propagatedLoc_dirY,
479  "direction cosine of angle between local y axis and GE11 plane"
480  "<br />(float, dir. cosine)");
481  addColumn(tabProp,
482  "propagatedLoc_dirZ",
483  propagatedLoc_dirZ,
484  "direction cosine of angle between local z axis and GE11 plane"
485  "<br />(float, dir. cosine)");
486 
487  addColumn(tabProp,
488  "propagatedLoc_errX",
489  propagatedLoc_errX,
490  "uncertainty on expected position of muon track extrapolated to GE11 surface"
491  "<br />(float, local layer x coordinates, cm)");
492  addColumn(tabProp,
493  "propagatedLoc_errY",
494  propagatedLoc_errY,
495  "uncertainty on expected position of muon track extrapolated to GE11 surface"
496  "<br />(float, local layer y coordinates, cm)");
497 
498  addColumn(tabProp,
499  "propagatedGlb_x",
500  propagatedGlb_x,
501  "expected position of muon track extrapolated to GE11 surface"
502  "<br />(float, global x coordinates, cm)");
503  addColumn(tabProp,
504  "propagatedGlb_y",
505  propagatedGlb_y,
506  "expected position of muon track extrapolated to GE11 surface"
507  "<br />(float, global y coordinates, cm)");
508  addColumn(tabProp,
509  "propagatedGlb_z",
510  propagatedGlb_z,
511  "expected position of muon track extrapolated to GE11 surface"
512  "<br />(float, global z coordinates, cm)");
513  addColumn(tabProp,
514  "propagatedGlb_r",
515  propagatedGlb_r,
516  "expected position of muon track extrapolated to GE11 surface"
517  "<br />(float, global radial (r) coordinates, cm)");
518  addColumn(tabProp,
519  "propagatedGlb_phi",
520  propagatedGlb_phi,
521  "expected position of muon track extrapolated to GE11 surface"
522  "<br />(float, global phi coordinates, rad)");
523  addColumn(tabProp,
524  "propagatedGlb_errX",
525  propagatedGlb_errX,
526  "uncertainty on position of muon track extrapolated to GE11 surface"
527  "<br />(float, global x coordinates, cm)");
528  addColumn(tabProp,
529  "propagatedGlb_errY",
530  propagatedGlb_errY,
531  "uncertainty on position of muon track extrapolated to GE11 surface"
532  "<br />(float, global y coordinates, cm)");
533  addColumn(tabProp,
534  "propagatedGlb_rerr",
535  propagatedGlb_rerr,
536  "uncertainty on position of muon track extrapolated to GE11 surface"
537  "<br />(float, global radial (r) coordinates, cm)");
538  addColumn(tabProp,
539  "propagatedGlb_phierr",
540  propagatedGlb_phierr,
541  "uncertainty on position of muon track extrapolated to GE11 surface"
542  "<br />(float, global phi coordinates, rad)");
543 
544  addColumn(tabProp,
545  "propagated_EtaPartition_centerX",
546  propagated_EtaPartition_centerX,
547  "global X coordinate of the center of the etaPartition"
548  "<br />where the extrapolated muon track position falls"
549  "<br />(float, global x coordinates, cm)");
550  addColumn(tabProp,
551  "propagated_EtaPartition_centerY",
552  propagated_EtaPartition_centerY,
553  "global Y coordinate of the center of the etaPartition"
554  "<br />where the extrapolated muon track position falls"
555  "<br />(float, global x coordinates, cm)");
556  addColumn(tabProp,
557  "propagated_EtaPartition_phiMax",
558  propagated_EtaPartition_phiMax,
559  "upper edge in phi global coordinates of the etaPartition"
560  "<br />where the extrapolated muon track position falls"
561  "<br />(float, global phi coordinates, rad)");
562  addColumn(tabProp,
563  "propagated_EtaPartition_phiMin",
564  propagated_EtaPartition_phiMin,
565  "lower edge in phi global coordinates of the etaPartition"
566  "<br />where the extrapolated muon track position falls"
567  "<br />(float, global phi coordinates, rad)");
568  addColumn(tabProp,
569  "propagated_EtaPartition_rMax",
570  propagated_EtaPartition_rMax,
571  "upper edge in r global coordinates of the etaPartition"
572  "<br />where the extrapolated muon track position falls"
573  "<br />(float, global radial (r) coordinates, cm)");
574  addColumn(tabProp,
575  "propagated_EtaPartition_rMin",
576  propagated_EtaPartition_rMin,
577  "lower edge in r global coordinates of the etaPartition"
578  "<br />where the extrapolated muon track position falls"
579  "<br />(float, global radial (r) coordinates, cm)");
580 
581  ev.put(std::move(tabProp), "propagated");
582  }
583 }
std::unique_ptr< MuonServiceProxy > m_muonSP
Muon service proxy.
static GlobalError transform(const LocalError &le, const Surface &surf)
T perp() const
Definition: PV3DBase.h:69
constexpr int region() const
Definition: GEMDetId.h:171
T z() const
Definition: PV3DBase.h:61
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
const HitPattern & hitPattern() const
auto conditionalGet(const edm::Event &ev) const
Definition: MuNtupleUtils.h:49
constexpr int layer() const
Definition: GEMDetId.h:190
static constexpr double DEFAULT_DOUBLE_VAL
Definition of default values for float variables.
constexpr int chamber() const
Definition: GEMDetId.h:183
T phierr(const GlobalPoint &aPoint) const
reco::TransientTrack build(const reco::Track *p) const
void addColumn(std::unique_ptr< nanoaod::FlatTable > &table, const std::string name, const std::vector< T > &vec, const std::string descr)
float yy() const
Definition: LocalError.h:24
T x() const
Definition: PV3DBase.h:59
T y() const
Definition: PV3DBase.h:60
nano_mu::ESTokenHandle< TransientTrackBuilder, TransientTrackRecord > m_transientTrackBuilder
Transient Track Builder.
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
bool m_fillPropagated
Fill matches table.
T sqrt(T t)
Definition: SSEVec.h:19
nano_mu::ESTokenHandle< GEMGeometry, MuonGeometryRecord, edm::Transition::BeginRun > m_gemGeometry
GEM Geometry.
Definition: DetId.h:17
bool isValid()
Check validity.
Definition: MuNtupleUtils.h:76
std::string m_name
The label name of the FlatTableProducer.
constexpr int roll() const
Definition: GEMDetId.h:194
bool isCSC(GeomDetEnumerators::SubDetector m)
T rerr(const GlobalPoint &aPoint) const
TupleMultiplicity< TrackerTraits > const *__restrict__ uint32_t nHits
static constexpr int CSC
Definition: MuonSubdetId.h:12
float xx() const
Definition: LocalError.h:22
def move(src, dest)
Definition: eostools.py:511
nano_mu::EDTokenHandle< edm::View< reco::Muon > > m_token
The RECO mu token.
const std::vector< const GEMEtaPartition * > & etaPartitions() const
Return a vector of all GEM eta partitions.
Definition: GEMGeometry.cc:40

◆ getFromES() [1/2]

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

Get info from the ES by run.

Reimplemented from MuBaseFlatTableProducer.

Definition at line 89 of file MuGEMMuonExtTableProducer.cc.

References reco_calib_source_client_cfg::environment, nano_mu::ESTokenHandle< T, R, TR >::getFromES(), and m_gemGeometry.

89  {
91 }
nano_mu::ESTokenHandle< GEMGeometry, MuonGeometryRecord, edm::Transition::BeginRun > m_gemGeometry
GEM Geometry.
void getFromES(const edm::EventSetup &environment)
Get Handle from ES.
Definition: MuNtupleUtils.h:73

◆ getFromES() [2/2]

void MuGEMMuonExtTableProducer::getFromES ( const edm::EventSetup environment)
finalprotectedvirtual

Get info from the ES for a given event.

Reimplemented from MuBaseFlatTableProducer.

Definition at line 93 of file MuGEMMuonExtTableProducer.cc.

References reco_calib_source_client_cfg::environment, nano_mu::ESTokenHandle< T, R, TR >::getFromES(), m_muonSP, and m_transientTrackBuilder.

93  {
95  m_muonSP->update(environment);
96 }
std::unique_ptr< MuonServiceProxy > m_muonSP
Muon service proxy.
nano_mu::ESTokenHandle< TransientTrackBuilder, TransientTrackRecord > m_transientTrackBuilder
Transient Track Builder.
void getFromES(const edm::EventSetup &environment)
Get Handle from ES.
Definition: MuNtupleUtils.h:73

Member Data Documentation

◆ m_fillPropagated

bool MuGEMMuonExtTableProducer::m_fillPropagated
private

Fill matches table.

Definition at line 50 of file MuGEMMuonExtTableProducer.cc.

Referenced by fillTable().

◆ m_gemGeometry

nano_mu::ESTokenHandle<GEMGeometry, MuonGeometryRecord, edm::Transition::BeginRun> MuGEMMuonExtTableProducer::m_gemGeometry
private

GEM Geometry.

Definition at line 53 of file MuGEMMuonExtTableProducer.cc.

Referenced by fillTable(), and getFromES().

◆ m_muonSP

std::unique_ptr<MuonServiceProxy> MuGEMMuonExtTableProducer::m_muonSP
private

Muon service proxy.

Definition at line 59 of file MuGEMMuonExtTableProducer.cc.

Referenced by fillTable(), and getFromES().

◆ m_token

nano_mu::EDTokenHandle<edm::View<reco::Muon> > MuGEMMuonExtTableProducer::m_token
private

The RECO mu token.

Definition at line 47 of file MuGEMMuonExtTableProducer.cc.

Referenced by fillTable().

◆ m_transientTrackBuilder

nano_mu::ESTokenHandle<TransientTrackBuilder, TransientTrackRecord> MuGEMMuonExtTableProducer::m_transientTrackBuilder
private

Transient Track Builder.

Definition at line 56 of file MuGEMMuonExtTableProducer.cc.

Referenced by fillTable(), and getFromES().