CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
IOPrinter.cc
Go to the documentation of this file.
1 //-------------------------------------------------
2 //
3 // Class: IOPrinter
4 //
5 // IOPrinter
6 //
7 //
8 // Author :
9 // G. Flouris U Ioannina Feb. 2015
10 // modifications: G Karathanasis U Athens
11 //--------------------------------------------------
15 
16 using namespace std;
17 
19  const L1MuDTChambPhContainer& outphiDigis,
21  const RPCGeometry& rpcGeometry) {
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 }
98 
99 void IOPrinter::run(L1MuDTChambPhContainer const* inphiDigis,
100  const L1MuDTChambPhContainer& outphiDigis,
101  RPCDigiCollection const* rpcDigis,
102  const RPCGeometry& rpcGeometry) {
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 }
L1MuDTChambPhDigi * chPhiSegm(int wheel, int stat, int sect, int bx, int ts2tag)
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 setContainer(const Phi_Container &inputSegments)
void run(edm::Handle< L1MuDTChambPhContainer >, const L1MuDTChambPhContainer &, edm::Handle< RPCDigiCollection >, const RPCGeometry &)
Definition: IOPrinter.cc:18
static int localX(RPCDetId, const RPCGeometry &, int)
function - will be replaced by LUTs(?)
int roll() const
Definition: RPCDetId.h:92
int ring() const
Definition: RPCDetId.h:59
int layer() const
Definition: RPCDetId.h:85
static int nRPCHits(L1MuTMChambPhContainer inCon, int bx, int wh, int sec, int st)
Phi_Container const * getContainer() const
int sector() const
Sector id: the group of chambers at same phi (and increasing r)
Definition: RPCDetId.h:81
tuple cout
Definition: gather_cfg.py:144
static int radialAngle(RPCDetId, const RPCGeometry &, int)
function - will be replaced by LUTs(?)
int station() const
Definition: RPCDetId.h:78