CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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 
76 
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 
95 }
96 
const edm::EventSetup & c
L1TTwinMuxProducer(const edm::ParameterSet &pset)
~L1TTwinMuxProducer() override
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
Geom::Theta< T > theta() const
const edm::EDPutTokenT< L1MuDTChambPhContainer > m_phContainerToken
void produce(edm::StreamID, edm::Event &e, const edm::EventSetup &c) const override
bool getData(T &iHolder) const
Definition: EventSetup.h:128
Handle< PROD > getHandle(EDGetTokenT< PROD > token) const
Definition: Event.h:563
const edm::EDGetTokenT< L1MuDTChambPhContainer > m_dtdigi
def move
Definition: eostools.py:511
L1MuDTChambPhContainer get_ph_tm_output()
Return Output PhContainer.
const edm::ESGetToken< RPCGeometry, MuonGeometryRecord > m_rpcGeometryToken
const edm::ESGetToken< L1TTwinMuxParams, L1TTwinMuxParamsRcd > m_tmParamsToken
Event Setup Handler.
bool isValid() const
Definition: HandleBase.h:70
OrphanHandle< PROD > emplace(EDPutTokenT< PROD > token, Args &&...args)
puts a new product
Definition: Event.h:433
const edm::EDPutTokenT< L1MuDTChambThContainer > m_thContainerToken
void setContainer(The_Container inputSegments)
Log< level::Warning, false > LogWarning
const edm::EDGetTokenT< RPCDigiCollection > m_rpcsource
ESGetTokenH3DDVariant esConsumes(std::string const &Reccord, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
const edm::EDGetTokenT< L1MuDTChambThContainer > m_dtthetadigi
void run(edm::Handle< L1MuDTChambPhContainer > phiDigis, edm::Handle< L1MuDTChambThContainer > thetaDigis, edm::Handle< RPCDigiCollection > rpcDigis, const L1TTwinMuxParams &, const RPCGeometry &)