CMS 3D CMS Logo

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 
edm::StreamID
Definition: StreamID.h:30
L1TTwinMuxProducer::m_tmParamsToken
const edm::ESGetToken< L1TTwinMuxParams, L1TTwinMuxParamsRcd > m_tmParamsToken
Event Setup Handler.
Definition: L1TTwinMuxProducer.cc:43
L1TTwinMuxProducer::~L1TTwinMuxProducer
~L1TTwinMuxProducer() override
Definition: L1TTwinMuxProducer.cc:35
edm::EDGetTokenT< L1MuDTChambPhContainer >
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::EDPutTokenT< L1MuDTChambPhContainer >
L1TTwinMuxAlgorithm::get_ph_tm_output
L1MuDTChambPhContainer get_ph_tm_output()
Return Output PhContainer.
Definition: L1TTwinMuxAlgorithm.h:39
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89301
L1TTwinMuxProducer
Definition: L1TTwinMuxProducer.cc:32
edm::Handle< L1MuDTChambPhContainer >
ESGetToken.h
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
L1TTwinMuxParamsRcd.h
L1MuDTChambPhContainer
Definition: L1MuDTChambPhContainer.h:33
MakerMacros.h
L1MuDTChambThContainer::setContainer
void setContainer(The_Container inputSegments)
Definition: L1MuDTChambThContainer.cc:39
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
theta
Geom::Theta< T > theta() const
Definition: Basic3DVectorLD.h:150
edm::global::EDProducer
Definition: EDProducer.h:32
L1TTwinMuxProducer::m_dtdigi
const edm::EDGetTokenT< L1MuDTChambPhContainer > m_dtdigi
Definition: L1TTwinMuxProducer.cc:39
L1TTwinMuxProducer::m_rpcsource
const edm::EDGetTokenT< RPCDigiCollection > m_rpcsource
Definition: L1TTwinMuxProducer.cc:41
edm::ParameterSet
Definition: ParameterSet.h:47
Event.h
L1MuDTChambThContainer::getContainer
The_Container const * getContainer() const
Definition: L1MuDTChambThContainer.cc:41
L1TTwinMuxProducer::m_rpcGeometryToken
const edm::ESGetToken< RPCGeometry, MuonGeometryRecord > m_rpcGeometryToken
Definition: L1TTwinMuxProducer.cc:44
edm::EventSetup
Definition: EventSetup.h:58
L1TTwinMuxProducer::L1TTwinMuxProducer
L1TTwinMuxProducer(const edm::ParameterSet &pset)
Definition: L1TTwinMuxProducer.cc:50
edm::ESGetToken< L1TTwinMuxParams, L1TTwinMuxParamsRcd >
L1TTwinMuxAlgorithm
Definition: L1TTwinMuxAlgorithm.h:27
L1TTwinMuxProducer::m_dtthetadigi
const edm::EDGetTokenT< L1MuDTChambThContainer > m_dtthetadigi
Definition: L1TTwinMuxProducer.cc:40
eostools.move
def move(src, dest)
Definition: eostools.py:511
std
Definition: JetResolutionObject.h:76
L1TTwinMuxProducer::produce
void produce(edm::StreamID, edm::Event &e, const edm::EventSetup &c) const override
Definition: L1TTwinMuxProducer.cc:59
L1TTwinMuxProducer::m_phContainerToken
const edm::EDPutTokenT< L1MuDTChambPhContainer > m_phContainerToken
Definition: L1TTwinMuxProducer.cc:46
L1TTwinMuxAlgorithm::run
void run(edm::Handle< L1MuDTChambPhContainer > phiDigis, edm::Handle< L1MuDTChambThContainer > thetaDigis, edm::Handle< RPCDigiCollection > rpcDigis, const L1TTwinMuxParams &, const RPCGeometry &)
Definition: L1TTwinMuxAlgorithm.cc:32
ConsumesCollector.h
ParameterSet.h
EDProducer.h
MuonGeometryRecord.h
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:56
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
DeDxTools::esConsumes
ESGetTokenH3DDVariant esConsumes(std::string const &Reccord, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
edm::Event
Definition: Event.h:73
L1MuDTChambThContainer
Definition: L1MuDTChambThContainer.h:33
L1TTwinMuxAlgorithm.h
L1TTwinMuxProducer::m_thContainerToken
const edm::EDPutTokenT< L1MuDTChambThContainer > m_thContainerToken
Definition: L1TTwinMuxProducer.cc:47
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37