Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef Phase2L1Trigger_DTTrigger_InitialGrouping_h
0002 #define Phase2L1Trigger_DTTrigger_InitialGrouping_h
0003 
0004 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0005 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0006 
0007 #include "DataFormats/MuonDetId/interface/DTChamberId.h"
0008 #include "DataFormats/MuonDetId/interface/DTSuperLayerId.h"
0009 #include "DataFormats/MuonDetId/interface/DTLayerId.h"
0010 #include "DataFormats/MuonDetId/interface/DTWireId.h"
0011 #include "DataFormats/DTDigi/interface/DTDigiCollection.h"
0012 
0013 #include "L1Trigger/DTTriggerPhase2/interface/MuonPath.h"
0014 #include "L1Trigger/DTTriggerPhase2/interface/constants.h"
0015 
0016 #include "L1Trigger/DTTriggerPhase2/interface/MotherGrouping.h"
0017 
0018 #include <iostream>
0019 #include <fstream>
0020 
0021 // ===============================================================================
0022 // Previous definitions and declarations
0023 // ===============================================================================
0024 
0025 /*
0026   Channels are labeled following next schema:
0027     ---------------------------------
0028     |   6   |   7   |   8   |   9   |
0029     ---------------------------------
0030         |   3   |   4   |   5   |
0031         -------------------------
0032             |   1   |   2   |
0033             -----------------
0034                 |   0   |
0035                 ---------
0036 */
0037 
0038 namespace dtamgrouping {
0039   /* Cell's combination, following previous labeling, to obtain every possible  muon's path. 
0040      Others cells combinations imply non straight paths */
0041   constexpr int CHANNELS_PATH_ARRANGEMENTS[8][4] = {
0042       {0, 1, 3, 6}, {0, 1, 3, 7}, {0, 1, 4, 7}, {0, 1, 4, 8}, {0, 2, 4, 7}, {0, 2, 4, 8}, {0, 2, 5, 8}, {0, 2, 5, 9}};
0043 
0044   /* For each of the previous cell's combinations, this array stores the associated cell's 
0045      displacement, relative to lower layer cell, measured in semi-cell length units */
0046 
0047   constexpr int CELL_HORIZONTAL_LAYOUTS[8][4] = {{0, -1, -2, -3},
0048                                                  {0, -1, -2, -1},
0049                                                  {0, -1, 0, -1},
0050                                                  {0, -1, 0, 1},
0051                                                  {0, 1, 0, -1},
0052                                                  {0, 1, 0, 1},
0053                                                  {0, 1, 2, 1},
0054                                                  {0, 1, 2, 3}};
0055 }  // namespace dtamgrouping
0056 
0057 // ===============================================================================
0058 // Class declarations
0059 // ===============================================================================
0060 
0061 class InitialGrouping : public MotherGrouping {
0062 public:
0063   // Constructors and destructor
0064   InitialGrouping(const edm::ParameterSet& pset, edm::ConsumesCollector& iC);
0065   ~InitialGrouping() override;
0066 
0067   // Main methods
0068   void initialise(const edm::EventSetup& iEventSetup) override;
0069   void run(edm::Event& iEvent,
0070            const edm::EventSetup& iEventSetup,
0071            const DTDigiCollection& digis,
0072            MuonPathPtrs& outMpath) override;
0073   void finish() override;
0074 
0075   // Other public methods
0076 
0077   // Public attributes
0078 
0079 private:
0080   // Private methods
0081   void setInChannels(const DTDigiCollection* digi, int sl);
0082   void selectInChannels(int baseCh);
0083   void resetPrvTDCTStamp(void);
0084   void mixChannels(int sl, int pathId, MuonPathPtrs& outMpath);
0085   bool notEnoughDataInChannels(void);
0086   bool isEqualComb2Previous(DTPrimitives& ptr);
0087 
0088   // Private attributes
0089   const bool debug_;
0090 
0091   DTPrimitives muxInChannels_[cmsdt::NUM_CELLS_PER_BLOCK];
0092   DTPrimitives channelIn_[cmsdt::NUM_LAYERS][cmsdt::NUM_CH_PER_LAYER];
0093   DTPrimitives chInDummy_;
0094   int prevTDCTimeStamps_[4];
0095   int currentBaseChannel_;
0096 };
0097 
0098 #endif