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