CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Private Attributes
trklet::L1TStub Class Reference

#include <L1TStub.h>

Public Member Functions

unsigned int allStubIndex () const
 
double alpha (double pitch) const
 
double alphanorm () const
 
double bend () const
 
double diphi ()
 
int disk () const
 
double diz ()
 
const std::string & DTClink () const
 
int eventid () const
 
unsigned int iphi () const
 
double iphiouter ()
 
unsigned int isFlipped () const
 
unsigned int isPSmodule () const
 
bool isTilted () const
 
unsigned int iz () const
 
 L1TStub ()
 
 L1TStub (std::string DTClink, int region, int layerdisk, std::string stubword, int isPSmodule, int isFlipped, double x, double y, double z, double bend, double strip, std::vector< int > tps)
 
unsigned int ladder () const
 
unsigned int layer () const
 
int layerdisk () const
 
void lorentzcor (double shift)
 
unsigned int module () const
 
bool operator== (const L1TStub &other) const
 
double phi () const
 
double pt () const
 
double r () const
 
double r2 () const
 
int region () const
 
void setAllStubIndex (unsigned int index)
 
void setiphi (int iphi)
 
void setiz (int iz)
 
void setXY (double x, double y)
 
double sigmax () const
 
double sigmaz () const
 
unsigned int strip () const
 
const std::string & stubword () const
 
bool tpmatch (int tp) const
 
bool tpmatch2 (int tp) const
 
std::vector< int > tps () const
 
void write (std::ofstream &out)
 
double x () const
 
double y () const
 
double z () const
 
 ~L1TStub ()=default
 

Private Attributes

unsigned int allstubindex_
 
double bend_
 
std::string DTClink_
 
int eventid_
 
unsigned int iphi_
 
unsigned int isFlipped_
 
unsigned int isPSmodule_
 
unsigned int iz_
 
unsigned int ladder_
 
unsigned int layer_
 
int layerdisk_
 
unsigned int module_
 
double pt_
 
int region_
 
double sigmax_
 
double sigmaz_
 
unsigned int strip_
 
std::string stubword_
 
std::vector< int > tps_
 
double x_
 
double y_
 
double z_
 

Detailed Description

Definition at line 14 of file L1TStub.h.

Constructor & Destructor Documentation

L1TStub::L1TStub ( )

Definition at line 6 of file L1TStub.cc.

6 {}
L1TStub::L1TStub ( std::string  DTClink,
int  region,
int  layerdisk,
std::string  stubword,
int  isPSmodule,
int  isFlipped,
double  x,
double  y,
double  z,
double  bend,
double  strip,
std::vector< int >  tps 
)

Definition at line 8 of file L1TStub.cc.

References sistrip::layer_, sistrip::module_, trklet::N_LAYER, HLT_FULL_cff::region, and digitizers_cfi::strip.

19  {
20  DTClink_ = DTClink;
22  region_ = region;
24  eventid_ = -1;
25  tps_ = tps;
26  iphi_ = -1;
27  iz_ = -1;
28  layer_ = layerdisk;
29  if (layerdisk >= N_LAYER) {
30  layer_ = 1000 + layerdisk - N_LAYER + 1;
31  if (z < 0.0)
32  layer_ += 1000;
33  }
34 
35  ladder_ = -1;
36  module_ = -1;
37  strip_ = strip;
38  x_ = x;
39  y_ = y;
40  z_ = z;
41  sigmax_ = -1.0;
42  sigmaz_ = -1.0;
43  pt_ = -1.0;
44  bend_ = bend;
47 
48  allstubindex_ = 999;
49 }
unsigned int iz_
Definition: L1TStub.h:118
unsigned int isFlipped() const
Definition: L1TStub.h:95
unsigned int module_
Definition: L1TStub.h:121
unsigned int strip() const
Definition: L1TStub.h:85
int region() const
Definition: L1TStub.h:106
std::vector< int > tps_
Definition: L1TStub.h:116
double sigmaz_
Definition: L1TStub.h:127
unsigned int strip_
Definition: L1TStub.h:122
unsigned int ladder_
Definition: L1TStub.h:120
unsigned int isPSmodule_
Definition: L1TStub.h:132
const std::string & DTClink() const
Definition: L1TStub.h:102
std::string DTClink_
Definition: L1TStub.h:112
double bend() const
Definition: L1TStub.h:61
double sigmax_
Definition: L1TStub.h:126
std::string stubword_
Definition: L1TStub.h:114
double z() const
Definition: L1TStub.h:57
int layerdisk() const
Definition: L1TStub.h:104
unsigned int isPSmodule() const
Definition: L1TStub.h:94
const std::string & stubword() const
Definition: L1TStub.h:108
double x() const
Definition: L1TStub.h:55
unsigned int layer_
Definition: L1TStub.h:119
double pt_
Definition: L1TStub.h:128
unsigned int allstubindex_
Definition: L1TStub.h:130
unsigned int isFlipped_
Definition: L1TStub.h:133
std::vector< int > tps() const
Definition: L1TStub.h:79
double y() const
Definition: L1TStub.h:56
unsigned int iphi_
Definition: L1TStub.h:117
double bend_
Definition: L1TStub.h:129
constexpr int N_LAYER
Definition: Settings.h:21
trklet::L1TStub::~L1TStub ( )
default

Member Function Documentation

unsigned int trklet::L1TStub::allStubIndex ( ) const
inline

Definition at line 83 of file L1TStub.h.

References allstubindex_.

83 { return allstubindex_; }
unsigned int allstubindex_
Definition: L1TStub.h:130
double L1TStub::alpha ( double  pitch) const

Definition at line 73 of file L1TStub.cc.

References diffTwoXMLs::r2.

Referenced by trklet::FitTrack::trackFitChisq().

73  {
74  if (isPSmodule())
75  return 0.0;
76  int flip = 1;
77  if (isFlipped())
78  flip = -1;
79  if (z_ > 0.0) {
80  return ((int)strip_ - 509.5) * pitch * flip / r2();
81  }
82  return -((int)strip_ - 509.5) * pitch * flip / r2();
83 }
unsigned int isFlipped() const
Definition: L1TStub.h:95
double r2() const
Definition: L1TStub.h:60
unsigned int strip_
Definition: L1TStub.h:122
unsigned int isPSmodule() const
Definition: L1TStub.h:94
double L1TStub::alphanorm ( ) const

Definition at line 85 of file L1TStub.cc.

Referenced by trklet::MatchCalculator::execute(), and trklet::MatchProcessor::matchCalculator().

85  {
86  if (isPSmodule())
87  return 0.0;
88  int flip = 1;
89  if (isFlipped())
90  flip = -1;
91  if (z_ > 0.0) {
92  return ((int)strip_ - 509.5) * flip / 510.0;
93  }
94  return -((int)strip_ - 509.5) * flip / 510.0;
95 }
unsigned int isFlipped() const
Definition: L1TStub.h:95
unsigned int strip_
Definition: L1TStub.h:122
unsigned int isPSmodule() const
Definition: L1TStub.h:94
double trklet::L1TStub::bend ( ) const
inline

Definition at line 61 of file L1TStub.h.

References bend_.

61 { return bend_; }
double bend_
Definition: L1TStub.h:129
double trklet::L1TStub::diphi ( )
int trklet::L1TStub::disk ( ) const
inline

Definition at line 42 of file L1TStub.h.

References layerdisk_, trklet::N_LAYER, and z_.

Referenced by trklet::Tracklet::disk(), and trklet::Tracklet::getStubIDs().

42  {
43  if (layerdisk_ < N_LAYER) {
44  return 0;
45  }
46  int disk = layerdisk_ - N_LAYER + 1;
47  if (z_ < 0.0) {
48  return -disk;
49  }
50  return disk;
51  }
int disk() const
Definition: L1TStub.h:42
constexpr int N_LAYER
Definition: Settings.h:21
double trklet::L1TStub::diz ( )
const std::string& trklet::L1TStub::DTClink ( ) const
inline

Definition at line 102 of file L1TStub.h.

References DTClink_.

Referenced by trklet::TrackletEventProcessor::event().

102 { return DTClink_; }
std::string DTClink_
Definition: L1TStub.h:112
int trklet::L1TStub::eventid ( ) const
inline

Definition at line 78 of file L1TStub.h.

References eventid_.

78 { return eventid_; }
unsigned int trklet::L1TStub::iphi ( ) const
inline

Definition at line 65 of file L1TStub.h.

References iphi_.

Referenced by operator==(), and setiphi().

65 { return iphi_; }
unsigned int iphi_
Definition: L1TStub.h:117
double trklet::L1TStub::iphiouter ( )
unsigned int trklet::L1TStub::isFlipped ( ) const
inline

Definition at line 95 of file L1TStub.h.

References isFlipped_.

95 { return isFlipped_; }
unsigned int isFlipped_
Definition: L1TStub.h:133
unsigned int trklet::L1TStub::isPSmodule ( ) const
inline
bool L1TStub::isTilted ( ) const

Definition at line 126 of file L1TStub.cc.

References cms::cuda::assert(), sistrip::layer_, sistrip::module_, trklet::N_MOD_PLANK, trklet::N_PSLAYER, and trklet::N_TILTED_RINGS.

126  {
127  //here layer_ runs 0-5 for barrel, >1000 for disk
128  //disk modules and outer barrel modules are not tilted by construction
129  if (layer_ >= N_PSLAYER)
130  return false;
131 
132  assert(layer_ < N_PSLAYER); // safety for acccessing # modules/plank
134  return true;
135  return false;
136 }
unsigned int module_
Definition: L1TStub.h:121
assert(be >=bs)
constexpr std::array< unsigned int, N_PSLAYER > N_MOD_PLANK
Definition: Settings.h:894
constexpr unsigned int N_TILTED_RINGS
Definition: Settings.h:893
constexpr unsigned int N_PSLAYER
Definition: Settings.h:23
unsigned int layer_
Definition: L1TStub.h:119
unsigned int trklet::L1TStub::iz ( ) const
inline

Definition at line 66 of file L1TStub.h.

References iz_.

Referenced by operator==(), and setiz().

66 { return iz_; }
unsigned int iz_
Definition: L1TStub.h:118
unsigned int trklet::L1TStub::ladder ( ) const
inline

Definition at line 52 of file L1TStub.h.

References ladder_.

Referenced by operator==().

52 { return ladder_; }
unsigned int ladder_
Definition: L1TStub.h:120
unsigned int trklet::L1TStub::layer ( ) const
inline

Definition at line 41 of file L1TStub.h.

References layer_.

Referenced by geometryXMLparser.DTAlignable::index(), geometryXMLparser.CSCAlignable::index(), operator==(), and trklet::Tracklet::Tracklet().

41 { return layer_; }
unsigned int layer_
Definition: L1TStub.h:119
int trklet::L1TStub::layerdisk ( ) const
inline
void L1TStub::lorentzcor ( double  shift)

Definition at line 66 of file L1TStub.cc.

References funct::cos(), alignCSCRings::r, and funct::sin().

66  {
67  double r = this->r();
68  double phi = this->phi() - shift / r;
69  this->x_ = r * cos(phi);
70  this->y_ = r * sin(phi);
71 }
double r() const
Definition: L1TStub.h:58
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
double phi() const
Definition: L1TStub.h:63
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
static unsigned int const shift
unsigned int trklet::L1TStub::module ( ) const
inline

Definition at line 53 of file L1TStub.h.

References module_.

Referenced by operator==().

53 { return module_; }
unsigned int module_
Definition: L1TStub.h:121
bool L1TStub::operator== ( const L1TStub other) const

Definition at line 61 of file L1TStub.cc.

References iphi(), iz(), ladder(), layer(), sistrip::layer_, module(), and sistrip::module_.

61  {
62  return (other.iphi() == iphi_ && other.iz() == iz_ && other.layer() == layer_ && other.ladder() == ladder_ &&
63  other.module() == module_);
64 }
unsigned int iz_
Definition: L1TStub.h:118
unsigned int iz() const
Definition: L1TStub.h:66
unsigned int module_
Definition: L1TStub.h:121
unsigned int ladder_
Definition: L1TStub.h:120
unsigned int iphi() const
Definition: L1TStub.h:65
unsigned int module() const
Definition: L1TStub.h:53
unsigned int ladder() const
Definition: L1TStub.h:52
unsigned int layer_
Definition: L1TStub.h:119
unsigned int layer() const
Definition: L1TStub.h:41
unsigned int iphi_
Definition: L1TStub.h:117
double trklet::L1TStub::phi ( void  ) const
inline
double trklet::L1TStub::pt ( ) const
inline
double trklet::L1TStub::r ( ) const
inline
double trklet::L1TStub::r2 ( ) const
inline

Definition at line 60 of file L1TStub.h.

References x_, and y_.

Referenced by trklet::MatchCalculator::execute(), and trklet::MatchProcessor::matchCalculator().

60 { return x_ * x_ + y_ * y_; }
int trklet::L1TStub::region ( ) const
inline

Definition at line 106 of file L1TStub.h.

References region_.

Referenced by trklet::TrackletEventProcessor::event().

106 { return region_; }
void trklet::L1TStub::setAllStubIndex ( unsigned int  index)
inline

Definition at line 81 of file L1TStub.h.

References allstubindex_.

Referenced by trklet::VMRouterCM::execute(), and trklet::VMRouter::execute().

void trklet::L1TStub::setiphi ( int  iphi)
inline

Definition at line 68 of file L1TStub.h.

References iphi(), and iphi_.

68 { iphi_ = iphi; }
unsigned int iphi() const
Definition: L1TStub.h:65
unsigned int iphi_
Definition: L1TStub.h:117
void trklet::L1TStub::setiz ( int  iz)
inline

Definition at line 69 of file L1TStub.h.

References iz(), and iz_.

69 { iz_ = iz; }
unsigned int iz_
Definition: L1TStub.h:118
unsigned int iz() const
Definition: L1TStub.h:66
void L1TStub::setXY ( double  x,
double  y 
)

Definition at line 97 of file L1TStub.cc.

97  {
98  x_ = x;
99  y_ = y;
100 }
double x() const
Definition: L1TStub.h:55
double y() const
Definition: L1TStub.h:56
double trklet::L1TStub::sigmax ( ) const
inline

Definition at line 71 of file L1TStub.h.

References sigmax_.

71 { return sigmax_; }
double sigmax_
Definition: L1TStub.h:126
double trklet::L1TStub::sigmaz ( ) const
inline
unsigned int trklet::L1TStub::strip ( void  ) const
inline

Definition at line 85 of file L1TStub.h.

References strip_.

85 { return strip_; }
unsigned int strip_
Definition: L1TStub.h:122
const std::string& trklet::L1TStub::stubword ( ) const
inline

Definition at line 108 of file L1TStub.h.

References stubword_.

Referenced by trklet::Stub::Stub().

108 { return stubword_; }
std::string stubword_
Definition: L1TStub.h:114
bool L1TStub::tpmatch ( int  tp) const

Definition at line 102 of file L1TStub.cc.

References funct::abs().

102  {
103  for (int itp : tps_) {
104  if (tp == std::abs(itp))
105  return true;
106  }
107 
108  return false;
109 }
std::vector< int > tps_
Definition: L1TStub.h:116
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
bool L1TStub::tpmatch2 ( int  tp) const

Definition at line 111 of file L1TStub.cc.

Referenced by trklet::Stub::Stub().

111  {
112  bool match1 = false;
113  bool match2 = false;
114  for (int itp : tps_) {
115  if (tp == itp) {
116  match1 = true;
117  }
118  if (tp == -itp) {
119  match2 = true;
120  }
121  }
122 
123  return match1 && match2;
124 }
std::vector< int > tps_
Definition: L1TStub.h:116
std::vector<int> trklet::L1TStub::tps ( ) const
inline

Definition at line 79 of file L1TStub.h.

References tps_.

Referenced by trklet::Tracklet::stubtruthmatch(), and trklet::Tracklet::tpseed().

79 { return tps_; }
std::vector< int > tps_
Definition: L1TStub.h:116
void L1TStub::write ( std::ofstream &  out)

Definition at line 51 of file L1TStub.cc.

51  {
52  out << "Stub: " << DTClink_ << "\t" << region_ << "\t" << layerdisk_ << "\t" << stubword_ << "\t" << isPSmodule_
53  << "\t" << isFlipped_ << "\t" << x_ << "\t" << y_ << "\t" << z_ << "\t" << bend_ << "\t" << strip_ << "\t"
54  << "\t" << tps_.size() << " \t";
55  for (int itp : tps_) {
56  out << itp << " \t";
57  }
58  out << endl;
59 }
std::vector< int > tps_
Definition: L1TStub.h:116
unsigned int strip_
Definition: L1TStub.h:122
unsigned int isPSmodule_
Definition: L1TStub.h:132
std::string DTClink_
Definition: L1TStub.h:112
std::string stubword_
Definition: L1TStub.h:114
unsigned int isFlipped_
Definition: L1TStub.h:133
double bend_
Definition: L1TStub.h:129
double trklet::L1TStub::x ( ) const
inline
double trklet::L1TStub::y ( ) const
inline
double trklet::L1TStub::z ( ) const
inline

Member Data Documentation

unsigned int trklet::L1TStub::allstubindex_
private

Definition at line 130 of file L1TStub.h.

Referenced by allStubIndex(), and setAllStubIndex().

double trklet::L1TStub::bend_
private

Definition at line 129 of file L1TStub.h.

Referenced by bend().

std::string trklet::L1TStub::DTClink_
private

Definition at line 112 of file L1TStub.h.

Referenced by DTClink().

int trklet::L1TStub::eventid_
private

Definition at line 115 of file L1TStub.h.

Referenced by eventid().

unsigned int trklet::L1TStub::iphi_
private

Definition at line 117 of file L1TStub.h.

Referenced by iphi(), and setiphi().

unsigned int trklet::L1TStub::isFlipped_
private

Definition at line 133 of file L1TStub.h.

Referenced by isFlipped().

unsigned int trklet::L1TStub::isPSmodule_
private

Definition at line 132 of file L1TStub.h.

Referenced by isPSmodule().

unsigned int trklet::L1TStub::iz_
private

Definition at line 118 of file L1TStub.h.

Referenced by iz(), and setiz().

unsigned int trklet::L1TStub::ladder_
private

Definition at line 120 of file L1TStub.h.

Referenced by ladder().

unsigned int trklet::L1TStub::layer_
private

Definition at line 119 of file L1TStub.h.

Referenced by layer().

int trklet::L1TStub::layerdisk_
private

Definition at line 111 of file L1TStub.h.

Referenced by disk(), and layerdisk().

unsigned int trklet::L1TStub::module_
private

Definition at line 121 of file L1TStub.h.

Referenced by module().

double trklet::L1TStub::pt_
private

Definition at line 128 of file L1TStub.h.

Referenced by pt().

int trklet::L1TStub::region_
private

Definition at line 113 of file L1TStub.h.

Referenced by region().

double trklet::L1TStub::sigmax_
private

Definition at line 126 of file L1TStub.h.

Referenced by sigmax().

double trklet::L1TStub::sigmaz_
private

Definition at line 127 of file L1TStub.h.

Referenced by sigmaz().

unsigned int trklet::L1TStub::strip_
private

Definition at line 122 of file L1TStub.h.

Referenced by strip().

std::string trklet::L1TStub::stubword_
private

Definition at line 114 of file L1TStub.h.

Referenced by stubword().

std::vector<int> trklet::L1TStub::tps_
private

Definition at line 116 of file L1TStub.h.

Referenced by tps().

double trklet::L1TStub::x_
private

Definition at line 123 of file L1TStub.h.

Referenced by phi(), r(), r2(), and x().

double trklet::L1TStub::y_
private

Definition at line 124 of file L1TStub.h.

Referenced by phi(), r(), r2(), and y().

double trklet::L1TStub::z_
private

Definition at line 125 of file L1TStub.h.

Referenced by disk(), and z().