CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
TTPrimitiveConversion Class Reference

#include <TTPrimitiveConversion.h>

Public Member Functions

void configure (const TTGeometryTranslator *tp_ttgeom, const SectorProcessorLUT *lut, int verbose, int endcap, int sector, int bx)
 
void convert_tt (const TTTriggerPrimitive &ttmuon_primitive, EMTFHit &conv_hit) const
 
const SectorProcessorLUTlut () const
 
void process (const std::map< int, TTTriggerPrimitiveCollection > &selected_ttprim_map, EMTFHitCollection &conv_hits) const
 
void process_no_prim_sel (const TTTriggerPrimitiveCollection &ttmuon_primitives, EMTFHitCollection &conv_hits) const
 

Private Attributes

int bx_
 
int endcap_
 
const SectorProcessorLUTlut_
 
int sector_
 
const TTGeometryTranslatortp_ttgeom_
 
int verbose_
 

Detailed Description

Definition at line 8 of file TTPrimitiveConversion.h.

Member Function Documentation

void TTPrimitiveConversion::configure ( const TTGeometryTranslator tp_ttgeom,
const SectorProcessorLUT lut,
int  verbose,
int  endcap,
int  sector,
int  bx 
)

Definition at line 6 of file TTPrimitiveConversion.cc.

References l1GtPatternGenerator_cfi::bx, bx_, makeMuonMisalignmentScenario::endcap, endcap_, lut(), lut_, sector_, tp_ttgeom_, verbose, and verbose_.

7  {
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 }
static int verbose
const TTGeometryTranslator * tp_ttgeom_
const SectorProcessorLUT * lut_
const SectorProcessorLUT & lut() const
void TTPrimitiveConversion::convert_tt ( const TTTriggerPrimitive ttmuon_primitive,
EMTFHit conv_hit 
) const

Definition at line 45 of file TTPrimitiveConversion.cc.

References L1TMuon::TTTriggerPrimitive::TTData::bend, L1TMuon::TTTriggerPrimitive::TTData::bx, L1TMuon::TTTriggerPrimitive::TTData::col_f, endcap_, PV3DBase< T, PVType, FrameType >::eta(), L1TMuon::TTGeometryTranslator::getGlobalPoint(), L1TMuon::TTTriggerPrimitive::getTTData(), runTauDisplay::gp, L1TMuon::TTTriggerPrimitive::kTT, L1TMuon::TTGeometryTranslator::layer(), L1TMuon::TTGeometryTranslator::module(), PV3DBase< T, PVType, FrameType >::perp(), PV3DBase< T, PVType, FrameType >::phi(), emtf::rad_to_deg(), L1TMuon::TTGeometryTranslator::region(), L1TMuon::TTGeometryTranslator::ring(), L1TMuon::TTTriggerPrimitive::TTData::row_f, sector_, l1t::EMTFHit::set_bend(), l1t::EMTFHit::set_bx(), l1t::EMTFHit::set_chamber(), l1t::EMTFHit::set_endcap(), l1t::EMTFHit::set_eta_sim(), l1t::EMTFHit::set_is_CSC(), l1t::EMTFHit::set_is_GEM(), l1t::EMTFHit::set_is_RPC(), l1t::EMTFHit::set_neighbor(), l1t::EMTFHit::set_phi_sim(), l1t::EMTFHit::set_rho_sim(), l1t::EMTFHit::set_ring(), l1t::EMTFHit::set_sector(), l1t::EMTFHit::set_sector_idx(), l1t::EMTFHit::set_station(), l1t::EMTFHit::set_strip(), l1t::EMTFHit::set_subsector(), l1t::EMTFHit::set_subsystem(), l1t::EMTFHit::set_theta_sim(), l1t::EMTFHit::set_valid(), l1t::EMTFHit::set_wire(), l1t::EMTFHit::set_z_sim(), PV3DBase< T, PVType, FrameType >::theta(), tp_ttgeom_, Geom::Phi< T1, Range >::value(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by lut(), process(), and process_no_prim_sel().

45  {
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
GlobalPoint getGlobalPoint(const TTTriggerPrimitive &) 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
int region(const TTTriggerPrimitive &) 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
void set_is_CSC(int bits)
Definition: EMTFHit.h:183
T z() const
Definition: PV3DBase.h:61
void set_wire(int bits)
Definition: EMTFHit.h:148
const TTGeometryTranslator * tp_ttgeom_
void set_is_RPC(int bits)
Definition: EMTFHit.h:184
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
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
const SectorProcessorLUT& TTPrimitiveConversion::lut ( void  ) const
inline

Definition at line 22 of file TTPrimitiveConversion.h.

References convert_tt(), and lut_.

Referenced by configure().

22 { return *lut_; }
const SectorProcessorLUT * lut_
void TTPrimitiveConversion::process ( const std::map< int, TTTriggerPrimitiveCollection > &  selected_ttprim_map,
EMTFHitCollection conv_hits 
) const

Definition at line 20 of file TTPrimitiveConversion.cc.

References convert_tt().

21  {
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 }
void convert_tt(const TTTriggerPrimitive &ttmuon_primitive, EMTFHit &conv_hit) const
void TTPrimitiveConversion::process_no_prim_sel ( const TTTriggerPrimitiveCollection ttmuon_primitives,
EMTFHitCollection conv_hits 
) const

Definition at line 31 of file TTPrimitiveConversion.cc.

References bx_, convert_tt(), endcap_, and sector_.

32  {
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 }
void convert_tt(const TTTriggerPrimitive &ttmuon_primitive, EMTFHit &conv_hit) const

Member Data Documentation

int TTPrimitiveConversion::bx_
private

Definition at line 32 of file TTPrimitiveConversion.h.

Referenced by configure(), and process_no_prim_sel().

int TTPrimitiveConversion::endcap_
private

Definition at line 32 of file TTPrimitiveConversion.h.

Referenced by configure(), convert_tt(), and process_no_prim_sel().

const SectorProcessorLUT* TTPrimitiveConversion::lut_
private

Definition at line 30 of file TTPrimitiveConversion.h.

Referenced by configure(), and lut().

int TTPrimitiveConversion::sector_
private

Definition at line 32 of file TTPrimitiveConversion.h.

Referenced by configure(), convert_tt(), and process_no_prim_sel().

const TTGeometryTranslator* TTPrimitiveConversion::tp_ttgeom_
private

Definition at line 28 of file TTPrimitiveConversion.h.

Referenced by configure(), and convert_tt().

int TTPrimitiveConversion::verbose_
private

Definition at line 32 of file TTPrimitiveConversion.h.

Referenced by configure().