test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
L1TMuonEndCapForestESProducer.cc
Go to the documentation of this file.
1 #include <iostream>
2 #include <memory>
3 #include <iostream>
4 
9 
13 
15 #include "TXMLEngine.h"
16 
18 
19 using namespace std;
20 
21 // class declaration
22 
24 public:
27 
28  typedef std::shared_ptr<L1TMuonEndCapForest> ReturnType;
29 
30  ReturnType produce(const L1TMuonEndCapForestRcd&);
31 private:
33 };
34 
36  data_(new L1TMuonEndCapForest())
37 {
38  //the following line is needed to tell the framework what
39  // data is being produced
40  setWhatProduced(this);
41 
42  // these should come from pythong config...
43  std::vector<int> modes = {3,5,9,6,10,12,7,11,13,14,15};
44  //std::string dir = "L1Trigger/L1TMuon/data/emtf_luts/ModeVariables/trees/";
45  std::string dir = "L1Trigger/L1TMuon/data/emtf_luts/v_16_02_21/ModeVariables/trees/";
46  int ntrees = 64;
47 
48  data_.initializeFromXML(dir.c_str(), modes, ntrees);
49  //data_.print(cout);
50 
51  // Benchmark calculations from original version of UF
52 
53  //DEBUG: mode: 15 dir L1Trigger/L1TMuon/data/emtf_luts/v_16_02_21/ModeVariables/trees/15 num trees 64
54  //DEBUG: pred val: 0.201249
55  //DEBUG: data = 1, 1.975, 121, -10, -16, 1,
56  {
57  //std::vector<double> x = {1, 1.975, 121, -10, -16, 1};
58  //cout << "DEBUG: original result: 0.201249, our result: " << data_.evaluate(15, x) << "\n";
59  }
60 
61  //DEBUG: mode: 15 dir L1Trigger/L1TMuon/data/emtf_luts/v_16_02_21/ModeVariables/trees/15 num trees 64
62  //DEBUG: pred val: 0.0201636
63  //DEBUG: data = 1, 1.325, 7, 0, 0, 0
64  {
65  //std::vector<double> x = {1, 1.325, 7, 0, 0, 0};
66  //cout << "DEBUG: original result: 0.0201636, our result: " << data_.evaluate(15, x) << "\n";
67  }
68 
69  //DEBUG: mode: 11 dir L1Trigger/L1TMuon/data/emtf_luts/v_16_02_21/ModeVariables/trees/11 num trees 64
70  //DEBUG: pred val: 0.0260195
71  //DEBUG: data = 1, 1.675, 34, 10, 2, 0, 1
72  {
73  //std::vector<double> x = {1, 1.675, 34, 10, 2, 0, 1};
74  //cout << "DEBUG: original result: 0.0260195, our result: " << data_.evaluate(11, x) << "\n";
75  }
76 
77  //DEBUG: mode: 10 dir L1Trigger/L1TMuon/data/emtf_luts/v_16_02_21/ModeVariables/trees/10 num trees 64
78  //DEBUG: pred val: 0.209812
79  //DEBUG: data = 1, 1.675, -38, 3, 1, 0, 1
80  {
81  //std::vector<double> x = {1, 1.675, -38, 3, 1, 0, 1};
82  //cout << "DEBUG: original result: 0.209812, our result: " << data_.evaluate(10, x) << "\n";
83  }
84 
85  //DEBUG: mode: 15 dir L1Trigger/L1TMuon/data/emtf_luts/v_16_02_21/ModeVariables/trees/15 num trees 64
86  //DEBUG: pred val: 0.0788114
87  //DEBUG: data = 1, 1.375, 27, 16, 4, 1
88  {
89  //std::vector<double> x = {1, 1.375, 27, 16, 4, 1};
90  //cout << "DEBUG: original result: 0.0788114, our result: " << data_.evaluate(15, x) << "\n";
91  }
92 
93 }
94 
95 
96 
98 {
99 }
100 
101 
102 
103 //
104 // member functions
105 //
106 
107 // ------------ method called to produce the data ------------
110 {
111  using namespace edm::es;
112  std::shared_ptr<L1TMuonEndCapForest> pEMTFForest(data_.getWriteInstance());
113  return pEMTFForest;
114 
115 }
116 
117 //define this as a plug-in
ReturnType produce(const L1TMuonEndCapForestRcd &)
L1TMuonEndCapForestESProducer(const edm::ParameterSet &)
L1TMuonEndCapForest * getWriteInstance()
Definition: ForestHelper.h:67
void initializeFromXML(const char *dirname, const std::vector< int > &modes, int ntrees)
Definition: ForestHelper.cc:72
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
std::shared_ptr< L1TMuonEndCapForest > ReturnType
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60
dbl *** dir
Definition: mlp_gen.cc:35