Main Page
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
o
p
q
r
s
t
u
v
w
z
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
:
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Enumerator
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Properties
_
a
d
e
f
l
m
o
p
s
t
u
v
Related Functions
:
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Package Documentation
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Modules
Pages
EventFilter
Utilities
plugins
TcdsRawToDigi.cc
Go to the documentation of this file.
1
// -*- C++ -*-
2
//
3
// Package: ProdTutorial/TcdsRawToDigi
4
// Class: TcdsRawToDigi
5
//
11
//
12
// Original Author: Chris Palmer
13
// Improved by : Salvatore Di Guida and Remi Mommsen
14
// Created: Thu, 28 May 2015 19:54:56 GMT
15
//
16
//
17
18
// system include files
19
#include <memory>
20
#include <iostream>
21
22
// user include files
23
#include "
FWCore/Framework/interface/Frameworkfwd.h
"
24
#include "
FWCore/Framework/interface/stream/EDProducer.h
"
25
26
#include "
FWCore/Framework/interface/Event.h
"
27
#include "
FWCore/Framework/interface/MakerMacros.h
"
28
29
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
30
31
#include "
DataFormats/FEDRawData/interface/FEDRawDataCollection.h
"
32
#include "
DataFormats/FEDRawData/interface/FEDNumbering.h
"
33
34
#include "
DataFormats/TCDS/interface/TCDSRecord.h
"
35
36
//
37
// class declaration
38
//
39
40
class
TcdsRawToDigi
:
public
edm::stream::EDProducer
<> {
41
public
:
42
explicit
TcdsRawToDigi
(
const
edm::ParameterSet
&);
43
~TcdsRawToDigi
()
override
;
44
45
static
void
fillDescriptions
(
edm::ConfigurationDescriptions
& descriptions);
46
47
private
:
48
void
produce
(
edm::Event
&,
const
edm::EventSetup
&)
override
;
49
50
edm::EDGetTokenT<FEDRawDataCollection>
dataToken_
;
51
};
52
53
TcdsRawToDigi::TcdsRawToDigi
(
const
edm::ParameterSet
& iConfig) {
54
edm::InputTag
dataLabel = iConfig.
getParameter
<
edm::InputTag
>(
"InputLabel"
);
55
dataToken_
= consumes<FEDRawDataCollection>(dataLabel);
56
produces<TCDSRecord>(
"tcdsRecord"
).setBranchAlias(
"tcdsRecord"
);
57
}
58
59
TcdsRawToDigi::~TcdsRawToDigi
() {}
60
61
//
62
// member functions
63
//
64
65
// ------------ method called to produce the data ------------
66
void
TcdsRawToDigi::produce
(
edm::Event
&
iEvent
,
const
edm::EventSetup
& iSetup) {
67
using namespace
edm
;
68
69
edm::Handle<FEDRawDataCollection>
rawdata;
70
iEvent
.getByToken(
dataToken_
, rawdata);
71
72
TCDSRecord
tcdsRecord;
73
if
(rawdata.
isValid
()) {
74
uint16_t selectedId = 0;
75
for
(uint16_t
fedId
=
FEDNumbering::MINTCDSuTCAFEDID
;
fedId
<=
FEDNumbering::MAXTCDSuTCAFEDID
;
fedId
++) {
76
const
FEDRawData
& tcdsData = rawdata->
FEDData
(
fedId
);
77
if
(tcdsData.
size
() > 0) {
78
if
(selectedId)
79
throw
cms::Exception
(
"TcdsRawToDigi::produce"
)
80
<<
"Second TCDS FED ID "
<<
fedId
<<
" found. First ID: "
<< selectedId;
81
tcdsRecord =
TCDSRecord
(tcdsData.
data
());
82
selectedId =
fedId
;
83
}
84
}
85
}
86
iEvent
.put(std::make_unique<TCDSRecord>(tcdsRecord),
"tcdsRecord"
);
87
}
88
89
// ------------ method fills 'descriptions' with the allowed parameters for the module ------------
90
void
TcdsRawToDigi::fillDescriptions
(
edm::ConfigurationDescriptions
& descriptions) {
91
//The following says we do not know what parameters are allowed so do no validation
92
// Please change this to state exactly what you do use, even if it is no parameters
93
edm::ParameterSetDescription
desc
;
94
desc
.add<
edm::InputTag
>(
"InputLabel"
,
edm::InputTag
(
"rawDataCollector"
));
95
descriptions.
add
(
"tcdsRawToDigi"
,
desc
);
96
}
97
98
//define this as a plug-in
99
DEFINE_FWK_MODULE
(
TcdsRawToDigi
);
FEDNumbering.h
edm::EDGetTokenT< FEDRawDataCollection >
edm
HLT enums.
Definition:
AlignableModifier.h:19
HLT_FULL_cff.InputTag
InputTag
Definition:
HLT_FULL_cff.py:89301
edm::ParameterSetDescription
Definition:
ParameterSetDescription.h:52
EDProducer.h
edm::Handle< FEDRawDataCollection >
FEDRawData::data
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
Definition:
FEDRawData.cc:24
FEDRawData
Definition:
FEDRawData.h:19
TcdsRawToDigi::dataToken_
edm::EDGetTokenT< FEDRawDataCollection > dataToken_
Definition:
TcdsRawToDigi.cc:50
MakerMacros.h
TcdsRawToDigi::TcdsRawToDigi
TcdsRawToDigi(const edm::ParameterSet &)
Definition:
TcdsRawToDigi.cc:53
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition:
MakerMacros.h:16
TCDSRecord.h
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition:
ConfigurationDescriptions.cc:57
FEDNumbering::MAXTCDSuTCAFEDID
Definition:
FEDNumbering.h:102
TcdsRawToDigi::~TcdsRawToDigi
~TcdsRawToDigi() override
Definition:
TcdsRawToDigi.cc:59
FEDNumbering::MINTCDSuTCAFEDID
Definition:
FEDNumbering.h:101
FEDRawDataCollection::FEDData
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
Definition:
FEDRawDataCollection.cc:19
edm::ConfigurationDescriptions
Definition:
ConfigurationDescriptions.h:28
edm::ParameterSet
Definition:
ParameterSet.h:47
Event.h
iEvent
int iEvent
Definition:
GenABIO.cc:224
FEDRawDataCollection.h
edm::stream::EDProducer
Definition:
EDProducer.h:36
edm::EventSetup
Definition:
EventSetup.h:58
l1tstage2_dqm_sourceclient-live_cfg.fedId
fedId
Definition:
l1tstage2_dqm_sourceclient-live_cfg.py:89
FEDRawData::size
size_t size() const
Lenght of the data buffer in bytes.
Definition:
FEDRawData.h:45
submitPVResolutionJobs.desc
string desc
Definition:
submitPVResolutionJobs.py:251
Frameworkfwd.h
TCDSRecord
Class to contain information from TCDS FED.
Definition:
TCDSRecord.h:19
TcdsRawToDigi::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition:
TcdsRawToDigi.cc:90
Exception
Definition:
hltDiff.cc:245
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition:
ParameterSet.h:303
ParameterSet.h
TcdsRawToDigi
Definition:
TcdsRawToDigi.cc:40
edm::HandleBase::isValid
bool isValid() const
Definition:
HandleBase.h:70
edm::Event
Definition:
Event.h:73
edm::InputTag
Definition:
InputTag.h:15
TcdsRawToDigi::produce
void produce(edm::Event &, const edm::EventSetup &) override
Definition:
TcdsRawToDigi.cc:66
Generated for CMSSW Reference Manual by
1.8.16