CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
L1TMicroGMTLUTDumper.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: L1TMicroGMTLUTDumper
4 // Class: L1TMicroGMTLUTDumper
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 
21 // system include files
22 #include <memory>
23 #include <fstream>
24 
25 // user include files
28 
31 
35 
38 
39 
40 #include <iostream>
41 //
42 // class declaration
43 //
44 using namespace l1t;
45 
47  public:
48  explicit L1TMicroGMTLUTDumper(const edm::ParameterSet&);
50  virtual void analyze(const edm::Event&, const edm::EventSetup&);
51 
52  private:
53  void dumpLut(MicroGMTLUT*, const std::string&);
54 
55  // ----------member data ---------------------------
58 
68 };
69 
70 //
71 // constants, enums and typedefs
72 //
73 
74 
75 //
76 // static data member definitions
77 //
78 
79 //
80 // constructors and destructor
81 //
83  m_rankLUT(iConfig),
84  m_boPosMatchQualLUT(iConfig, "BOPos", cancel_t::omtf_bmtf_pos),
85  m_boNegMatchQualLUT(iConfig, "BONeg", cancel_t::omtf_bmtf_neg),
86  m_foPosMatchQualLUT(iConfig, "FOPos", cancel_t::omtf_emtf_pos),
87  m_foNegMatchQualLUT(iConfig, "FONeg", cancel_t::omtf_emtf_neg),
88  m_brlSingleMatchQualLUT(iConfig, "BrlSingle", cancel_t::bmtf_bmtf),
89  m_ovlPosSingleMatchQualLUT(iConfig, "OvlPosSingle", cancel_t::omtf_omtf_pos),
90  m_ovlNegSingleMatchQualLUT(iConfig, "OvlNegSingle", cancel_t::omtf_omtf_neg),
91  m_fwdPosSingleMatchQualLUT(iConfig, "FwdPosSingle", cancel_t::emtf_emtf_pos),
92  m_fwdNegSingleMatchQualLUT(iConfig, "FwdNegSingle", cancel_t::emtf_emtf_neg)
93 {
94  //register your products
95 
96  //now do what ever other initialization is needed
97  m_foldername = iConfig.getParameter<std::string> ("out_directory");
98 
99 
100 }
101 
102 
104 {
105  // do anything here that needs to be done at desctruction time
106  // (e.g. close files, deallocate resources etc.)
107 }
108 
109 
110 //
111 // member functions
112 //
113 void
115  std::ofstream fStream(m_foldername+oName);
116  lut->save(fStream);
117  fStream.close();
118 }
119 
120 
121 
122 // ------------ method called to produce the data ------------
123 void
125 {
126  using namespace edm;
127  dumpLut(&m_rankLUT, std::string("/rank_lut.json"));
128  dumpLut(&m_boPosMatchQualLUT, std::string("/boPosMatchQualLUT.json"));
129  dumpLut(&m_boNegMatchQualLUT, std::string("/boNegMatchQualLUT.json"));
130  dumpLut(&m_foPosMatchQualLUT, std::string("/foPosMatchQualLUT.json"));
131  dumpLut(&m_foNegMatchQualLUT, std::string("/foNegMatchQualLUT.json"));
132  dumpLut(&m_brlSingleMatchQualLUT, std::string("/brlSingleMatchQualLUT.json"));
133  dumpLut(&m_ovlPosSingleMatchQualLUT, std::string("/ovlPosSingleMatchQualLUT.json"));
134  dumpLut(&m_ovlNegSingleMatchQualLUT, std::string("/ovlNegSingleMatchQualLUT.json"));
135  dumpLut(&m_fwdPosSingleMatchQualLUT, std::string("/fwdPosSingleMatchQualLUT.json"));
136  dumpLut(&m_fwdNegSingleMatchQualLUT, std::string("/fwdNegSingleMatchQualLUT.json"));
137 
138 }
139 
140 
141 //define this as a plug-in
T getParameter(std::string const &) const
MicroGMTMatchQualLUT m_brlSingleMatchQualLUT
MicroGMTRankPtQualLUT m_rankLUT
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
MicroGMTMatchQualLUT m_boNegMatchQualLUT
MicroGMTMatchQualLUT m_fwdPosSingleMatchQualLUT
MicroGMTMatchQualLUT m_ovlNegSingleMatchQualLUT
int iEvent
Definition: GenABIO.cc:230
MicroGMTMatchQualLUT m_boPosMatchQualLUT
virtual void analyze(const edm::Event &, const edm::EventSetup &)
void dumpLut(MicroGMTLUT *, const std::string &)
tuple lut
Definition: lumiPlot.py:244
L1TMicroGMTLUTDumper(const edm::ParameterSet &)
MicroGMTMatchQualLUT m_fwdNegSingleMatchQualLUT
MicroGMTMatchQualLUT m_foNegMatchQualLUT
void save(std::ofstream &output)
Definition: MicroGMTLUT.cc:8
MicroGMTMatchQualLUT m_ovlPosSingleMatchQualLUT
MicroGMTMatchQualLUT m_foPosMatchQualLUT