CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_5_3_13_patch3/src/L1Trigger/DTTrackFinder/plugins/DTTrackFinder.cc

Go to the documentation of this file.
00001 //-------------------------------------------------
00002 //
00003 //   Class: DTTrackFinder
00004 //
00005 //   L1 DT Track Finder EDProducer
00006 //
00007 //
00008 //   $Date: 2008/02/18 17:38:03 $
00009 //   $Revision: 1.2 $
00010 //
00011 //   Author :
00012 //   J. Troconiz              UAM Madrid
00013 //
00014 //--------------------------------------------------
00015 
00016 #include "DTTrackFinder.h"
00017 
00018 #include "DataFormats/Common/interface/Handle.h"
00019 #include "FWCore/Framework/interface/Event.h"
00020 
00021 #include <DataFormats/L1DTTrackFinder/interface/L1MuDTChambPhContainer.h>
00022 #include <DataFormats/L1DTTrackFinder/interface/L1MuDTChambThContainer.h>
00023 #include <DataFormats/L1DTTrackFinder/interface/L1MuDTTrackContainer.h>
00024 #include <DataFormats/L1GlobalMuonTrigger/interface/L1MuRegionalCand.h>
00025 
00026 #include "L1Trigger/DTTrackFinder/src/L1MuDTTFConfig.h"
00027 #include "L1Trigger/DTTrackFinder/interface/L1MuDTTFSetup.h"
00028 #include "L1Trigger/DTTrackFinder/interface/L1MuDTTrackFinder.h"
00029 
00030 #include <iostream>
00031 #include <iomanip>
00032 
00033 using namespace std;
00034 
00035 DTTrackFinder::DTTrackFinder(const edm::ParameterSet & pset) {
00036 
00037   produces<L1MuDTTrackContainer>("DTTF");
00038   produces<vector<L1MuRegionalCand> >("DT");
00039 
00040   setup1 = new L1MuDTTFSetup(pset);
00041 
00042 }
00043 
00044 DTTrackFinder::~DTTrackFinder() {
00045 
00046   delete setup1;
00047 
00048 }
00049 
00050 void DTTrackFinder::produce(edm::Event& e, const edm::EventSetup& c) {
00051 
00052   if ( L1MuDTTFConfig::Debug(1) ) cout << endl;
00053   if ( L1MuDTTFConfig::Debug(1) ) cout << "**** L1MuonDTTFTrigger processing event  ****" << endl;
00054 
00055   L1MuDTTrackFinder* dtbx = setup1->TrackFinder();
00056   dtbx->clear();
00057   dtbx->run(e,c);
00058 
00059   int ndt = dtbx->numberOfTracks();
00060   if ( L1MuDTTFConfig::Debug(1) ) cout << "Number of muons found by the L1 DTBX TRIGGER : "
00061                                        << ndt << endl;
00062 
00063   auto_ptr<L1MuDTTrackContainer> tra_product(new L1MuDTTrackContainer);
00064   auto_ptr<vector<L1MuRegionalCand> >
00065                                  vec_product(new vector<L1MuRegionalCand>);
00066 
00067   vector<L1MuDTTrackCand>&  dtTracks = dtbx->getcache0();
00068   tra_product->setContainer(dtTracks);
00069   vector<L1MuRegionalCand>& DTTracks = dtbx->getcache();
00070   *vec_product = DTTracks;
00071 
00072   e.put(tra_product,"DTTF");
00073   e.put(vec_product,"DT");
00074 
00075 }