CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
L1TMuon::DTBunchCrossingCleaner Class Reference

#include <DTBunchCrossingCleaner.h>

Public Member Functions

TriggerPrimitiveCollection clean (const TriggerPrimitiveCollection &) const
 
 DTBunchCrossingCleaner (const edm::ParameterSet &)
 
 ~DTBunchCrossingCleaner ()
 

Private Attributes

const int bx_window_size
 

Detailed Description

Definition at line 22 of file DTBunchCrossingCleaner.h.

Constructor & Destructor Documentation

DTBunchCrossingCleaner::DTBunchCrossingCleaner ( const edm::ParameterSet )

Definition at line 19 of file DTBunchCrossingCleaner.cc.

19 : bx_window_size(ps.getParameter<int>("bxWindowSize")) {}
L1TMuon::DTBunchCrossingCleaner::~DTBunchCrossingCleaner ( )
inline

Definition at line 25 of file DTBunchCrossingCleaner.h.

References clean().

25 {}

Member Function Documentation

TriggerPrimitiveCollection DTBunchCrossingCleaner::clean ( const TriggerPrimitiveCollection inlist) const

Definition at line 21 of file DTBunchCrossingCleaner.cc.

References funct::abs(), L1TMuon::TriggerPrimitive::DTData::bendingAngle, L1TMuon::TriggerPrimitive::DTData::bx, bx_window_size, L1TMuon::TriggerPrimitive::DTData::BxCntCode, data, spr::find(), mps_fire::i, position, L1TMuon::TriggerPrimitive::DTData::qualityCode, L1TMuon::TriggerPrimitive::DTData::radialAngle, L1TMuon::TriggerPrimitive::DTData::sector, L1TMuon::TriggerPrimitive::DTData::segment_number, L1TMuon::TriggerPrimitive::DTData::station, L1TMuon::TriggerPrimitive::DTData::theta_bti_group, L1TMuon::TriggerPrimitive::DTData::theta_quality, L1TMuon::TriggerPrimitive::DTData::Ts2TagCode, and L1TMuon::TriggerPrimitive::DTData::wheel.

21  {
22  TriggerPrimitiveCollection leftovers = inlist;
24 
25  auto tpin = inlist.cbegin();
26  auto inend = inlist.cend();
27  for (; tpin != inend; ++tpin) {
28  const TriggerPrimitive::DTData data = tpin->getDTData();
29 
30  // automatically add well matched tracks
31  if (data.qualityCode != -1 && data.theta_quality != -1) {
32  outlist.push_back(*tpin);
33  auto toerase = std::find(leftovers.begin(), leftovers.end(), *tpin);
34  if (toerase != leftovers.end()) {
35  leftovers.erase(toerase);
36  }
37  }
38 
39  // clean up phi/theta digis split across a BX
40  // key off of the phi digis since they are of higher quality
41  if (data.qualityCode != -1 && data.theta_quality == -1) {
42  auto tp_bx = leftovers.cbegin();
43  auto tp_bx_end = leftovers.cend();
44  for (; tp_bx != tp_bx_end; ++tp_bx) {
45  if (*tp_bx == *tpin)
46  continue;
47  const TriggerPrimitive::DTData bx_data = tp_bx->getDTData();
48  // look in-window and match to the segment number
49  // requiring that we find a theta-segment with no phi info
50  if (std::abs(bx_data.bx - data.bx) <= bx_window_size && bx_data.qualityCode == -1 &&
51  bx_data.theta_quality != -1 && data.segment_number == bx_data.segment_number) {
52  // we need spoof the Digis used to create the individual objects
53  L1MuDTChambPhDigi phi_digi(data.bx,
54  data.wheel,
55  data.sector,
56  data.station,
57  data.radialAngle,
58  data.bendingAngle,
59  data.qualityCode,
60  data.Ts2TagCode,
61  data.BxCntCode);
62  int qual[7], position[7];
63  for (int i = 0; i < 7; ++i) {
64  qual[i] = 0;
65  position[i] = 0;
66  if (bx_data.theta_bti_group == i) {
67  qual[i] = bx_data.theta_quality;
68  position[i] = bx_data.segment_number;
69  }
70  }
71  L1MuDTChambThDigi the_digi(data.bx, data.wheel, data.sector, data.station, position, qual);
72 
73  DTChamberId the_id = tpin->detId<DTChamberId>();
74  TriggerPrimitive newtp(the_id, phi_digi, the_digi, bx_data.theta_bti_group);
75 
76  outlist.push_back(newtp);
77  // remove these primitives from the leftovers list
78  auto phierase = std::find(leftovers.begin(), leftovers.end(), *tpin);
79  auto theerase = std::find(leftovers.begin(), leftovers.end(), *tp_bx);
80  if (phierase != leftovers.end()) {
81  leftovers.erase(phierase);
82  }
83  if (theerase != leftovers.end()) {
84  leftovers.erase(theerase);
85  }
86  break; // do not look for further matches!
87  }
88  }
89  }
90  }
91  // re-insert any un-used trigger primitives
92  auto lo_tp = leftovers.cbegin();
93  auto lo_end = leftovers.cend();
94  for (; lo_tp != lo_end; ++lo_tp) {
95  outlist.push_back(*lo_tp);
96  }
97  return outlist;
98 }
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
std::vector< TriggerPrimitive > TriggerPrimitiveCollection
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
static int position[264][3]
Definition: ReadPGInfo.cc:289

Member Data Documentation

const int L1TMuon::DTBunchCrossingCleaner::bx_window_size
private

Definition at line 30 of file DTBunchCrossingCleaner.h.

Referenced by clean().