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 
22 
23 #include <iostream>
24 #include <iomanip>
25 #include <memory>
26 
27 using namespace std;
28 
29 //class L1TTwinMuxProducer: public edm::one::EDProducer<edm::one::SharedResources>
30 //class L1TTwinMuxProducer: public edm::EDProducer
32 public:
34  ~L1TTwinMuxProducer() override {}
35  void produce(edm::Event& e, const edm::EventSetup& c) override;
36 
37 private:
38  //L1TTwinMuxAlgorithm * m_l1tma;
39  // std::unique_ptr<L1TTwinMuxAlgorithm> m_l1tma(new L1TTwinMuxAlgorithm());
40  edm::EDGetToken m_dtdigi, m_dtthetadigi, m_rpcsource;
44 };
45 
47  //m_l1tma = new L1TTwinMuxAlgorithm();
48  // std::unique_ptr<L1TTwinMuxAlgorithm> m_l1tma(new L1TTwinMuxAlgorithm());
49 
50  m_dtdigi = consumes<L1MuDTChambPhContainer>(pset.getParameter<edm::InputTag>("DTDigi_Source"));
51  m_dtthetadigi = consumes<L1MuDTChambThContainer>(pset.getParameter<edm::InputTag>("DTThetaDigi_Source"));
52  m_rpcsource = consumes<RPCDigiCollection>(pset.getParameter<edm::InputTag>("RPC_Source"));
53  m_tmParamsToken = esConsumes<L1TTwinMuxParams, L1TTwinMuxParamsRcd>();
54 
55  produces<L1MuDTChambPhContainer>();
56  produces<L1MuDTChambThContainer>();
57 }
58 
60  std::unique_ptr<L1TTwinMuxAlgorithm> m_l1tma(new L1TTwinMuxAlgorithm());
62  tmParamsHandle = c.getHandle(m_tmParamsToken);
63  const L1TTwinMuxParams& tmParams = *tmParamsHandle.product();
64 
66  bool onlyRPC = tmParams.get_UseOnlyRPC();
68  bool onlyDT = tmParams.get_UseOnlyDT();
69 
70  if (onlyDT && onlyRPC) {
71  edm::LogWarning("Inconsistent configuration") << "onlyRPC and onlyDT options";
72  return;
73  }
75 
78  e.getByToken(m_dtdigi, phiDigis);
79  e.getByToken(m_dtthetadigi, thetaDigis);
80 
82  e.getByToken(m_rpcsource, rpcDigis);
83 
84  if (!phiDigis.isValid()) {
85  edm::LogWarning("Inconsistent digis") << "input DT phi digis not valid";
86  }
87 
88  //std::unique_ptr<L1MuDTChambPhContainer> l1ttmp(new L1MuDTChambPhContainer);
89  auto l1ttmp = std::make_unique<L1MuDTChambPhContainer>();
90  m_l1tma->run(phiDigis, thetaDigis, rpcDigis, c);
91  *l1ttmp = m_l1tma->get_ph_tm_output();
92  //null transfer of theta digis
93  auto l1ttmth = std::make_unique<L1MuDTChambThContainer>();
94  const std::vector<L1MuDTChambThDigi>* theta = thetaDigis->getContainer();
95  l1ttmth->setContainer(*theta);
96 
97  e.put(std::move(l1ttmp));
98  e.put(std::move(l1ttmth));
99 }
100 
L1TTwinMuxProducer::m_rpcsource
edm::EDGetToken m_rpcsource
Definition: L1TTwinMuxProducer.cc:40
L1TTwinMuxProducer::~L1TTwinMuxProducer
~L1TTwinMuxProducer() override
Definition: L1TTwinMuxProducer.cc:34
EDProducer.h
L1TTwinMuxParams::get_UseOnlyRPC
int get_UseOnlyRPC() const
Definition: L1TTwinMuxParams.h:60
L1TTwinMuxProducer
Definition: L1TTwinMuxProducer.cc:31
edm::Handle< L1MuDTChambPhContainer >
ESGetToken.h
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
MakerMacros.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
L1TTwinMuxProducer::produce
void produce(edm::Event &e, const edm::EventSetup &c) override
Definition: L1TTwinMuxProducer.cc:59
edm::ESHandle< L1TTwinMuxParams >
theta
Geom::Theta< T > theta() const
Definition: Basic3DVectorLD.h:150
edm::ParameterSet
Definition: ParameterSet.h:47
Event.h
L1MuDTChambThContainer::getContainer
The_Container const * getContainer() const
Definition: L1MuDTChambThContainer.cc:41
edm::stream::EDProducer
Definition: EDProducer.h:38
edm::EventSetup
Definition: EventSetup.h:57
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
L1TTwinMuxProducer::L1TTwinMuxProducer
L1TTwinMuxProducer(const edm::ParameterSet &pset)
Definition: L1TTwinMuxProducer.cc:46
edm::EDGetToken
Definition: EDGetToken.h:35
edm::ESGetToken< L1TTwinMuxParams, L1TTwinMuxParamsRcd >
L1TTwinMuxAlgorithm
Definition: L1TTwinMuxAlgorithm.h:33
eostools.move
def move(src, dest)
Definition: eostools.py:511
std
Definition: JetResolutionObject.h:76
L1TTwinMuxProducer::m_tmParamsToken
edm::ESGetToken< L1TTwinMuxParams, L1TTwinMuxParamsRcd > m_tmParamsToken
Definition: L1TTwinMuxProducer.cc:43
ConsumesCollector.h
ParameterSet.h
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
edm::Event
Definition: Event.h:73
L1TTwinMuxParams::get_UseOnlyDT
int get_UseOnlyDT() const
Definition: L1TTwinMuxParams.h:63
edm::InputTag
Definition: InputTag.h:15
L1TTwinMuxAlgorithm.h
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27
L1TTwinMuxProducer::tmParamsHandle
edm::ESHandle< L1TTwinMuxParams > tmParamsHandle
Event Setup Handler.
Definition: L1TTwinMuxProducer.cc:42
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
L1TTwinMuxParams
Definition: L1TTwinMuxParams.h:19