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 
48  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
49 
50 private:
51  void produce(edm::Event&, const edm::EventSetup&) override;
52 
53  // ----------member data ---------------------------
56  std::map<int, int> ptMap_;
57 };
58 
59 //
60 // constants, enums and typedefs
61 //
62 
63 //
64 // static data member definitions
65 //
66 
67 //
68 // constructors and destructor
69 //
71  m_barrelTfInputTag = iConfig.getParameter<edm::InputTag>("barrelTFInput");
72  m_barrelTfInputToken = consumes<RegionalMuonCandBxCollection>(m_barrelTfInputTag);
73  //register your products
74  produces<RegionalMuonCandBxCollection>("ConvBMTFMuons");
75  ptMap_[0] = 0;
76  ptMap_[1] = 0;
77  ptMap_[2] = 3;
78  ptMap_[3] = 4;
79  ptMap_[4] = 5;
80  ptMap_[5] = 6;
81  ptMap_[6] = 7;
82  ptMap_[7] = 8;
83  ptMap_[8] = 9;
84  ptMap_[9] = 10;
85  ptMap_[10] = 12;
86  ptMap_[11] = 14;
87  ptMap_[12] = 16;
88  ptMap_[13] = 20;
89  ptMap_[14] = 24;
90  ptMap_[15] = 28;
91  ptMap_[16] = 32;
92  ptMap_[17] = 36;
93  ptMap_[18] = 40;
94  ptMap_[19] = 50;
95  ptMap_[20] = 60;
96  ptMap_[21] = 70;
97  ptMap_[22] = 80;
98  ptMap_[23] = 90;
99  ptMap_[24] = 100;
100  ptMap_[25] = 120;
101  ptMap_[26] = 140;
102  ptMap_[27] = 160;
103  ptMap_[28] = 180;
104  ptMap_[29] = 200;
105  ptMap_[30] = 240;
106  ptMap_[31] = 280;
107 }
108 
109 //
110 // member functions
111 //
112 
113 // ------------ method called to produce the data ------------
115  using namespace edm;
116 
117  std::unique_ptr<RegionalMuonCandBxCollection> convMuons(new RegionalMuonCandBxCollection());
118 
120  iEvent.getByToken(m_barrelTfInputToken, bmtfMuons);
121  for (auto mu = bmtfMuons->begin(0); mu != bmtfMuons->end(0); ++mu) {
122  RegionalMuonCand convMu((*mu));
123  // int convPt = ptMap_.at(mu->hwPt());
124  // int convPhi = (mu->hwPhi() * 4) - (mu->processor() * 48);
125  // int convEta = getSigned(mu->hwEta())*3.54;
126  int convEta = (mu->hwEta() - 32) * 3.54;
127  // convMu.setHwPt(convPt);
128  // convMu.setHwPhi(convPhi);
129  convMu.setHwEta(convEta);
130  // convMu.setTFIdentifiers(mu->processor()+1, mu->trackFinderType());
131  convMuons->push_back(0, convMu);
132  }
133 
134  iEvent.put(std::move(convMuons), "ConvBMTFMuons");
135 }
136 
137 // ------------ method fills 'descriptions' with the allowed parameters for the module ------------
139  //The following says we do not know what parameters are allowed so do no validation
140  // Please change this to state exactly what you do use, even if it is no parameters
142  desc.setUnknown();
143  descriptions.addDefault(desc);
144 }
145 
146 //define this as a plug-in
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
std::map< int, int > ptMap_
BXVector< RegionalMuonCand > RegionalMuonCandBxCollection
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)
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
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
def move(src, dest)
Definition: eostools.py:511