RecoPPS
Local
plugins
TotemRPRecHitProducer.cc
Go to the documentation of this file.
1
/****************************************************************************
2
*
3
* This is a part of TOTEM offline software.
4
* Authors:
5
* Hubert Niewiadomski
6
* Jan Kašpar (jan.kaspar@gmail.com)
7
*
8
****************************************************************************/
9
10
#include "
FWCore/Framework/interface/MakerMacros.h
"
11
12
#include "
FWCore/Framework/interface/stream/EDProducer.h
"
13
#include "
FWCore/Framework/interface/Event.h
"
14
#include "
FWCore/Framework/interface/EventSetup.h
"
15
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
16
17
#include "
DataFormats/Common/interface/DetSetVector.h
"
18
#include "
DataFormats/Common/interface/DetSet.h
"
19
#include "
DataFormats/CTPPSReco/interface/TotemRPCluster.h
"
20
#include "
DataFormats/CTPPSReco/interface/TotemRPRecHit.h
"
21
22
#include "
RecoPPS/Local/interface/TotemRPRecHitProducerAlgorithm.h
"
23
24
//----------------------------------------------------------------------------------------------------
25
26
class
TotemRPRecHitProducer
:
public
edm::stream::EDProducer
<> {
27
public
:
28
explicit
TotemRPRecHitProducer
(
const
edm::ParameterSet
& conf);
29
30
~TotemRPRecHitProducer
()
override
{}
31
32
void
produce
(
edm::Event
&
e
,
const
edm::EventSetup
&
c
)
override
;
33
static
void
fillDescriptions
(
edm::ConfigurationDescriptions
&);
34
35
private
:
36
const
edm::ParameterSet
conf_
;
37
int
verbosity_
;
38
39
TotemRPRecHitProducerAlgorithm
algorithm_
;
40
41
edm::InputTag
tagCluster_
;
42
edm::EDGetTokenT<edm::DetSetVector<TotemRPCluster>
>
tokenCluster_
;
43
};
44
45
//----------------------------------------------------------------------------------------------------
46
//----------------------------------------------------------------------------------------------------
47
48
using namespace
std
;
49
using namespace
edm
;
50
51
//----------------------------------------------------------------------------------------------------
52
53
TotemRPRecHitProducer::TotemRPRecHitProducer
(
const
edm::ParameterSet
& conf) : conf_(conf), algorithm_(conf) {
54
verbosity_
= conf.
getParameter
<
int
>(
"verbosity"
);
55
56
tagCluster_
= conf.
getParameter
<
edm::InputTag
>(
"tagCluster"
);
57
tokenCluster_
= consumes<edm::DetSetVector<TotemRPCluster>>(
tagCluster_
);
58
59
produces<edm::DetSetVector<TotemRPRecHit>>();
60
}
61
62
//----------------------------------------------------------------------------------------------------
63
64
void
TotemRPRecHitProducer::produce
(
edm::Event
&
e
,
const
edm::EventSetup
& es) {
65
// get input
66
edm::Handle<edm::DetSetVector<TotemRPCluster>
>
input
;
67
e
.getByToken(
tokenCluster_
,
input
);
68
69
// prepare output
70
DetSetVector<TotemRPRecHit>
output
;
71
72
// build reco hits
73
for
(
auto
& ids : *
input
) {
74
DetSet<TotemRPRecHit>
& ods =
output
.find_or_insert(ids.detId());
75
algorithm_
.
buildRecoHits
(ids, ods);
76
}
77
78
// save output
79
e
.put(make_unique<
DetSetVector<TotemRPRecHit>
>(
output
));
80
}
81
82
//----------------------------------------------------------------------------------------------------
83
84
void
TotemRPRecHitProducer::fillDescriptions
(
edm::ConfigurationDescriptions
& descr) {
85
edm::ParameterSetDescription
desc
;
86
87
desc
.add<
edm::InputTag
>(
"tagCluster"
,
edm::InputTag
(
"totemRPClusterProducer"
))
88
->setComment(
"input clusters collection to retrieve"
);
89
desc
.add<
int
>(
"verbosity"
, 0);
90
91
descr.
add
(
"totemRPRecHitProducer"
,
desc
);
92
}
93
94
//----------------------------------------------------------------------------------------------------
95
96
DEFINE_FWK_MODULE
(
TotemRPRecHitProducer
);
TotemRPRecHitProducer::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &)
Definition:
TotemRPRecHitProducer.cc:84
edm::DetSetVector< TotemRPRecHit >
input
static const std::string input
Definition:
EdmProvDump.cc:48
TotemRPRecHitProducer::~TotemRPRecHitProducer
~TotemRPRecHitProducer() override
Definition:
TotemRPRecHitProducer.cc:36
edm::DetSet
Definition:
DetSet.h:23
convertSQLitetoXML_cfg.output
output
Definition:
convertSQLitetoXML_cfg.py:72
edm::EDGetTokenT
Definition:
EDGetToken.h:33
edm
HLT enums.
Definition:
AlignableModifier.h:19
HLT_FULL_cff.InputTag
InputTag
Definition:
HLT_FULL_cff.py:89301
edm::ParameterSetDescription
Definition:
ParameterSetDescription.h:52
TotemRPRecHitProducerAlgorithm.h
EDProducer.h
TotemRPRecHit.h
TotemRPRecHitProducer::tagCluster_
edm::InputTag tagCluster_
Definition:
TotemRPRecHitProducer.cc:47
TotemRPCluster.h
edm::Handle
Definition:
AssociativeIterator.h:50
TotemRPRecHitProducer::algorithm_
TotemRPRecHitProducerAlgorithm algorithm_
Definition:
TotemRPRecHitProducer.cc:45
MakerMacros.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition:
MakerMacros.h:16
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition:
ConfigurationDescriptions.cc:57
TotemRPRecHitProducerAlgorithm::buildRecoHits
void buildRecoHits(const edm::DetSet< TotemRPCluster > &input, edm::DetSet< TotemRPRecHit > &output)
Definition:
TotemRPRecHitProducerAlgorithm.cc:13
TotemRPRecHitProducer::conf_
const edm::ParameterSet conf_
Definition:
TotemRPRecHitProducer.cc:42
TotemRPRecHitProducer::TotemRPRecHitProducer
TotemRPRecHitProducer(const edm::ParameterSet &conf)
Definition:
TotemRPRecHitProducer.cc:53
TotemRPRecHitProducer::tokenCluster_
edm::EDGetTokenT< edm::DetSetVector< TotemRPCluster > > tokenCluster_
Definition:
TotemRPRecHitProducer.cc:48
edm::ConfigurationDescriptions
Definition:
ConfigurationDescriptions.h:28
edm::ParameterSet
Definition:
ParameterSet.h:47
TotemRPRecHitProducer::verbosity_
int verbosity_
Definition:
TotemRPRecHitProducer.cc:43
Event.h
edm::stream::EDProducer
Definition:
EDProducer.h:36
edm::EventSetup
Definition:
EventSetup.h:58
DetSetVector.h
TotemRPRecHitProducer::produce
void produce(edm::Event &e, const edm::EventSetup &c) override
Definition:
TotemRPRecHitProducer.cc:64
submitPVResolutionJobs.desc
string desc
Definition:
submitPVResolutionJobs.py:251
std
Definition:
JetResolutionObject.h:76
TotemRPRecHitProducerAlgorithm
Definition:
TotemRPRecHitProducerAlgorithm.h:20
TotemRPRecHitProducer
Definition:
TotemRPRecHitProducer.cc:26
EventSetup.h
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition:
ParameterSet.h:303
DetSet.h
ParameterSet.h
c
auto & c
Definition:
CAHitNtupletGeneratorKernelsImpl.h:56
edm::Event
Definition:
Event.h:73
edm::InputTag
Definition:
InputTag.h:15
MillePedeFileConverter_cfg.e
e
Definition:
MillePedeFileConverter_cfg.py:37
Generated for CMSSW Reference Manual by
1.8.16