CMS 3D CMS Logo

List of all members | Public Member Functions
IOPrinter Class Reference

#include <IOPrinter.h>

Public Member Functions

 IOPrinter ()
 
void run (edm::Handle< L1MuDTChambPhContainer >, const L1MuDTChambPhContainer &, edm::Handle< RPCDigiCollection >, const RPCGeometry &)
 
void run (L1MuDTChambPhContainer const *, const L1MuDTChambPhContainer &, RPCDigiCollection const *, const RPCGeometry &)
 
 ~IOPrinter ()
 

Detailed Description

Definition at line 27 of file IOPrinter.h.

Constructor & Destructor Documentation

◆ IOPrinter()

IOPrinter::IOPrinter ( )
inline

Definition at line 29 of file IOPrinter.h.

29 {};

◆ ~IOPrinter()

IOPrinter::~IOPrinter ( )
inline

Definition at line 30 of file IOPrinter.h.

30 {};

Member Function Documentation

◆ run() [1/2]

void IOPrinter::run ( edm::Handle< L1MuDTChambPhContainer inphiDigis,
const L1MuDTChambPhContainer outphiDigis,
edm::Handle< RPCDigiCollection rpcDigis,
const RPCGeometry rpcGeometry 
)

Align track segments that are coming in bx-1.

for digicout

for chamber

Definition at line 18 of file IOPrinter.cc.

References simKBmtfDigis_cfi::bx, relativeConstraints::chamber, L1MuDTChambPhContainer::chPhiSegm1(), L1MuDTChambPhContainer::chPhiSegm2(), gather_cfg::cout, RPCDetId::layer(), RPCtoDTTranslator::localX(), RPCtoDTTranslator::radialAngle(), RPCDetId::ring(), RPCDetId::roll(), hgcalTBTopologyTester_cfi::sector, RPCDetId::sector(), relativeConstraints::station, RPCDetId::station(), and makeMuonMisalignmentScenario::wheel.

Referenced by L1TTwinMuxAlgorithm::run().

21  {
22  cout << "======================================================" << endl;
23  int bx = 0, wheel = 0, sector = 0, station = 1;
24 
26  cout << "DT Inputs/RPCDT Inputs" << endl;
27  cout << "bx\twheel\tsector\tstation\tphi\tphib\tcode\tts2tag\tbxcnt\trpcbit" << endl;
28 
29  for (bx = -2; bx <= 2; bx++) {
30  for (wheel = -2; wheel <= 2; wheel++) {
31  for (sector = 0; sector < 12; sector++) {
32  for (station = 1; station <= 4; station++) {
33  auto dtts1 = inphiDigis->chPhiSegm1(wheel, station, sector, bx);
34  auto dtts2 = inphiDigis->chPhiSegm2(wheel, station, sector, bx - 1);
35  if (dtts1 && dtts1->code() != 7) {
36  L1MuDTChambPhDigi dt_ts1 = *dtts1;
37  cout << dtts1->bxNum() << "\t" << dtts1->whNum() << "\t" << dtts1->scNum() << "\t" << dtts1->stNum() << "\t"
38  << dtts1->phi() << "\t" << dtts1->phiB() << "\t" << dtts1->code() << "\t" << dtts1->Ts2Tag() << "\t"
39  << dtts1->BxCnt() << "\t0" << endl;
40  }
41  if (dtts2 && dtts2->code() != 7) {
42  L1MuDTChambPhDigi dt_ts2 = *dtts2;
43  cout << dtts2->bxNum() << "\t" << dtts2->whNum() << "\t" << dtts2->scNum() << "\t" << dtts2->stNum() << "\t"
44  << dtts2->phi() << "\t" << dtts2->phiB() << "\t" << dtts2->code() << "\t" << dtts2->Ts2Tag() << "\t"
45  << dtts2->BxCnt() << "\t0" << endl;
46  }
47  }
48  }
49  }
50  }
51 
52  cout << endl;
53 
54  cout << "RPC Inputs" << endl;
55  cout << "bx\tring\tsector\tstation\troll\tlayer\tstrip\tphi\tlocalX" << endl;
56  //cout<<"RPCHitCleaner"<<endl;
57  for (auto chamber = rpcDigis->begin(); chamber != rpcDigis->end(); ++chamber) {
58  RPCDetId detid = (*chamber).first;
59  for (auto digi = (*chamber).second.first; digi != (*chamber).second.second; ++digi) {
60  RPCDigi digi_out(digi->strip(), digi->bx());
61  //if(digi->bx()!=0) continue;
62  int phi = RPCtoDTTranslator::radialAngle(detid, rpcGeometry, digi->strip()) << 2;
63  float localx = RPCtoDTTranslator::localX(detid, rpcGeometry, digi->strip());
64  cout << digi->bx() << "\t" << detid.ring() << "\t" << detid.sector() - 1 << "\t" << detid.station() << "\t"
65  << detid.roll() << "\t" << detid.layer() << "\t" << digi->strip() << "\t" << phi << "\t" << localx << endl;
66  }
67  }
68  cout << endl;
69 
70  cout << "TwinMux Output" << endl;
71  cout << "bx\twheel\tsector\tstation\tphi\tphib\tcode\tts2tag\tbxcnt\trpcbit" << endl;
72 
73  for (bx = -2; bx <= 2; bx++) {
74  for (wheel = -2; wheel <= 2; wheel++) {
75  for (sector = 0; sector < 12; sector++) {
76  for (station = 1; station <= 4; station++) {
77  auto dtts1 = outphiDigis.chPhiSegm1(wheel, station, sector, bx);
78  auto dtts2 = outphiDigis.chPhiSegm2(wheel, station, sector, bx - 1);
79  if (dtts1 && dtts1->code() != 7) {
80  L1MuDTChambPhDigi dt_ts1 = *dtts1;
81  cout << dtts1->bxNum() << "\t" << dtts1->whNum() << "\t" << dtts1->scNum() << "\t" << dtts1->stNum() << "\t"
82  << dtts1->phi() << "\t" << dtts1->phiB() << "\t" << dtts1->code() << "\t" << dtts1->Ts2Tag() << "\t"
83  << dtts1->BxCnt() << "\t" << dtts1->RpcBit() << endl;
84  }
85  if (dtts2 && dtts2->code() != 7) {
86  L1MuDTChambPhDigi dt_ts2 = *dtts2;
87  cout << dtts2->bxNum() << "\t" << dtts2->whNum() << "\t" << dtts2->scNum() << "\t" << dtts2->stNum() << "\t"
88  << dtts2->phi() << "\t" << dtts2->phiB() << "\t" << dtts2->code() << "\t" << dtts2->Ts2Tag() << "\t"
89  << dtts2->BxCnt() << "\t" << dtts2->RpcBit() << endl;
90  }
91  }
92  }
93  }
94  }
95 
96  cout << "======================================================" << endl;
97 }
int sector() const
Sector id: the group of chambers at same phi (and increasing r)
Definition: RPCDetId.h:81
int ring() const
Definition: RPCDetId.h:59
static int localX(RPCDetId, const RPCGeometry &, int)
function - will be replaced by LUTs(?)
L1MuDTChambPhDigi const * chPhiSegm2(int wheel, int stat, int sect, int bx) const
int roll() const
Definition: RPCDetId.h:92
int station() const
Definition: RPCDetId.h:78
int layer() const
Definition: RPCDetId.h:85
static int radialAngle(RPCDetId, const RPCGeometry &, int)
function - will be replaced by LUTs(?)
L1MuDTChambPhDigi const * chPhiSegm1(int wheel, int stat, int sect, int bx) const

◆ run() [2/2]

void IOPrinter::run ( L1MuDTChambPhContainer const *  inphiDigis,
const L1MuDTChambPhContainer outphiDigis,
RPCDigiCollection const *  rpcDigis,
const RPCGeometry rpcGeometry 
)

Align track segments that are coming in bx-1.

for digicout

for chamber

Definition at line 99 of file IOPrinter.cc.

References simKBmtfDigis_cfi::bx, relativeConstraints::chamber, L1MuTMChambPhContainer::chPhiSegm(), L1MuDTChambPhContainer::chPhiSegm1(), L1MuDTChambPhContainer::chPhiSegm2(), gather_cfg::cout, L1MuDTChambPhContainer::getContainer(), RPCDetId::layer(), RPCtoDTTranslator::localX(), nhits, DTRPCBxCorrection::nRPCHits(), RPCtoDTTranslator::radialAngle(), RPCDetId::ring(), RPCDetId::roll(), hgcalTBTopologyTester_cfi::sector, RPCDetId::sector(), L1MuTMChambPhContainer::setContainer(), relativeConstraints::station, RPCDetId::station(), and makeMuonMisalignmentScenario::wheel.

102  {
103  cout << "======================================================" << endl;
104  int bx = 0, wheel = 0, sector = 0, station = 1;
105  L1MuTMChambPhContainer inphiDigis_tm;
106  const std::vector<L1MuDTChambPhDigi>* vInCon = inphiDigis->getContainer();
107  inphiDigis_tm.setContainer(*vInCon);
108 
110  cout << "RPC->DT Inputs" << endl;
111  cout << "bx\twheel\tsector\tstation\tphi\tphib\tcode\tts2tag\tbxcnt\trpcbit" << endl;
112 
113  for (bx = -2; bx <= 2; bx++) {
114  for (wheel = -2; wheel <= 2; wheel++) {
115  for (sector = 0; sector < 12; sector++) {
116  for (station = 1; station <= 4; station++) {
117  int nhits = DTRPCBxCorrection::nRPCHits(*inphiDigis, bx, wheel, sector, station);
118  for (int hit = 0; hit < nhits; hit++) {
119  auto dtts1 = inphiDigis_tm.chPhiSegm(wheel, station, sector, bx, hit);
120  if (dtts1) {
121  cout << dtts1->bxNum() << "\t" << dtts1->whNum() << "\t" << dtts1->scNum() << "\t" << dtts1->stNum()
122  << "\t" << dtts1->phi() << "\t" << dtts1->phiB() << "\t" << dtts1->code() << "\t" << dtts1->Ts2Tag()
123  << "\t" << dtts1->BxCnt() << "\t0" << endl;
124  }
125  }
126  }
127  }
128  }
129  }
130 
131  cout << endl;
132 
133  cout << "RPC Inputs" << endl;
134  cout << "bx\tring\tsector\tstation\troll\tlayer\tstrip\tphi\tlocalX" << endl;
135  //cout<<"RPCHitCleaner"<<endl;
136  for (auto chamber = rpcDigis->begin(); chamber != rpcDigis->end(); ++chamber) {
137  RPCDetId detid = (*chamber).first;
138  for (auto digi = (*chamber).second.first; digi != (*chamber).second.second; ++digi) {
139  RPCDigi digi_out(digi->strip(), digi->bx());
140  //if(digi->bx()!=0) continue;
141  int phi = RPCtoDTTranslator::radialAngle(detid, rpcGeometry, digi->strip()) << 2;
142  float localx = RPCtoDTTranslator::localX(detid, rpcGeometry, digi->strip());
143  cout << digi->bx() << "\t" << detid.ring() << "\t" << detid.sector() - 1 << "\t" << detid.station() << "\t"
144  << detid.roll() << "\t" << detid.layer() << "\t" << digi->strip() << "\t" << phi << "\t" << localx << endl;
145  }
146  }
147  cout << endl;
148 
149  cout << "TwinMux Output" << endl;
150  cout << "bx\twheel\tsector\tstation\tphi\tphib\tcode\tts2tag\tbxcnt\trpcbit" << endl;
151 
152  for (bx = -2; bx <= 2; bx++) {
153  for (wheel = -2; wheel <= 2; wheel++) {
154  for (sector = 0; sector < 12; sector++) {
155  for (station = 1; station <= 4; station++) {
156  auto dtts1 = outphiDigis.chPhiSegm1(wheel, station, sector, bx);
157  auto dtts2 = outphiDigis.chPhiSegm2(wheel, station, sector, bx - 1);
158  if (dtts1 && dtts1->code() != 7) {
159  L1MuDTChambPhDigi dt_ts1 = *dtts1;
160  cout << dtts1->bxNum() << "\t" << dtts1->whNum() << "\t" << dtts1->scNum() << "\t" << dtts1->stNum() << "\t"
161  << dtts1->phi() << "\t" << dtts1->phiB() << "\t" << dtts1->code() << "\t" << dtts1->Ts2Tag() << "\t"
162  << dtts1->BxCnt() << "\t" << dtts1->RpcBit() << endl;
163  }
164  if (dtts2 && dtts2->code() != 7) {
165  L1MuDTChambPhDigi dt_ts2 = *dtts2;
166  cout << dtts2->bxNum() << "\t" << dtts2->whNum() << "\t" << dtts2->scNum() << "\t" << dtts2->stNum() << "\t"
167  << dtts2->phi() << "\t" << dtts2->phiB() << "\t" << dtts2->code() << "\t" << dtts2->Ts2Tag() << "\t"
168  << dtts2->BxCnt() << "\t" << dtts2->RpcBit() << endl;
169  }
170  }
171  }
172  }
173  }
174 
175  cout << "======================================================" << endl;
176 }
int sector() const
Sector id: the group of chambers at same phi (and increasing r)
Definition: RPCDetId.h:81
L1MuDTChambPhDigi * chPhiSegm(int wheel, int stat, int sect, int bx, int ts2tag)
void setContainer(const Phi_Container &inputSegments)
int ring() const
Definition: RPCDetId.h:59
static int localX(RPCDetId, const RPCGeometry &, int)
function - will be replaced by LUTs(?)
L1MuDTChambPhDigi const * chPhiSegm2(int wheel, int stat, int sect, int bx) const
int roll() const
Definition: RPCDetId.h:92
static int nRPCHits(L1MuTMChambPhContainer inCon, int bx, int wh, int sec, int st)
int station() const
Definition: RPCDetId.h:78
int layer() const
Definition: RPCDetId.h:85
Phi_Container const * getContainer() const
static int radialAngle(RPCDetId, const RPCGeometry &, int)
function - will be replaced by LUTs(?)
L1MuDTChambPhDigi const * chPhiSegm1(int wheel, int stat, int sect, int bx) const