Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-03-17 11:11:10

0001 //-------------------------------------------------
0002 //
0003 /**  \class DTTracoCard
0004  *   Contains active DTTracoChips
0005  *
0006  *
0007  *
0008  *   \author C. Grandi, S. Vanini
0009  *
0010  *    Modifications:
0011  *   III/07 : SV configuration with DTConfigManager
0012  */
0013 //
0014 //--------------------------------------------------
0015 #ifndef DT_TRACO_CARD_H
0016 #define DT_TRACO_CARD_H
0017 
0018 //------------------------------------
0019 // Collaborating Class Declarations --
0020 //------------------------------------
0021 class DTTracoChip;
0022 class DTTracoTrig;
0023 class DTBtiCard;
0024 class DTTSTheta;
0025 class DTTrigGeom;
0026 
0027 //----------------------
0028 // Base Class Headers --
0029 //----------------------
0030 #include "DataFormats/MuonDetId/interface/DTTracoId.h"
0031 #include "L1Trigger/DTTraco/interface/DTTracoTrigData.h"
0032 #include "L1Trigger/DTUtilities/interface/DTCache.h"
0033 #include "L1Trigger/DTUtilities/interface/DTGeomSupplier.h"
0034 #include "L1TriggerConfig/DTTPGConfig/interface/DTConfig.h"
0035 #include "L1TriggerConfig/DTTPGConfig/interface/DTConfigLUTs.h"
0036 #include "L1TriggerConfig/DTTPGConfig/interface/DTConfigManager.h"
0037 #include "L1TriggerConfig/DTTPGConfig/interface/DTConfigTraco.h"
0038 //#include "FWCore/ParameterSet/interface/ParameterSet.h"
0039 
0040 //---------------
0041 // C++ Headers --
0042 //---------------
0043 #include <map>
0044 #include <vector>
0045 
0046 //              ---------------------
0047 //              -- Class Interface --
0048 //              ---------------------
0049 
0050 typedef std::map<int, DTTracoChip *, std::less<int>> TRACOContainer;
0051 typedef TRACOContainer::const_iterator TRACO_const_iter;
0052 typedef TRACOContainer::iterator TRACO_iter;
0053 
0054 typedef std::map<DTTracoId, DTConfigTraco> ConfTracoMap;
0055 
0056 typedef DTCache<DTTracoTrigData, std::vector<DTTracoTrigData>> TRACOCache;
0057 
0058 class DTTracoCard : public TRACOCache, public DTGeomSupplier {
0059 public:
0060   /// Constructor
0061   // DTTracoCard(DTTrigGeom*, DTBtiCard*, DTTSTheta*,edm::ParameterSet&);
0062   DTTracoCard(DTTrigGeom *, DTBtiCard *, DTTSTheta *);
0063 
0064   /// Destructor
0065   ~DTTracoCard() override;
0066 
0067   /// Clear all traco stuff (cache & map)
0068   void clearCache();
0069 
0070   /// Set configuration
0071   void setConfig(const DTConfigManager *conf);
0072 
0073   /// Return TU debug flag
0074   inline bool debug() { return _debug; }
0075 
0076   /// Return TSTheta
0077   inline DTTSTheta *TSTh() const { return _tstheta; }
0078 
0079   /// Returns the required DTTracoChip. Return 0 if it doesn't exist
0080   DTTracoChip *getTRACO(int n) const;
0081 
0082   /// Returns the required DTTracoChip. Return 0 if it doesn't exist
0083   DTTracoChip *getTRACO(const DTTracoId &tracoid) const { return getTRACO(tracoid.traco()); }
0084 
0085   /// Returns the active TRACO list
0086   std::vector<DTTracoChip *> tracoList();
0087 
0088   /**
0089    * Returns a DTTracoTrig corresponding to a DTTracoTrigData.
0090    * Creates the corresponding TRACO chip if needed and stores the trigger
0091    */
0092   DTTracoTrig *storeTrigger(DTTracoTrigData);
0093 
0094   /// NEWGEO Local position in chamber of a trigger-data object
0095   LocalPoint localPosition(const DTTrigData *) const override;
0096 
0097   /// NEWGEO Local direction in chamber of a trigger-data object
0098   LocalVector localDirection(const DTTrigData *) const override;
0099 
0100   /// Load BTIs triggers and run TRACOs algorithm
0101   void reconstruct() override {
0102     clearCache();
0103     loadTRACO();
0104     runTRACO();
0105   }
0106 
0107   /// Return LUTS config for this chamber (=minicrate)
0108   const DTConfigLUTs *config_luts() const { return _conf_luts; }
0109 
0110   /// Return acceptance flag
0111   inline bool useAcceptParamFlag() { return _flag_acc; }
0112 
0113   /// Return lut computation option (DB/geometry)
0114   inline bool lutFromDBFlag() { return _lut_from_db; }
0115 
0116 private:
0117   /// store BTI triggers in TRACO's
0118   void loadTRACO();
0119 
0120   /// run TRACO algorithm
0121   void runTRACO();
0122 
0123   /// Returns the required DTTracoChip. Create it if it doesn't exist
0124   DTTracoChip *activeGetTRACO(int);
0125 
0126   /// Returns the required DTTracoChip. Create it if it doesn't exist
0127   DTTracoChip *activeGetTRACO(const DTTracoId &tracoid) { return activeGetTRACO(tracoid.traco()); }
0128 
0129   /// clear the TRACO map
0130   void localClear();
0131 
0132   /// Return single TRACO config
0133   DTConfigTraco *config_traco(const DTTracoId &tracoid) const;
0134 
0135 private:
0136   DTBtiCard *_bticard;
0137   DTTSTheta *_tstheta;
0138 
0139   TRACOContainer _tracomap;
0140   ConfTracoMap _conf_traco_map;  // bti configuration map for this chamber
0141 
0142   const DTConfigLUTs *_conf_luts;
0143 
0144   bool _debug;
0145 
0146   bool _flag_acc;
0147   bool _lut_from_db;
0148 };
0149 
0150 #endif