CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
L1TTwinMuxAlgorithm Class Reference

#include <L1TTwinMuxAlgorithm.h>

Public Member Functions

L1MuDTChambPhContainer get_ph_tm_output ()
 Return Output PhContainer. More...
 
 L1TTwinMuxAlgorithm ()
 
void run (edm::Handle< L1MuDTChambPhContainer > phiDigis, edm::Handle< L1MuDTChambThContainer > thetaDigis, edm::Handle< RPCDigiCollection > rpcDigis, const edm::EventSetup &c)
 
 ~L1TTwinMuxAlgorithm ()
 

Private Member Functions

int radialAngle (RPCDetId, const edm::EventSetup &, int)
 

Private Attributes

L1MuDTChambPhContainer m_tm_phi_output
 Output PhContainer. More...
 
edm::ESHandle< L1TTwinMuxParamstmParamsHandle
 Event Setup Handler. More...
 

Detailed Description

Definition at line 33 of file L1TTwinMuxAlgorithm.h.

Constructor & Destructor Documentation

L1TTwinMuxAlgorithm::L1TTwinMuxAlgorithm ( )
inline

Definition at line 35 of file L1TTwinMuxAlgorithm.h.

35 {};
L1TTwinMuxAlgorithm::~L1TTwinMuxAlgorithm ( )
inline

Definition at line 36 of file L1TTwinMuxAlgorithm.h.

References EnergyCorrector::c, and run().

36 {};

Member Function Documentation

L1MuDTChambPhContainer L1TTwinMuxAlgorithm::get_ph_tm_output ( )
inline

Return Output PhContainer.

Definition at line 44 of file L1TTwinMuxAlgorithm.h.

References m_tm_phi_output, and radialAngle().

44 { return m_tm_phi_output;}
L1MuDTChambPhContainer m_tm_phi_output
Output PhContainer.
int L1TTwinMuxAlgorithm::radialAngle ( RPCDetId  ,
const edm::EventSetup ,
int   
)
private

Referenced by get_ph_tm_output().

void L1TTwinMuxAlgorithm::run ( edm::Handle< L1MuDTChambPhContainer phiDigis,
edm::Handle< L1MuDTChambThContainer thetaDigis,
edm::Handle< RPCDigiCollection rpcDigis,
const edm::EventSetup c 
)

ES Parameters

Align track segments that are coming in bx-1.

Clean RPC hits

Translate RPC digis to DT primitives.

Match low q DT primitives with RPC hits in dphiWindow

Correct(in bx) DT primitives by comparing them to RPC.

Add RPC primitives in case that there are no DT primitives.

Definition at line 33 of file L1TTwinMuxAlgorithm.cc.

References L1MuDTChambPhDigi::BxCnt(), L1MuDTChambPhDigi::bxNum(), L1MuDTChambPhContainer::chPhiSegm1(), L1MuDTChambPhContainer::chPhiSegm2(), L1MuDTChambPhDigi::code(), gather_cfg::cout, edm::EventSetup::get(), edm::eventsetup::EventSetupRecord::get(), L1TTwinMuxParams::get_CorrectDTBxwRPC(), L1TTwinMuxParams::get_UseLowQDT(), L1TTwinMuxParams::get_UseOnlyDT(), L1TTwinMuxParams::get_UseOnlyRPC(), L1TTwinMuxParams::get_Verbose(), L1MuDTChambPhDigi::phi(), L1MuDTChambPhDigi::phiB(), IOPrinter::run(), L1MuDTChambPhDigi::scNum(), relativeConstraints::station, L1MuDTChambPhDigi::stNum(), L1MuDTChambPhDigi::Ts2Tag(), makeMuonMisalignmentScenario::wheel, and L1MuDTChambPhDigi::whNum().

Referenced by ~L1TTwinMuxAlgorithm().

34  {
35 
36 
38  const L1TTwinMuxParamsRcd& tmParamsRcd = c.get<L1TTwinMuxParamsRcd>();
39  tmParamsRcd.get(tmParamsHandle);
40  const L1TTwinMuxParams& tmParams = *tmParamsHandle.product();
41  bool onlyRPC = tmParams.get_UseOnlyRPC();
42  bool onlyDT = tmParams.get_UseOnlyDT();
43  bool useLowQDT = tmParams.get_UseLowQDT();
44  bool correctBX = tmParams.get_CorrectDTBxwRPC();
45  bool verbose = tmParams.get_Verbose();
46 
47 
48 
50  AlignTrackSegments alignedDTs{*inphiDigis};
51  alignedDTs.run(c);
52  L1MuDTChambPhContainer const& phiDigis = alignedDTs.getDTContainer();
53  //if only DTs are required without bx correction
54  //return the aligned track segments
55  if(onlyDT && !correctBX && !useLowQDT) {
56  m_tm_phi_output = phiDigis;
57  return;
58  }
60  RPCHitCleaner rpcHitCl{*rpcDigis};
61  rpcHitCl.run(c);
62  RPCDigiCollection const& rpcDigisCleaned = rpcHitCl.getRPCCollection();
63 
65  RPCtoDTTranslator dt_from_rpc{rpcDigisCleaned};
66  dt_from_rpc.run(c);
67  L1MuDTChambPhContainer const& rpcPhiDigis = dt_from_rpc.getDTContainer(); //Primitves used for RPC->DT (only station 1 and 2)
68  L1MuDTChambPhContainer const& rpcHitsPhiDigis = dt_from_rpc.getDTRPCHitsContainer(); //Primitves used for bx correction
69 
71  DTLowQMatching dtlowq{&phiDigis, rpcHitsPhiDigis};
72  dtlowq.run(c);
73 
74  if(onlyDT && !correctBX && useLowQDT) {
75  m_tm_phi_output = phiDigis;
76  if(verbose){
77  IOPrinter ioPrinter;
78  cout<<"======DT========"<<endl;
79  ioPrinter.run(inphiDigis, m_tm_phi_output, rpcDigis, c);
80  cout<<"======RPC========"<<endl;
81  ioPrinter.run(&rpcHitsPhiDigis, m_tm_phi_output, &rpcDigisCleaned, c);
82  cout<<"+++++++++++++++++++++++++++++++++++++++++++++++++"<<endl;
83  }
84 
85  return;
86  }
87 
88 
90 // DTRPCBxCorrection *rpc_dt_bx = new DTRPCBxCorrection(phiDigis,rpcHitsPhiDigis);
91  DTRPCBxCorrection rpc_dt_bx{phiDigis,rpcHitsPhiDigis};
92  rpc_dt_bx.run(c);
93 
94  L1MuDTChambPhContainer const& phiDigiscp = rpc_dt_bx.getDTContainer();
95 
97  std::vector<L1MuDTChambPhDigi> l1ttma_out;
98 
99  int bx=0, wheel=0, sector=0, station=1;
100 
101  for(bx=-3; bx<=3; bx++){
102  for (wheel=-2;wheel<=2; wheel++ ){
103  for (sector=0;sector<12; sector++ ){
104  for (station=1; station<=4; station++){
105 
106  L1MuDTChambPhDigi const* dtts1 = phiDigiscp.chPhiSegm1(wheel,station,sector,bx);
107  L1MuDTChambPhDigi const* dtts2 = phiDigiscp.chPhiSegm2(wheel,station,sector,bx);
108  L1MuDTChambPhDigi const* rpcts1 = rpcPhiDigis.chPhiSegm1(wheel,station,sector,bx);
109 
110  if(!onlyRPC) {
111  if(!dtts1 && !dtts2 && !rpcts1) continue;
112  if(dtts1 && dtts1->code()!=7) {
113  l1ttma_out.push_back(*dtts1);
114  }
115  if(dtts2 && dtts2->code()!=7) {
116  l1ttma_out.push_back(*dtts2);
117  }
118  if(!onlyDT){
119  if(!dtts1 && !dtts2 && rpcts1 && station<=2 ) {
120  l1ttma_out.emplace_back(rpcts1->bxNum() , rpcts1->whNum(), rpcts1->scNum(), rpcts1->stNum(),rpcts1->phi(), rpcts1->phiB(), rpcts1->code(), rpcts1->Ts2Tag(), rpcts1->BxCnt(),2);
121  }
122  }
123  }
124 
125  else if(onlyRPC){
126  if( rpcts1 && station<=2 ) {
127  l1ttma_out.emplace_back(rpcts1->bxNum() , rpcts1->whNum(), rpcts1->scNum(), rpcts1->stNum(),rpcts1->phi(), rpcts1->phiB(), rpcts1->code(), rpcts1->Ts2Tag(), rpcts1->BxCnt(),2);
128  }
129  }
130 
131  }
132  }
133  }
134  }
135 
136 m_tm_phi_output.setContainer(l1ttma_out);
137 
138  if(verbose){
139  IOPrinter ioPrinter;
140  cout<<"======DT========"<<endl;
141  ioPrinter.run(inphiDigis, m_tm_phi_output, rpcDigis, c);
142  cout<<"======RPC========"<<endl;
143  ioPrinter.run(&rpcHitsPhiDigis, m_tm_phi_output, &rpcDigisCleaned, c);
144  cout<<"+++++++++++++++++++++++++++++++++++++++++++++++++"<<endl;
145  }
146 
147 }
int get_Verbose() const
L1MuDTChambPhDigi const * chPhiSegm1(int wheel, int stat, int sect, int bx) const
L1MuDTChambPhDigi const * chPhiSegm2(int wheel, int stat, int sect, int bx) const
void run(const edm::EventSetup &c)
void run(edm::Handle< L1MuDTChambPhContainer >, const L1MuDTChambPhContainer &, edm::Handle< RPCDigiCollection >, const edm::EventSetup &)
Definition: IOPrinter.cc:17
L1MuDTChambPhContainer m_tm_phi_output
Output PhContainer.
edm::ESHandle< L1TTwinMuxParams > tmParamsHandle
Event Setup Handler.
void get(HolderT &iHolder) const
int get_UseLowQDT() const
int get_UseOnlyDT() const
void setContainer(const Phi_Container &inputSegments)
T get() const
Definition: EventSetup.h:63
int get_UseOnlyRPC() const
int get_CorrectDTBxwRPC() const
T const * product() const
Definition: ESHandle.h:86

Member Data Documentation

L1MuDTChambPhContainer L1TTwinMuxAlgorithm::m_tm_phi_output
private

Output PhContainer.

Definition at line 49 of file L1TTwinMuxAlgorithm.h.

Referenced by get_ph_tm_output().

edm::ESHandle< L1TTwinMuxParams > L1TTwinMuxAlgorithm::tmParamsHandle
private

Event Setup Handler.

Definition at line 52 of file L1TTwinMuxAlgorithm.h.