RecoLocalCalo
HcalLaserReco
src
HcalLaserReco.cc
Go to the documentation of this file.
1
#include "
FWCore/Framework/interface/EDProducer.h
"
2
#include "
FWCore/Framework/interface/Event.h
"
3
#include "
DataFormats/Common/interface/Handle.h
"
4
#include "
DataFormats/FEDRawData/interface/FEDRawDataCollection.h
"
5
#include "
DataFormats/HcalDigi/interface/HcalLaserDigi.h
"
6
#include "
RecoLocalCalo/HcalLaserReco/src/HcalLaserUnpacker.h
"
7
#include "
DataFormats/Common/interface/EDCollection.h
"
8
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
9
#include "
FWCore/Utilities/interface/InputTag.h
"
10
11
#include <iostream>
12
#include <fstream>
13
14
class
HcalLaserReco
:
public
edm::EDProducer
{
15
public
:
16
explicit
HcalLaserReco
(
const
edm::ParameterSet
& ps);
17
~HcalLaserReco
()
override
;
18
void
produce
(
edm::Event
&
e
,
const
edm::EventSetup
&
c
)
override
;
19
20
private
:
21
int
qdctdcFed_
;
22
HcalLaserUnpacker
unpacker_
;
23
edm::EDGetTokenT<FEDRawDataCollection>
tok_raw_
;
24
};
25
26
HcalLaserReco::HcalLaserReco
(
edm::ParameterSet
const
& conf)
27
: qdctdcFed_(conf.getUntrackedParameter<
int
>(
"QADCTDCFED"
, 8)) {
28
tok_raw_
= consumes<FEDRawDataCollection>(conf.
getParameter
<
edm::InputTag
>(
"fedRawDataCollectionTag"
));
29
30
produces<HcalLaserDigi>();
31
}
32
33
// Virtual destructor needed.
34
HcalLaserReco::~HcalLaserReco
() {}
35
36
// Functions that gets called by framework every event
37
void
HcalLaserReco::produce
(
edm::Event
&
e
,
const
edm::EventSetup
&) {
38
// Step A: Get Inputs
39
edm::Handle<FEDRawDataCollection>
rawraw;
40
e
.getByToken(
tok_raw_
, rawraw);
41
42
// Step B: Create empty output
43
auto
digi = std::make_unique<HcalLaserDigi>();
44
45
if
(
qdctdcFed_
>= 0) {
46
// Step C: unpack all requested FEDs
47
const
FEDRawData
& fed = rawraw->
FEDData
(
qdctdcFed_
);
48
unpacker_
.
unpack
(fed, *digi);
49
}
50
51
// Step D: Put outputs into event
52
e
.put(
std::move
(digi));
53
}
54
55
#include "
FWCore/PluginManager/interface/ModuleDef.h
"
56
#include "
FWCore/Framework/interface/MakerMacros.h
"
57
58
DEFINE_FWK_MODULE
(
HcalLaserReco
);
Handle.h
EDProducer.h
HcalLaserUnpacker::unpack
void unpack(const FEDRawData &raw, HcalLaserDigi &digi) const
Definition:
HcalLaserUnpacker.cc:16
edm::EDGetTokenT< FEDRawDataCollection >
HcalLaserUnpacker.h
edm::Handle< FEDRawDataCollection >
FEDRawData
Definition:
FEDRawData.h:19
MakerMacros.h
HcalLaserDigi.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition:
MakerMacros.h:16
HcalLaserReco::HcalLaserReco
HcalLaserReco(const edm::ParameterSet &ps)
Definition:
HcalLaserReco.cc:26
HcalLaserReco::~HcalLaserReco
~HcalLaserReco() override
Definition:
HcalLaserReco.cc:34
FEDRawDataCollection::FEDData
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
Definition:
FEDRawDataCollection.cc:19
edm::ParameterSet
Definition:
ParameterSet.h:47
Event.h
ModuleDef.h
createfilelist.int
int
Definition:
createfilelist.py:10
HcalLaserReco::qdctdcFed_
int qdctdcFed_
Definition:
HcalLaserReco.cc:21
FEDRawDataCollection.h
edm::EventSetup
Definition:
EventSetup.h:58
InputTag.h
HcalLaserReco::produce
void produce(edm::Event &e, const edm::EventSetup &c) override
Definition:
HcalLaserReco.cc:37
eostools.move
def move(src, dest)
Definition:
eostools.py:511
HcalLaserReco::tok_raw_
edm::EDGetTokenT< FEDRawDataCollection > tok_raw_
Definition:
HcalLaserReco.cc:23
HcalLaserReco::unpacker_
HcalLaserUnpacker unpacker_
Definition:
HcalLaserReco.cc:22
edm::EDProducer
Definition:
EDProducer.h:35
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition:
ParameterSet.h:303
ParameterSet.h
c
auto & c
Definition:
CAHitNtupletGeneratorKernelsImpl.h:46
edm::Event
Definition:
Event.h:73
EDCollection.h
edm::InputTag
Definition:
InputTag.h:15
HcalLaserUnpacker
Definition:
HcalLaserUnpacker.h:7
MillePedeFileConverter_cfg.e
e
Definition:
MillePedeFileConverter_cfg.py:37
HcalLaserReco
Definition:
HcalLaserReco.cc:14
Generated for CMSSW Reference Manual by
1.8.16