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