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
 
TriggerPrimitiveCollection clean (const TriggerPrimitiveCollection &) const
 
 DTBunchCrossingCleaner (const edm::ParameterSet &)
 
 DTBunchCrossingCleaner (const edm::ParameterSet &)
 
 ~DTBunchCrossingCleaner ()
 
 ~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 ps)

Definition at line 19 of file DTBunchCrossingCleaner.cc.

19  :
20  bx_window_size(ps.getParameter<int>("bxWindowSize")) {
21 }
T getParameter(std::string const &) const
L1TMuon::DTBunchCrossingCleaner::~DTBunchCrossingCleaner ( )
inline

Definition at line 25 of file DTBunchCrossingCleaner.h.

25 {}
L1TMuon::DTBunchCrossingCleaner::DTBunchCrossingCleaner ( const edm::ParameterSet )
L1TMuon::DTBunchCrossingCleaner::~DTBunchCrossingCleaner ( )
inline

Definition at line 25 of file DTBunchCrossingCleaner.h.

25 {}

Member Function Documentation

TriggerPrimitiveCollection DTBunchCrossingCleaner::clean ( const TriggerPrimitiveCollection inlist) const

Definition at line 24 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(), 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.

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

Member Data Documentation

const int L1TMuon::DTBunchCrossingCleaner::bx_window_size
private

Definition at line 31 of file DTBunchCrossingCleaner.h.

Referenced by clean().