CMS 3D CMS Logo

Stub.h
Go to the documentation of this file.
1 #ifndef L1Trigger_TrackFindingTracklet_interface_Stub_h
2 #define L1Trigger_TrackFindingTracklet_interface_Stub_h
3 
4 #include <iostream>
5 #include <fstream>
6 #include <cassert>
7 #include <cmath>
8 
13 
14 namespace trklet {
15 
16  class Stub {
17  public:
18  Stub(Settings const& settings);
19 
20  Stub(L1TStub& stub, Settings const& settings, double phiminsec, double phimaxsec);
21 
22  ~Stub() = default;
23 
24  FPGAWord iphivmFineBins(int VMbits, int finebits) const;
25 
26  std::string str() const {
27  if (layer_.value() != -1) {
28  return r_.str() + "|" + z_.str() + "|" + phi_.str() + "|" + bend_.str();
29  } else {
30  if (isPSmodule()) {
31  return r_.str() + "|" + z_.str() + "|" + phi_.str() + "|" + bend_.str();
32  } else {
33  return "000" + r_.str() + "|" + z_.str() + "|" + phi_.str() + "|" + alphanew_.str() + "|" + bend_.str();
34  }
35  }
36  }
37 
38  std::string strbare() const { return bend_.str() + r_.str() + z_.str() + phi_.str(); }
39 
40  unsigned int phiregionaddress() const;
42 
43  void setAllStubIndex(int nstub); //should migrate away from using this method
44 
45  void setPhiCorr(int phiCorr);
46 
47  const FPGAWord& bend() const { return bend_; }
48 
49  const FPGAWord& r() const { return r_; }
50  const FPGAWord& z() const { return z_; }
51  const FPGAWord& phi() const { return phi_; }
52  const FPGAWord& phicorr() const { return phicorr_; }
53  const FPGAWord& alphanew() const { return alphanew_; }
54 
55  const FPGAWord& stubindex() const { return stubindex_; }
56  const FPGAWord& layer() const { return layer_; }
57  const FPGAWord& disk() const { return disk_; }
58  unsigned int layerdisk() const;
59 
60  bool isBarrel() const { return layer_.value() != -1; }
61  bool isDisk() const { return disk_.value() != 0; }
62 
63  bool isPSmodule() const { return isBarrel() ? (layer_.value() < (int)N_PSLAYER) : (r_.value() > 10); }
64 
65  double rapprox() const;
66  double zapprox() const;
67  double phiapprox(double phimin, double) const;
68 
69  L1TStub* l1tstub() { return l1tstub_; }
70  const L1TStub* l1tstub() const { return l1tstub_; }
72 
73  private:
80 
82 
83  FPGAWord phicorr_; //Corrected for bend to nominal radius
84 
86 
89  };
90 
91 }; // namespace trklet
92 #endif
trklet::Stub::phi_
FPGAWord phi_
Definition: Stub.h:78
Settings.h
trklet::N_PSLAYER
constexpr unsigned int N_PSLAYER
Definition: Settings.h:21
Util.h
L1TStub.h
trklet::Stub::Stub
Stub(Settings const &settings)
Definition: Stub.cc:12
trklet::Stub::phiregionaddressstr
std::string phiregionaddressstr() const
Definition: Stub.cc:182
trklet::Stub::alphanew_
FPGAWord alphanew_
Definition: Stub.h:79
trklet::FPGAWord::str
std::string str() const
Definition: FPGAWord.cc:54
trklet::Stub::phi
const FPGAWord & phi() const
Definition: Stub.h:51
phimin
float phimin
Definition: ReggeGribovPartonMCHadronizer.h:107
trklet::Stub::bend
const FPGAWord & bend() const
Definition: Stub.h:47
trklet::Stub::r_
FPGAWord r_
Definition: Stub.h:76
trklet::Stub::layer_
FPGAWord layer_
Definition: Stub.h:74
trklet::Settings
Definition: Settings.h:31
trklet::L1TStub
Definition: L1TStub.h:12
trklet::Stub::strbare
std::string strbare() const
Definition: Stub.h:38
trklet::Stub::phiapprox
double phiapprox(double phimin, double) const
Definition: Stub.cc:242
trklet::Stub::bend_
FPGAWord bend_
Definition: Stub.h:81
trklet::Stub::phicorr_
FPGAWord phicorr_
Definition: Stub.h:83
trklet::Stub::isBarrel
bool isBarrel() const
Definition: Stub.h:60
trklet::Stub::r
const FPGAWord & r() const
Definition: Stub.h:49
trklet::Stub::disk_
FPGAWord disk_
Definition: Stub.h:75
FPGAWord.h
trklet::Stub::~Stub
~Stub()=default
trklet::Stub::z_
FPGAWord z_
Definition: Stub.h:77
trklet::Stub::disk
const FPGAWord & disk() const
Definition: Stub.h:57
trklet::Stub::iphivmFineBins
FPGAWord iphivmFineBins(int VMbits, int finebits) const
Definition: Stub.cc:172
trklet::Stub::z
const FPGAWord & z() const
Definition: Stub.h:50
trklet::Stub
Definition: Stub.h:16
trklet::Stub::isDisk
bool isDisk() const
Definition: Stub.h:61
trklet::Stub::layerdisk
unsigned int layerdisk() const
Definition: Stub.cc:250
trklet::FPGAWord
Definition: FPGAWord.h:9
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
trklet::Stub::alphanew
const FPGAWord & alphanew() const
Definition: Stub.h:53
trklet::Stub::rapprox
double rapprox() const
Definition: Stub.cc:209
createfilelist.int
int
Definition: createfilelist.py:10
trklet::Stub::l1tstub
const L1TStub * l1tstub() const
Definition: Stub.h:70
trklet
Definition: AllProjectionsMemory.h:9
trklet::Stub::setAllStubIndex
void setAllStubIndex(int nstub)
Definition: Stub.cc:188
trklet::FPGAWord::value
int value() const
Definition: FPGAWord.h:24
trklet::Stub::str
std::string str() const
Definition: Stub.h:26
trklet::Stub::phiregionaddress
unsigned int phiregionaddress() const
Definition: Stub.cc:177
trklet::Stub::setl1tstub
void setl1tstub(L1TStub *l1tstub)
Definition: Stub.h:71
trklet::Stub::phicorr
const FPGAWord & phicorr() const
Definition: Stub.h:52
trklet::Stub::setPhiCorr
void setPhiCorr(int phiCorr)
Definition: Stub.cc:198
trklet::Stub::l1tstub
L1TStub * l1tstub()
Definition: Stub.h:69
trklet::Stub::stubindex
const FPGAWord & stubindex() const
Definition: Stub.h:55
trklet::Stub::isPSmodule
bool isPSmodule() const
Definition: Stub.h:63
trklet::Stub::layer
const FPGAWord & layer() const
Definition: Stub.h:56
trklet::Stub::settings_
Settings const & settings_
Definition: Stub.h:88
trklet::Stub::stubindex_
FPGAWord stubindex_
Definition: Stub.h:85
trklet::Stub::zapprox
double zapprox() const
Definition: Stub.cc:223
trklet::Stub::l1tstub_
L1TStub * l1tstub_
Definition: Stub.h:87