Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:30:49

0001 #ifndef L1Trigger_TrackFindingTracklet_interface_TrackDerTable_h
0002 #define L1Trigger_TrackFindingTracklet_interface_TrackDerTable_h
0003 
0004 #include <iostream>
0005 #include <fstream>
0006 #include <cassert>
0007 #include <cmath>
0008 #include <vector>
0009 #include <string>
0010 
0011 #include "L1Trigger/TrackFindingTracklet/interface/TrackDer.h"
0012 
0013 namespace trklet {
0014 
0015   class Settings;
0016   class Globals;
0017 
0018   class TrackDerTable {
0019   public:
0020     TrackDerTable(Settings const& settings);
0021 
0022     ~TrackDerTable() = default;
0023 
0024     const TrackDer* getDerivatives(int index) const { return &derivatives_[index]; }
0025 
0026     const TrackDer* getDerivatives(unsigned int layermask,
0027                                    unsigned int diskmask,
0028                                    unsigned int alphaindex,
0029                                    unsigned int rinvindex) const;
0030 
0031     int getIndex(unsigned int layermask, unsigned int diskmask) const;
0032 
0033     void addEntry(unsigned int layermask, unsigned int diskmask, int multiplicity, int nrinv);
0034 
0035     void readPatternFile(std::string fileName);
0036 
0037     int getEntries() const { return nextLayerDiskValue_; }
0038 
0039     void fillTable();
0040 
0041     static void invert(double M[4][8], unsigned int n);
0042 
0043     static void invert(std::vector<std::vector<double> >& M, unsigned int n);
0044 
0045     static void calculateDerivatives(Settings const& settings,
0046                                      unsigned int nlayers,
0047                                      double r[N_LAYER],
0048                                      unsigned int ndisks,
0049                                      double z[N_DISK],
0050                                      double alpha[N_DISK],
0051                                      double t,
0052                                      double rinv,
0053                                      double D[N_FITPARAM][N_FITSTUB * 2],
0054                                      int iD[N_FITPARAM][N_FITSTUB * 2],
0055                                      double MinvDt[N_FITPARAM][N_FITSTUB * 2],
0056                                      int iMinvDt[N_FITPARAM][N_FITSTUB * 2],
0057                                      double sigma[N_FITSTUB * 2],
0058                                      double kfactor[N_FITSTUB * 2]);
0059 
0060     static double tpar(Settings const& settings, int diskmask, int layermask);
0061 
0062   private:
0063     Settings const& settings_;
0064 
0065     std::vector<int> LayerMem_;
0066     std::vector<int> DiskMem_;
0067     std::vector<int> LayerDiskMem_;
0068 
0069     unsigned int LayerMemBits_;
0070     unsigned int DiskMemBits_;
0071     unsigned int LayerDiskMemBits_;
0072     unsigned int alphaBits_;
0073 
0074     unsigned int Nlay_;
0075     unsigned int Ndisk_;
0076 
0077     std::vector<TrackDer> derivatives_;
0078 
0079     int nextLayerValue_;
0080     int nextDiskValue_;
0081     int nextLayerDiskValue_;
0082     int lastMultiplicity_;
0083   };
0084 
0085 };  // namespace trklet
0086 #endif