CMS 3D CMS Logo

List of all members | Public 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 L1TTwinMuxParams &, const RPCGeometry &)
 
 ~L1TTwinMuxAlgorithm ()
 

Private Attributes

L1MuDTChambPhContainer m_tm_phi_output
 Output PhContainer. More...
 

Detailed Description

Definition at line 27 of file L1TTwinMuxAlgorithm.h.

Constructor & Destructor Documentation

◆ L1TTwinMuxAlgorithm()

L1TTwinMuxAlgorithm::L1TTwinMuxAlgorithm ( )
inline

Definition at line 29 of file L1TTwinMuxAlgorithm.h.

29 {};

◆ ~L1TTwinMuxAlgorithm()

L1TTwinMuxAlgorithm::~L1TTwinMuxAlgorithm ( )
inline

Definition at line 30 of file L1TTwinMuxAlgorithm.h.

30 {};

Member Function Documentation

◆ get_ph_tm_output()

L1MuDTChambPhContainer L1TTwinMuxAlgorithm::get_ph_tm_output ( )
inline

Return Output PhContainer.

Definition at line 39 of file L1TTwinMuxAlgorithm.h.

References m_tm_phi_output.

Referenced by L1TTwinMuxProducer::produce().

39 { return m_tm_phi_output; }
L1MuDTChambPhContainer m_tm_phi_output
Output PhContainer.

◆ run()

void L1TTwinMuxAlgorithm::run ( edm::Handle< L1MuDTChambPhContainer phiDigis,
edm::Handle< L1MuDTChambThContainer thetaDigis,
edm::Handle< RPCDigiCollection rpcDigis,
const L1TTwinMuxParams tmParams,
const RPCGeometry rpcGeometry 
)

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 32 of file L1TTwinMuxAlgorithm.cc.

References simKBmtfDigis_cfi::bx, L1MuDTChambPhDigi::BxCnt(), L1MuDTChambPhDigi::bxNum(), L1MuDTChambPhContainer::chPhiSegm1(), L1MuDTChambPhContainer::chPhiSegm2(), L1MuDTChambPhDigi::code(), gather_cfg::cout, 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(), fakeTwinMuxParams_cff::useLowQDT, verbose, makeMuonMisalignmentScenario::wheel, and L1MuDTChambPhDigi::whNum().

Referenced by L1TTwinMuxProducer::produce().

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

Member Data Documentation

◆ m_tm_phi_output

L1MuDTChambPhContainer L1TTwinMuxAlgorithm::m_tm_phi_output
private

Output PhContainer.

Definition at line 43 of file L1TTwinMuxAlgorithm.h.

Referenced by get_ph_tm_output().