EventFilter
LTCRawToDigi
src
LTCRawToDigi.cc
Go to the documentation of this file.
1
// -*- C++ -*-
2
//
3
// Package: LTCRawToDigi
4
// Class: LTCRawToDigi
5
//
13
//
14
// Original Author: Peter Wittich
15
// Created: Tue May 9 07:47:59 CDT 2006
16
//
17
//
18
19
// system include files
20
#include <memory>
21
22
// user include files
23
#include "
FWCore/Framework/interface/Frameworkfwd.h
"
24
#include "
FWCore/Framework/interface/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
//FEDRawData
32
#include "
DataFormats/FEDRawData/interface/FEDRawData.h
"
33
#include "
DataFormats/FEDRawData/interface/FEDNumbering.h
"
34
#include "
DataFormats/FEDRawData/interface/FEDRawDataCollection.h
"
35
// LTC class
36
#include "
DataFormats/LTCDigi/interface/LTCDigi.h
"
37
//
38
// class declaration
39
//
40
41
class
LTCRawToDigi
:
public
edm::EDProducer
{
42
public
:
43
explicit
LTCRawToDigi
(
const
edm::ParameterSet
&);
44
~LTCRawToDigi
()
override
;
45
46
void
produce
(
edm::Event
&,
const
edm::EventSetup
&)
override
;
47
48
private
:
49
// ----------member data ---------------------------
50
};
51
52
//
53
// constants, enums and typedefs
54
//
55
56
//
57
// static data member definitions
58
//
59
60
//
61
// constructors and destructor
62
//
63
LTCRawToDigi::LTCRawToDigi
(
const
edm::ParameterSet
& iConfig) {
64
//register your products
65
produces<LTCDigiCollection>();
66
}
67
68
LTCRawToDigi::~LTCRawToDigi
() {
69
// do anything here that needs to be done at desctruction time
70
// (e.g. close files, deallocate resources etc.)
71
}
72
73
//
74
// member functions
75
//
76
77
// ------------ method called to produce the data ------------
78
void
LTCRawToDigi::produce
(
edm::Event
&
iEvent
,
const
edm::EventSetup
& iSetup) {
79
using namespace
edm
;
80
const
int
LTCFedIDLo = 815;
81
const
int
LTCFedIDHi = 823;
82
83
// Get a handle to the FED data collection
84
edm::Handle<FEDRawDataCollection>
rawdata;
85
iEvent
.getByLabel(
"source"
, rawdata);
86
87
// create collection we'll save in the event record
88
auto
pOut = std::make_unique<LTCDigiCollection>();
89
90
// Loop over all possible FED's with the appropriate FED ID
91
for
(
int
id
= LTCFedIDLo;
id
<= LTCFedIDHi; ++
id
) {
93
const
FEDRawData
& fedData = rawdata->
FEDData
(
id
);
94
unsigned
short
int
length = fedData.
size
();
95
if
(!length)
96
continue
;
// bank does not exist
97
LTCDigi
ltcDigi(fedData.
data
());
98
pOut->push_back(ltcDigi);
99
}
100
iEvent
.put(
std::move
(pOut));
101
}
102
103
//define this as a plug-in
104
DEFINE_FWK_MODULE
(
LTCRawToDigi
);
FEDNumbering.h
EDProducer.h
edm
HLT enums.
Definition:
AlignableModifier.h:19
FEDRawData.h
edm::Handle
Definition:
AssociativeIterator.h:50
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
LTCDigi.h
MakerMacros.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition:
MakerMacros.h:16
LTCRawToDigi
Definition:
LTCRawToDigi.cc:41
LTCDigi
Definition:
LTCDigi.h:15
FEDRawDataCollection::FEDData
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
Definition:
FEDRawDataCollection.cc:19
edm::ParameterSet
Definition:
ParameterSet.h:47
Event.h
LTCRawToDigi::produce
void produce(edm::Event &, const edm::EventSetup &) override
Definition:
LTCRawToDigi.cc:78
iEvent
int iEvent
Definition:
GenABIO.cc:224
FEDRawDataCollection.h
edm::EventSetup
Definition:
EventSetup.h:57
LTCRawToDigi::~LTCRawToDigi
~LTCRawToDigi() override
Definition:
LTCRawToDigi.cc:68
FEDRawData::size
size_t size() const
Lenght of the data buffer in bytes.
Definition:
FEDRawData.h:45
eostools.move
def move(src, dest)
Definition:
eostools.py:511
LTCRawToDigi::LTCRawToDigi
LTCRawToDigi(const edm::ParameterSet &)
Definition:
LTCRawToDigi.cc:63
Frameworkfwd.h
triggerObjects_cff.id
id
Definition:
triggerObjects_cff.py:31
edm::EDProducer
Definition:
EDProducer.h:35
ParameterSet.h
edm::Event
Definition:
Event.h:73
Generated for CMSSW Reference Manual by
1.8.16