Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-12-10 02:50:53

0001 #ifndef GMTCollections_h
0002 #define GMTCollections_h
0003 
0004 #include "DataFormats/L1TMuon/interface/RegionalMuonCand.h"
0005 #include "DataFormats/L1Trigger/interface/Muon.h"
0006 
0007 #include "DataFormats/L1TMuon/interface/RegionalMuonShower.h"
0008 #include "DataFormats/L1Trigger/interface/MuonShower.h"
0009 
0010 #include "L1TObjectCollections.h"
0011 
0012 #include <array>
0013 
0014 namespace l1t {
0015   namespace stage2 {
0016     class GMTCollections : public L1TObjectCollections {
0017     public:
0018       // If the zero suppression deletes all the blocks used to
0019       // fill a collection the BX range cannot be determined.
0020       // Set default values here to then create an empty collection
0021       // with a defined BX range.
0022       GMTCollections(
0023           edm::Event& e, const int iFirstBx = -2, const int iLastBx = 2, const int oFirstBx = -2, const int oLastBx = 2)
0024           : L1TObjectCollections(e),
0025             regionalMuonCandsBMTF_(std::make_unique<RegionalMuonCandBxCollection>(0, iFirstBx, iLastBx)),
0026             regionalMuonCandsOMTF_(std::make_unique<RegionalMuonCandBxCollection>(0, iFirstBx, iLastBx)),
0027             regionalMuonCandsEMTF_(std::make_unique<RegionalMuonCandBxCollection>(0, iFirstBx, iLastBx)),
0028             muons_(),
0029             imdMuonsBMTF_(std::make_unique<MuonBxCollection>(0, oFirstBx, oLastBx)),
0030             imdMuonsEMTFNeg_(std::make_unique<MuonBxCollection>(0, oFirstBx, oLastBx)),
0031             imdMuonsEMTFPos_(std::make_unique<MuonBxCollection>(0, oFirstBx, oLastBx)),
0032             imdMuonsOMTFNeg_(std::make_unique<MuonBxCollection>(0, oFirstBx, oLastBx)),
0033             imdMuonsOMTFPos_(std::make_unique<MuonBxCollection>(0, oFirstBx, oLastBx)),
0034 
0035             regionalMuonShowersEMTF_(std::make_unique<RegionalMuonShowerBxCollection>(0, iFirstBx, iLastBx)),
0036             muonShowers_() {
0037         std::generate(muons_.begin(), muons_.end(), [&oFirstBx, &oLastBx] {
0038           return std::make_unique<MuonBxCollection>(0, oFirstBx, oLastBx);
0039         });
0040         std::generate(muonShowers_.begin(), muonShowers_.end(), [&oFirstBx, &oLastBx] {
0041           return std::make_unique<MuonShowerBxCollection>(0, oFirstBx, oLastBx);
0042         });
0043       };
0044 
0045       ~GMTCollections() override;
0046 
0047       inline RegionalMuonCandBxCollection* getRegionalMuonCandsBMTF() { return regionalMuonCandsBMTF_.get(); };
0048       inline RegionalMuonCandBxCollection* getRegionalMuonCandsOMTF() { return regionalMuonCandsOMTF_.get(); };
0049       inline RegionalMuonCandBxCollection* getRegionalMuonCandsEMTF() { return regionalMuonCandsEMTF_.get(); };
0050       inline MuonBxCollection* getMuons(const unsigned int copy) override { return muons_[copy].get(); };
0051       inline MuonBxCollection* getImdMuonsBMTF() { return imdMuonsBMTF_.get(); };
0052       inline MuonBxCollection* getImdMuonsEMTFNeg() { return imdMuonsEMTFNeg_.get(); };
0053       inline MuonBxCollection* getImdMuonsEMTFPos() { return imdMuonsEMTFPos_.get(); };
0054       inline MuonBxCollection* getImdMuonsOMTFNeg() { return imdMuonsOMTFNeg_.get(); };
0055       inline MuonBxCollection* getImdMuonsOMTFPos() { return imdMuonsOMTFPos_.get(); };
0056 
0057       inline RegionalMuonShowerBxCollection* getRegionalMuonShowersEMTF() { return regionalMuonShowersEMTF_.get(); };
0058       inline MuonShowerBxCollection* getMuonShowers(const unsigned int copy) override {
0059         return muonShowers_[copy].get();
0060       };
0061 
0062       static constexpr size_t NUM_OUTPUT_COPIES{6};
0063 
0064     private:
0065       std::unique_ptr<RegionalMuonCandBxCollection> regionalMuonCandsBMTF_;
0066       std::unique_ptr<RegionalMuonCandBxCollection> regionalMuonCandsOMTF_;
0067       std::unique_ptr<RegionalMuonCandBxCollection> regionalMuonCandsEMTF_;
0068       std::array<std::unique_ptr<MuonBxCollection>, 6> muons_;
0069       std::unique_ptr<MuonBxCollection> imdMuonsBMTF_;
0070       std::unique_ptr<MuonBxCollection> imdMuonsEMTFNeg_;
0071       std::unique_ptr<MuonBxCollection> imdMuonsEMTFPos_;
0072       std::unique_ptr<MuonBxCollection> imdMuonsOMTFNeg_;
0073       std::unique_ptr<MuonBxCollection> imdMuonsOMTFPos_;
0074 
0075       std::unique_ptr<RegionalMuonShowerBxCollection> regionalMuonShowersEMTF_;
0076       std::array<std::unique_ptr<MuonShowerBxCollection>, 6> muonShowers_;
0077     };
0078   }  // namespace stage2
0079 }  // namespace l1t
0080 
0081 #endif