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 
22 DTLowQMatching::DTLowQMatching(L1MuDTChambPhContainer* inphiDTDigis, L1MuDTChambPhContainer inphiRPCDigis): m_phiDTDigis(inphiDTDigis),m_phiRPCDigis(inphiRPCDigis) {
23 // m_phiDTDigis=inphiDTDigis;
24 // m_phiRPCDigis=inphiRPCDigis;
25 };
26 
27 
29 
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 
42  L1MuDTChambPhDigi * dtts=nullptr;
43  L1MuDTChambPhDigi * rpcts1=nullptr;
44  auto m_phiRPCDigis_tm=std::make_shared<L1MuTMChambPhContainer>();
45  const std::vector<L1MuDTChambPhDigi> *phiChambVector;
46  phiChambVector=m_phiRPCDigis.getContainer();
47  m_phiRPCDigis_tm->setContainer(*phiChambVector );
48 
49  auto m_phiDTDigis_tm=std::make_shared<L1MuTMChambPhContainer>();
50  const std::vector<L1MuDTChambPhDigi> *phiChambVectorDT;
51  phiChambVectorDT=m_phiDTDigis->getContainer();
52  m_phiDTDigis_tm->setContainer(*phiChambVectorDT );
53 
54  int bx=0, wheel=0, sector=0, station=1;
55  //cout<<"LowQ Matching "<<track_seg<<endl;
56  for (wheel=-2;wheel<=2; wheel++ ){
57  for (sector=0;sector<12; sector++ ){
58  for (station=1; station<=4; station++){
59  for(bx=-3; bx<=3; bx++){
60  int matched = 0;
61  for(int rpcbx=bx-1; rpcbx<=bx+1; rpcbx++){
62  dtts=nullptr; rpcts1=nullptr;
63  dtts = m_phiDTDigis_tm->chPhiSegm(wheel,station,sector,bx ,track_seg);
64  if(!dtts || dtts->code()>=2) continue;
65  int nhits = 0;
66  nhits = DTRPCBxCorrection::nRPCHits(m_phiRPCDigis, rpcbx, wheel, sector, station);
67  for(int hit=0; hit<nhits; hit++){
68  rpcts1 = m_phiRPCDigis_tm->chPhiSegm(wheel, station, sector, rpcbx,hit);
69  //If DT primitives with q<2 match with rpc hits do nothing else
70  //'remove' the primitive by setting is quality to 7
71  if(rpcts1 && DTRPCBxCorrection::deltaPhi(dtts->phi(),rpcts1->phi()) < m_DphiWindow) {
72  matched++;
73  continue;}
74  }
75  }//end of rpc bx
76  if(matched == 0 && dtts && dtts->code()<2) {//dtts->setCode(7);
77  // int bx=dtts->bxNum(); cout<<bx<<endl;
78  L1MuDTChambPhDigi dtts2(dtts->bxNum(),dtts->whNum(),dtts->scNum(),dtts->stNum(),dtts->phi(),dtts->phiB(),7,dtts->Ts2Tag(),dtts->BxCnt(),dtts->RpcBit());
79  *dtts=dtts2;
80  }
81  }//end of dt bx
82  }//end of station
83  }//end of sc
84  }//end of wheel
85 }
L1MuDTChambPhContainer m_phiRPCDigis
void run(const edm::EventSetup &c)
int get_DphiWindowBxShift() const
edm::ESHandle< L1TTwinMuxParams > tmParamsHandle
DTLowQMatching(L1MuDTChambPhContainer *, L1MuDTChambPhContainer)
void Matching(int track_seg)
void get(HolderT &iHolder) const
L1MuDTChambPhContainer * m_phiDTDigis
static int deltaPhi(int dt_phi, int rpc_strip)
const T & get() const
Definition: EventSetup.h:55
static int nRPCHits(L1MuTMChambPhContainer inCon, int bx, int wh, int sec, int st)
Phi_Container const * getContainer() const
T const * product() const
Definition: ESHandle.h:86