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
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
std::map< int, int > ptMap_
void endRun(const edm::Run &, edm::EventSetup const &) override
void beginLuminosityBlock(const edm::LuminosityBlock &, edm::EventSetup const &) override
BXVector< RegionalMuonCand > RegionalMuonCandBxCollection
~L1TBMTFConverter() override
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
L1TBMTFConverter(const edm::ParameterSet &)
edm::EDGetTokenT< RegionalMuonCandBxCollection > m_barrelTfInputToken
delete x;
Definition: CaloConfig.h:22
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
const_iterator begin(int bx) const
int iEvent
Definition: GenABIO.cc:224
void addDefault(ParameterSetDescription const &psetDescription)
void beginRun(const edm::Run &, edm::EventSetup const &) override
void setHwEta(int bits)
Set compressed eta as transmitted by hardware LSB = 0.010875 (9 bits)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
void produce(edm::Event &, const edm::EventSetup &) override
const_iterator end(int bx) const
HLT enums.
edm::InputTag m_barrelTfInputTag
void endLuminosityBlock(const edm::LuminosityBlock &, edm::EventSetup const &) override
def move(src, dest)
Definition: eostools.py:511
Definition: Run.h:45