File indexing completed on 2024-04-06 12:20:50
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 #include "L1TMuonBarrelTrackProducer.h"
0016
0017 #include "DataFormats/Common/interface/Handle.h"
0018 #include "FWCore/Framework/interface/Event.h"
0019
0020 #include "DataFormats/L1DTTrackFinder/interface/L1MuDTChambPhContainer.h"
0021 #include "DataFormats/L1DTTrackFinder/interface/L1MuDTChambThContainer.h"
0022 #include "FWCore/Utilities/interface/EDGetToken.h"
0023 #include "FWCore/Utilities/interface/InputTag.h"
0024 #include "DataFormats/L1CSCTrackFinder/interface/TrackStub.h"
0025 #include <FWCore/Framework/interface/ConsumesCollector.h>
0026
0027 #include "L1Trigger/L1TMuonBarrel/src/L1MuBMTFConfig.h"
0028 #include "L1Trigger/L1TMuonBarrel/interface/L1MuBMTFSetup.h"
0029 #include "L1Trigger/L1TMuonBarrel/interface/L1MuBMTrackFinder.h"
0030
0031 #include <iostream>
0032 #include <iomanip>
0033
0034 using namespace std;
0035
0036 L1TMuonBarrelTrackProducer::L1TMuonBarrelTrackProducer(const edm::ParameterSet& pset) {
0037 produces<l1t::RegionalMuonCandBxCollection>("BMTF");
0038 produces<l1t::RegionalMuonCandBxCollection>("UnsortedBMTF");
0039 produces<vector<L1MuBMTrack> >("BMTF");
0040 produces<vector<L1MuBMTrackSegPhi> >("BMTF");
0041 produces<vector<L1MuBMTrackSegEta> >("BMTF");
0042
0043 usesResource("L1TMuonBarrelTrackProducer");
0044 setup1 = std::make_unique<L1MuBMTFSetup>(pset, consumesCollector());
0045 }
0046
0047 L1TMuonBarrelTrackProducer::~L1TMuonBarrelTrackProducer() {}
0048
0049 void L1TMuonBarrelTrackProducer::produce(edm::Event& e, const edm::EventSetup& c) {
0050 if (L1MuBMTFConfig::Debug(1))
0051 cout << endl;
0052 if (L1MuBMTFConfig::Debug(1))
0053 cout << "**** L1MuonBMTFTrigger processing event ****" << endl;
0054
0055 L1MuBMTrackFinder* dtbx = setup1->TrackFinder();
0056 dtbx->clear();
0057
0058 dtbx->run(e, c);
0059
0060 int ndt = dtbx->numberOfTracks();
0061 if (L1MuBMTFConfig::Debug(1))
0062 cout << "Number of muons found by the L1 BBMX TRIGGER : " << ndt << endl;
0063
0064 std::unique_ptr<l1t::RegionalMuonCandBxCollection> tra_product(new l1t::RegionalMuonCandBxCollection);
0065 std::unique_ptr<l1t::RegionalMuonCandBxCollection> vec_product(new l1t::RegionalMuonCandBxCollection);
0066 unique_ptr<vector<L1MuBMTrack> > vec_L1MuBMTrack(new vector<L1MuBMTrack>);
0067 unique_ptr<vector<L1MuBMTrackSegPhi> > vec_L1MuBMTrackSegPhi(new vector<L1MuBMTrackSegPhi>);
0068 unique_ptr<vector<L1MuBMTrackSegEta> > vec_L1MuBMTrackSegEta(new vector<L1MuBMTrackSegEta>);
0069
0070
0071 l1t::RegionalMuonCandBxCollection dtTracks = dtbx->getcache0();
0072 *tra_product = dtTracks;
0073
0074
0075 l1t::RegionalMuonCandBxCollection BMTracks = dtbx->getcache();
0076 *vec_product = BMTracks;
0077
0078 *vec_L1MuBMTrack = dtbx->getcache1();
0079 *vec_L1MuBMTrackSegPhi = dtbx->getcache2();
0080 *vec_L1MuBMTrackSegEta = dtbx->getcache3();
0081
0082
0083
0084
0085 e.put(std::move(tra_product), "UnsortedBMTF");
0086 e.put(std::move(vec_product), "BMTF");
0087 e.put(std::move(vec_L1MuBMTrack), "BMTF");
0088 e.put(std::move(vec_L1MuBMTrackSegPhi), "BMTF");
0089 e.put(std::move(vec_L1MuBMTrackSegEta), "BMTF");
0090 }
0091
0092 #include "FWCore/Framework/interface/MakerMacros.h"
0093 DEFINE_FWK_MODULE(L1TMuonBarrelTrackProducer);