CMS 3D CMS Logo

List of all members | Classes | Public Types | Public Member Functions | Private Member Functions | Private Attributes
L1TwinMux::MBLTCollection Class Reference

#include <MBLTCollection.h>

Classes

struct  primitiveAssociation
 structure for internal indexing More...
 

Public Types

enum  bxMatch { NOMATCH, INMATCH, OUTMATCH, FULLMATCH }
 
enum  subsystem_offset { kDT, kRPCb, kCSC, kRPCf }
 internal enum for subdetector stub identification More...
 

Public Member Functions

void addStub (const TriggerPrimitiveRef &stub)
 
void associate (double)
 
DTChamberId detId () const
 returns detId More...
 
const TriggerPrimitiveListgetDtSegments () const
 return a reference to the DT only segments More...
 
TriggerPrimitiveList getRpcInAssociatedStubs (size_t dtIndex) const
 rpc inner layer hits associated to a given dt station More...
 
const TriggerPrimitiveListgetRpcInner () const
 rpc inner layer hits only More...
 
TriggerPrimitiveList getRpcInUnassociatedStubs () const
 rpc inner layer hits associated to a given dt station More...
 
TriggerPrimitiveList getRpcOutAssociatedStubs (size_t dtIndex) const
 rpc outer layer hits associated to a given dt station More...
 
const TriggerPrimitiveListgetRpcOuter () const
 rpc outer layer hits only More...
 
TriggerPrimitiveList getRpcOutUnassociatedStubs () const
 rpc outer layer hits associated to a given dt station More...
 
std::vector< std::pair< TriggerPrimitiveList, TriggerPrimitiveList > > getUnassociatedRpcClusters (double minRpcPhi) const
 RPC unassociated clusters. More...
 
bxMatch haveCommonRpc (size_t dt1, size_t dt2) const
 
 MBLTCollection ()
 default constructor More...
 
 MBLTCollection (const DTChamberId &dtId)
 construction out of DTChamberId: automatically extracts info More...
 
int sector () const
 returns sector More...
 
int station () const
 returns station More...
 
int wheel () const
 returns wheel More...
 
 ~MBLTCollection ()
 

Private Member Functions

bool areCloseClusters (std::vector< size_t > &cluster1, std::vector< size_t > &cluster2, const TriggerPrimitiveList &rpcList1, const TriggerPrimitiveList &rpcList2, double minRpcPhi) const
 
void getUnassociatedRpcClusters (const std::vector< size_t > &rpcUnass, const TriggerPrimitiveList &rpcList, double minRpcPhi, std::vector< std::vector< size_t > > &clusters) const
 RPC unassociated utility functions. More...
 
size_t reduceRpcClusters (std::vector< std::vector< size_t > > &tmpClusters, const TriggerPrimitiveList &rpcList, double minRpcPhi) const
 

Private Attributes

TriggerPrimitiveList _dtAssociatedStubs
 dt segments More...
 
std::vector< primitiveAssociation_dtMapAss
 
TriggerPrimitiveList _rpcInAssociatedStubs
 rpc inner layer hits More...
 
primitiveAssociation _rpcMapUnass
 
TriggerPrimitiveList _rpcOutAssociatedStubs
 rpc outer layer hits More...
 
int _sector
 
int _station
 
int _wheel
 space coordinates More...
 

Detailed Description

Definition at line 31 of file MBLTCollection.h.

Member Enumeration Documentation

internal enum for subdetector stub identification

Enumerator
kDT 
kRPCb 
kCSC 
kRPCf 

Definition at line 36 of file MBLTCollection.h.

Constructor & Destructor Documentation

L1TwinMux::MBLTCollection::MBLTCollection ( )
inline

default constructor

Definition at line 47 of file MBLTCollection.h.

L1TwinMux::MBLTCollection::MBLTCollection ( const DTChamberId dtId)

construction out of DTChamberId: automatically extracts info

Definition at line 10 of file MBLTCollection.cc.

References DTChamberId::sector(), DTChamberId::station(), and DTChamberId::wheel().

11 {
12  _wheel = dtId.wheel();
13  _sector = dtId.sector();
14  _station = dtId.station();
15 }
int _wheel
space coordinates
int sector() const
Definition: DTChamberId.h:61
int station() const
Return the station number.
Definition: DTChamberId.h:51
int wheel() const
Return the wheel number.
Definition: DTChamberId.h:45
L1TwinMux::MBLTCollection::~MBLTCollection ( )
inline

Definition at line 51 of file MBLTCollection.h.

References addStub().

51 {};

Member Function Documentation

void L1TwinMux::MBLTCollection::addStub ( const TriggerPrimitiveRef stub)

selectively add Trigger Primitives to the MBLTCollection dt, rpc up layer and rpc down layer are stored in separated collections

Definition at line 17 of file MBLTCollection.cc.

References Exception, L1TMuon::TriggerPrimitive::kDT, L1TMuon::TriggerPrimitive::kRPC, RPCDetId::layer(), and RPCDetId::region().

Referenced by ~MBLTCollection().

18 {
19 
20  TriggerPrimitive::subsystem_type type = stub->subsystem();
21 
22  switch ( type ) {
23  case TriggerPrimitive::kDT :
24  _dtAssociatedStubs.push_back( stub );
25  break;
26  case TriggerPrimitive::kRPC : {
27  const RPCDetId & rpcId = stub->detId<RPCDetId>();
28 
29  if ( rpcId.region() ) { // endcap
30  throw cms::Exception("Invalid Subsytem")
31  << "The RPC stub is not in a barrel layer" << std::endl;
32  }
33 
34  if ( rpcId.layer() == 1 ) _rpcInAssociatedStubs.push_back( stub );
35  else if ( rpcId.layer() == 2 ) _rpcOutAssociatedStubs.push_back( stub );
36  else throw cms::Exception("Invalid Subsytem")
37  << "The RPC layer is not a barrel layer" << std::endl;
38  break;
39  }
40  default :
41  throw cms::Exception("Invalid Subsytem")
42  << "The specified subsystem for this track stub is out of range"
43  << std::endl;
44  }
45 }
type
Definition: HCALResponse.h:21
TriggerPrimitiveList _dtAssociatedStubs
dt segments
TriggerPrimitiveList _rpcOutAssociatedStubs
rpc outer layer hits
int layer() const
Definition: RPCDetId.h:108
TriggerPrimitiveList _rpcInAssociatedStubs
rpc inner layer hits
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.
Definition: RPCDetId.h:63
bool L1TwinMux::MBLTCollection::areCloseClusters ( std::vector< size_t > &  cluster1,
std::vector< size_t > &  cluster2,
const TriggerPrimitiveList rpcList1,
const TriggerPrimitiveList rpcList2,
double  minRpcPhi 
) const
private

Definition at line 277 of file MBLTCollection.cc.

References reco::deltaPhi(), and electronIdCutBased_cfi::deltaPhiIn.

Referenced by detId().

282 {
283 
284  size_t clSize1 = cluster1.size();
285  size_t clSize2 = cluster2.size();
286 
287  for ( size_t idx1 = 0; idx1 < clSize1; ++idx1 ) {
288 
289  size_t uidx1 = cluster1.at(idx1);
290  double phi1 = rpcList1.at( uidx1 )->getCMSGlobalPhi();
291 
292  for ( size_t idx2 = 0; idx2 < clSize2; ++idx2 ) {
293 
294  size_t uidx2 = cluster2.at(idx2);
295  double phi2 = rpcList2.at( uidx2 )->getCMSGlobalPhi();
296  double deltaPhiIn = fabs( reco::deltaPhi( phi1, phi2 ) );
297  if ( deltaPhiIn < minRpcPhi ) {
298  return true;
299  }
300  }
301  }
302 
303  return false;
304 
305 }
double deltaPhi(double phi1, double phi2)
Definition: deltaPhi.h:22
void L1TwinMux::MBLTCollection::associate ( double  minRpcPhi)

fill up index for In associations

fill up index for Out associations

fill unassociated rpcIn

fill unassociated rpcOut

Definition at line 49 of file MBLTCollection.cc.

References reco::deltaPhi(), electronIdCutBased_cfi::deltaPhiIn, electronIdCutBasedClasses_cfi::deltaPhiOut, L1TwinMux::MBLTCollection::primitiveAssociation::rpcIn, and L1TwinMux::MBLTCollection::primitiveAssociation::rpcOut.

Referenced by detId().

50 {
51 
52  size_t dtSize = _dtAssociatedStubs.size();
53  size_t rpcInSize = _rpcInAssociatedStubs.size();
54  size_t rpcOutSize = _rpcOutAssociatedStubs.size();
55  _dtMapAss.resize( dtSize );
56 
57 
58 // std::vector< std::map<double, size_t> > dtIdxIn;
59 // dtIdxIn.resize(rpcInSize);
60 // std::vector< std::map<double, size_t> > dtIdxOut;
61 // dtIdxOut.resize(rpcOutSize);
62 
63  std::vector< size_t > rpcInAss( rpcInSize, 0 );
64  std::vector< size_t > rpcOutAss( rpcOutSize, 0 );
65 
66  for ( size_t iDt = 0; iDt < dtSize; ++iDt ) {
67 
68  double phi = _dtAssociatedStubs.at(iDt)->getCMSGlobalPhi();
69  std::map< double, size_t > rpcInIdx;
70  std::map< double, size_t > rpcOutIdx;
71 
72  for ( size_t iIn = 0; iIn < rpcInSize; ++iIn ) {
73  double phiIn = _rpcInAssociatedStubs.at( iIn )->getCMSGlobalPhi();
74  double deltaPhiIn = fabs( reco::deltaPhi( phi, phiIn ) );
75  if ( deltaPhiIn < minRpcPhi ) {
76  rpcInIdx[ deltaPhiIn ] = iIn;
77  ++rpcInAss[iIn];
78 // dtIdxIn[iIn][ deltaPhiIn ] = iDt;
79  }
80  }
81 
82  for ( size_t iOut = 0; iOut < rpcOutSize; ++iOut ) {
83  double phiOut = _rpcOutAssociatedStubs.at( iOut )->getCMSGlobalPhi();
84  double deltaPhiOut = fabs( reco::deltaPhi( phi, phiOut ) );
85  if ( deltaPhiOut < minRpcPhi ) {
86  rpcOutIdx[ deltaPhiOut ] = iOut;
87  ++rpcOutAss[iOut];
88 // dtIdxOut[iOut][ deltaPhiOut ] = iDt;
89  }
90  }
91 
93 
95  std::map< double, size_t >::const_iterator it = rpcInIdx.begin();
96  std::map< double, size_t >::const_iterator itend = rpcInIdx.end();
97  dtAss.rpcIn.reserve( rpcInIdx.size() );
98  for ( ; it != itend; ++it ) dtAss.rpcIn.push_back( it->second );
99 
101  it = rpcOutIdx.begin();
102  itend = rpcOutIdx.end();
103  dtAss.rpcOut.reserve( rpcOutIdx.size() );
104  for ( ; it != itend; ++it ) dtAss.rpcOut.push_back( it->second );
105 
106  }
107 
109  for ( size_t iIn = 0; iIn < rpcInSize; ++iIn ) {
110  if ( !rpcInAss.at(iIn) ) _rpcMapUnass.rpcIn.push_back(iIn);
111  }
112  if ( _rpcInAssociatedStubs.size() < _rpcMapUnass.rpcIn.size() )
113  throw cms::Exception("More unassociated IN hits than the total rpc IN hits") << std::endl;
114 
116  for ( size_t iOut = 0; iOut < rpcOutSize; ++iOut ) {
117  if ( !rpcOutAss.at(iOut) ) _rpcMapUnass.rpcOut.push_back(iOut);
118  }
119  if ( _rpcOutAssociatedStubs.size() < _rpcMapUnass.rpcOut.size() )
120  throw cms::Exception("More unassociated OUT hits than the total OUT rpc hits") << std::endl;
121 
122 }
TriggerPrimitiveList _dtAssociatedStubs
dt segments
std::vector< primitiveAssociation > _dtMapAss
structure for internal indexing
TriggerPrimitiveList _rpcOutAssociatedStubs
rpc outer layer hits
double deltaPhi(double phi1, double phi2)
Definition: deltaPhi.h:22
primitiveAssociation _rpcMapUnass
TriggerPrimitiveList _rpcInAssociatedStubs
rpc inner layer hits
DTChamberId L1TwinMux::MBLTCollection::detId ( ) const
inline
const TriggerPrimitiveList& L1TwinMux::MBLTCollection::getDtSegments ( ) const
inline

return a reference to the DT only segments

Definition at line 59 of file MBLTCollection.h.

References _dtAssociatedStubs.

Referenced by L1ITMuonBarrelPrimitiveProducer::produce().

59  {
60  return _dtAssociatedStubs;
61  }
TriggerPrimitiveList _dtAssociatedStubs
dt segments
L1TwinMux::TriggerPrimitiveList L1TwinMux::MBLTCollection::getRpcInAssociatedStubs ( size_t  dtIndex) const

rpc inner layer hits associated to a given dt station

Definition at line 125 of file MBLTCollection.cc.

References MillePedeFileConverter_cfg::e, Exception, and L1TwinMux::MBLTCollection::primitiveAssociation::rpcIn.

Referenced by detId(), and L1ITMuonBarrelPrimitiveProducer::produce().

126 {
127 
129 
130  try {
131  const primitiveAssociation & prim = _dtMapAss.at(dtIndex);
132  std::vector<size_t>::const_iterator it = prim.rpcIn.begin();
133  std::vector<size_t>::const_iterator itend = prim.rpcIn.end();
134 
135  for ( ; it != itend; ++it ) returnList.push_back( _rpcInAssociatedStubs.at( *it ) );
136 
137  } catch ( const std::out_of_range & e ) {
138  throw cms::Exception("DT Chamber Out of Range")
139  << "Requested DT primitive in position " << dtIndex << " out of " << _dtMapAss.size() << " total primitives"
140  << std::endl;
141  }
142 
143  return returnList;
144 
145 }
std::vector< primitiveAssociation > _dtMapAss
TriggerPrimitiveList _rpcInAssociatedStubs
rpc inner layer hits
std::vector< TriggerPrimitiveRef > TriggerPrimitiveList
const TriggerPrimitiveList& L1TwinMux::MBLTCollection::getRpcInner ( ) const
inline

rpc inner layer hits only

Definition at line 64 of file MBLTCollection.h.

References _rpcInAssociatedStubs.

64  {
65  return _rpcInAssociatedStubs;
66  }
TriggerPrimitiveList _rpcInAssociatedStubs
rpc inner layer hits
L1TwinMux::TriggerPrimitiveList L1TwinMux::MBLTCollection::getRpcInUnassociatedStubs ( ) const

rpc inner layer hits associated to a given dt station

Definition at line 174 of file MBLTCollection.cc.

Referenced by detId().

175 {
176 
178  std::vector<size_t>::const_iterator it = _rpcMapUnass.rpcIn.begin();
179  std::vector<size_t>::const_iterator itend = _rpcMapUnass.rpcIn.end();
180 
181  for ( ; it != itend; ++it )
182  returnList.push_back( _rpcInAssociatedStubs.at( *it ) );
183 
184  return returnList;
185 
186 }
primitiveAssociation _rpcMapUnass
TriggerPrimitiveList _rpcInAssociatedStubs
rpc inner layer hits
std::vector< TriggerPrimitiveRef > TriggerPrimitiveList
L1TwinMux::TriggerPrimitiveList L1TwinMux::MBLTCollection::getRpcOutAssociatedStubs ( size_t  dtIndex) const

rpc outer layer hits associated to a given dt station

Definition at line 148 of file MBLTCollection.cc.

References MillePedeFileConverter_cfg::e, Exception, and L1TwinMux::MBLTCollection::primitiveAssociation::rpcOut.

Referenced by detId(), and L1ITMuonBarrelPrimitiveProducer::produce().

149 {
150 
152 
153  try {
154  const primitiveAssociation & prim = _dtMapAss.at(dtIndex);
155 
156  std::vector<size_t>::const_iterator it = prim.rpcOut.begin();
157  std::vector<size_t>::const_iterator itend = prim.rpcOut.end();
158 
159  for ( ; it != itend; ++it ) returnList.push_back( _rpcOutAssociatedStubs.at( *it ) );
160  } catch ( const std::out_of_range & e ) {
161  throw cms::Exception("DT Chamber Out of Range")
162  << "The number of dt primitives in sector are " << _dtMapAss.size()
163  << std::endl;
164  }
165 
166  return returnList;
167 
168 }
std::vector< primitiveAssociation > _dtMapAss
TriggerPrimitiveList _rpcOutAssociatedStubs
rpc outer layer hits
std::vector< TriggerPrimitiveRef > TriggerPrimitiveList
const TriggerPrimitiveList& L1TwinMux::MBLTCollection::getRpcOuter ( ) const
inline

rpc outer layer hits only

Definition at line 69 of file MBLTCollection.h.

References _rpcOutAssociatedStubs.

69  {
71  }
TriggerPrimitiveList _rpcOutAssociatedStubs
rpc outer layer hits
L1TwinMux::TriggerPrimitiveList L1TwinMux::MBLTCollection::getRpcOutUnassociatedStubs ( ) const

rpc outer layer hits associated to a given dt station

Definition at line 190 of file MBLTCollection.cc.

Referenced by detId().

191 {
192 
194  std::vector<size_t>::const_iterator it = _rpcMapUnass.rpcOut.begin();
195  std::vector<size_t>::const_iterator itend = _rpcMapUnass.rpcOut.end();
196 
197  for ( ; it != itend; ++it )
198  returnList.push_back( _rpcOutAssociatedStubs.at( *it ) );
199 
200  return returnList;
201 
202 }
TriggerPrimitiveList _rpcOutAssociatedStubs
rpc outer layer hits
primitiveAssociation _rpcMapUnass
std::vector< TriggerPrimitiveRef > TriggerPrimitiveList
std::vector< std::pair< L1TwinMux::TriggerPrimitiveList, L1TwinMux::TriggerPrimitiveList > > L1TwinMux::MBLTCollection::getUnassociatedRpcClusters ( double  minRpcPhi) const

RPC unassociated clusters.

loop over unassociated inner and outer RPC hits

Definition at line 408 of file MBLTCollection.cc.

References gather_cfg::cout, MillePedeFileConverter_cfg::e, Exception, recoMuon::in, and MillePedeFileConverter_cfg::out.

Referenced by detId(), and L1ITMuonBarrelPrimitiveProducer::produce().

409 {
410 
412 
413  std::vector< std::pair< L1TwinMux::TriggerPrimitiveList, L1TwinMux::TriggerPrimitiveList > > associated;
414 
415  if ( _rpcMapUnass.rpcIn.empty() && _rpcMapUnass.rpcOut.empty())
416  return associated;
419 
420  std::vector< std::vector <size_t> > inClusters;
421  try {
423  minRpcPhi, inClusters );
424  } catch ( const std::out_of_range & e ) {
425  std::cout << " getUnassociatedRpcClusters " << e.what() << std::endl;
426  throw cms::Exception("RPC HIT Out of Range")<< std::endl;
427  }
428 
429  size_t rpcInClusterSize = inClusters.size();
430  std::vector< std::vector <size_t> > outClusters;
431  try {
433  minRpcPhi, outClusters );
434  } catch ( const std::out_of_range & e ) {
435  std::cout << " getUnassociatedRpcClusters " << e.what() << std::endl;
436  throw cms::Exception("RPC HIT Out of Range")<< std::endl;
437  }
438 
439  size_t rpcOutClusterSize = outClusters.size();
441 
442  std::vector<bool> spareInMap( rpcInClusterSize, true );
443  std::vector<bool> spareOutMap( rpcOutClusterSize, true );
444 
445  for ( size_t in = 0; in < rpcInClusterSize; ++in ) {
446  for ( size_t out = 0; out < rpcOutClusterSize; ++out ) {
447  if ( areCloseClusters( inClusters.at(in),
448  outClusters.at(out),
451  minRpcPhi ) ) {
452 
454  std::vector<size_t>::const_iterator itIn = inClusters.at(in).begin();
455  std::vector<size_t>::const_iterator itInEnd = inClusters.at(in).end();
456  for ( ; itIn != itInEnd; ++itIn )
457  primIn.push_back( _rpcInAssociatedStubs.at(*itIn) );
458 
460  std::vector<size_t>::const_iterator itOut = outClusters.at(out).begin();
461  std::vector<size_t>::const_iterator itOutEnd = outClusters.at(out).end();
462  for ( ; itOut != itOutEnd; ++itOut )
463  primOut.push_back( _rpcOutAssociatedStubs.at(*itOut) );
464 
465  associated.push_back( std::pair< L1TwinMux::TriggerPrimitiveList, L1TwinMux::TriggerPrimitiveList >(primIn, primOut) );
466  spareInMap[in] = false;
467  spareOutMap[out] = false;
468  }
469  }
470  }
471 
472  for ( size_t in = 0; in < rpcInClusterSize; ++in ) {
473  if ( spareInMap[in] ) {
474 
476  std::vector<size_t>::const_iterator itIn = inClusters.at(in).begin();
477  std::vector<size_t>::const_iterator itInEnd = inClusters.at(in).end();
478  for ( ; itIn != itInEnd; ++itIn )
479  primIn.push_back( _rpcInAssociatedStubs.at(*itIn) );
480 
482  associated.push_back( std::pair< L1TwinMux::TriggerPrimitiveList, L1TwinMux::TriggerPrimitiveList >(primIn, primOut) );
483  }
484  }
485 
486  for ( size_t out = 0; out < rpcOutClusterSize; ++out ) {
487  if ( spareOutMap[out] ) {
488 
489 
492  std::vector<size_t>::const_iterator itOut = outClusters.at(out).begin();
493  std::vector<size_t>::const_iterator itOutEnd = outClusters.at(out).end();
494  for ( ; itOut != itOutEnd; ++itOut )
495  primOut.push_back( _rpcOutAssociatedStubs.at(*itOut) );
496 
497  associated.push_back( std::pair< L1TwinMux::TriggerPrimitiveList, L1TwinMux::TriggerPrimitiveList >(primIn, primOut) );
498  }
499  }
500 
501 
502  return associated;
503 
504 }
std::vector< std::pair< TriggerPrimitiveList, TriggerPrimitiveList > > getUnassociatedRpcClusters(double minRpcPhi) const
RPC unassociated clusters.
bool areCloseClusters(std::vector< size_t > &cluster1, std::vector< size_t > &cluster2, const TriggerPrimitiveList &rpcList1, const TriggerPrimitiveList &rpcList2, double minRpcPhi) const
TriggerPrimitiveList _rpcOutAssociatedStubs
rpc outer layer hits
primitiveAssociation _rpcMapUnass
TriggerPrimitiveList _rpcInAssociatedStubs
rpc inner layer hits
std::vector< TriggerPrimitiveRef > TriggerPrimitiveList
void L1TwinMux::MBLTCollection::getUnassociatedRpcClusters ( const std::vector< size_t > &  rpcUnass,
const TriggerPrimitiveList rpcList,
double  minRpcPhi,
std::vector< std::vector< size_t > > &  clusters 
) const
private

RPC unassociated utility functions.

remember: we are running over an array of indices

remember: we are running over an array of indices

Definition at line 356 of file MBLTCollection.cc.

References fastPrimaryVertexProducer_cfi::clusters, reco::deltaPhi(), and electronIdCutBased_cfi::deltaPhiIn.

360 {
361 
362  if ( rpcUnass.empty() ) return;
363 
364  size_t rpcSizeU = rpcUnass.size();
365  std::vector<bool> pickUpMap( rpcSizeU, true );
366 
367  for ( size_t idx1 = 0; idx1 < rpcSizeU; ++idx1 ) {
368 
369  if ( pickUpMap.at(idx1) ) {
370 
372  size_t uidx1 = rpcUnass.at(idx1);
373 
374  std::vector<size_t> subCluster = { uidx1 };
375  double phi1 = rpcList.at( uidx1 )->getCMSGlobalPhi();
376 
377  for ( size_t idx2 = idx1+1; idx2 < rpcSizeU; ++idx2 ) {
378 
379  if ( pickUpMap.at(idx2) ) {
380 
382  size_t uidx2 = rpcUnass.at(idx2);
383 
384  double phi2 = rpcList.at( uidx2 )->getCMSGlobalPhi();
385  double deltaPhiIn = fabs( reco::deltaPhi( phi1, phi2 ) );
386  if ( deltaPhiIn < minRpcPhi ) {
387  subCluster.push_back( uidx2 );
388  pickUpMap[idx2] = false;
389  }
390  }
391  }
392  clusters.push_back( subCluster );
393  }
394  }
395 
396  size_t reduced = 0;
397  do {
398  reduced = reduceRpcClusters( clusters, rpcList, minRpcPhi );
399  } while ( reduced );
400 
401 }
size_t reduceRpcClusters(std::vector< std::vector< size_t > > &tmpClusters, const TriggerPrimitiveList &rpcList, double minRpcPhi) const
double deltaPhi(double phi1, double phi2)
Definition: deltaPhi.h:22
L1TwinMux::MBLTCollection::bxMatch L1TwinMux::MBLTCollection::haveCommonRpc ( size_t  dt1,
size_t  dt2 
) const

Definition at line 207 of file MBLTCollection.cc.

References MillePedeFileConverter_cfg::e, Exception, NOMATCH, L1TwinMux::MBLTCollection::primitiveAssociation::rpcIn, and L1TwinMux::MBLTCollection::primitiveAssociation::rpcOut.

Referenced by detId(), and L1ITMuonBarrelPrimitiveProducer::produce().

208 {
209 
211 
212  if ( dt1 == dt2 ) {
213  throw cms::Exception("DT primitive compared to itself")
214  << "The two id passed refer to the same primitive"
215  << std::endl;
216  }
217 
218  try {
219  const primitiveAssociation & prim1 = _dtMapAss.at(dt1);
220  const primitiveAssociation & prim2 = _dtMapAss.at(dt2);
221 
222 // bool in_match = false;
223 // bool out_match = false;
224 
225 // size_t rpcInSize1 = prim1.rpcIn.size();
226 // size_t rpcInSize2 = prim2.rpcIn.size();
227 // for ( size_t i = 0; i < rpcInSize1; ++i )
228 // for ( size_t j = 0; j < rpcInSize2; ++j )
229 // if ( prim1.rpcIn[i] == prim1.rpcIn[j] ) {
230 // in_match = true;
231 // i = rpcInSize1;
232 // break;
233 // }
234 
235 // size_t rpcOutSize1 = prim1.rpcOut.size();
236 // size_t rpcOutSize2 = prim2.rpcOut.size();
237 // for ( size_t i = 0; i < rpcOutSize1; ++i )
238 // for ( size_t j = 0; j < rpcOutSize2; ++j )
239 // if ( prim1.rpcOut[i] == prim1.rpcOut[j] ) {
240 // out_match = true;
241 // i = rpcOutSize1;
242 // break;
243 // }
244 // if ( in_match && out_match ) return FULLMATCH;
245 // else if ( in_match ) return INMATCH;
246 // else if ( out_match ) return OUTMATCH;
247 // return NOMATCH;
248 
249 
250  if ( !prim1.rpcIn.empty() && !prim2.rpcIn.empty() ) {
251  if ( prim1.rpcIn.front() == prim2.rpcIn.front() ) {
252  ret_val = INMATCH;
253  }
254  }
255 
256  if ( !prim1.rpcOut.empty() && !prim2.rpcOut.empty() ) {
257  if ( prim1.rpcOut.front() == prim2.rpcOut.front() ) {
258  ret_val = ( ret_val == INMATCH ) ? FULLMATCH : OUTMATCH;
259  }
260  }
261  return ret_val;
262 
263  } catch ( const std::out_of_range & e ) {
264  throw cms::Exception("DT Chamber Out of Range")
265  << "The number of dt primitives in sector are " << _dtMapAss.size()
266  << std::endl;
267  }
268 
269  return ret_val;
270 
271 }
std::vector< primitiveAssociation > _dtMapAss
size_t L1TwinMux::MBLTCollection::reduceRpcClusters ( std::vector< std::vector< size_t > > &  tmpClusters,
const TriggerPrimitiveList rpcList,
double  minRpcPhi 
) const
private

Definition at line 310 of file MBLTCollection.cc.

References fastPrimaryVertexProducer_cfi::clusters.

Referenced by detId().

313 {
314 
315  size_t clusterSize = clusters.size();
316  if ( clusterSize < 2 ) return 0;
317 
318  std::vector<bool> pickUpClusterMap( clusterSize, true );
319 
320  size_t reduced = 0;
321  for ( size_t cidx1 = 0; cidx1 < clusterSize; ++cidx1 ) {
322 
323  if ( pickUpClusterMap.at(cidx1) ) {
324  for ( size_t cidx2 = cidx1+1; cidx2 < clusterSize; ++cidx2 ) {
325  if ( pickUpClusterMap.at(cidx2) &&
326  areCloseClusters( clusters.at(cidx1), clusters.at(cidx2),
327  rpcList, rpcList, minRpcPhi ) ) {
328 
329  clusters.at(cidx1).insert( clusters.at(cidx1).end(),
330  clusters.at(cidx2).begin(),
331  clusters.at(cidx2).end() );
332  pickUpClusterMap[cidx2] = false;
333  ++reduced;
334  }
335  }
336  }
337  }
338 
339  if ( reduced ) {
340  // std::cout << "### Reduce..." << std::endl; CB commented out, is it really needed?
341  std::vector< std::vector <size_t> > tmpClusters;
342  for ( size_t cidx = 0; cidx < clusterSize; ++cidx ) {
343  if ( pickUpClusterMap.at(cidx) ) {
344  tmpClusters.push_back( clusters.at(cidx) );
345  }
346  }
347  clusters = tmpClusters;
348  }
349 
350  return reduced;
351 }
bool areCloseClusters(std::vector< size_t > &cluster1, std::vector< size_t > &cluster2, const TriggerPrimitiveList &rpcList1, const TriggerPrimitiveList &rpcList2, double minRpcPhi) const
int L1TwinMux::MBLTCollection::sector ( void  ) const
inline

returns sector

Definition at line 77 of file MBLTCollection.h.

References _sector.

Referenced by geometryXMLparser.DTAlignable::index(), and L1ITMuonBarrelPrimitiveProducer::produce().

77 { return _sector; }
int L1TwinMux::MBLTCollection::station ( ) const
inline
int L1TwinMux::MBLTCollection::wheel ( ) const
inline

returns wheel

Definition at line 74 of file MBLTCollection.h.

References _wheel.

Referenced by geometryXMLparser.DTAlignable::index(), and L1ITMuonBarrelPrimitiveProducer::produce().

74 { return _wheel; }
int _wheel
space coordinates

Member Data Documentation

TriggerPrimitiveList L1TwinMux::MBLTCollection::_dtAssociatedStubs
private

dt segments

Definition at line 127 of file MBLTCollection.h.

Referenced by getDtSegments().

std::vector< primitiveAssociation > L1TwinMux::MBLTCollection::_dtMapAss
private

Definition at line 139 of file MBLTCollection.h.

TriggerPrimitiveList L1TwinMux::MBLTCollection::_rpcInAssociatedStubs
private

rpc inner layer hits

Definition at line 130 of file MBLTCollection.h.

Referenced by getRpcInner().

primitiveAssociation L1TwinMux::MBLTCollection::_rpcMapUnass
private

Definition at line 141 of file MBLTCollection.h.

TriggerPrimitiveList L1TwinMux::MBLTCollection::_rpcOutAssociatedStubs
private

rpc outer layer hits

Definition at line 133 of file MBLTCollection.h.

Referenced by getRpcOuter().

int L1TwinMux::MBLTCollection::_sector
private

Definition at line 136 of file MBLTCollection.h.

Referenced by detId(), and sector().

int L1TwinMux::MBLTCollection::_station
private

Definition at line 136 of file MBLTCollection.h.

Referenced by detId(), and station().

int L1TwinMux::MBLTCollection::_wheel
private

space coordinates

Definition at line 136 of file MBLTCollection.h.

Referenced by detId(), and wheel().