Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:19:27

0001 #ifndef L1Trigger_CSCSectorReceiverLUT_h
0002 #define L1Trigger_CSCSectorReceiverLUT_h
0003 
0004 /**
0005  * \class CSCSectorReceiverLUT
0006  * \author Lindsey Gray, Slava Valuev, Jason Mumford
0007  *
0008  * Provides Look Up Table information for use in the SP Core.
0009  * Partial port from ORCA.
0010  */
0011 
0012 #include <L1Trigger/CSCTrackFinder/interface/CSCTrackFinderDataTypes.h>
0013 #include <FWCore/ParameterSet/interface/ParameterSet.h>
0014 #include <FWCore/ParameterSet/interface/FileInPath.h>
0015 #include "Geometry/CSCGeometry/interface/CSCGeometry.h"
0016 
0017 class CSCLayer;
0018 
0019 class CSCSectorReceiverLUT {
0020 public:
0021   CSCSectorReceiverLUT(int endcap, int sector, int subsector, int station, const edm::ParameterSet& pset, bool TMB07);
0022   CSCSectorReceiverLUT(const CSCSectorReceiverLUT&);
0023   ~CSCSectorReceiverLUT();
0024 
0025   CSCSectorReceiverLUT& operator=(const CSCSectorReceiverLUT&);
0026 
0027   ///Geometry Lookup Tables
0028 
0029   /// Please note, the pattern used below is the 4 bit pattern.
0030   /// ex) digi->getPattern(), NOT digi->getCLCTPattern()
0031   lclphidat localPhi(int strip, int pattern, int quality, int lr, const bool gangedME1a = false) const;
0032   lclphidat localPhi(unsigned address, const bool gangedME1a = false) const;
0033   lclphidat localPhi(lclphiadd address, const bool gangedME1a = false) const;
0034 
0035   gblphidat globalPhiME(int phi_local, int wire_group, int cscid, const bool gangedME1a = false) const;
0036   gblphidat globalPhiME(unsigned address, const bool gangedME1a = false) const;
0037   gblphidat globalPhiME(gblphiadd address, const bool gangedME1a = false) const;
0038 
0039   gblphidat globalPhiMB(int phi_local, int wire_group, int cscid, const bool gangedME1a = false) const;
0040   gblphidat globalPhiMB(unsigned address, const bool gangedME1a = false) const;
0041   gblphidat globalPhiMB(gblphiadd address, const bool gangedME1a = false) const;
0042 
0043   gbletadat globalEtaME(int phi_bend, int phi_local, int wire_group, int cscid, const bool gangedME1a = false) const;
0044   gbletadat globalEtaME(unsigned address, const bool gangedME1a = false) const;
0045   gbletadat globalEtaME(gbletaadd address, const bool gangedME1a = false) const;
0046 
0047   /// Helpers
0048   std::string encodeFileIndex() const;
0049 
0050   void setCSCGeometry(const CSCGeometry* g) { csc_g = g; }
0051 
0052 private:
0053   int _endcap, _sector, _subsector, _station;
0054 
0055   /// Local Phi LUT
0056   lclphidat calcLocalPhi(const lclphiadd& address) const;
0057 
0058   /// Global Phi LUT
0059   gblphidat calcGlobalPhiME(const gblphiadd& address) const;
0060   gblphidat calcGlobalPhiMB(const gblphidat& me_gphi_data) const;
0061   double getGlobalPhiValue(const CSCLayer* thelayer, const unsigned& strip, const unsigned& wire_group) const;
0062 
0063   /// Global Eta LUT
0064   gbletadat calcGlobalEtaME(const gbletaadd& address) const;
0065   double getGlobalEtaValue(const unsigned& cscid, const unsigned& wire_group, const unsigned& phi_local) const;
0066 
0067   void fillLocalPhiLUT();
0068 
0069   edm::FileInPath me_lcl_phi_file;
0070   edm::FileInPath me_gbl_phi_file;
0071   edm::FileInPath mb_gbl_phi_file;
0072   edm::FileInPath me_gbl_eta_file;
0073   bool LUTsFromFile;  // readLUTs from file or generate on the fly
0074   bool useMiniLUTs;  // if useMiniLUTs is set to true, the code will generate LUTs using the CSCSectorReceiverMiniLUTs class -- BJ
0075   bool isBinary;  // if readLUTs is set to true, are the LUT files binary or ascii format
0076 
0077   bool isTMB07;  // use the TMB 2007 patterns or the older set of parameters
0078 
0079   /// Arrays for holding read in LUT information.
0080   /// MB LUT arrays only initialized in ME1
0081   void readLUTsFromFile();
0082 
0083   static bool me_lcl_phi_loaded;
0084   static lclphidat* me_lcl_phi;
0085   gblphidat *me_global_phi, *mb_global_phi;
0086   gbletadat* me_global_eta;
0087 
0088   const CSCGeometry* csc_g;
0089 };
0090 
0091 #endif