CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
L1TTwinMuxProducer.cc
Go to the documentation of this file.
1 //-------------------------------------------------
2 //
3 // Class: L1TwinMuxProducer
4 //
5 // L1TwinMuxProducer EDProducer
6 //
7 //
8 // Author :
9 // G. Flouris U Ioannina Feb. 2015
10 // Mod.: g Karathanasis
11 //--------------------------------------------------
12 
20 
23 
25 
26 #include <iostream>
27 #include <iomanip>
28 #include <memory>
29 
30 using namespace std;
31 
33 public:
35  ~L1TTwinMuxProducer() override {}
36  void produce(edm::StreamID, edm::Event& e, const edm::EventSetup& c) const override;
37 
38 private:
45 
48 };
49 
51  : m_dtdigi(consumes(pset.getParameter<edm::InputTag>("DTDigi_Source"))),
52  m_dtthetadigi(consumes(pset.getParameter<edm::InputTag>("DTThetaDigi_Source"))),
53  m_rpcsource(consumes(pset.getParameter<edm::InputTag>("RPC_Source"))),
54  m_tmParamsToken(esConsumes()),
55  m_rpcGeometryToken(esConsumes()),
56  m_phContainerToken(produces<L1MuDTChambPhContainer>()),
57  m_thContainerToken(produces<L1MuDTChambThContainer>()) {}
58 
61  auto const& tmParams = c.getData(m_tmParamsToken);
62 
64  bool onlyRPC = tmParams.get_UseOnlyRPC();
66  bool onlyDT = tmParams.get_UseOnlyDT();
67 
68  if (onlyDT && onlyRPC) {
69  edm::LogWarning("Inconsistent configuration") << "onlyRPC and onlyDT options";
70  return;
71  }
73 
74  edm::Handle<L1MuDTChambPhContainer> phiDigis = e.getHandle(m_dtdigi);
75  edm::Handle<L1MuDTChambThContainer> thetaDigis = e.getHandle(m_dtthetadigi);
76 
77  edm::Handle<RPCDigiCollection> rpcDigis = e.getHandle(m_rpcsource);
78 
79  if (!phiDigis.isValid()) {
80  edm::LogWarning("Inconsistent digis") << "input DT phi digis not valid";
81  }
82 
83  auto const& rpcGeometry = c.getData(m_rpcGeometryToken);
84 
85  L1TTwinMuxAlgorithm l1tma;
86  l1tma.run(phiDigis, thetaDigis, rpcDigis, tmParams, rpcGeometry);
87  auto l1ttmp = l1tma.get_ph_tm_output();
88  //null transfer of theta digis
89  L1MuDTChambThContainer l1ttmth;
90  const std::vector<L1MuDTChambThDigi>* theta = thetaDigis->getContainer();
91  l1ttmth.setContainer(*theta);
92 
93  e.emplace(m_phContainerToken, std::move(l1ttmp));
94  e.emplace(m_thContainerToken, std::move(l1ttmth));
95 }
96 
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
L1TTwinMuxProducer(const edm::ParameterSet &pset)
~L1TTwinMuxProducer() override
const edm::EDPutTokenT< L1MuDTChambPhContainer > m_phContainerToken
void produce(edm::StreamID, edm::Event &e, const edm::EventSetup &c) const override
The_Container const * getContainer() const
const edm::EDGetTokenT< L1MuDTChambPhContainer > m_dtdigi
L1MuDTChambPhContainer get_ph_tm_output()
Return Output PhContainer.
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
const edm::ESGetToken< RPCGeometry, MuonGeometryRecord > m_rpcGeometryToken
const edm::ESGetToken< L1TTwinMuxParams, L1TTwinMuxParamsRcd > m_tmParamsToken
Event Setup Handler.
const edm::EDPutTokenT< L1MuDTChambThContainer > m_thContainerToken
void setContainer(The_Container inputSegments)
bool isValid() const
Definition: HandleBase.h:70
HLT enums.
Log< level::Warning, false > LogWarning
const edm::EDGetTokenT< RPCDigiCollection > m_rpcsource
Geom::Theta< T > theta() const
def move(src, dest)
Definition: eostools.py:511
const edm::EDGetTokenT< L1MuDTChambThContainer > m_dtthetadigi
void run(edm::Handle< L1MuDTChambPhContainer > phiDigis, edm::Handle< L1MuDTChambThContainer > thetaDigis, edm::Handle< RPCDigiCollection > rpcDigis, const L1TTwinMuxParams &, const RPCGeometry &)