CMS 3D CMS Logo

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:
33  std::unique_ptr<L1TTwinMuxAlgortithm> m_l1tma;
34  edm::EDGetToken m_dtdigi, m_dtthetadigi, m_rpcsource;
35 
36 };
37 
38 
39 
40 
42 
43 m_dtdigi = consumes<L1MuDTChambPhContainer>(pset.getParameter<edm::InputTag>("DTDigi_Source"));
44 m_dtthetadigi = consumes<L1MuDTChambThContainer>(pset.getParameter<edm::InputTag>("DTThetaDigi_Source"));
45 m_rpcsource = consumes<RPCDigiCollection>(pset.getParameter<edm::InputTag>("RPC_Source"));
46 
47 produces<L1MuDTChambPhContainer>();
48 
49 }
50 
52 
55  e.getByToken(m_dtdigi, phiDigis);
56  e.getByToken(m_dtthetadigi, thetaDigis);
57 
58  if (! phiDigis.isValid()){
59  //cout << "ERROR: TwinMux input DT phi digis not valid.\n";
60  }
61  if (! thetaDigis.isValid()){
62  //cout << "ERROR: TwinMux input DT theta digis not valid.\n";
63  }
64 
66  e.getByToken(m_rpcsource, rpcDigis);
67 
68 
69  std::unique_ptr<L1MuDTChambPhContainer> l1ttmp = m_l1tma->produce(phiDigis, thetaDigis, rpcDigis,c);
70  //cout << "DEBUG: L1T Twin Mux Producer, output size: " << l1ttmp->getContainer()->size() << "\n";
71  e.put(std::move(l1ttmp));
72 }
73 
74 
T getParameter(std::string const &) const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:122
L1TTwinMuxProducer(const edm::ParameterSet &pset)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:460
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
std::unique_ptr< L1TTwinMuxAlgortithm > m_l1tma
edm::EDGetToken m_dtthetadigi
bool isValid() const
Definition: HandleBase.h:74
edm::EDGetToken m_dtdigi
void produce(edm::Event &e, const edm::EventSetup &c)
def move(src, dest)
Definition: eostools.py:510
edm::EDGetToken m_rpcsource