Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:19:41

0001 //-------------------------------------------------
0002 //
0003 //   Class: DTTrackFinder
0004 //
0005 //   L1 DT Track Finder EDProducer
0006 //
0007 //
0008 //
0009 //   Author :
0010 //   J. Troconiz              UAM Madrid
0011 //
0012 //--------------------------------------------------
0013 
0014 #include "DTTrackFinder.h"
0015 
0016 #include "DataFormats/Common/interface/Handle.h"
0017 #include "FWCore/Framework/interface/Event.h"
0018 
0019 #include <DataFormats/L1DTTrackFinder/interface/L1MuDTChambPhContainer.h>
0020 #include <DataFormats/L1DTTrackFinder/interface/L1MuDTChambThContainer.h>
0021 #include <DataFormats/L1DTTrackFinder/interface/L1MuDTTrackContainer.h>
0022 #include <DataFormats/L1GlobalMuonTrigger/interface/L1MuRegionalCand.h>
0023 
0024 #include "L1Trigger/DTTrackFinder/interface/L1MuDTTFConfig.h"
0025 #include "L1Trigger/DTTrackFinder/interface/L1MuDTTFSetup.h"
0026 #include "L1Trigger/DTTrackFinder/interface/L1MuDTTrackFinder.h"
0027 
0028 #include <iostream>
0029 #include <iomanip>
0030 
0031 using namespace std;
0032 
0033 DTTrackFinder::DTTrackFinder(const edm::ParameterSet& pset) {
0034   produces<L1MuDTTrackContainer>("DTTF");
0035   produces<vector<L1MuRegionalCand> >("DT");
0036 
0037   setup1 = new L1MuDTTFSetup(pset, consumesCollector());
0038   usesResource("DTTrackFinder");
0039 }
0040 
0041 DTTrackFinder::~DTTrackFinder() { delete setup1; }
0042 
0043 void DTTrackFinder::produce(edm::Event& e, const edm::EventSetup& c) {
0044   if (L1MuDTTFConfig::Debug(1))
0045     cout << endl;
0046   if (L1MuDTTFConfig::Debug(1))
0047     cout << "**** L1MuonDTTFTrigger processing event  ****" << endl;
0048 
0049   L1MuDTTrackFinder* dtbx = setup1->TrackFinder();
0050   dtbx->clear();
0051   dtbx->run(e, c);
0052 
0053   int ndt = dtbx->numberOfTracks();
0054   if (L1MuDTTFConfig::Debug(1))
0055     cout << "Number of muons found by the L1 DTBX TRIGGER : " << ndt << endl;
0056 
0057   unique_ptr<L1MuDTTrackContainer> tra_product(new L1MuDTTrackContainer);
0058   unique_ptr<vector<L1MuRegionalCand> > vec_product(new vector<L1MuRegionalCand>);
0059 
0060   vector<L1MuDTTrackCand>& dtTracks = dtbx->getcache0();
0061   tra_product->setContainer(dtTracks);
0062   vector<L1MuRegionalCand>& DTTracks = dtbx->getcache();
0063   *vec_product = DTTracks;
0064 
0065   e.put(std::move(tra_product), "DTTF");
0066   e.put(std::move(vec_product), "DT");
0067 }