CMS 3D CMS Logo

L1TStub.cc
Go to the documentation of this file.
3 
4 using namespace std;
5 using namespace trklet;
6 
7 L1TStub::L1TStub() {}
8 
9 L1TStub::L1TStub(int eventid,
10  vector<int> tps,
11  int iphi,
12  int iz,
13  int layer,
14  int ladder,
15  int module,
16  int strip,
17  double x,
18  double y,
19  double z,
20  double sigmax,
21  double sigmaz,
22  double pt,
23  double bend,
24  int isPSmodule,
25  int isFlipped) {
26  eventid_ = eventid;
27  tps_ = tps;
28  iphi_ = iphi;
29  iz_ = iz;
30  layer_ = layer;
31  ladder_ = ladder;
32  module_ = module;
33  strip_ = strip;
34  x_ = x;
35  y_ = y;
36  z_ = z;
37  sigmax_ = sigmax;
38  sigmaz_ = sigmaz;
39  pt_ = pt;
40  bend_ = bend;
41  isPSmodule_ = isPSmodule;
42  isFlipped_ = isFlipped;
43 
44  allstubindex_ = 999;
45 }
46 
47 void L1TStub::write(ofstream& out) {
48  out << "Stub: " << layer_ + 1 << "\t" << ladder_ << "\t" << module_ << "\t" << strip_ << "\t" << eventid_ << "\t"
49  << pt_ << "\t" << x_ << "\t" << y_ << "\t" << z_ << "\t" << bend_ << "\t" << isPSmodule_ << "\t" << isFlipped_
50  << "\t" << tps_.size() << " \t";
51  for (int itp : tps_) {
52  out << itp << " \t";
53  }
54  out << endl;
55 }
56 
57 void L1TStub::write(ostream& out) {
58  out << "Stub: " << layer_ + 1 << "\t" << ladder_ << "\t" << module_ << "\t" << strip_ << "\t" << eventid_ << "\t"
59  << pt_ << "\t" << x_ << "\t" << y_ << "\t" << z_ << "\t" << bend_ << "\t" << isPSmodule_ << "\t" << isFlipped_
60  << "\t" << tps_.size() << " \t";
61  for (int itp : tps_) {
62  out << itp << " \t";
63  }
64  out << endl;
65 }
66 
67 bool L1TStub::operator==(const L1TStub& other) const {
68  return (other.iphi() == iphi_ && other.iz() == iz_ && other.layer() == layer_ && other.ladder() == ladder_ &&
69  other.module() == module_);
70 }
71 
72 void L1TStub::lorentzcor(double shift) {
73  double r = this->r();
74  double phi = this->phi() - shift / r;
75  this->x_ = r * cos(phi);
76  this->y_ = r * sin(phi);
77 }
78 
79 double L1TStub::alpha(double pitch) const {
80  if (isPSmodule())
81  return 0.0;
82  int flip = 1;
83  if (isFlipped())
84  flip = -1;
85  if (z_ > 0.0) {
86  return ((int)strip_ - 509.5) * pitch * flip / r2();
87  }
88  return -((int)strip_ - 509.5) * pitch * flip / r2();
89 }
90 
91 double L1TStub::alphanorm() const {
92  if (isPSmodule())
93  return 0.0;
94  int flip = 1;
95  if (isFlipped())
96  flip = -1;
97  if (z_ > 0.0) {
98  return ((int)strip_ - 509.5) * flip / 510.0;
99  }
100  return -((int)strip_ - 509.5) * flip / 510.0;
101 }
102 
103 void L1TStub::setXY(double x, double y) {
104  x_ = x;
105  y_ = y;
106 }
107 
108 bool L1TStub::tpmatch(int tp) const {
109  for (int itp : tps_) {
110  if (tp == itp)
111  return true;
112  }
113 
114  return false;
115 }
116 
117 bool L1TStub::isTilted() const {
118  //here layer_ runs 0-5 for barrel, >1000 for disk
119  //disk modules and outer barrel modules are not tilted by construction
120  if (layer_ >= N_PSLAYER)
121  return false;
122 
123  assert(layer_ < N_PSLAYER); // safety for acccessing # modules/plank
125  return true;
126  return false;
127 }
Settings.h
trklet::N_PSLAYER
constexpr unsigned int N_PSLAYER
Definition: Settings.h:21
L1TStub.h
sistrip::module_
static const char module_[]
Definition: ConstantsForGranularity.h:38
DiDispStaMuonMonitor_cfi.pt
pt
Definition: DiDispStaMuonMonitor_cfi.py:39
digitizers_cfi.strip
strip
Definition: digitizers_cfi.py:19
trklet::L1TStub
Definition: L1TStub.h:12
cms::cuda::assert
assert(be >=bs)
alpha
float alpha
Definition: AMPTWrapper.h:105
trklet::N_TILTED_RINGS
constexpr unsigned int N_TILTED_RINGS
Definition: Settings.h:772
funct::sin
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
LEDCalibrationChannels.iphi
iphi
Definition: LEDCalibrationChannels.py:64
funct::cos
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
pfNegativeDeepFlavourTagInfos_cfi.flip
flip
Definition: pfNegativeDeepFlavourTagInfos_cfi.py:8
trackingPlots.other
other
Definition: trackingPlots.py:1460
cmsswSequenceInfo.tp
tp
Definition: cmsswSequenceInfo.py:17
phase1PixelTopology::layer
constexpr std::array< uint8_t, layerIndexSize > layer
Definition: phase1PixelTopology.h:99
operator==
bool operator==(const QGLikelihoodParameters &lhs, const QGLikelihoodCategory &rhs)
Test if parameters are compatible with category.
Definition: QGLikelihoodObject.h:49
diffTwoXMLs.r2
r2
Definition: diffTwoXMLs.py:73
createfilelist.int
int
Definition: createfilelist.py:10
trklet
Definition: AllProjectionsMemory.h:9
alignCSCRings.r
r
Definition: alignCSCRings.py:93
writeEcalDQMStatus.write
write
Definition: writeEcalDQMStatus.py:48
std
Definition: JetResolutionObject.h:76
edm::shift
static unsigned const int shift
Definition: LuminosityBlockID.cc:7
trklet::bend
double bend(double r, double rinv, double stripPitch)
Definition: Util.h:166
trklet::N_MOD_PLANK
constexpr std::array< unsigned int, N_PSLAYER > N_MOD_PLANK
Definition: Settings.h:773
PVValHelper::ladder
Definition: PVValidationHelpers.h:73
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
sistrip::layer_
static const char layer_[]
Definition: ConstantsForGranularity.h:30