CMS 3D CMS Logo

DTLowQMatching.cc
Go to the documentation of this file.
1 //-------------------------------------------------
2 //
3 // Class: DTLowQMatching
4 //
5 // DTLowQMatching
6 //
7 //
8 // Author :
9 // G. Flouris U Ioannina Nov. 2016
10 // modifications: GKarathanasis UAthens
11 //--------------------------------------------------
12 #include <iostream>
13 #include <iomanip>
14 #include <iterator>
15 
19 
20 using namespace std;
21 
23  : m_phiDTDigis(inphiDTDigis),
24  m_phiRPCDigis(inphiRPCDigis){
25  // m_phiDTDigis=inphiDTDigis;
26  // m_phiRPCDigis=inphiRPCDigis;
27  };
28 
30  const L1TTwinMuxParamsRcd& tmParamsRcd = c.get<L1TTwinMuxParamsRcd>();
31  tmParamsRcd.get(tmParamsHandle);
32  const L1TTwinMuxParams& tmParams = *tmParamsHandle.product();
33 
35 
36  Matching(0);
37  Matching(1);
38 }
39 
40 void DTLowQMatching::Matching(int track_seg) {
41  L1MuDTChambPhDigi* dtts = nullptr;
42  L1MuDTChambPhDigi* rpcts1 = nullptr;
43  L1MuTMChambPhContainer m_phiRPCDigis_tm;
44  const std::vector<L1MuDTChambPhDigi>* phiChambVector;
45  phiChambVector = m_phiRPCDigis.getContainer();
46  m_phiRPCDigis_tm.setContainer(*phiChambVector);
47 
48  L1MuTMChambPhContainer m_phiDTDigis_tm;
49  const std::vector<L1MuDTChambPhDigi>* phiChambVectorDT;
50  phiChambVectorDT = m_phiDTDigis->getContainer();
51  m_phiDTDigis_tm.setContainer(*phiChambVectorDT);
52 
53  int bx = 0, wheel = 0, sector = 0, station = 1;
54  //cout<<"LowQ Matching "<<track_seg<<endl;
55  for (wheel = -2; wheel <= 2; wheel++) {
56  for (sector = 0; sector < 12; sector++) {
57  for (station = 1; station <= 4; station++) {
58  for (bx = -3; bx <= 3; bx++) {
59  int matched = 0;
60  for (int rpcbx = bx - 1; rpcbx <= bx + 1; rpcbx++) {
61  dtts = nullptr;
62  rpcts1 = nullptr;
63  dtts = m_phiDTDigis_tm.chPhiSegm(wheel, station, sector, bx, track_seg);
64  if (!dtts || dtts->code() >= 2)
65  continue;
66  int nhits = 0;
67  nhits = DTRPCBxCorrection::nRPCHits(m_phiRPCDigis, rpcbx, wheel, sector, station);
68  for (int hit = 0; hit < nhits; hit++) {
69  rpcts1 = m_phiRPCDigis_tm.chPhiSegm(wheel, station, sector, rpcbx, hit);
70  //If DT primitives with q<2 match with rpc hits do nothing else
71  //'remove' the primitive by setting is quality to 7
72  if (rpcts1 && DTRPCBxCorrection::deltaPhi(dtts->phi(), rpcts1->phi()) < m_DphiWindow) {
73  matched++;
74  continue;
75  }
76  }
77  } //end of rpc bx
78  if (matched == 0 && dtts && dtts->code() < 2) { //dtts->setCode(7);
79  // int bx=dtts->bxNum(); cout<<bx<<endl;
80  L1MuDTChambPhDigi dtts2(dtts->bxNum(),
81  dtts->whNum(),
82  dtts->scNum(),
83  dtts->stNum(),
84  dtts->phi(),
85  dtts->phiB(),
86  7,
87  dtts->Ts2Tag(),
88  dtts->BxCnt(),
89  dtts->RpcBit());
90  *dtts = dtts2;
91  }
92  } //end of dt bx
93  } //end of station
94  } //end of sc
95  } //end of wheel
96 }
void run(const edm::EventSetup &c)
L1MuDTChambPhDigi * chPhiSegm(int wheel, int stat, int sect, int bx, int ts2tag)
int get_DphiWindowBxShift() const
void setContainer(const Phi_Container &inputSegments)
void Matching(int track_seg)
PRODUCT const & get(ESGetToken< PRODUCT, T > const &iToken) const
DTLowQMatching(L1MuDTChambPhContainer const *, L1MuDTChambPhContainer const &)
static int deltaPhi(int dt_phi, int rpc_strip)
static int nRPCHits(L1MuTMChambPhContainer inCon, int bx, int wh, int sec, int st)
Phi_Container const * getContainer() const
L1MuDTChambPhContainer const * m_phiDTDigis
T get() const
Definition: EventSetup.h:73
L1MuDTChambPhContainer const & m_phiRPCDigis
edm::ESHandle< L1TTwinMuxParams > tmParamsHandle
T const * product() const
Definition: ESHandle.h:86