Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-09-07 04:37:00

0001 /*
0002  * InputMakerPhase2.h
0003  *
0004  *  Created on: May 20, 2020
0005  *      Author: kbunkow
0006  */
0007 
0008 #ifndef L1Trigger_L1TMuonOverlapPhase2_InputMakerPhase2_h
0009 #define L1Trigger_L1TMuonOverlapPhase2_InputMakerPhase2_h
0010 
0011 #include "DataFormats/Common/interface/Handle.h"
0012 #include "DataFormats/L1DTTrackFinder/interface/L1MuDTChambThContainer.h"
0013 #include "DataFormats/L1DTTrackFinder/interface/L1Phase2MuDTPhContainer.h"
0014 #include "DataFormats/L1TMuon/interface/RegionalMuonCandFwd.h"
0015 #include "DataFormats/MuonDetId/interface/DTChamberId.h"
0016 #include "FWCore/Utilities/interface/EDGetToken.h"
0017 
0018 #include "L1Trigger/L1TMuonOverlapPhase1/interface/Omtf/OMTFConfiguration.h"
0019 #include "L1Trigger/L1TMuonOverlapPhase1/interface/MuonStub.h"
0020 #include "L1Trigger/L1TMuonOverlapPhase1/interface/MuonStubMakerBase.h"
0021 #include "L1Trigger/L1TMuonOverlapPhase1/interface/Omtf/OMTFinputMaker.h"
0022 #include "L1Trigger/L1TMuonOverlapPhase2/interface/OmtfPhase2AngleConverter.h"
0023 
0024 class DtPhase2DigiToStubsConverter : public DigiToStubsConverterBase {
0025 public:
0026   DtPhase2DigiToStubsConverter(edm::EDGetTokenT<L1Phase2MuDTPhContainer> inputTokenDtPh,
0027                                edm::EDGetTokenT<L1MuDTChambThContainer> inputTokenDtTh)
0028       : inputTokenDtPh(inputTokenDtPh), inputTokenDtTh(inputTokenDtTh) {}
0029 
0030   ~DtPhase2DigiToStubsConverter() override {}
0031 
0032   void loadDigis(const edm::Event& event) override;
0033 
0034   void makeStubs(MuonStubPtrs2D& muonStubsInLayers,
0035                  unsigned int iProcessor,
0036                  l1t::tftype procTyp,
0037                  int bxFrom,
0038                  int bxTo,
0039                  std::vector<std::unique_ptr<IOMTFEmulationObserver> >& observers) override;
0040 
0041   //dtThDigis is provided as argument, because in the OMTF implementation the phi and eta digis are merged (even thought it is artificial)
0042   virtual void addDTphiDigi(MuonStubPtrs2D& muonStubsInLayers,
0043                             const L1Phase2MuDTPhDigi& digi,
0044                             const L1MuDTChambThContainer* dtThDigis,
0045                             unsigned int iProcessor,
0046                             l1t::tftype procTyp) = 0;
0047 
0048   virtual void addDTetaStubs(MuonStubPtrs2D& muonStubsInLayers,
0049                              const L1MuDTChambThDigi& thetaDigi,
0050                              unsigned int iProcessor,
0051                              l1t::tftype procTyp) = 0;
0052 
0053   virtual bool acceptDigi(const DTChamberId& dTChamberId, unsigned int iProcessor, l1t::tftype procType) {
0054     return true;
0055   }
0056 
0057 protected:
0058   bool mergePhiAndTheta = true;
0059 
0060   edm::EDGetTokenT<L1Phase2MuDTPhContainer> inputTokenDtPh;
0061   edm::EDGetTokenT<L1MuDTChambThContainer> inputTokenDtTh;
0062 
0063   edm::Handle<L1Phase2MuDTPhContainer> dtPhDigis;
0064   edm::Handle<L1MuDTChambThContainer> dtThDigis;
0065 };
0066 
0067 class DtPhase2DigiToStubsConverterOmtf : public DtPhase2DigiToStubsConverter {
0068 public:
0069   DtPhase2DigiToStubsConverterOmtf(const OMTFConfiguration* config,
0070                                    const OmtfAngleConverter* angleConverter,
0071                                    edm::EDGetTokenT<L1Phase2MuDTPhContainer> inputTokenDtPh,
0072                                    edm::EDGetTokenT<L1MuDTChambThContainer> inputTokenDtTh)
0073       : DtPhase2DigiToStubsConverter(inputTokenDtPh, inputTokenDtTh),
0074         config(*config),
0075         angleConverter(*angleConverter) {}
0076 
0077   ~DtPhase2DigiToStubsConverterOmtf() override = default;
0078 
0079   //dtThDigis is provided as argument, because in the OMTF implementation the phi and eta digis are merged (even thought it is artificial)
0080   void addDTphiDigi(MuonStubPtrs2D& muonStubsInLayers,
0081                     const L1Phase2MuDTPhDigi& digi,
0082                     const L1MuDTChambThContainer* dtThDigis,
0083                     unsigned int iProcessor,
0084                     l1t::tftype procTyp) override;
0085 
0086   void addDTetaStubs(MuonStubPtrs2D& muonStubsInLayers,
0087                      const L1MuDTChambThDigi& thetaDigi,
0088                      unsigned int iProcessor,
0089                      l1t::tftype procTyp) override;
0090 
0091   bool acceptDigi(const DTChamberId& dTChamberId, unsigned int iProcessor, l1t::tftype procType) override;
0092 
0093 private:
0094   const OMTFConfiguration& config;
0095   const OmtfAngleConverter& angleConverter;
0096 };
0097 
0098 class InputMakerPhase2 : public OMTFinputMaker {
0099 public:
0100   InputMakerPhase2(const edm::ParameterSet& edmParameterSet,
0101                    MuStubsInputTokens& muStubsInputTokens,
0102                    edm::EDGetTokenT<L1Phase2MuDTPhContainer> inputTokenDTPhPhase2,
0103                    const OMTFConfiguration* config,
0104                    std::unique_ptr<OmtfAngleConverter> angleConverter);
0105 
0106   ~InputMakerPhase2() override = default;
0107 
0108   //the phi and eta digis are merged (even thought it is artificial)
0109   virtual void addDTphiDigi(MuonStubPtrs2D& muonStubsInLayers,
0110                             const L1Phase2MuDTPhDigi& digi,
0111                             const L1Phase2MuDTPhContainer* dtThDigis,
0112                             unsigned int iProcessor,
0113                             l1t::tftype procTyp) {}
0114 };
0115 
0116 #endif /* L1Trigger_L1TMuonOverlapPhase2_InputMakerPhase2_h */