CMS 3D CMS Logo

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 //--------------------------------------------------
14 
15 using namespace std;
16 
18  const L1MuDTChambPhContainer& outphiDigis,
20  const edm::EventSetup& c) {
21  cout << "======================================================" << endl;
22  int bx = 0, wheel = 0, sector = 0, station = 1;
23 
25  cout << "DT Inputs/RPCDT Inputs" << endl;
26  cout << "bx\twheel\tsector\tstation\tphi\tphib\tcode\tts2tag\tbxcnt\trpcbit" << endl;
27 
28  for (bx = -2; bx <= 2; bx++) {
29  for (wheel = -2; wheel <= 2; wheel++) {
30  for (sector = 0; sector < 12; sector++) {
31  for (station = 1; station <= 4; station++) {
32  auto dtts1 = inphiDigis->chPhiSegm1(wheel, station, sector, bx);
33  auto dtts2 = inphiDigis->chPhiSegm2(wheel, station, sector, bx - 1);
34  if (dtts1 && dtts1->code() != 7) {
35  L1MuDTChambPhDigi dt_ts1 = *dtts1;
36  cout << dtts1->bxNum() << "\t" << dtts1->whNum() << "\t" << dtts1->scNum() << "\t" << dtts1->stNum() << "\t"
37  << dtts1->phi() << "\t" << dtts1->phiB() << "\t" << dtts1->code() << "\t" << dtts1->Ts2Tag() << "\t"
38  << dtts1->BxCnt() << "\t0" << endl;
39  }
40  if (dtts2 && dtts2->code() != 7) {
41  L1MuDTChambPhDigi dt_ts2 = *dtts2;
42  cout << dtts2->bxNum() << "\t" << dtts2->whNum() << "\t" << dtts2->scNum() << "\t" << dtts2->stNum() << "\t"
43  << dtts2->phi() << "\t" << dtts2->phiB() << "\t" << dtts2->code() << "\t" << dtts2->Ts2Tag() << "\t"
44  << dtts2->BxCnt() << "\t0" << endl;
45  }
46  }
47  }
48  }
49  }
50 
51  cout << endl;
52 
53  cout << "RPC Inputs" << endl;
54  cout << "bx\tring\tsector\tstation\troll\tlayer\tstrip\tphi\tlocalX" << endl;
55  //cout<<"RPCHitCleaner"<<endl;
56  for (auto chamber = rpcDigis->begin(); chamber != rpcDigis->end(); ++chamber) {
57  RPCDetId detid = (*chamber).first;
58  for (auto digi = (*chamber).second.first; digi != (*chamber).second.second; ++digi) {
59  RPCDigi digi_out(digi->strip(), digi->bx());
60  //if(digi->bx()!=0) continue;
61  int phi = RPCtoDTTranslator::radialAngle(detid, c, digi->strip()) << 2;
62  float localx = RPCtoDTTranslator::localX(detid, c, digi->strip());
63  cout << digi->bx() << "\t" << detid.ring() << "\t" << detid.sector() - 1 << "\t" << detid.station() << "\t"
64  << detid.roll() << "\t" << detid.layer() << "\t" << digi->strip() << "\t" << phi << "\t" << localx << endl;
65  }
66  }
67  cout << endl;
68 
69  cout << "TwinMux Output" << endl;
70  cout << "bx\twheel\tsector\tstation\tphi\tphib\tcode\tts2tag\tbxcnt\trpcbit" << endl;
71 
72  for (bx = -2; bx <= 2; bx++) {
73  for (wheel = -2; wheel <= 2; wheel++) {
74  for (sector = 0; sector < 12; sector++) {
75  for (station = 1; station <= 4; station++) {
76  auto dtts1 = outphiDigis.chPhiSegm1(wheel, station, sector, bx);
77  auto dtts2 = outphiDigis.chPhiSegm2(wheel, station, sector, bx - 1);
78  if (dtts1 && dtts1->code() != 7) {
79  L1MuDTChambPhDigi dt_ts1 = *dtts1;
80  cout << dtts1->bxNum() << "\t" << dtts1->whNum() << "\t" << dtts1->scNum() << "\t" << dtts1->stNum() << "\t"
81  << dtts1->phi() << "\t" << dtts1->phiB() << "\t" << dtts1->code() << "\t" << dtts1->Ts2Tag() << "\t"
82  << dtts1->BxCnt() << "\t" << dtts1->RpcBit() << endl;
83  }
84  if (dtts2 && dtts2->code() != 7) {
85  L1MuDTChambPhDigi dt_ts2 = *dtts2;
86  cout << dtts2->bxNum() << "\t" << dtts2->whNum() << "\t" << dtts2->scNum() << "\t" << dtts2->stNum() << "\t"
87  << dtts2->phi() << "\t" << dtts2->phiB() << "\t" << dtts2->code() << "\t" << dtts2->Ts2Tag() << "\t"
88  << dtts2->BxCnt() << "\t" << dtts2->RpcBit() << endl;
89  }
90  }
91  }
92  }
93  }
94 
95  cout << "======================================================" << endl;
96 }
97 
98 void IOPrinter::run(L1MuDTChambPhContainer const* inphiDigis,
99  const L1MuDTChambPhContainer& outphiDigis,
100  RPCDigiCollection const* rpcDigis,
101  const edm::EventSetup& c) {
102  cout << "======================================================" << endl;
103  int bx = 0, wheel = 0, sector = 0, station = 1;
104  L1MuTMChambPhContainer inphiDigis_tm;
105  const std::vector<L1MuDTChambPhDigi>* vInCon = inphiDigis->getContainer();
106  inphiDigis_tm.setContainer(*vInCon);
107 
109  cout << "RPC->DT Inputs" << endl;
110  cout << "bx\twheel\tsector\tstation\tphi\tphib\tcode\tts2tag\tbxcnt\trpcbit" << endl;
111 
112  for (bx = -2; bx <= 2; bx++) {
113  for (wheel = -2; wheel <= 2; wheel++) {
114  for (sector = 0; sector < 12; sector++) {
115  for (station = 1; station <= 4; station++) {
116  int nhits = DTRPCBxCorrection::nRPCHits(*inphiDigis, bx, wheel, sector, station);
117  for (int hit = 0; hit < nhits; hit++) {
118  auto dtts1 = inphiDigis_tm.chPhiSegm(wheel, station, sector, bx, hit);
119  if (dtts1) {
120  cout << dtts1->bxNum() << "\t" << dtts1->whNum() << "\t" << dtts1->scNum() << "\t" << dtts1->stNum()
121  << "\t" << dtts1->phi() << "\t" << dtts1->phiB() << "\t" << dtts1->code() << "\t" << dtts1->Ts2Tag()
122  << "\t" << dtts1->BxCnt() << "\t0" << endl;
123  }
124  }
125  }
126  }
127  }
128  }
129 
130  cout << endl;
131 
132  cout << "RPC Inputs" << endl;
133  cout << "bx\tring\tsector\tstation\troll\tlayer\tstrip\tphi\tlocalX" << endl;
134  //cout<<"RPCHitCleaner"<<endl;
135  for (auto chamber = rpcDigis->begin(); chamber != rpcDigis->end(); ++chamber) {
136  RPCDetId detid = (*chamber).first;
137  for (auto digi = (*chamber).second.first; digi != (*chamber).second.second; ++digi) {
138  RPCDigi digi_out(digi->strip(), digi->bx());
139  //if(digi->bx()!=0) continue;
140  int phi = RPCtoDTTranslator::radialAngle(detid, c, digi->strip()) << 2;
141  float localx = RPCtoDTTranslator::localX(detid, c, digi->strip());
142  cout << digi->bx() << "\t" << detid.ring() << "\t" << detid.sector() - 1 << "\t" << detid.station() << "\t"
143  << detid.roll() << "\t" << detid.layer() << "\t" << digi->strip() << "\t" << phi << "\t" << localx << endl;
144  }
145  }
146  cout << endl;
147 
148  cout << "TwinMux Output" << endl;
149  cout << "bx\twheel\tsector\tstation\tphi\tphib\tcode\tts2tag\tbxcnt\trpcbit" << endl;
150 
151  for (bx = -2; bx <= 2; bx++) {
152  for (wheel = -2; wheel <= 2; wheel++) {
153  for (sector = 0; sector < 12; sector++) {
154  for (station = 1; station <= 4; station++) {
155  auto dtts1 = outphiDigis.chPhiSegm1(wheel, station, sector, bx);
156  auto dtts2 = outphiDigis.chPhiSegm2(wheel, station, sector, bx - 1);
157  if (dtts1 && dtts1->code() != 7) {
158  L1MuDTChambPhDigi dt_ts1 = *dtts1;
159  cout << dtts1->bxNum() << "\t" << dtts1->whNum() << "\t" << dtts1->scNum() << "\t" << dtts1->stNum() << "\t"
160  << dtts1->phi() << "\t" << dtts1->phiB() << "\t" << dtts1->code() << "\t" << dtts1->Ts2Tag() << "\t"
161  << dtts1->BxCnt() << "\t" << dtts1->RpcBit() << endl;
162  }
163  if (dtts2 && dtts2->code() != 7) {
164  L1MuDTChambPhDigi dt_ts2 = *dtts2;
165  cout << dtts2->bxNum() << "\t" << dtts2->whNum() << "\t" << dtts2->scNum() << "\t" << dtts2->stNum() << "\t"
166  << dtts2->phi() << "\t" << dtts2->phiB() << "\t" << dtts2->code() << "\t" << dtts2->Ts2Tag() << "\t"
167  << dtts2->BxCnt() << "\t" << dtts2->RpcBit() << endl;
168  }
169  }
170  }
171  }
172  }
173 
174  cout << "======================================================" << endl;
175 }
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 edm::EventSetup &)
Definition: IOPrinter.cc:17
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
static int radialAngle(RPCDetId, const edm::EventSetup &, int)
function - will be replaced by LUTs(?)
int sector() const
Sector id: the group of chambers at same phi (and increasing r)
Definition: RPCDetId.h:81
int station() const
Definition: RPCDetId.h:78
static int localX(RPCDetId, const edm::EventSetup &, int)
function - will be replaced by LUTs(?)