Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:21:03

0001 #ifndef OMTFinputMaker_H
0002 #define OMTFinputMaker_H
0003 
0004 #include <vector>
0005 #include <cstdint>
0006 #include <memory>
0007 
0008 #include "DataFormats/L1DTTrackFinder/interface/L1MuDTChambPhContainer.h"
0009 #include "DataFormats/L1DTTrackFinder/interface/L1MuDTChambThContainer.h"
0010 #include "DataFormats/L1TMuon/interface/RegionalMuonCandFwd.h"
0011 #include "DataFormats/CSCDigi/interface/CSCCorrelatedLCTDigiCollection.h"
0012 #include "DataFormats/RPCDigi/interface/RPCDigiCollection.h"
0013 #include "FWCore/Framework/interface/FrameworkfwdMostUsed.h"
0014 #include "L1Trigger/L1TMuonOverlap/interface/OMTFinput.h"
0015 
0016 class AngleConverter;
0017 class OMTFConfiguration;
0018 
0019 class OMTFinputMaker {
0020 public:
0021   OMTFinputMaker(edm::ConsumesCollector &, bool getDuringEvent = true);
0022 
0023   ~OMTFinputMaker();
0024 
0025   void initialize(const edm::EventSetup &, const OMTFConfiguration *);
0026 
0027   ///Method translating trigger digis into input matrix with global phi coordinates
0028   OMTFinput buildInputForProcessor(const L1MuDTChambPhContainer *dtPhDigis,
0029                                    const L1MuDTChambThContainer *dtThDigis,
0030                                    const CSCCorrelatedLCTDigiCollection *cscDigis,
0031                                    const RPCDigiCollection *rpcDigis,
0032                                    unsigned int iProcessor,
0033                                    l1t::tftype type = l1t::tftype::omtf_pos,
0034                                    int bx = 0);
0035 
0036   void setFlag(int aFlag) { flag = aFlag; }
0037   int getFlag() const { return flag; }
0038 
0039 private:
0040   ///Take the DT digis, select chambers connected to given
0041   ///processor, convers logal angles to global scale.
0042   ///For DT take also the bending angle.
0043   OMTFinput processDT(const L1MuDTChambPhContainer *dtPhDigis,
0044                       const L1MuDTChambThContainer *dtThDigis,
0045                       unsigned int iProcessor,
0046                       l1t::tftype type,
0047                       int bx);
0048 
0049   ///Take the CSC digis, select chambers connected to given
0050   ///processor, convers logal angles to global scale.
0051   ///For CSC do NOT take the bending angle.
0052   OMTFinput processCSC(const CSCCorrelatedLCTDigiCollection *cscDigis,
0053                        unsigned int iProcessor,
0054                        l1t::tftype type,
0055                        int bx);
0056 
0057   ///Decluster nearby hits in single chamber, by taking
0058   ///average cluster position, expressed in half RPC strip:
0059   ///pos = (cluster_begin + cluster_end)
0060   OMTFinput processRPC(const RPCDigiCollection *rpcDigis, unsigned int iProcessor, l1t::tftype type, int bx);
0061 
0062   ///Check if digis are within a give processor input.
0063   ///Simply checks sectors range.
0064   bool acceptDigi(uint32_t rawId, unsigned int iProcessor, l1t::tftype type);
0065 
0066   ///Give input number for givedn processor, using
0067   ///the chamber sector number.
0068   ///Result is modulo allowed number of hits per chamber
0069   unsigned int getInputNumber(unsigned int rawId, unsigned int iProcessor, l1t::tftype type);
0070 
0071   std::unique_ptr<AngleConverter> myAngleConverter;
0072 
0073   const OMTFConfiguration *myOmtfConfig;
0074 
0075   int flag;
0076 };
0077 
0078 #endif