CMS 3D CMS Logo

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() [1/2]

L1TStub::L1TStub ( )

Definition at line 6 of file L1TStub.cc.

6 {}

◆ L1TStub() [2/2]

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.

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 }

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

◆ ~L1TStub()

trklet::L1TStub::~L1TStub ( )
default

Member Function Documentation

◆ allStubIndex()

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

Definition at line 83 of file L1TStub.h.

83 { return allstubindex_; }

References allstubindex_.

◆ alpha()

double L1TStub::alpha ( double  pitch) const

Definition at line 73 of file L1TStub.cc.

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 }

References pfNegativeDeepFlavourTagInfos_cfi::flip, createfilelist::int, and diffTwoXMLs::r2.

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

◆ alphanorm()

double L1TStub::alphanorm ( ) const

Definition at line 85 of file L1TStub.cc.

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 }

References pfNegativeDeepFlavourTagInfos_cfi::flip, and createfilelist::int.

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

◆ bend()

double trklet::L1TStub::bend ( ) const
inline

Definition at line 61 of file L1TStub.h.

61 { return bend_; }

References bend_.

◆ diphi()

double trklet::L1TStub::diphi ( )

◆ disk()

int trklet::L1TStub::disk ( ) const
inline

Definition at line 42 of file L1TStub.h.

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  }

References layerdisk_, trklet::N_LAYER, and z_.

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

◆ diz()

double trklet::L1TStub::diz ( )

◆ DTClink()

const std::string& trklet::L1TStub::DTClink ( ) const
inline

Definition at line 102 of file L1TStub.h.

102 { return DTClink_; }

References DTClink_.

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

◆ eventid()

int trklet::L1TStub::eventid ( ) const
inline

Definition at line 78 of file L1TStub.h.

78 { return eventid_; }

References eventid_.

◆ iphi()

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

Definition at line 65 of file L1TStub.h.

65 { return iphi_; }

References iphi_.

Referenced by setiphi().

◆ iphiouter()

double trklet::L1TStub::iphiouter ( )

◆ isFlipped()

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

Definition at line 95 of file L1TStub.h.

95 { return isFlipped_; }

References isFlipped_.

◆ isPSmodule()

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

◆ isTilted()

bool L1TStub::isTilted ( ) const

Definition at line 126 of file L1TStub.cc.

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 }

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

◆ iz()

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

Definition at line 66 of file L1TStub.h.

66 { return iz_; }

References iz_.

Referenced by setiz().

◆ ladder()

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

Definition at line 52 of file L1TStub.h.

52 { return ladder_; }

References ladder_.

◆ layer()

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

◆ layerdisk()

int trklet::L1TStub::layerdisk ( ) const
inline

◆ lorentzcor()

void L1TStub::lorentzcor ( double  shift)

Definition at line 66 of file L1TStub.cc.

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 }

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

◆ module()

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

Definition at line 53 of file L1TStub.h.

53 { return module_; }

References module_.

◆ operator==()

bool L1TStub::operator== ( const L1TStub other) const

Definition at line 61 of file L1TStub.cc.

61  {
62  return (other.iphi() == iphi_ && other.iz() == iz_ && other.layer() == layer_ && other.ladder() == ladder_ &&
63  other.module() == module_);
64 }

References sistrip::layer_, sistrip::module_, and trackingPlots::other.

◆ phi()

double trklet::L1TStub::phi ( void  ) const
inline

◆ pt()

double trklet::L1TStub::pt ( ) const
inline

◆ r()

double trklet::L1TStub::r ( ) const
inline

◆ r2()

double trklet::L1TStub::r2 ( ) const
inline

Definition at line 60 of file L1TStub.h.

60 { return x_ * x_ + y_ * y_; }

References x_, and y_.

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

◆ region()

int trklet::L1TStub::region ( ) const
inline

Definition at line 106 of file L1TStub.h.

106 { return region_; }

References region_.

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

◆ setAllStubIndex()

void trklet::L1TStub::setAllStubIndex ( unsigned int  index)
inline

Definition at line 81 of file L1TStub.h.

81 { allstubindex_ = index; }

References allstubindex_.

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

◆ setiphi()

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

Definition at line 68 of file L1TStub.h.

68 { iphi_ = iphi; }

References iphi(), and iphi_.

◆ setiz()

void trklet::L1TStub::setiz ( int  iz)
inline

Definition at line 69 of file L1TStub.h.

69 { iz_ = iz; }

References iz(), and iz_.

◆ setXY()

void L1TStub::setXY ( double  x,
double  y 
)

Definition at line 97 of file L1TStub.cc.

97  {
98  x_ = x;
99  y_ = y;
100 }

◆ sigmax()

double trklet::L1TStub::sigmax ( ) const
inline

Definition at line 71 of file L1TStub.h.

71 { return sigmax_; }

References sigmax_.

◆ sigmaz()

double trklet::L1TStub::sigmaz ( ) const
inline

◆ strip()

unsigned int trklet::L1TStub::strip ( void  ) const
inline

Definition at line 85 of file L1TStub.h.

85 { return strip_; }

References strip_.

◆ stubword()

const std::string& trklet::L1TStub::stubword ( ) const
inline

Definition at line 108 of file L1TStub.h.

108 { return stubword_; }

References stubword_.

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

◆ tpmatch()

bool L1TStub::tpmatch ( int  tp) const

Definition at line 102 of file L1TStub.cc.

102  {
103  for (int itp : tps_) {
104  if (tp == std::abs(itp))
105  return true;
106  }
107 
108  return false;
109 }

References funct::abs(), and cmsswSequenceInfo::tp.

◆ tpmatch2()

bool L1TStub::tpmatch2 ( int  tp) const

Definition at line 111 of file L1TStub.cc.

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 }

References cmsswSequenceInfo::tp.

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

◆ tps()

std::vector<int> trklet::L1TStub::tps ( ) const
inline

Definition at line 79 of file L1TStub.h.

79 { return tps_; }

References tps_.

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

◆ write()

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 }

References MillePedeFileConverter_cfg::out.

◆ x()

double trklet::L1TStub::x ( ) const
inline

◆ y()

double trklet::L1TStub::y ( ) const
inline

◆ z()

double trklet::L1TStub::z ( ) const
inline

Member Data Documentation

◆ allstubindex_

unsigned int trklet::L1TStub::allstubindex_
private

Definition at line 130 of file L1TStub.h.

Referenced by allStubIndex(), and setAllStubIndex().

◆ bend_

double trklet::L1TStub::bend_
private

Definition at line 129 of file L1TStub.h.

Referenced by bend().

◆ DTClink_

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

Definition at line 112 of file L1TStub.h.

Referenced by DTClink().

◆ eventid_

int trklet::L1TStub::eventid_
private

Definition at line 115 of file L1TStub.h.

Referenced by eventid().

◆ iphi_

unsigned int trklet::L1TStub::iphi_
private

Definition at line 117 of file L1TStub.h.

Referenced by iphi(), and setiphi().

◆ isFlipped_

unsigned int trklet::L1TStub::isFlipped_
private

Definition at line 133 of file L1TStub.h.

Referenced by isFlipped().

◆ isPSmodule_

unsigned int trklet::L1TStub::isPSmodule_
private

Definition at line 132 of file L1TStub.h.

Referenced by isPSmodule().

◆ iz_

unsigned int trklet::L1TStub::iz_
private

Definition at line 118 of file L1TStub.h.

Referenced by iz(), and setiz().

◆ ladder_

unsigned int trklet::L1TStub::ladder_
private

Definition at line 120 of file L1TStub.h.

Referenced by ladder().

◆ layer_

unsigned int trklet::L1TStub::layer_
private

Definition at line 119 of file L1TStub.h.

Referenced by layer().

◆ layerdisk_

int trklet::L1TStub::layerdisk_
private

Definition at line 111 of file L1TStub.h.

Referenced by disk(), and layerdisk().

◆ module_

unsigned int trklet::L1TStub::module_
private

Definition at line 121 of file L1TStub.h.

Referenced by module().

◆ pt_

double trklet::L1TStub::pt_
private

Definition at line 128 of file L1TStub.h.

Referenced by pt().

◆ region_

int trklet::L1TStub::region_
private

Definition at line 113 of file L1TStub.h.

Referenced by region().

◆ sigmax_

double trklet::L1TStub::sigmax_
private

Definition at line 126 of file L1TStub.h.

Referenced by sigmax().

◆ sigmaz_

double trklet::L1TStub::sigmaz_
private

Definition at line 127 of file L1TStub.h.

Referenced by sigmaz().

◆ strip_

unsigned int trklet::L1TStub::strip_
private

Definition at line 122 of file L1TStub.h.

Referenced by strip().

◆ stubword_

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

Definition at line 114 of file L1TStub.h.

Referenced by stubword().

◆ tps_

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

Definition at line 116 of file L1TStub.h.

Referenced by tps().

◆ x_

double trklet::L1TStub::x_
private

Definition at line 123 of file L1TStub.h.

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

◆ y_

double trklet::L1TStub::y_
private

Definition at line 124 of file L1TStub.h.

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

◆ z_

double trklet::L1TStub::z_
private

Definition at line 125 of file L1TStub.h.

Referenced by disk(), and z().

trklet::N_PSLAYER
constexpr unsigned int N_PSLAYER
Definition: Settings.h:23
trklet::L1TStub::tps
std::vector< int > tps() const
Definition: L1TStub.h:79
trklet::L1TStub::eventid_
int eventid_
Definition: L1TStub.h:115
trklet::L1TStub::region_
int region_
Definition: L1TStub.h:113
trklet::L1TStub::sigmaz_
double sigmaz_
Definition: L1TStub.h:127
trklet::L1TStub::strip_
unsigned int strip_
Definition: L1TStub.h:122
trklet::L1TStub::module_
unsigned int module_
Definition: L1TStub.h:121
trklet::L1TStub::isPSmodule_
unsigned int isPSmodule_
Definition: L1TStub.h:132
trklet::L1TStub::bend
double bend() const
Definition: L1TStub.h:61
trklet::L1TStub::z
double z() const
Definition: L1TStub.h:57
trklet::L1TStub::tps_
std::vector< int > tps_
Definition: L1TStub.h:116
cms::cuda::assert
assert(be >=bs)
trklet::L1TStub::ladder_
unsigned int ladder_
Definition: L1TStub.h:120
trklet::L1TStub::DTClink
const std::string & DTClink() const
Definition: L1TStub.h:102
trklet::L1TStub::y
double y() const
Definition: L1TStub.h:56
trklet::L1TStub::DTClink_
std::string DTClink_
Definition: L1TStub.h:112
trklet::N_TILTED_RINGS
constexpr unsigned int N_TILTED_RINGS
Definition: Settings.h:893
trklet::L1TStub::x
double x() const
Definition: L1TStub.h:55
funct::sin
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
trklet::L1TStub::sigmax_
double sigmax_
Definition: L1TStub.h:126
trklet::L1TStub::stubword_
std::string stubword_
Definition: L1TStub.h:114
funct::cos
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
pfNegativeDeepFlavourTagInfos_cfi.flip
flip
Definition: pfNegativeDeepFlavourTagInfos_cfi.py:8
trklet::L1TStub::strip
unsigned int strip() const
Definition: L1TStub.h:85
trklet::L1TStub::isPSmodule
unsigned int isPSmodule() const
Definition: L1TStub.h:94
trklet::L1TStub::x_
double x_
Definition: L1TStub.h:123
trklet::N_LAYER
constexpr int N_LAYER
Definition: Settings.h:21
trackingPlots.other
other
Definition: trackingPlots.py:1464
trklet::L1TStub::layerdisk
int layerdisk() const
Definition: L1TStub.h:104
cmsswSequenceInfo.tp
tp
Definition: cmsswSequenceInfo.py:17
trklet::L1TStub::y_
double y_
Definition: L1TStub.h:124
createfilelist.int
int
Definition: createfilelist.py:10
trklet::L1TStub::disk
int disk() const
Definition: L1TStub.h:42
trklet::L1TStub::isFlipped
unsigned int isFlipped() const
Definition: L1TStub.h:95
trklet::L1TStub::z_
double z_
Definition: L1TStub.h:125
trklet::L1TStub::layer_
unsigned int layer_
Definition: L1TStub.h:119
trklet::L1TStub::iz
unsigned int iz() const
Definition: L1TStub.h:66
trklet::L1TStub::layerdisk_
int layerdisk_
Definition: L1TStub.h:111
trklet::L1TStub::pt_
double pt_
Definition: L1TStub.h:128
trklet::L1TStub::stubword
const std::string & stubword() const
Definition: L1TStub.h:108
edm::shift
static unsigned const int shift
Definition: LuminosityBlockID.cc:7
trklet::N_MOD_PLANK
constexpr std::array< unsigned int, N_PSLAYER > N_MOD_PLANK
Definition: Settings.h:894
trklet::L1TStub::allstubindex_
unsigned int allstubindex_
Definition: L1TStub.h:130
trklet::L1TStub::isFlipped_
unsigned int isFlipped_
Definition: L1TStub.h:133
trklet::L1TStub::iphi_
unsigned int iphi_
Definition: L1TStub.h:117
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
trklet::L1TStub::iphi
unsigned int iphi() const
Definition: L1TStub.h:65
trklet::L1TStub::r
double r() const
Definition: L1TStub.h:58
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
trklet::L1TStub::region
int region() const
Definition: L1TStub.h:106
trklet::L1TStub::bend_
double bend_
Definition: L1TStub.h:129
trklet::L1TStub::r2
double r2() const
Definition: L1TStub.h:60
trklet::L1TStub::phi
double phi() const
Definition: L1TStub.h:63
trklet::L1TStub::iz_
unsigned int iz_
Definition: L1TStub.h:118