CMS 3D CMS Logo

L1TBMTFConverter.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: L1TBMTFConverter
4 // Class: L1TBMTFConverter
5 //
13 //
14 // Original Author: Joschka Philip Lingemann,40 3-B01,+41227671598,
15 // Created: Thu Oct 3 10:12:30 CEST 2013
16 // $Id$
17 //
18 //
19 
20 // system include files
21 #include <memory>
22 #include <fstream>
23 
24 // user include files
27 
30 
34 
37 
38 #include <iostream>
39 //
40 // class declaration
41 //
42 using namespace l1t;
43 
45 public:
46  explicit L1TBMTFConverter(const edm::ParameterSet&);
47  ~L1TBMTFConverter() override;
48 
49  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
50 
51 private:
52  void produce(edm::Event&, const edm::EventSetup&) override;
53 
54  void beginRun(const edm::Run&, edm::EventSetup const&) override;
55  void endRun(const edm::Run&, edm::EventSetup const&) override;
56  void beginLuminosityBlock(const edm::LuminosityBlock&, edm::EventSetup const&) override;
57  void endLuminosityBlock(const edm::LuminosityBlock&, edm::EventSetup const&) override;
58  // ----------member data ---------------------------
61  std::map<int, int> ptMap_;
62 };
63 
64 //
65 // constants, enums and typedefs
66 //
67 
68 //
69 // static data member definitions
70 //
71 
72 //
73 // constructors and destructor
74 //
76  m_barrelTfInputTag = iConfig.getParameter<edm::InputTag>("barrelTFInput");
77  m_barrelTfInputToken = consumes<RegionalMuonCandBxCollection>(m_barrelTfInputTag);
78  //register your products
79  produces<RegionalMuonCandBxCollection>("ConvBMTFMuons");
80  ptMap_[0] = 0;
81  ptMap_[1] = 0;
82  ptMap_[2] = 3;
83  ptMap_[3] = 4;
84  ptMap_[4] = 5;
85  ptMap_[5] = 6;
86  ptMap_[6] = 7;
87  ptMap_[7] = 8;
88  ptMap_[8] = 9;
89  ptMap_[9] = 10;
90  ptMap_[10] = 12;
91  ptMap_[11] = 14;
92  ptMap_[12] = 16;
93  ptMap_[13] = 20;
94  ptMap_[14] = 24;
95  ptMap_[15] = 28;
96  ptMap_[16] = 32;
97  ptMap_[17] = 36;
98  ptMap_[18] = 40;
99  ptMap_[19] = 50;
100  ptMap_[20] = 60;
101  ptMap_[21] = 70;
102  ptMap_[22] = 80;
103  ptMap_[23] = 90;
104  ptMap_[24] = 100;
105  ptMap_[25] = 120;
106  ptMap_[26] = 140;
107  ptMap_[27] = 160;
108  ptMap_[28] = 180;
109  ptMap_[29] = 200;
110  ptMap_[30] = 240;
111  ptMap_[31] = 280;
112 }
113 
115  // do anything here that needs to be done at desctruction time
116  // (e.g. close files, deallocate resources etc.)
117 }
118 
119 //
120 // member functions
121 //
122 
123 // ------------ method called to produce the data ------------
125  using namespace edm;
126 
127  std::unique_ptr<RegionalMuonCandBxCollection> convMuons(new RegionalMuonCandBxCollection());
128 
130  iEvent.getByToken(m_barrelTfInputToken, bmtfMuons);
131  for (auto mu = bmtfMuons->begin(0); mu != bmtfMuons->end(0); ++mu) {
132  RegionalMuonCand convMu((*mu));
133  // int convPt = ptMap_.at(mu->hwPt());
134  // int convPhi = (mu->hwPhi() * 4) - (mu->processor() * 48);
135  // int convEta = getSigned(mu->hwEta())*3.54;
136  int convEta = (mu->hwEta() - 32) * 3.54;
137  // convMu.setHwPt(convPt);
138  // convMu.setHwPhi(convPhi);
139  convMu.setHwEta(convEta);
140  // convMu.setTFIdentifiers(mu->processor()+1, mu->trackFinderType());
141  convMuons->push_back(0, convMu);
142  }
143 
144  iEvent.put(std::move(convMuons), "ConvBMTFMuons");
145 }
146 
147 // ------------ method called when starting to processes a run ------------
149 
150 // ------------ method called when ending the processing of a run ------------
152 
153 // ------------ method called when starting to processes a luminosity block ------------
155 
156 // ------------ method called when ending the processing of a luminosity block ------------
158 
159 // ------------ method fills 'descriptions' with the allowed parameters for the module ------------
161  //The following says we do not know what parameters are allowed so do no validation
162  // Please change this to state exactly what you do use, even if it is no parameters
164  desc.setUnknown();
165  descriptions.addDefault(desc);
166 }
167 
168 //define this as a plug-in
Ecal2004TBTDCRanges_v1_cff.endRun
endRun
Definition: Ecal2004TBTDCRanges_v1_cff.py:4
MessageLogger.h
edm::LuminosityBlock
Definition: LuminosityBlock.h:50
amptDefaultParameters_cff.mu
mu
Definition: amptDefaultParameters_cff.py:16
edm::Run
Definition: Run.h:45
edm::EDGetTokenT< RegionalMuonCandBxCollection >
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
EDProducer.h
edm::Handle
Definition: AssociativeIterator.h:50
L1TBMTFConverter
Definition: L1TBMTFConverter.cc:44
L1TBMTFConverter::produce
void produce(edm::Event &, const edm::EventSetup &) override
Definition: L1TBMTFConverter.cc:124
L1TBMTFConverter::endLuminosityBlock
void endLuminosityBlock(const edm::LuminosityBlock &, edm::EventSetup const &) override
Definition: L1TBMTFConverter.cc:157
L1TBMTFConverter::m_barrelTfInputTag
edm::InputTag m_barrelTfInputTag
Definition: L1TBMTFConverter.cc:60
MakerMacros.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
BXVector::begin
const_iterator begin(int bx) const
L1TBMTFConverter::endRun
void endRun(const edm::Run &, edm::EventSetup const &) override
Definition: L1TBMTFConverter.cc:151
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
BXVector::end
const_iterator end(int bx) const
edm::ParameterSet
Definition: ParameterSet.h:36
Event.h
l1t
delete x;
Definition: CaloConfig.h:22
L1TBMTFConverter::L1TBMTFConverter
L1TBMTFConverter(const edm::ParameterSet &)
Definition: L1TBMTFConverter.cc:75
L1TBMTFConverter::m_barrelTfInputToken
edm::EDGetTokenT< RegionalMuonCandBxCollection > m_barrelTfInputToken
Definition: L1TBMTFConverter.cc:59
L1TBMTFConverter::beginLuminosityBlock
void beginLuminosityBlock(const edm::LuminosityBlock &, edm::EventSetup const &) override
Definition: L1TBMTFConverter.cc:154
l1t::RegionalMuonCand::setHwEta
void setHwEta(int bits)
Set compressed eta as transmitted by hardware LSB = 0.010875 (9 bits)
Definition: RegionalMuonCand.h:134
iEvent
int iEvent
Definition: GenABIO.cc:224
edm::stream::EDProducer
Definition: EDProducer.h:38
edm::ParameterSetDescription::setUnknown
void setUnknown()
Definition: ParameterSetDescription.cc:39
l1t::RegionalMuonCandBxCollection
BXVector< RegionalMuonCand > RegionalMuonCandBxCollection
Definition: RegionalMuonCandFwd.h:9
edm::EventSetup
Definition: EventSetup.h:57
L1TBMTFConverter::~L1TBMTFConverter
~L1TBMTFConverter() override
Definition: L1TBMTFConverter.cc:114
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
L1TBMTFConverter::ptMap_
std::map< int, int > ptMap_
Definition: L1TBMTFConverter.cc:61
eostools.move
def move(src, dest)
Definition: eostools.py:511
Frameworkfwd.h
RegionalMuonCand.h
Exception.h
L1TBMTFConverter::beginRun
void beginRun(const edm::Run &, edm::EventSetup const &) override
Definition: L1TBMTFConverter.cc:148
RegionalMuonCandFwd.h
ParameterSet.h
edm::Event
Definition: Event.h:73
edm::ConfigurationDescriptions::addDefault
void addDefault(ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:99
edm::InputTag
Definition: InputTag.h:15
L1TBMTFConverter::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: L1TBMTFConverter.cc:160
l1t::RegionalMuonCand
Definition: RegionalMuonCand.h:8