RecoEgamma
EgammaHFProducers
plugins
HFEMClusterProducer.cc
Go to the documentation of this file.
1
//Package: EgammaHFProdcers
2
// Class : HFEMClusterProducer
3
// Original Author: Kevin Klapoetke (minnesota)
4
//
5
// $Id: HFEMClusterProducer.cc,v 1.2 2007/09/19 Kevin Klapoetke
6
//
7
8
#include <iostream>
9
#include "
DataFormats/Common/interface/Handle.h
"
10
#include "
FWCore/Framework/interface/ESHandle.h
"
11
#include "
Geometry/Records/interface/CaloGeometryRecord.h
"
12
#include "
RecoEgamma/EgammaHFProducers/plugins/HFEMClusterProducer.h
"
13
using namespace
reco
;
14
HFEMClusterProducer::HFEMClusterProducer
(
edm::ParameterSet
const
& conf)
15
: hfreco_(consumes<
HFRecHitCollection
>(conf.getParameter<
edm
::
InputTag
>(
"hits"
))) {
16
produces<reco::HFEMClusterShapeCollection>();
17
produces<reco::BasicClusterCollection>();
18
produces<reco::SuperClusterCollection>();
19
produces<reco::HFEMClusterShapeAssociationCollection>();
20
algo_
.
setup
(conf.
getParameter
<
double
>(
"minTowerEnergy"
),
21
conf.
getParameter
<
double
>(
"seedThresholdET"
),
22
conf.
getParameter
<
double
>(
"maximumSL"
),
23
conf.
getParameter
<
double
>(
"maximumRenergy"
),
24
conf.
getParameter
<
bool
>(
"usePMTFlag"
),
25
conf.
getParameter
<
bool
>(
"usePulseFlag"
),
26
conf.
getParameter
<
bool
>(
"forcePulseFlagMC"
),
27
conf.
getParameter
<
int
>(
"correctionType"
));
28
}
29
30
void
HFEMClusterProducer::produce
(
edm::Event
&
e
,
edm::EventSetup
const
& iSetup) {
31
edm::Handle<HFRecHitCollection>
hf_hits;
32
33
e
.getByToken(
hfreco_
, hf_hits);
34
35
edm::ESHandle<CaloGeometry>
geometry
;
36
iSetup.
get
<
CaloGeometryRecord
>().
get
(
geometry
);
37
38
// create return data
39
auto
retdata1 = std::make_unique<HFEMClusterShapeCollection>();
40
auto
retdata2 = std::make_unique<SuperClusterCollection>();
41
42
algo_
.
isMC
(!
e
.isRealData());
43
44
algo_
.
clusterize
(*hf_hits, *
geometry
, *retdata1, *retdata2);
45
edm::OrphanHandle<reco::SuperClusterCollection>
SupHandle;
46
edm::OrphanHandle<reco::HFEMClusterShapeCollection>
ShapeHandle;
47
48
// put the results
49
ShapeHandle =
e
.put(
std::move
(retdata1));
50
SupHandle =
e
.put(
std::move
(retdata2));
51
52
auto
retdata3 = std::make_unique<HFEMClusterShapeAssociationCollection>(SupHandle, ShapeHandle);
53
54
for
(
unsigned
int
i
= 0;
i
< ShapeHandle->size();
i
++) {
55
retdata3->insert(
edm::Ref<reco::SuperClusterCollection>
(SupHandle,
i
),
56
edm::Ref<reco::HFEMClusterShapeCollection>
(ShapeHandle,
i
));
57
}
58
59
e
.put(
std::move
(retdata3));
60
}
geometry
ESHandle< TrackerGeometry > geometry
Definition:
TkLasBeamFitter.cc:200
HFEMClusterProducer::produce
void produce(edm::Event &e, edm::EventSetup const &iSetup) override
Definition:
HFEMClusterProducer.cc:30
Handle.h
mps_fire.i
i
Definition:
mps_fire.py:355
ESHandle.h
HFClusterAlgo::clusterize
void clusterize(const HFRecHitCollection &hf, const CaloGeometry &geom, reco::HFEMClusterShapeCollection &clusters, reco::SuperClusterCollection &SuperClusters)
Definition:
HFClusterAlgo.cc:89
CaloGeometryRecord
Definition:
CaloGeometryRecord.h:30
edm
HLT enums.
Definition:
AlignableModifier.h:19
geometry
Definition:
geometry.py:1
edm::SortedCollection
Definition:
SortedCollection.h:49
reco
fixed size matrix
Definition:
AlignmentAlgorithmBase.h:45
edm::Handle
Definition:
AssociativeIterator.h:50
edm::Ref
Definition:
AssociativeIterator.h:58
edm::EventSetup::get
T get() const
Definition:
EventSetup.h:73
edm::ESHandle< CaloGeometry >
HFClusterAlgo::setup
void setup(double minTowerEnergy, double seedThreshold, double maximumSL, double m_maximumRenergy, bool usePMTflag, bool usePulseflag, bool forcePulseFlagMC, int correctionSet)
Definition:
HFClusterAlgo.cc:40
CaloGeometryRecord.h
HFEMClusterProducer::hfreco_
edm::EDGetToken hfreco_
Definition:
HFEMClusterProducer.h:22
HLT_2018_cff.InputTag
InputTag
Definition:
HLT_2018_cff.py:79016
edm::ParameterSet
Definition:
ParameterSet.h:36
HFEMClusterProducer::algo_
HFClusterAlgo algo_
Definition:
HFEMClusterProducer.h:23
HFEMClusterProducer::HFEMClusterProducer
HFEMClusterProducer(edm::ParameterSet const &conf)
Definition:
HFEMClusterProducer.cc:14
edm::EventSetup
Definition:
EventSetup.h:57
get
#define get
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
eostools.move
def move(src, dest)
Definition:
eostools.py:511
edm::OrphanHandle
Definition:
EDProductfwd.h:39
HFEMClusterProducer.h
HFClusterAlgo::isMC
void isMC(bool isMC)
Definition:
HFClusterAlgo.h:35
edm::Event
Definition:
Event.h:73
MillePedeFileConverter_cfg.e
e
Definition:
MillePedeFileConverter_cfg.py:37
Generated for CMSSW Reference Manual by
1.8.16