CMS 3D CMS Logo

TrackDerTable.h
Go to the documentation of this file.
1 #ifndef L1Trigger_TrackFindingTracklet_interface_TrackDerTable_h
2 #define L1Trigger_TrackFindingTracklet_interface_TrackDerTable_h
3 
4 #include <iostream>
5 #include <fstream>
6 #include <cassert>
7 #include <cmath>
8 #include <vector>
9 #include <string>
10 
12 
13 namespace trklet {
14 
15  class Settings;
16  class Globals;
17 
18  class TrackDerTable {
19  public:
20  TrackDerTable(Settings const& settings);
21 
22  ~TrackDerTable() = default;
23 
24  const TrackDer* getDerivatives(int index) const { return &derivatives_[index]; }
25 
26  const TrackDer* getDerivatives(unsigned int layermask,
27  unsigned int diskmask,
28  unsigned int alphaindex,
29  unsigned int rinvindex) const;
30 
31  int getIndex(unsigned int layermask, unsigned int diskmask) const;
32 
33  void addEntry(unsigned int layermask, unsigned int diskmask, int multiplicity, int nrinv);
34 
36 
37  int getEntries() const { return nextLayerDiskValue_; }
38 
39  void fillTable();
40 
41  static void invert(double M[4][8], unsigned int n);
42 
43  static void invert(std::vector<std::vector<double> >& M, unsigned int n);
44 
45  static void calculateDerivatives(Settings const& settings,
46  unsigned int nlayers,
47  double r[N_LAYER],
48  unsigned int ndisks,
49  double z[N_DISK],
50  double alpha[N_DISK],
51  double t,
52  double rinv,
53  double D[N_FITPARAM][N_FITSTUB * 2],
54  int iD[N_FITPARAM][N_FITSTUB * 2],
55  double MinvDt[N_FITPARAM][N_FITSTUB * 2],
56  int iMinvDt[N_FITPARAM][N_FITSTUB * 2],
57  double sigma[N_FITSTUB * 2],
58  double kfactor[N_FITSTUB * 2]);
59 
60  static double tpar(Settings const& settings, int diskmask, int layermask);
61 
62  private:
64 
65  std::vector<int> LayerMem_;
66  std::vector<int> DiskMem_;
67  std::vector<int> LayerDiskMem_;
68 
69  unsigned int LayerMemBits_;
70  unsigned int DiskMemBits_;
71  unsigned int LayerDiskMemBits_;
72  unsigned int alphaBits_;
73 
74  unsigned int Nlay_;
75  unsigned int Ndisk_;
76 
77  std::vector<TrackDer> derivatives_;
78 
83  };
84 
85 }; // namespace trklet
86 #endif
unsigned int alphaBits_
Definition: TrackDerTable.h:72
float alpha
Definition: AMPTWrapper.h:105
constexpr int N_DISK
Definition: Settings.h:22
static void calculateDerivatives(Settings const &settings, unsigned int nlayers, double r[N_LAYER], unsigned int ndisks, double z[N_DISK], double alpha[N_DISK], double t, double rinv, double D[N_FITPARAM][N_FITSTUB *2], int iD[N_FITPARAM][N_FITSTUB *2], double MinvDt[N_FITPARAM][N_FITSTUB *2], int iMinvDt[N_FITPARAM][N_FITSTUB *2], double sigma[N_FITSTUB *2], double kfactor[N_FITSTUB *2])
std::vector< int > LayerMem_
Definition: TrackDerTable.h:65
TrackDerTable(Settings const &settings)
Settings const & settings_
Definition: TrackDerTable.h:63
int getEntries() const
Definition: TrackDerTable.h:37
unsigned int LayerMemBits_
Definition: TrackDerTable.h:69
std::vector< int > LayerDiskMem_
Definition: TrackDerTable.h:67
unsigned int DiskMemBits_
Definition: TrackDerTable.h:70
int getIndex(unsigned int layermask, unsigned int diskmask) const
unsigned int LayerDiskMemBits_
Definition: TrackDerTable.h:71
static double tpar(Settings const &settings, int diskmask, int layermask)
std::vector< int > DiskMem_
Definition: TrackDerTable.h:66
const TrackDer * getDerivatives(int index) const
Definition: TrackDerTable.h:24
static void invert(double M[4][8], unsigned int n)
void addEntry(unsigned int layermask, unsigned int diskmask, int multiplicity, int nrinv)
DecomposeProduct< arg, typename Div::arg > D
Definition: Factorize.h:141
double rinv(double phi1, double phi2, double r1, double r2)
Definition: Util.h:49
constexpr unsigned int N_FITPARAM
Definition: Settings.h:977
void readPatternFile(std::string fileName)
constexpr unsigned int N_FITSTUB
Definition: Settings.h:978
const unsigned int kfactor
std::vector< TrackDer > derivatives_
Definition: TrackDerTable.h:77
constexpr int N_LAYER
Definition: Settings.h:21