Main Page
Namespaces
Classes
Package Documentation
GIT Directory
WorkBook
Offline Guide
Release schedule
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
L1Trigger
L1TGlobal
plugins
GtExternalFakeProducer.cc
Go to the documentation of this file.
1
10
11
// system include files
12
#include <boost/shared_ptr.hpp>
13
14
// user include files
15
16
#include "
FWCore/Framework/interface/EventSetup.h
"
17
#include "
FWCore/Framework/interface/Frameworkfwd.h
"
18
#include "
FWCore/Framework/interface/global/EDProducer.h
"
19
#include "
FWCore/Framework/interface/ESHandle.h
"
20
#include "
FWCore/Framework/interface/Event.h
"
21
#include "
FWCore/Framework/interface/MakerMacros.h
"
22
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
23
#include "
FWCore/Utilities/interface/EDGetToken.h
"
24
#include "
FWCore/Utilities/interface/InputTag.h
"
25
#include "
FWCore/MessageLogger/interface/MessageLogger.h
"
26
27
#include <
FWCore/ParameterSet/interface/ConfigurationDescriptions.h
>
28
#include <
FWCore/ParameterSet/interface/ParameterSetDescription.h
>
29
30
//#include <vector>
31
#include "
DataFormats/L1Trigger/interface/BXVector.h
"
32
33
#include "
DataFormats/L1TGlobal/interface/GlobalExtBlk.h
"
34
35
using namespace
std;
36
using namespace
edm;
37
38
39
namespace
l1t {
40
41
//
42
// class declaration
43
//
44
45
class
GtExternalFakeProducer
:
public
global::EDProducer
<> {
46
public
:
47
explicit
GtExternalFakeProducer
(
const
ParameterSet
&);
48
~
GtExternalFakeProducer
();
49
50
static
void
fillDescriptions(
ConfigurationDescriptions
& descriptions);
51
52
private
:
53
virtual
void
produce(
edm::StreamID
,
edm::Event
&,
const
edm::EventSetup
&)
const override
;
54
55
// ----------member data ---------------------------
56
// unsigned long long m_paramsCacheId; // Cache-ID from current parameters, to check if needs to be updated.
57
//boost::shared_ptr<const CaloParams> m_dbpars; // Database parameters for the trigger, to be updated as needed.
58
//boost::shared_ptr<const FirmwareVersion> m_fwv;
59
//boost::shared_ptr<FirmwareVersion> m_fwv; //not const during testing.
60
61
// BX parameters
62
int
bxFirst_
;
63
int
bxLast_
;
64
65
bool
setBptxAND_
;
66
bool
setBptxPlus_
;
67
bool
setBptxMinus_
;
68
bool
setBptxOR_
;
69
70
};
71
72
//
73
// constructors and destructor
74
//
75
GtExternalFakeProducer::GtExternalFakeProducer(
const
ParameterSet
& iConfig) :
76
bxFirst_ (iConfig.getParameter<int>(
"bxFirst"
)),
77
bxLast_ (iConfig.getParameter<int>(
"bxLast"
)),
78
setBptxAND_ (iConfig.getParameter<bool>(
"setBptxAND"
)),
79
setBptxPlus_ (iConfig.getParameter<bool>(
"setBptxPlus"
)),
80
setBptxMinus_ (iConfig.getParameter<bool>(
"setBptxMinus"
)),
81
setBptxOR_ (iConfig.getParameter<bool>(
"setBptxOR"
))
82
{
83
// register what you produce
84
produces<GlobalExtBlkBxCollection>();
85
86
// Setup parameters
87
88
}
89
90
91
GtExternalFakeProducer::~GtExternalFakeProducer
()
92
{
93
}
94
95
96
97
//
98
// member functions
99
//
100
101
// ------------ method called to produce the data ------------
102
void
103
GtExternalFakeProducer::produce
(
edm::StreamID
,
Event
&
iEvent
,
const
EventSetup
& iSetup)
const
104
{
105
106
LogDebug
(
"GtExternalFakeProducer"
) <<
"GtExternalFakeProducer::produce function called...\n"
;
107
108
// Setup vectors
109
GlobalExtBlk
extCond_bx;
110
111
//outputs
112
std::auto_ptr<GlobalExtBlkBxCollection> extCond(
new
GlobalExtBlkBxCollection
(0,
bxFirst_
,
bxLast_
));
113
114
// Fill in some external conditions for testing
115
if
(
setBptxAND_
) extCond_bx.
setExternalDecision
(8,
true
);
//EXT_BPTX_plus_AND_minus.v0
116
if
(
setBptxPlus_
) extCond_bx.
setExternalDecision
(9,
true
);
//EXT_BPTX_plus.v0
117
if
(
setBptxMinus_
) extCond_bx.
setExternalDecision
(10,
true
);
//EXT_BPTX_minus.v0
118
if
(
setBptxOR_
) extCond_bx.
setExternalDecision
(11,
true
);
//EXT_BPTX_plus_OR_minus.v0
119
120
// Fill Externals
121
for
(
int
iBx=
bxFirst_
; iBx<=
bxLast_
; iBx++ ){
122
extCond->push_back(iBx, extCond_bx);
123
}
124
125
126
iEvent.
put
(extCond);
127
128
}
129
130
// ------------ method fills 'descriptions' with the allowed parameters for the module ------------
131
void
132
GtExternalFakeProducer::fillDescriptions
(
ConfigurationDescriptions
& descriptions) {
133
// simGtExtFakeProd
134
edm::ParameterSetDescription
desc;
135
desc.
add
<
bool
>(
"setBptxMinus"
,
true
);
136
desc.
add
<
bool
>(
"setBptxAND"
,
true
);
137
desc.
add
<
int
>(
"bxFirst"
, -2);
138
desc.
add
<
bool
>(
"setBptxOR"
,
true
);
139
desc.
add
<
int
>(
"bxLast"
, 2);
140
desc.
add
<
bool
>(
"setBptxPlus"
,
true
);
141
descriptions.
add
(
"simGtExtFakeProd"
, desc);
142
}
143
144
}
// namespace
145
146
//define this as a plug-in
147
DEFINE_FWK_MODULE
(
l1t::GtExternalFakeProducer
);
LogDebug
#define LogDebug(id)
Definition:
MessageLogger.h:501
GlobalExtBlkBxCollection
BXVector< GlobalExtBlk > GlobalExtBlkBxCollection
Definition:
GlobalExtBlk.h:30
l1t::GtExternalFakeProducer::setBptxPlus_
bool setBptxPlus_
Definition:
GtExternalFakeProducer.cc:66
EDProducer.h
MessageLogger.h
EDGetToken.h
l1t::GtExternalFakeProducer::setBptxOR_
bool setBptxOR_
Definition:
GtExternalFakeProducer.cc:68
l1t::GtExternalFakeProducer::setBptxAND_
bool setBptxAND_
Definition:
GtExternalFakeProducer.cc:65
l1t::GtExternalFakeProducer::setBptxMinus_
bool setBptxMinus_
Definition:
GtExternalFakeProducer.cc:67
GlobalExtBlk.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition:
MakerMacros.h:17
edm::StreamID
Definition:
StreamID.h:30
Event.h
MakerMacros.h
EventSetup.h
l1t::GtExternalFakeProducer::produce
virtual void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
Definition:
GtExternalFakeProducer.cc:103
BXVector.h
Frameworkfwd.h
l1t::GtExternalFakeProducer
Definition:
GtExternalFakeProducer.cc:45
edm::ParameterSetDescription
Definition:
ParameterSetDescription.h:50
ParameterSet.h
iEvent
int iEvent
Definition:
GenABIO.cc:230
ParameterSetDescription.h
edm::Event::put
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition:
Event.h:121
l1t::GtExternalFakeProducer::bxLast_
int bxLast_
Definition:
GtExternalFakeProducer.cc:63
ESHandle.h
edm::EventSetup
Definition:
EventSetup.h:45
edm::global::EDProducer
Definition:
EDProducer.h:32
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition:
ParameterSetDescription.h:89
l1t::GtExternalFakeProducer::bxFirst_
int bxFirst_
Definition:
GtExternalFakeProducer.cc:62
GlobalExtBlk::setExternalDecision
void setExternalDecision(unsigned int bit, bool val)
Set decision bits.
Definition:
GlobalExtBlk.cc:52
l1t::GtExternalFakeProducer::~GtExternalFakeProducer
~GtExternalFakeProducer()
Definition:
GtExternalFakeProducer.cc:91
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition:
ConfigurationDescriptions.cc:65
l1t::GtExternalFakeProducer::fillDescriptions
static void fillDescriptions(ConfigurationDescriptions &descriptions)
Definition:
GtExternalFakeProducer.cc:132
InputTag.h
edm::ParameterSet
Definition:
ParameterSet.h:36
ConfigurationDescriptions.h
edm::Event
Definition:
Event.h:65
edm::ConfigurationDescriptions
Definition:
ConfigurationDescriptions.h:27
GlobalExtBlk
Definition:
GlobalExtBlk.h:35
Generated for CMSSW Reference Manual by
1.8.5