CMS 3D CMS Logo

EMTFUnpackerTools.cc
Go to the documentation of this file.
1 
2 #include "EMTFUnpackerTools.h"
3 
4 namespace l1t {
5  namespace stage2 {
6  namespace emtf {
7 
8  void ImportME(EMTFHit& _hit, const l1t::emtf::ME _ME, const int _endcap, const int _evt_sector) {
9  _hit.set_endcap(_endcap == 1 ? 1 : -1);
10  _hit.set_sector_idx(_endcap == 1 ? _evt_sector - 1 : _evt_sector + 5);
11 
12  _hit.set_wire(_ME.Wire());
13  _hit.set_strip(_ME.Strip());
14  _hit.set_quality(_ME.Quality());
15  _hit.set_pattern(_ME.CLCT_pattern());
16  _hit.set_bend((_ME.LR() == 1) ? 1 : -1);
17  _hit.set_valid(_ME.VP());
18  _hit.set_sync_err(_ME.SE());
19  _hit.set_bx(_ME.TBIN() - 3);
20  _hit.set_bc0(_ME.BC0());
21  _hit.set_subsystem(1); // 1 for CSC
22  // _hit.set_layer();
23 
24  _hit.set_ring(L1TMuonEndCap::calc_ring(_hit.Station(), _hit.CSC_ID(), _hit.Strip()));
25  _hit.set_chamber(
26  L1TMuonEndCap::calc_chamber(_hit.Station(), _hit.Sector(), _hit.Subsector(), _hit.Ring(), _hit.CSC_ID()));
27 
28  _hit.SetCSCDetId(_hit.CreateCSCDetId());
29  //_hit.SetCSCLCTDigi ( _hit.CreateCSCCorrelatedLCTDigi() );
30 
31  // Station, CSC_ID, Sector, Subsector, and Neighbor filled in
32  // EventFilter/L1TRawToDigi/src/implementations_stage2/EMTFBlockME.cc
33  // "set_layer()" is not invoked, so Layer is not yet filled - AWB 21.04.16
34 
35  } // End ImportME
36 
37  void ImportRPC(EMTFHit& _hit, const l1t::emtf::RPC _RPC, const int _endcap, const int _evt_sector) {
38  _hit.set_endcap(_endcap == 1 ? 1 : -1);
39  _hit.set_sector_idx(_endcap == 1 ? _evt_sector - 1 : _evt_sector + 5);
40 
41  _hit.set_phi_fp(_RPC.Phi() * 4); // 1/4th the precision of CSC LCTs
42  _hit.set_theta_fp(_RPC.Theta() * 4); // 1/4th the precision of CSC LCTs
43  _hit.set_bx(_RPC.TBIN() - 3);
44  _hit.set_valid(_RPC.VP());
45  _hit.set_bc0(_RPC.BC0());
46  _hit.set_subsystem(2); // 2 for RPC
47 
48  _hit.SetRPCDetId(_hit.CreateRPCDetId());
49  // // Not yet implemented - AWB 15.03.17
50  // _hit.SetRPCDigi ( _hit.CreateRPCDigi() );
51 
52  // Convert integer values to degrees
54  _hit.set_phi_glob(L1TMuonEndCap::calc_phi_glob_deg(_hit.Phi_loc(), _evt_sector));
57 
58  // Station, Ring, Sector, Subsector, Neighbor, and PC/FS/BT_segment filled in
59  // EventFilter/L1TRawToDigi/src/implementations_stage2/EMTFBlockRPC.cc - AWB 02.05.17
60 
61  } // End ImportRPC
62 
63  void ImportSP(EMTFTrack& _track, const l1t::emtf::SP _SP, const int _endcap, const int _evt_sector) {
64  _track.set_endcap((_endcap == 1) ? 1 : -1);
65  _track.set_sector(_evt_sector);
66  _track.set_sector_idx((_endcap == 1) ? _evt_sector - 1 : _evt_sector + 5);
67  _track.set_mode(_SP.Mode());
68  _track.set_mode_inv((((_SP.Mode() >> 0) & 1) << 3) | (((_SP.Mode() >> 1) & 1) << 2) |
69  (((_SP.Mode() >> 2) & 1) << 1) | (((_SP.Mode() >> 3) & 1) << 0));
70  _track.set_charge((_SP.C() == 1) ? -1 : 1); // uGMT uses opposite of physical charge (to match pdgID)
71  _track.set_bx(_SP.TBIN() - 3);
72  _track.set_phi_fp(_SP.Phi_full());
74  _track.set_phi_glob(L1TMuonEndCap::calc_phi_glob_deg(_track.Phi_loc(), _track.Sector()));
76  _track.set_pt((_SP.Pt_GMT() - 1) * 0.5);
77 
78  _track.set_gmt_pt(_SP.Pt_GMT());
79  _track.set_gmt_phi(_SP.Phi_GMT());
80  _track.set_gmt_eta(_SP.Eta_GMT());
81  _track.set_gmt_quality(_SP.Quality_GMT());
82  _track.set_gmt_charge(_SP.C());
83  _track.set_gmt_charge_valid(_SP.VC());
84 
85  EMTFPtLUT _lut = {};
86  _lut.address = _SP.Pt_LUT_addr();
87  _track.set_PtLUT(_lut);
88 
89  // First_bx, Second_bx, Track_num, Has_neighbor, All_neighbor, and Hits should be filled in
90  // EventFilter/L1TRawToDigi/src/implementations_stage2/EMTFBlockSP.cc - AWB 07.03.17
91 
92  } // End ImportSP
93 
94  } // End namespace emtf
95  } // End namespace stage2
96 } // End namespace l1t
l1t::emtf::ME::Strip
int Strip() const
Definition: ME.h:73
l1t::EMTFHit::set_subsystem
void set_subsystem(int bits)
Definition: EMTFHit.h:123
l1t::EMTFHit::set_eta
void set_eta(float val)
Definition: EMTFHit.h:166
l1t::emtf::SP::Pt_LUT_addr
unsigned long Pt_LUT_addr() const
Definition: SP.h:107
l1t::emtf::SP::Quality_GMT
int Quality_GMT() const
Definition: SP.h:87
l1t::stage2::emtf::ImportRPC
void ImportRPC(EMTFHit &_hit, const l1t::emtf::RPC _RPC, const int _endcap, const int _evt_sector)
Definition: EMTFUnpackerTools.cc:37
l1t::emtf::RPC::BC0
int BC0() const
Definition: RPC.h:48
l1t::EMTFTrack::set_gmt_phi
void set_gmt_phi(int bits)
Definition: EMTFTrack.h:136
l1t::EMTFHit::CSC_ID
int CSC_ID() const
Definition: EMTFHit.h:186
l1t::EMTFPtLUT
Definition: EMTFTrack.h:16
l1t::EMTFTrack::set_phi_fp
void set_phi_fp(int bits)
Definition: EMTFTrack.h:132
l1t::emtf::RPC
Definition: RPC.h:11
emtf::calc_eta
double calc_eta(int bits)
Definition: TrackTools.h:95
l1t::EMTFTrack::set_sector
void set_sector(int bits)
Definition: EMTFTrack.h:114
l1t::emtf::ME
Definition: ME.h:11
l1t::EMTFTrack::set_mode
void set_mode(int bits)
Definition: EMTFTrack.h:116
l1t::emtf::ME::TBIN
int TBIN() const
Definition: ME.h:85
l1t::emtf::SP::Pt_GMT
int Pt_GMT() const
Definition: SP.h:92
l1t::EMTFHit::Sector
int Sector() const
Definition: EMTFHit.h:180
l1t::EMTFHit::Endcap
int Endcap() const
Definition: EMTFHit.h:177
l1t::EMTFHit::set_phi_loc
void set_phi_loc(float val)
Definition: EMTFHit.h:163
l1t::EMTFHit::Theta
float Theta() const
Definition: EMTFHit.h:218
l1t::emtf::ME::SE
int SE() const
Definition: ME.h:79
l1t::EMTFTrack::Sector
int Sector() const
Definition: EMTFTrack.h:144
l1t::EMTFHit::CreateRPCDetId
RPCDetId CreateRPCDetId() const
Definition: EMTFHit.cc:12
emtf::calc_ring
int calc_ring(int station, int csc_ID, int strip)
Definition: TrackTools.cc:5
emtf::calc_eta_from_theta_deg
double calc_eta_from_theta_deg(double theta_deg, int endcap)
Definition: TrackTools.h:113
l1t::EMTFTrack::set_phi_loc
void set_phi_loc(float val)
Definition: EMTFTrack.h:133
emtf::calc_chamber
int calc_chamber(int station, int sector, int subsector, int ring, int csc_ID)
Definition: TrackTools.cc:28
l1t::emtf::SP::Phi_full
int Phi_full() const
Definition: SP.h:82
l1t::EMTFHit::set_theta
void set_theta(float val)
Definition: EMTFHit.h:165
l1t::EMTFHit::set_chamber
void set_chamber(int bits)
Definition: EMTFHit.h:132
emtf::calc_theta_deg_from_int
double calc_theta_deg_from_int(int theta_int)
Definition: TrackTools.h:128
l1t::emtf::ME::CLCT_pattern
int CLCT_pattern() const
Definition: ME.h:68
l1t::emtf::SP
Definition: SP.h:11
l1t::EMTFHit::CreateCSCDetId
CSCDetId CreateCSCDetId() const
Definition: EMTFHit.cc:6
l1t::emtf::RPC::Theta
int Theta() const
Definition: RPC.h:43
l1t::emtf::ME::LR
int LR() const
Definition: ME.h:71
l1t::EMTFHit::Subsector
int Subsector() const
Definition: EMTFHit.h:183
emtf
Definition: Event.h:15
l1t::emtf::RPC::Phi
int Phi() const
Definition: RPC.h:42
emtf::calc_phi_loc_deg
double calc_phi_loc_deg(int bits)
Definition: TrackTools.h:176
l1t::emtf::SP::Phi_GMT
int Phi_GMT() const
Definition: SP.h:88
l1t::EMTFHit::Theta_fp
int Theta_fp() const
Definition: EMTFHit.h:209
l1t::EMTFHit::set_valid
void set_valid(int bits)
Definition: EMTFHit.h:150
l1t::EMTFTrack::set_charge
void set_charge(int bits)
Definition: EMTFTrack.h:120
l1t::EMTFTrack::set_pt
void set_pt(float val)
Definition: EMTFTrack.h:124
l1t::EMTFHit::set_strip
void set_strip(int bits)
Definition: EMTFHit.h:143
l1t::emtf::ME::VP
int VP() const
Definition: ME.h:84
l1t::EMTFHit::set_sync_err
void set_sync_err(int bits)
Definition: EMTFHit.h:151
emtf::calc_phi_glob_deg
double calc_phi_glob_deg(double loc, int sector)
Definition: TrackTools.h:166
l1t::EMTFTrack
Definition: EMTFTrack.h:34
l1t::EMTFTrack::set_gmt_charge_valid
void set_gmt_charge_valid(int bits)
Definition: EMTFTrack.h:140
l1t::emtf::SP::C
int C() const
Definition: SP.h:81
l1t::emtf::SP::Eta_GMT
int Eta_GMT() const
Definition: SP.h:91
l1t::emtf::SP::VC
int VC() const
Definition: SP.h:83
l1t::EMTFTrack::set_sector_idx
void set_sector_idx(int bits)
Definition: EMTFTrack.h:115
l1t::EMTFHit
Definition: EMTFHit.h:22
l1t
delete x;
Definition: CaloConfig.h:22
l1t::EMTFHit::SetCSCDetId
void SetCSCDetId(const CSCDetId &id)
Definition: EMTFHit.h:104
l1t::EMTFHit::set_quality
void set_quality(int bits)
Definition: EMTFHit.h:147
l1t::EMTFHit::set_phi_glob
void set_phi_glob(float val)
Definition: EMTFHit.h:164
l1t::emtf::SP::Mode
int Mode() const
Definition: SP.h:90
l1t::EMTFHit::set_sector_idx
void set_sector_idx(int bits)
Definition: EMTFHit.h:129
l1t::EMTFPtLUT::address
uint64_t address
Definition: EMTFTrack.h:17
l1t::EMTFHit::set_theta_fp
void set_theta_fp(int bits)
Definition: EMTFHit.h:156
l1t::EMTFHit::set_wire
void set_wire(int bits)
Definition: EMTFHit.h:142
l1t::emtf::RPC::TBIN
int TBIN() const
Definition: RPC.h:49
l1t::emtf::RPC::VP
int VP() const
Definition: RPC.h:50
l1t::EMTFHit::set_pattern
void set_pattern(int bits)
Definition: EMTFHit.h:148
l1t::EMTFHit::Phi_loc
float Phi_loc() const
Definition: EMTFHit.h:216
l1t::EMTFTrack::set_bx
void set_bx(int bits)
Definition: EMTFTrack.h:121
SiStripSourceConfigTier0_cff.stage2
stage2
Definition: SiStripSourceConfigTier0_cff.py:71
l1t::EMTFTrack::set_gmt_charge
void set_gmt_charge(int bits)
Definition: EMTFTrack.h:139
l1t::EMTFHit::set_endcap
void set_endcap(int bits)
Definition: EMTFHit.h:124
l1t::EMTFTrack::set_gmt_quality
void set_gmt_quality(int bits)
Definition: EMTFTrack.h:138
l1t::emtf::ME::Quality
int Quality() const
Definition: ME.h:67
l1t::stage2::emtf::ImportSP
void ImportSP(EMTFTrack &_track, const l1t::emtf::SP _SP, const int _endcap, const int _evt_sector)
Definition: EMTFUnpackerTools.cc:63
l1t::EMTFHit::set_bx
void set_bx(int bits)
Definition: EMTFHit.h:153
l1t::emtf::ME::BC0
int BC0() const
Definition: ME.h:69
l1t::EMTFTrack::set_PtLUT
void set_PtLUT(EMTFPtLUT bits)
Definition: EMTFTrack.h:110
l1t::EMTFHit::Ring
int Ring() const
Definition: EMTFHit.h:179
EMTFUnpackerTools.h
l1t::emtf::ME::Wire
int Wire() const
Definition: ME.h:66
l1t::EMTFTrack::set_gmt_pt
void set_gmt_pt(int bits)
Definition: EMTFTrack.h:135
l1t::EMTFHit::set_phi_fp
void set_phi_fp(int bits)
Definition: EMTFHit.h:155
l1t::EMTFHit::Station
int Station() const
Definition: EMTFHit.h:178
l1t::stage2::emtf::ImportME
void ImportME(EMTFHit &_hit, const l1t::emtf::ME _ME, const int _endcap, const int _evt_sector)
Definition: EMTFUnpackerTools.cc:8
l1t::EMTFTrack::set_mode_inv
void set_mode_inv(int bits)
Definition: EMTFTrack.h:117
l1t::EMTFTrack::set_phi_glob
void set_phi_glob(float val)
Definition: EMTFTrack.h:134
l1t::emtf::SP::TBIN
int TBIN() const
Definition: SP.h:102
l1t::EMTFTrack::set_endcap
void set_endcap(int bits)
Definition: EMTFTrack.h:113
l1t::EMTFHit::SetRPCDetId
void SetRPCDetId(const RPCDetId &id)
Definition: EMTFHit.h:105
l1t::EMTFHit::set_bend
void set_bend(int bits)
Definition: EMTFHit.h:149
l1t::EMTFTrack::Phi_loc
float Phi_loc() const
Definition: EMTFTrack.h:166
l1t::EMTFTrack::set_gmt_eta
void set_gmt_eta(int bits)
Definition: EMTFTrack.h:137
l1t::EMTFHit::set_bc0
void set_bc0(int bits)
Definition: EMTFHit.h:152
l1t::EMTFHit::Phi_fp
int Phi_fp() const
Definition: EMTFHit.h:208
l1t::EMTFHit::set_ring
void set_ring(int bits)
Definition: EMTFHit.h:126
l1t::EMTFTrack::set_eta
void set_eta(float val)
Definition: EMTFTrack.h:131
l1t::EMTFHit::Strip
int Strip() const
Definition: EMTFHit.h:196