Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 //-------------------------------------------------
0002 //
0003 /**  \class DTTSTheta
0004  *    Implementation of TS Theta L1Trigger algorithm
0005  *
0006  *
0007  *   \author C.Grandi
0008  */
0009 //
0010 //--------------------------------------------------
0011 #ifndef DT_TS_THETA_H
0012 #define DT_TS_THETA_H
0013 
0014 //------------------------------------
0015 // Collaborating Class Declarations --
0016 //------------------------------------
0017 class DTBtiCard;
0018 class DTBtiTrigData;
0019 class DTTrigGeom;
0020 
0021 //----------------------
0022 // Base Class Headers --
0023 //----------------------
0024 #include "L1Trigger/DTUtilities/interface/DTGeomSupplier.h"
0025 #include "L1TriggerConfig/DTTPGConfig/interface/BitArray.h"
0026 #include "L1Trigger/DTTriggerServerTheta/interface/DTChambThSegm.h"
0027 #include "L1TriggerConfig/DTTPGConfig/interface/DTConfigTSTheta.h"
0028 #include "L1TriggerConfig/DTTPGConfig/interface/DTConfigManager.h"
0029 #include "L1Trigger/DTUtilities/interface/DTCache.h"
0030 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0031 
0032 //---------------
0033 // C++ Headers --
0034 //---------------
0035 #include <vector>
0036 
0037 //              ---------------------
0038 //              -- Class Interface --
0039 //              ---------------------
0040 
0041 typedef std::vector<DTChambThSegm> DTChambThVector;
0042 typedef DTCache<DTChambThSegm, DTChambThVector> DTTSThetaManager;
0043 
0044 class DTTSTheta : public DTTSThetaManager, public DTGeomSupplier {
0045 public:
0046   ///  Constructor
0047   //DTTSTheta(DTTrigGeom*, DTBtiCard*, edm::ParameterSet&);
0048   DTTSTheta(DTTrigGeom*, DTBtiCard*);
0049 
0050   ///  Destructor
0051   ~DTTSTheta() override;
0052 
0053   /// Return configuration
0054   inline const DTConfigTSTheta* config() const { return _config; }
0055 
0056   /// Set configuration
0057   void setConfig(const DTConfigManager* conf);
0058 
0059   /// Return number of TStheta segments (just 1)
0060   int nSegm(int step);
0061 
0062   /// Return the requested DTTSTheta segment (only the first)
0063   const DTChambThSegm* segment(int step, unsigned n);
0064 
0065   /// Return number of DTBtiChip fired (used by DTTracoChip)
0066   int nTrig(int step);
0067 
0068   /// Return number of DTBtiChip fired with a HTRIG (used by DTTracoChip)
0069   int nHTrig(int step);
0070 
0071   /// Local position in chamber of a L1Trigger-data object
0072   LocalPoint localPosition(const DTTrigData*) const override;
0073 
0074   /// Local direction in chamber of a L1Trigger-data object
0075   LocalVector localDirection(const DTTrigData*) const override;
0076 
0077   /// Print a L1Trigger-data object with also local and global position/direction
0078   void print(const DTTrigData* trig) const override;
0079 
0080   /// Load BTIs triggers and run TSTheta algoritm
0081   void reconstruct() override {
0082     loadDTTSTheta();
0083     runDTTSTheta();
0084   }
0085 
0086 private:
0087   /// store DTBtiChip L1Triggers in the TST
0088   void loadDTTSTheta();
0089 
0090   /// run DTTSTheta algorithm (build the mask)
0091   void runDTTSTheta();
0092 
0093   /// Add a DTBtiChip L1Trigger to the DTTSTheta
0094   void add_btiT(int step, const DTBtiTrigData* btitrig);
0095 
0096   /// Clear
0097   void localClear();
0098 
0099   /// Return the BitArray of DTBtiChip fired
0100   BitArray<DTConfigTSTheta::NCELLTH>* btiMask(int step) const;
0101 
0102   /// Return the BitArray of DTBtiChip fired with a HTRIG
0103   BitArray<DTConfigTSTheta::NCELLTH>* btiQual(int step) const;
0104 
0105 private:
0106   DTBtiCard* _bticard;
0107 
0108   const DTConfigTSTheta* _config;
0109 
0110   // Input data
0111   BitArray<DTConfigTSTheta::NCELLTH> _trig[DTConfigTSTheta::NSTEPL - DTConfigTSTheta::NSTEPF + 1];
0112   BitArray<DTConfigTSTheta::NCELLTH> _Htrig[DTConfigTSTheta::NSTEPL - DTConfigTSTheta::NSTEPF + 1];
0113   int _ntrig[DTConfigTSTheta::NSTEPL - DTConfigTSTheta::NSTEPF + 1];
0114   int _nHtrig[DTConfigTSTheta::NSTEPL - DTConfigTSTheta::NSTEPF + 1];
0115 };
0116 
0117 #endif