CMS 3D CMS Logo

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