Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 //-------------------------------------------------
0002 //
0003 /**  \class DTBtiCard
0004  *     Contains active DTBtiChips
0005  *
0006  *
0007  *
0008  *   \author C. Grandi, S. Vanini
0009  *
0010  *   Modifications:
0011  *   V/05 S.Vanini : modified to run with new geometry
0012  *   III/07 : SV configuration with DTConfigManager 
0013  */
0014 //
0015 //--------------------------------------------------
0016 #ifndef DT_BTI_CARD_H
0017 #define DT_BTI_CARD_H
0018 
0019 //------------------------------------
0020 // Collaborating Class Declarations --
0021 //------------------------------------
0022 class DTBtiChip;
0023 class DTBtiTrig;
0024 class DTTrigGeom;
0025 class DTTTrigBaseSync;
0026 
0027 //----------------------
0028 // Base Class Headers --
0029 //----------------------
0030 #include "DataFormats/DTDigi/interface/DTDigiCollection.h"
0031 #include "L1Trigger/DTUtilities/interface/DTGeomSupplier.h"
0032 #include "DataFormats/MuonDetId/interface/DTBtiId.h"
0033 #include "L1Trigger/DTBti/interface/DTBtiTrigData.h"
0034 #include "L1Trigger/DTUtilities/interface/DTCache.h"
0035 #include "L1TriggerConfig/DTTPGConfig/interface/DTConfigBti.h"
0036 #include "L1TriggerConfig/DTTPGConfig/interface/DTConfigManager.h"
0037 
0038 //---------------
0039 // C++ Headers --
0040 //---------------
0041 #include <vector>
0042 #include <map>
0043 
0044 namespace edm {
0045   class ParameterSet;
0046   class Event;
0047   class EventSetup;
0048 }  // namespace edm
0049 
0050 //              ---------------------
0051 //              -- Class Interface --
0052 //              ---------------------
0053 
0054 typedef std::map<int, DTBtiChip*, std::less<int> > BTIContainer;
0055 typedef BTIContainer::const_iterator BTI_const_iter;
0056 typedef BTIContainer::iterator BTI_iter;
0057 
0058 typedef std::map<DTBtiId, DTConfigBti> ConfBtiMap;
0059 
0060 typedef DTCache<DTBtiTrigData, std::vector<DTBtiTrigData> > BTICache;
0061 
0062 class DTBtiCard : public BTICache, public DTGeomSupplier {
0063 public:
0064   /// Constructor
0065   DTBtiCard(DTTrigGeom*);
0066 
0067   /// Destructor
0068   ~DTBtiCard() override;
0069 
0070   /// Clear all BTI stuff (map & cache)
0071   void clearCache();
0072 
0073   /// Set configuration
0074   void setConfig(const DTConfigManager* conf);
0075 
0076   /// Return TU debug flag
0077   inline bool debug() const { return _debug; }
0078 
0079   /// Returns the required BTI. Return 0 if it doesn't exist
0080   DTBtiChip* getBTI(int sl, int n) const;
0081 
0082   /// Returns the required BTI. Return 0 if it doesn't exist
0083   DTBtiChip* getBTI(const DTBtiId& btiid) const { return getBTI(btiid.superlayer(), btiid.bti()); }
0084 
0085   /// NEWGEO Local position in chamber of a trigger-data object
0086   LocalPoint localPosition(const DTTrigData*) const override;
0087   /// NEWGEO Local direction in chamber of a trigger-data object
0088   LocalVector localDirection(const DTTrigData*) const override;
0089 
0090   /// Returns the active BTI list in a given superlayer
0091   std::vector<DTBtiChip*> btiList(int);
0092 
0093   /**
0094      * Returns a DTBtiTrig corresponding to a DTBtiTrigData.
0095      * Creates the corresponding BTI chip if needed and stores the trigger
0096      */
0097   DTBtiTrig* storeTrigger(DTBtiTrigData);
0098 
0099   using BTICache::reconstruct;
0100   // run the trigger algorithm
0101   virtual void reconstruct(const DTDigiCollection dtDigis) {
0102     clearCache();
0103     loadBTI(dtDigis);
0104     runBTI();
0105   }
0106 
0107   /// Return bti chip configuration
0108   DTConfigBti* config_bti(DTBtiId& btiid) const;
0109 
0110   /// Return acceptance flag
0111   inline bool useAcceptParamFlag() { return _flag_acc; }
0112 
0113 private:
0114   /// store digi's in DTBtiChip's
0115   void loadBTI(const DTDigiCollection dtDigis);
0116 
0117   /// run DTBtiChip algorithm
0118   void runBTI();
0119 
0120   /// Returns the required DTBtiChip. Create it if it doesn't exist
0121   DTBtiChip* activeGetBTI(int sl, int n);
0122 
0123   /// Returns the required DTBtiChip. Create it if it doesn't exist
0124   DTBtiChip* activeGetBTI(const DTBtiId& btiid) { return activeGetBTI(btiid.superlayer(), btiid.bti()); }
0125 
0126   /// clear the BTI maps
0127   void localClear();
0128 
0129 private:
0130   BTIContainer _btimap[3];
0131   ConfBtiMap _conf_bti_map;  //bti configuration map for this chamber
0132 
0133   std::vector<DTDigi*> _digis;
0134 
0135   bool _debug;
0136   const DTConfigPedestals* _pedestals;
0137 
0138   bool _flag_acc;
0139 };
0140 
0141 #endif