CMS 3D CMS Logo

TTPrimitiveConversion.cc
Go to the documentation of this file.
2 
5 
6 
8  const TTGeometryTranslator* tp_ttgeom,
9  const SectorProcessorLUT* lut,
10  int verbose, int endcap, int sector, int bx
11 ) {
12  assert(tp_ttgeom != nullptr);
13  assert(lut != nullptr);
14 
15  tp_ttgeom_ = tp_ttgeom;
16  lut_ = lut; // not used
17 
18  verbose_ = verbose;
19  endcap_ = endcap; // 1 for ME+, 2 for ME-
20  sector_ = sector;
21  bx_ = bx;
22 }
23 
25  const std::map<int, TTTriggerPrimitiveCollection>& selected_ttprim_map,
26  EMTFHitCollection& conv_hits
27 ) const {
28 
29  for (const auto& map_tp_it : selected_ttprim_map) {
30  for (const auto& tp_it : map_tp_it.second) {
31  EMTFHit conv_hit;
32  convert_tt(tp_it, conv_hit);
33  conv_hits.push_back(conv_hit);
34  }
35  }
36 }
37 
39  const TTTriggerPrimitiveCollection& ttmuon_primitives,
40  EMTFHitCollection& conv_hits
41 ) const {
42 
43  for (const auto& tp_it : ttmuon_primitives) {
44  if (endcap_ == 1 && sector_ == 1 && bx_ == tp_it.getTTData().bx) { //FIXME: stupidly put everything into sector +1, to be fixed.
45  EMTFHit conv_hit;
46  convert_tt(tp_it, conv_hit);
47  conv_hits.push_back(conv_hit);
48  }
49  }
50 }
51 
52 
53 // _____________________________________________________________________________
54 // TT functions
56  const TTTriggerPrimitive& ttmuon_primitive,
57  EMTFHit& conv_hit
58 ) const {
59  //const DetId& tp_detId = ttmuon_primitive.detId();
60  const TTData& tp_data = ttmuon_primitive.getTTData();
61 
62  int tp_region = tp_ttgeom_->region(ttmuon_primitive); // 0 for Barrel, +/-1 for +/- Endcap
63  int tp_endcap = (tp_region == -1) ? 2 : tp_region;
64  int tp_station = tp_ttgeom_->layer(ttmuon_primitive);
65  int tp_ring = tp_ttgeom_->ring(ttmuon_primitive);
66  int tp_chamber = tp_ttgeom_->module(ttmuon_primitive);
67  int tp_sector = 1; //FIXME
68  int tp_subsector = 0; //FIXME
69 
70  const bool is_neighbor = false; //FIXME
71 
72  // Set properties
73  //conv_hit.SetTTDetId ( tp_detId );
74 
75  conv_hit.set_endcap ( (tp_endcap == 2) ? -1 : tp_endcap );
76  conv_hit.set_station ( tp_station );
77  conv_hit.set_ring ( tp_ring );
78  //conv_hit.set_roll ( tp_roll );
79  conv_hit.set_chamber ( tp_chamber );
80  conv_hit.set_sector ( tp_sector );
81  conv_hit.set_subsector ( tp_subsector );
82  //conv_hit.set_csc_ID ( tp_csc_ID );
83  //conv_hit.set_csc_nID ( csc_nID );
84  //conv_hit.set_track_num ( tp_data.trknmb );
85  //conv_hit.set_sync_err ( tp_data.syncErr );
86 
87  conv_hit.set_bx ( tp_data.bx );
89  conv_hit.set_is_CSC ( false );
90  conv_hit.set_is_RPC ( false );
91  conv_hit.set_is_GEM ( false );
92 
93  //conv_hit.set_pc_sector ( pc_sector );
94  //conv_hit.set_pc_station ( pc_station );
95  //conv_hit.set_pc_chamber ( pc_chamber );
96  //conv_hit.set_pc_segment ( pc_segment );
97 
98  conv_hit.set_valid ( true );
99  conv_hit.set_strip ( static_cast<int>(tp_data.row_f) );
100  //conv_hit.set_strip_low ( tp_data.strip_low );
101  //conv_hit.set_strip_hi ( tp_data.strip_hi );
102  conv_hit.set_wire ( static_cast<int>(tp_data.col_f) );
103  //conv_hit.set_quality ( tp_data.quality );
104  //conv_hit.set_pattern ( tp_data.pattern );
105  conv_hit.set_bend ( tp_data.bend );
106  //conv_hit.set_time ( tp_data.time );
107 
108  conv_hit.set_neighbor ( is_neighbor );
109  conv_hit.set_sector_idx ( (endcap_ == 1) ? sector_ - 1 : sector_ + 5 );
110 
111  // Add coordinates from fullsim
112  {
113  const GlobalPoint& gp = tp_ttgeom_->getGlobalPoint(ttmuon_primitive);
114  double glob_phi = emtf::rad_to_deg(gp.phi().value());
115  double glob_theta = emtf::rad_to_deg(gp.theta());
116  double glob_eta = gp.eta();
117  double glob_rho = gp.perp();
118  double glob_z = gp.z();
119 
120  conv_hit.set_phi_sim ( glob_phi );
121  conv_hit.set_theta_sim ( glob_theta );
122  conv_hit.set_eta_sim ( glob_eta );
123  conv_hit.set_rho_sim ( glob_rho );
124  conv_hit.set_z_sim ( glob_z );
125  }
126 }
void set_theta_sim(float val)
Definition: EMTFHit.h:133
void set_is_GEM(int bits)
Definition: EMTFHit.h:141
void set_neighbor(int bits)
Definition: EMTFHit.h:98
void set_rho_sim(float val)
Definition: EMTFHit.h:135
void set_phi_sim(float val)
Definition: EMTFHit.h:132
T perp() const
Definition: PV3DBase.h:72
int module(const TTTriggerPrimitive &) const
bool verbose
void set_station(int bits)
Definition: EMTFHit.h:87
GlobalPoint getGlobalPoint(const TTTriggerPrimitive &) const
void convert_tt(const TTTriggerPrimitive &ttmuon_primitive, EMTFHit &conv_hit) const
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
void set_eta_sim(float val)
Definition: EMTFHit.h:134
void set_sector_idx(int bits)
Definition: EMTFHit.h:91
int region(const TTTriggerPrimitive &) const
void process_no_prim_sel(const TTTriggerPrimitiveCollection &ttmuon_primitives, EMTFHitCollection &conv_hits) const
void set_endcap(int bits)
Definition: EMTFHit.h:86
void set_ring(int bits)
Definition: EMTFHit.h:88
Geom::Theta< T > theta() const
Definition: PV3DBase.h:75
void set_is_CSC(int bits)
Definition: EMTFHit.h:139
T z() const
Definition: PV3DBase.h:64
void process(const std::map< int, TTTriggerPrimitiveCollection > &selected_ttprim_map, EMTFHitCollection &conv_hits) const
void set_wire(int bits)
Definition: EMTFHit.h:104
void configure(const TTGeometryTranslator *tp_ttgeom, const SectorProcessorLUT *lut, int verbose, int endcap, int sector, int bx)
const TTGeometryTranslator * tp_ttgeom_
l1t::EMTFHitCollection EMTFHitCollection
Definition: Common.h:25
L1TMuon::TTTriggerPrimitiveCollection TTTriggerPrimitiveCollection
Definition: Common.h:38
void set_is_RPC(int bits)
Definition: EMTFHit.h:140
const SectorProcessorLUT * lut_
void set_sector(int bits)
Definition: EMTFHit.h:89
void set_valid(int bits)
Definition: EMTFHit.h:112
void set_z_sim(float val)
Definition: EMTFHit.h:136
int ring(const TTTriggerPrimitive &) const
void set_strip(int bits)
Definition: EMTFHit.h:105
void set_subsystem(int bits)
Definition: EMTFHit.h:142
T eta() const
Definition: PV3DBase.h:76
int layer(const TTTriggerPrimitive &) const
void set_bx(int bits)
Definition: EMTFHit.h:115
double rad_to_deg(double rad)
Definition: TrackTools.h:54
const SectorProcessorLUT & lut() const
void set_chamber(int bits)
Definition: EMTFHit.h:94
void set_subsector(int bits)
Definition: EMTFHit.h:92
void set_bend(int bits)
Definition: EMTFHit.h:111