CMS 3D CMS Logo

L1TMuonBarrelTrackProducer.cc
Go to the documentation of this file.
1 //-------------------------------------------------
2 //
3 // Class: L1TMuonBarrelTrackProducer
4 //
5 // L1 BM Track Finder EDProducer
6 //
7 //
8 //
9 // Author :
10 // J. Troconiz UAM Madrid
11 // Modified :
12 // G. Flouris U Ioannina
13 //--------------------------------------------------
14 
19 
26 
29 
30 #include <iostream>
31 #include <iomanip>
32 
34 public:
37 
39  void produce(edm::Event& e, const edm::EventSetup& c) override;
40 
41 private:
43 
49 };
50 
51 using namespace std;
52 
54  : dtbx_(pset, consumesCollector()) {
55  regionToken_ = produces<l1t::RegionalMuonCandBxCollection>("BMTF");
56  unsortRegionToken_ = produces<l1t::RegionalMuonCandBxCollection>("UnsortedBMTF");
57  trackToken_ = produces<vector<L1MuBMTrack>>("BMTF");
58  segPhiToken_ = produces<vector<L1MuBMTrackSegPhi>>("BMTF");
59  segEtaToken_ = produces<vector<L1MuBMTrackSegEta>>("BMTF");
60  //without clearing before the first call things fail
61  dtbx_.clear();
62 }
63 
65  if (dtbx_.config().Debug(1))
66  cout << endl;
67  if (dtbx_.config().Debug(1))
68  cout << "**** L1MuonBMTFTrigger processing event ****" << endl;
69 
70  dtbx_.run(e, c);
71 
72  int ndt = dtbx_.numberOfTracks();
73  if (dtbx_.config().Debug(1))
74  cout << "Number of muons found by the L1 BBMX TRIGGER : " << ndt << endl;
75 
77  auto tra_product = dtbx_.getcache0();
78 
80  auto vec_product = dtbx_.getcache();
81 
82  auto vec_L1MuBMTrack = dtbx_.getcache1();
83  auto vec_L1MuBMTrackSegPhi = dtbx_.getcache2();
84  auto vec_L1MuBMTrackSegEta = dtbx_.getcache3();
85 
86  //for (int ibx = BMTracks.getFirstBX(); ibx <= BMTracks.getLastBX(); ibx++){
87  //cout << "DEBUG: BMTF size at bx " << ibx << " " << BMTracks.size(ibx) << "\n";
88  //}
89  e.emplace(unsortRegionToken_, std::move(tra_product));
90  e.emplace(regionToken_, std::move(vec_product));
91  e.emplace(trackToken_, std::move(vec_L1MuBMTrack));
92  e.emplace(segPhiToken_, std::move(vec_L1MuBMTrackSegPhi));
93  e.emplace(segEtaToken_, std::move(vec_L1MuBMTrackSegEta));
94 
95  dtbx_.clear();
96 }
97 
L1MuBMTrackCollection & getcache1()
edm::EDPutTokenT< l1t::RegionalMuonCandBxCollection > unsortRegionToken_
edm::EDPutTokenT< vector< L1MuBMTrackSegPhi > > segPhiToken_
void produce(edm::Event &e, const edm::EventSetup &c) override
Produce digis out of raw data.
int numberOfTracks()
get number of muon candidates found by the barrel MTTF
L1MuBMTrackSegPhiCollection & getcache2()
edm::EDPutTokenT< vector< L1MuBMTrackSegEta > > segEtaToken_
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
void run(const edm::Event &e, const edm::EventSetup &c)
run the barrel MTTF
const L1MuBMTFConfig & config() const
return configuration
bool Debug() const
L1MuBMTrackSegEtaCollection & getcache3()
edm::EDPutTokenT< vector< L1MuBMTrack > > trackToken_
l1t::RegionalMuonCandBxCollection & getcache()
L1TMuonBarrelTrackProducer(const edm::ParameterSet &pset)
Constructor.
l1t::RegionalMuonCandBxCollection & getcache0()
def move(src, dest)
Definition: eostools.py:511
edm::EDPutTokenT< l1t::RegionalMuonCandBxCollection > regionToken_