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