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 9 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 7 of file TTPrimitiveConversion.cc.

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

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 }
bool 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 55 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_, and PV3DBase< T, PVType, FrameType >::z().

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

58  {
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:128
void set_is_GEM(int bits)
Definition: EMTFHit.h:136
void set_neighbor(int bits)
Definition: EMTFHit.h:93
void set_rho_sim(float val)
Definition: EMTFHit.h:130
void set_phi_sim(float val)
Definition: EMTFHit.h:127
T perp() const
Definition: PV3DBase.h:72
int module(const TTTriggerPrimitive &) const
void set_station(int bits)
Definition: EMTFHit.h:82
GlobalPoint getGlobalPoint(const TTTriggerPrimitive &) const
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
void set_eta_sim(float val)
Definition: EMTFHit.h:129
void set_sector_idx(int bits)
Definition: EMTFHit.h:86
int region(const TTTriggerPrimitive &) const
void set_endcap(int bits)
Definition: EMTFHit.h:81
void set_ring(int bits)
Definition: EMTFHit.h:83
Geom::Theta< T > theta() const
Definition: PV3DBase.h:75
void set_is_CSC(int bits)
Definition: EMTFHit.h:134
T z() const
Definition: PV3DBase.h:64
void set_wire(int bits)
Definition: EMTFHit.h:99
const TTGeometryTranslator * tp_ttgeom_
void set_is_RPC(int bits)
Definition: EMTFHit.h:135
void set_sector(int bits)
Definition: EMTFHit.h:84
void set_valid(int bits)
Definition: EMTFHit.h:107
void set_z_sim(float val)
Definition: EMTFHit.h:131
int ring(const TTTriggerPrimitive &) const
void set_strip(int bits)
Definition: EMTFHit.h:100
void set_subsystem(int bits)
Definition: EMTFHit.h:137
T eta() const
Definition: PV3DBase.h:76
int layer(const TTTriggerPrimitive &) const
void set_bx(int bits)
Definition: EMTFHit.h:110
double rad_to_deg(double rad)
Definition: TrackTools.h:54
void set_chamber(int bits)
Definition: EMTFHit.h:89
void set_subsector(int bits)
Definition: EMTFHit.h:87
void set_bend(int bits)
Definition: EMTFHit.h:106
const SectorProcessorLUT& TTPrimitiveConversion::lut ( void  ) const
inline

Definition at line 27 of file TTPrimitiveConversion.h.

References convert_tt(), and lut_.

Referenced by configure().

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

Definition at line 38 of file TTPrimitiveConversion.cc.

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

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

Member Data Documentation

int TTPrimitiveConversion::bx_
private

Definition at line 40 of file TTPrimitiveConversion.h.

Referenced by configure(), and process_no_prim_sel().

int TTPrimitiveConversion::endcap_
private

Definition at line 40 of file TTPrimitiveConversion.h.

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

const SectorProcessorLUT* TTPrimitiveConversion::lut_
private

Definition at line 38 of file TTPrimitiveConversion.h.

Referenced by configure(), and lut().

int TTPrimitiveConversion::sector_
private

Definition at line 40 of file TTPrimitiveConversion.h.

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

const TTGeometryTranslator* TTPrimitiveConversion::tp_ttgeom_
private

Definition at line 36 of file TTPrimitiveConversion.h.

Referenced by configure(), and convert_tt().

int TTPrimitiveConversion::verbose_
private

Definition at line 40 of file TTPrimitiveConversion.h.

Referenced by configure().