Main Page
Namespaces
Classes
Package Documentation
L1Trigger
L1TMuonEndCap
plugins
L1TMuonEndCapForestESProducer.cc
Go to the documentation of this file.
1
#include <iostream>
2
#include <memory>
3
#include <iostream>
4
5
#include "
FWCore/Framework/interface/ModuleFactory.h
"
6
#include "
FWCore/Framework/interface/ESProducer.h
"
7
#include "
FWCore/Framework/interface/ESHandle.h
"
8
#include "
FWCore/Framework/interface/ESProducts.h
"
9
10
#include "
CondFormats/L1TObjects/interface/L1TMuonEndCapForest.h
"
11
#include "
CondFormats/DataRecord/interface/L1TMuonEndCapForestRcd.h
"
12
#include "
L1Trigger/L1TMuonEndCap/interface/ForestHelper.h
"
13
14
#include "
FWCore/ParameterSet/interface/FileInPath.h
"
15
#include "TXMLEngine.h"
16
17
#include "
L1Trigger/L1TMuonEndCap/interface/Tree.h
"
18
19
using namespace
std
;
20
21
// class declaration
22
23
class
L1TMuonEndCapForestESProducer
:
public
edm::ESProducer
{
24
public
:
25
L1TMuonEndCapForestESProducer
(
const
edm::ParameterSet
&);
26
~
L1TMuonEndCapForestESProducer
();
27
28
typedef
std::shared_ptr<L1TMuonEndCapForest>
ReturnType
;
29
30
ReturnType produce(
const
L1TMuonEndCapForestRcd
&);
31
private
:
32
33
};
34
35
L1TMuonEndCapForestESProducer::L1TMuonEndCapForestESProducer
(
const
edm::ParameterSet
& iConfig)
36
{
37
//the following line is needed to tell the framework what
38
// data is being produced
39
setWhatProduced(
this
);
40
41
//data_.print(cout);
42
43
// Benchmark calculations from original version of UF
44
45
//DEBUG: mode: 15 dir L1Trigger/L1TMuon/data/emtf_luts/v_16_02_21/ModeVariables/trees/15 num trees 64
46
//DEBUG: pred val: 0.201249
47
//DEBUG: data = 1, 1.975, 121, -10, -16, 1,
48
{
49
//std::vector<double> x = {1, 1.975, 121, -10, -16, 1};
50
//cout << "DEBUG: original result: 0.201249, our result: " << data_.evaluate(15, x) << "\n";
51
}
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.0201636
55
//DEBUG: data = 1, 1.325, 7, 0, 0, 0
56
{
57
//std::vector<double> x = {1, 1.325, 7, 0, 0, 0};
58
//cout << "DEBUG: original result: 0.0201636, our result: " << data_.evaluate(15, x) << "\n";
59
}
60
61
//DEBUG: mode: 11 dir L1Trigger/L1TMuon/data/emtf_luts/v_16_02_21/ModeVariables/trees/11 num trees 64
62
//DEBUG: pred val: 0.0260195
63
//DEBUG: data = 1, 1.675, 34, 10, 2, 0, 1
64
{
65
//std::vector<double> x = {1, 1.675, 34, 10, 2, 0, 1};
66
//cout << "DEBUG: original result: 0.0260195, our result: " << data_.evaluate(11, x) << "\n";
67
}
68
69
//DEBUG: mode: 10 dir L1Trigger/L1TMuon/data/emtf_luts/v_16_02_21/ModeVariables/trees/10 num trees 64
70
//DEBUG: pred val: 0.209812
71
//DEBUG: data = 1, 1.675, -38, 3, 1, 0, 1
72
{
73
//std::vector<double> x = {1, 1.675, -38, 3, 1, 0, 1};
74
//cout << "DEBUG: original result: 0.209812, our result: " << data_.evaluate(10, x) << "\n";
75
}
76
77
//DEBUG: mode: 15 dir L1Trigger/L1TMuon/data/emtf_luts/v_16_02_21/ModeVariables/trees/15 num trees 64
78
//DEBUG: pred val: 0.0788114
79
//DEBUG: data = 1, 1.375, 27, 16, 4, 1
80
{
81
//std::vector<double> x = {1, 1.375, 27, 16, 4, 1};
82
//cout << "DEBUG: original result: 0.0788114, our result: " << data_.evaluate(15, x) << "\n";
83
}
84
85
}
86
87
88
89
L1TMuonEndCapForestESProducer::~L1TMuonEndCapForestESProducer
()
90
{
91
}
92
93
94
95
//
96
// member functions
97
//
98
99
// ------------ method called to produce the data ------------
100
L1TMuonEndCapForestESProducer::ReturnType
101
L1TMuonEndCapForestESProducer::produce
(
const
L1TMuonEndCapForestRcd
& iRecord)
102
{
103
auto
value
= std::make_shared<L1TMuonEndCapForest>();
104
105
l1t::ForestHelper
data
(
value
.get());
106
// these should come from pythong config...
107
std::vector<int> modes = {3,5,9,6,10,12,7,11,13,14,15};
108
//std::string dir = "L1Trigger/L1TMuon/data/emtf_luts/ModeVariables/trees/";
109
std::string
dir
=
"L1Trigger/L1TMuon/data/emtf_luts/v_16_02_21/ModeVariables/trees/"
;
110
int
ntrees = 64;
111
112
data
.initializeFromXML(dir.c_str(), modes, ntrees);
113
114
return
value
;
115
}
116
117
//define this as a plug-in
118
DEFINE_FWK_EVENTSETUP_MODULE
(
L1TMuonEndCapForestESProducer
);
L1TMuonEndCapForestESProducer::produce
ReturnType produce(const L1TMuonEndCapForestRcd &)
Definition:
L1TMuonEndCapForestESProducer.cc:101
ESProducts.h
L1TMuonEndCapForestESProducer::L1TMuonEndCapForestESProducer
L1TMuonEndCapForestESProducer(const edm::ParameterSet &)
Definition:
L1TMuonEndCapForestESProducer.cc:35
L1TMuonEndCapForestESProducer::~L1TMuonEndCapForestESProducer
~L1TMuonEndCapForestESProducer()
Definition:
L1TMuonEndCapForestESProducer.cc:89
l1t::ForestHelper
Definition:
ForestHelper.h:39
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:255
std
Definition:
JetResolutionObject.h:76
Tree.h
edm::ESProducer
Definition:
ESProducer.h:97
L1TMuonEndCapForestESProducer::ReturnType
std::shared_ptr< L1TMuonEndCapForest > ReturnType
Definition:
L1TMuonEndCapForestESProducer.cc:28
L1TMuonEndCapForestESProducer
Definition:
L1TMuonEndCapForestESProducer.cc:23
FileInPath.h
ESHandle.h
value
Definition:
value.py:1
ForestHelper.h
relativeConstraints.value
value
Definition:
relativeConstraints.py:52
L1TMuonEndCapForest.h
DEFINE_FWK_EVENTSETUP_MODULE
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition:
ModuleFactory.h:60
ESProducer.h
data
char data[epos_bytes_allocation]
Definition:
EPOS_Wrapper.h:82
L1TMuonEndCapForestRcd.h
edm::ParameterSet
Definition:
ParameterSet.h:36
ModuleFactory.h
dir
dbl *** dir
Definition:
mlp_gen.cc:35
L1TMuonEndCapForestRcd
Definition:
L1TMuonEndCapForestRcd.h:11
Generated for CMSSW Reference Manual by
1.8.11