CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
L1TTwinMuxProducer.cc
Go to the documentation of this file.
1 //-------------------------------------------------
2 //
3 // Class: L1TTwinMuxProducer
4 //
5 // L1TTwinMuxProducer EDProducer
6 //
7 //
8 // Author :
9 // G. Flouris U Ioannina Oct. 2015
10 //--------------------------------------------------
11 
12 
13 
20 
21 
22 #include <iostream>
23 #include <iomanip>
24 
25 using namespace std;
26 
27 class L1TTwinMuxProducer: public edm::one::EDProducer<edm::one::SharedResources> {
28 public:
31  void produce(edm::Event & e, const edm::EventSetup& c);
32 private:
34  edm::EDGetToken m_dtdigi, m_dtthetadigi, m_rpcsource;
35 
36 };
37 
38 
39 
40 
42 m_l1tma = new L1TTwinMuxAlgortithm();
43 
44 m_dtdigi = consumes<L1MuDTChambPhContainer>(pset.getParameter<edm::InputTag>("DTDigi_Source"));
45 m_dtthetadigi = consumes<L1MuDTChambThContainer>(pset.getParameter<edm::InputTag>("DTThetaDigi_Source"));
46 m_rpcsource = consumes<RPCDigiCollection>(pset.getParameter<edm::InputTag>("RPC_Source"));
47 
48 produces<L1MuDTChambPhContainer>();
49 
50 }
51 
53 
56  e.getByToken(m_dtdigi, phiDigis);
57  e.getByToken(m_dtthetadigi, thetaDigis);
58 
59  if (! phiDigis.isValid()){
60  //cout << "ERROR: TwinMux input DT phi digis not valid.\n";
61  }
62  if (! thetaDigis.isValid()){
63  //cout << "ERROR: TwinMux input DT theta digis not valid.\n";
64  }
65 
67  e.getByToken(m_rpcsource, rpcDigis);
68 
69 
70  std::auto_ptr<L1MuDTChambPhContainer> l1ttmp = m_l1tma->produce(phiDigis, thetaDigis, rpcDigis,c);
71  //cout << "DEBUG: L1T Twin Mux Producer, output size: " << l1ttmp->getContainer()->size() << "\n";
72  e.put(l1ttmp);
73 }
74 
75 
T getParameter(std::string const &) const
L1TTwinMuxProducer(const edm::ParameterSet &pset)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:121
bool isValid() const
Definition: HandleBase.h:75
void produce(edm::Event &e, const edm::EventSetup &c)
edm::EDGetToken m_rpcsource
L1TTwinMuxAlgortithm * m_l1tma