Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:31:03

0001 //-------------------------------------------------
0002 //
0003 /**  \class DTConfigManager
0004  *
0005  *   DTTPG Configuration manager 
0006  *   Includes config classes for every single chip
0007  *
0008  *   \author  C. Battilana
0009  *   april 07 : SV DTConfigTrigUnit added
0010  *   april 07 : CB Removed DTGeometry dependecies
0011  *   september 08 : SV LUTs added
0012  *   091106 SV flags for DB/geometry lut or bti acceptance compute
0013  */
0014 //
0015 //--------------------------------------------------
0016 #ifndef DT_CONFIG_MANAGER_H
0017 #define DT_CONFIG_MANAGER_H
0018 
0019 //---------------
0020 // C++ Headers --
0021 //---------------
0022 #include <map>
0023 
0024 //----------------------
0025 // Base Class Headers --
0026 //----------------------
0027 #include "L1TriggerConfig/DTTPGConfig/interface/DTConfigBti.h"
0028 #include "L1TriggerConfig/DTTPGConfig/interface/DTConfigTraco.h"
0029 #include "L1TriggerConfig/DTTPGConfig/interface/DTConfigTSTheta.h"
0030 #include "L1TriggerConfig/DTTPGConfig/interface/DTConfigTSPhi.h"
0031 #include "L1TriggerConfig/DTTPGConfig/interface/DTConfigTrigUnit.h"
0032 #include "L1TriggerConfig/DTTPGConfig/interface/DTConfigSectColl.h"
0033 #include "L1TriggerConfig/DTTPGConfig/interface/DTConfigLUTs.h"
0034 #include "DataFormats/MuonDetId/interface/DTChamberId.h"
0035 #include "DataFormats/MuonDetId/interface/DTBtiId.h"
0036 #include "DataFormats/MuonDetId/interface/DTTracoId.h"
0037 #include "DataFormats/MuonDetId/interface/DTSectCollId.h"
0038 
0039 #include "L1TriggerConfig/DTTPGConfig/interface/DTConfigPedestals.h"
0040 
0041 //------------------------------------
0042 // Collaborating Class Declarations --
0043 //------------------------------------
0044 
0045 //              ---------------------
0046 //              -- Class Interface --
0047 //              ---------------------
0048 
0049 class DTConfigManager {
0050 public:
0051   typedef std::map<DTBtiId, DTConfigBti> innerBtiMap;
0052   typedef std::map<DTTracoId, DTConfigTraco> innerTracoMap;
0053   typedef std::map<DTChamberId, innerBtiMap> BtiMap;
0054   typedef std::map<DTChamberId, innerTracoMap> TracoMap;
0055   typedef std::map<DTChamberId, DTConfigTSTheta> TSThetaMap;
0056   typedef std::map<DTChamberId, DTConfigTSPhi> TSPhiMap;
0057   typedef std::map<DTChamberId, DTConfigTrigUnit> TrigUnitMap;
0058   typedef std::map<DTChamberId, DTConfigLUTs> LUTMap;
0059   typedef std::map<DTSectCollId, DTConfigSectColl> SectCollMap;
0060 
0061 public:
0062   //! Constructor
0063   DTConfigManager();
0064 
0065   //! Destructor
0066   ~DTConfigManager();
0067 
0068   //! Get desired BTI configuration
0069   const DTConfigBti* getDTConfigBti(DTBtiId) const;
0070 
0071   //! Get desired BTI configuration map for a given DTChamber
0072   const std::map<DTBtiId, DTConfigBti>& getDTConfigBtiMap(DTChamberId) const;
0073 
0074   //! Get desired TRACO configuration
0075   const DTConfigTraco* getDTConfigTraco(DTTracoId) const;
0076 
0077   //! Get desired TRACO configuration map for a given DTChamber
0078   const std::map<DTTracoId, DTConfigTraco>& getDTConfigTracoMap(DTChamberId) const;
0079 
0080   //! Get desired Trigger Server Theta configuration
0081   const DTConfigTSTheta* getDTConfigTSTheta(DTChamberId) const;
0082 
0083   //! Get desired Trigger Server Phi configuration
0084   const DTConfigTSPhi* getDTConfigTSPhi(DTChamberId) const;
0085 
0086   //! Get desired Trigger Unit configuration
0087   const DTConfigTrigUnit* getDTConfigTrigUnit(DTChamberId) const;
0088 
0089   //! Get desired LUT configuration
0090   const DTConfigLUTs* getDTConfigLUTs(DTChamberId) const;
0091 
0092   //! Get desired SectorCollector configuration
0093   const DTConfigSectColl* getDTConfigSectColl(DTSectCollId) const;
0094 
0095   //! Get desired Pedestals configuration
0096   const DTConfigPedestals* getDTConfigPedestals() const;
0097 
0098   //! Get global debug flag
0099   inline bool getDTTPGDebug() const { return my_dttpgdebug; };
0100 
0101   //! Get BX Offset for a given vdrift config
0102   int getBXOffset() const;
0103 
0104   //! Lut from DB flag
0105   inline bool lutFromDB() const { return my_lutfromdb; }
0106 
0107   //! Use Bti acceptance parameters (LL,LH,CL,CH,RL,RH)
0108   inline bool useAcceptParam() const { return my_acceptparam; }
0109 
0110   //! flag for CCB configuration validity
0111   inline bool CCBConfigValidity() const { return my_CCBvalid; }
0112 
0113   //! Set DTConfigBti for desired chip
0114   void setDTConfigBti(DTBtiId, DTConfigBti);
0115 
0116   //! Set DTConfigTraco for desired chip
0117   void setDTConfigTraco(DTTracoId, DTConfigTraco);
0118 
0119   //! Set DTConfigTSTheta for desired chip
0120   inline void setDTConfigTSTheta(DTChamberId chambid, DTConfigTSTheta conf) { my_tsthetamap[chambid] = conf; };
0121 
0122   //! Set DTConfigTSPhi for desired chip
0123   inline void setDTConfigTSPhi(DTChamberId chambid, DTConfigTSPhi conf) { my_tsphimap[chambid] = conf; };
0124 
0125   //! Set DTConfigTrigUnit for desired chamber
0126   void setDTConfigTrigUnit(DTChamberId chambid, DTConfigTrigUnit conf) { my_trigunitmap[chambid] = conf; };
0127 
0128   //! Set DTConfigLUTs for desired chamber
0129   void setDTConfigLUTs(DTChamberId chambid, DTConfigLUTs conf) { my_lutmap[chambid] = conf; };
0130 
0131   //! Set DTConfigSectColl for desired chip
0132   void setDTConfigSectColl(DTSectCollId sectcollid, DTConfigSectColl conf) { my_sectcollmap[sectcollid] = conf; };
0133 
0134   //! Set DTConfigPedestals configuration
0135   void setDTConfigPedestals(DTConfigPedestals pedestals) { my_pedestals = pedestals; };
0136 
0137   //! SetGlobalDebug flag
0138   inline void setDTTPGDebug(bool debug) { my_dttpgdebug = debug; }
0139 
0140   //! Set lut from DB flag
0141   inline void setLutFromDB(bool lutFromDB) { my_lutfromdb = lutFromDB; }
0142 
0143   //! Set the use of Bti acceptance parameters (LL,LH,CL,CH,RL,RH)
0144   inline void setUseAcceptParam(bool acceptparam) { my_acceptparam = acceptparam; }
0145 
0146   //! Set the flag for CCB configuration validity
0147   inline void setCCBConfigValidity(bool CCBValid) { my_CCBvalid = CCBValid; }
0148 
0149   //! Dump luts string commands from configuration parameters
0150   void dumpLUTParam(DTChamberId& chambid) const; /* SV 091111 */
0151 
0152 private:
0153   // maps for the whole config structure
0154   BtiMap my_btimap;
0155   TracoMap my_tracomap;
0156   TSThetaMap my_tsthetamap;
0157   TSPhiMap my_tsphimap;
0158   TrigUnitMap my_trigunitmap;
0159   LUTMap my_lutmap;
0160   SectCollMap my_sectcollmap;
0161   DTConfigPedestals my_pedestals;
0162 
0163   bool my_dttpgdebug;
0164 
0165   bool my_lutfromdb;
0166   bool my_acceptparam;
0167   bool my_CCBvalid;
0168 };
0169 
0170 #endif