RecoLocalTracker
Phase2TrackerRecHits
plugins
Phase2TrackerRecHits.cc
Go to the documentation of this file.
1
#include "
FWCore/Framework/interface/global/EDProducer.h
"
2
#include "
FWCore/Framework/interface/Event.h
"
3
#include "
FWCore/Framework/interface/EventSetup.h
"
4
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
5
#include "
FWCore/Utilities/interface/InputTag.h
"
6
#include "
FWCore/Framework/interface/ESHandle.h
"
7
#include "
FWCore/Framework/interface/ConsumesCollector.h
"
8
#include "
FWCore/PluginManager/interface/ModuleDef.h
"
9
#include "
FWCore/Framework/interface/MakerMacros.h
"
10
#include "
FWCore/MessageLogger/interface/MessageLogger.h
"
11
#include "
FWCore/Framework/interface/ESHandle.h
"
12
13
#include "
Geometry/CommonDetUnit/interface/GeomDet.h
"
14
#include "
Geometry/Records/interface/TrackerDigiGeometryRecord.h
"
15
#include "
Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h
"
16
#include "
Geometry/CommonDetUnit/interface/PixelGeomDetUnit.h
"
17
18
#include "
DataFormats/Common/interface/DetSetVector.h
"
19
#include "
DataFormats/Phase2TrackerCluster/interface/Phase2TrackerCluster1D.h
"
20
#include "
DataFormats/TrackerRecHit2D/interface/Phase2TrackerRecHit1D.h
"
21
#include "
DataFormats/TrackerCommon/interface/TrackerTopology.h
"
22
#include "
DataFormats/DetId/interface/DetId.h
"
23
24
#include "
RecoLocalTracker/Records/interface/TkPhase2OTCPERecord.h
"
25
#include "
RecoLocalTracker/Phase2TrackerRecHits/interface/Phase2StripCPE.h
"
26
27
#include <vector>
28
#include <string>
29
30
class
Phase2TrackerRecHits
:
public
edm::global::EDProducer
<> {
31
public
:
32
explicit
Phase2TrackerRecHits
(
const
edm::ParameterSet
& conf);
33
~Phase2TrackerRecHits
()
override
{};
34
void
produce
(
edm::StreamID
sid,
edm::Event
&
event
,
const
edm::EventSetup
& eventSetup)
const
final
;
35
36
private
:
37
edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord>
const
tTrackerGeom_
;
38
edm::ESGetToken<ClusterParameterEstimator<Phase2TrackerCluster1D>
,
TkPhase2OTCPERecord
>
const
tCPE_
;
39
40
edm::EDGetTokenT<Phase2TrackerCluster1DCollectionNew>
token_
;
41
};
42
43
Phase2TrackerRecHits::Phase2TrackerRecHits
(
edm::ParameterSet
const
& conf)
44
: tTrackerGeom_(
esConsumes
<
TrackerGeometry
,
TrackerDigiGeometryRecord
>()),
45
tCPE_(
esConsumes
(conf.getParameter<
edm
::
ESInputTag
>(
"Phase2StripCPE"
))),
46
token_(consumes<
Phase2TrackerCluster1DCollectionNew
>(conf.getParameter<
edm
::
InputTag
>(
"src"
))) {
47
produces<Phase2TrackerRecHit1DCollectionNew>();
48
}
49
50
void
Phase2TrackerRecHits::produce
(
edm::StreamID
sid,
edm::Event
&
event
,
const
edm::EventSetup
& eventSetup)
const
{
51
// Get the Clusters
52
edm::Handle<Phase2TrackerCluster1DCollectionNew>
clusters
;
53
event
.getByToken(
token_
,
clusters
);
54
55
// load the cpe via the eventsetup
56
const
auto
& cpe = &eventSetup.
getData
(
tCPE_
);
57
58
// Get the geometry
59
const
TrackerGeometry
* tkGeom = &eventSetup.
getData
(
tTrackerGeom_
);
60
61
// Global container for the RecHits of each module
62
auto
outputRecHits = std::make_unique<Phase2TrackerRecHit1DCollectionNew>();
63
64
// Loop over clusters
65
for
(
const
auto
& clusterDetSet : *
clusters
) {
66
DetId
detId(clusterDetSet.detId());
67
68
// Geometry
69
const
GeomDetUnit
* geomDetUnit(tkGeom->
idToDetUnit
(detId));
70
71
// Container for the clusters that will be produced for this modules
72
Phase2TrackerRecHit1DCollectionNew::FastFiller
rechits
(*outputRecHits, clusterDetSet.detId());
73
74
for
(
const
auto
& clusterRef : clusterDetSet) {
75
ClusterParameterEstimator<Phase2TrackerCluster1D>::LocalValues
lv =
76
cpe->
localParameters
(clusterRef, *geomDetUnit);
77
78
// Create a persistent edm::Ref to the cluster
79
edm::Ref<Phase2TrackerCluster1DCollectionNew, Phase2TrackerCluster1D>
cluster =
80
edmNew::makeRefTo
(
clusters
, &clusterRef);
81
82
// Make a RecHit and add it to the DetSet
83
Phase2TrackerRecHit1D
hit
(lv.first, lv.second, *geomDetUnit, cluster);
84
85
rechits
.push_back(
hit
);
86
}
87
}
88
89
outputRecHits->shrink_to_fit();
90
event
.put(
std::move
(outputRecHits));
91
}
92
93
DEFINE_FWK_MODULE
(
Phase2TrackerRecHits
);
edm::StreamID
Definition:
StreamID.h:30
MessageLogger.h
TrackerGeometry.h
GeomDet
Definition:
GeomDet.h:27
ESHandle.h
ESInputTag
Phase2TrackerRecHits::~Phase2TrackerRecHits
~Phase2TrackerRecHits() override
Definition:
Phase2TrackerRecHits.cc:33
edm::EDGetTokenT
Definition:
EDGetToken.h:33
edm
HLT enums.
Definition:
AlignableModifier.h:19
TkPhase2OTCPERecord.h
HLT_FULL_cff.InputTag
InputTag
Definition:
HLT_FULL_cff.py:89301
edmNew::makeRefTo
edm::Ref< typename HandleT::element_type, typename HandleT::element_type::value_type::value_type > makeRefTo(const HandleT &iHandle, typename HandleT::element_type::value_type::const_iterator itIter)
Definition:
DetSetVectorNew.h:704
Phase2TrackerRecHits::Phase2TrackerRecHits
Phase2TrackerRecHits(const edm::ParameterSet &conf)
Definition:
Phase2TrackerRecHits.cc:43
edm::Handle
Definition:
AssociativeIterator.h:50
edm::Ref
Definition:
AssociativeIterator.h:58
TrackerGeometry::idToDetUnit
const TrackerGeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
Definition:
TrackerGeometry.cc:183
DetId
Definition:
DetId.h:17
MakerMacros.h
TrackerTopology.h
Phase2TrackerRecHits::produce
void produce(edm::StreamID sid, edm::Event &event, const edm::EventSetup &eventSetup) const final
Definition:
Phase2TrackerRecHits.cc:50
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition:
MakerMacros.h:16
TrackerDigiGeometryRecord
Definition:
TrackerDigiGeometryRecord.h:16
Phase2StripCPE.h
HI_PhotonSkim_cff.rechits
rechits
Definition:
HI_PhotonSkim_cff.py:76
Phase2TrackerRecHits::tTrackerGeom_
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > tTrackerGeom_
Definition:
Phase2TrackerRecHits.cc:37
TkPhase2OTCPERecord
Definition:
TkPhase2OTCPERecord.h:12
ClusterParameterEstimator
Definition:
ClusterParameterEstimator.h:12
edm::global::EDProducer
Definition:
EDProducer.h:32
bsc_activity_cfg.clusters
clusters
Definition:
bsc_activity_cfg.py:36
TrackerDigiGeometryRecord.h
Phase2TrackerRecHit1D.h
edm::ParameterSet
Definition:
ParameterSet.h:47
Event.h
ModuleDef.h
ClusterParameterEstimator::localParameters
virtual LocalValues localParameters(const T &, const GeomDetUnit &) const =0
edm::EventSetup
Definition:
EventSetup.h:58
DetSetVector.h
Phase2TrackerRecHits
Definition:
Phase2TrackerRecHits.cc:30
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord >
InputTag.h
edm::EventSetup::getData
bool getData(T &iHolder) const
Definition:
EventSetup.h:127
GeomDet.h
Phase2TrackerRecHits::tCPE_
const edm::ESGetToken< ClusterParameterEstimator< Phase2TrackerCluster1D >, TkPhase2OTCPERecord > tCPE_
Definition:
Phase2TrackerRecHits.cc:38
edmNew::DetSetVector
Definition:
DetSetNew.h:13
eostools.move
def move(src, dest)
Definition:
eostools.py:511
DetId.h
Phase2TrackerCluster1D.h
Phase2TrackerRecHits::token_
edm::EDGetTokenT< Phase2TrackerCluster1DCollectionNew > token_
Definition:
Phase2TrackerRecHits.cc:40
PixelGeomDetUnit.h
EventSetup.h
edmNew::DetSetVector::FastFiller
Definition:
DetSetVectorNew.h:202
ConsumesCollector.h
ParameterSet.h
EDProducer.h
event
Definition:
event.py:1
DeDxTools::esConsumes
ESGetTokenH3DDVariant esConsumes(std::string const &Reccord, edm::ConsumesCollector &)
Definition:
DeDxTools.cc:283
edm::Event
Definition:
Event.h:73
hit
Definition:
SiStripHitEffFromCalibTree.cc:88
Phase2TrackerRecHit1D
Definition:
Phase2TrackerRecHit1D.h:10
TrackerGeometry
Definition:
TrackerGeometry.h:14
Generated for CMSSW Reference Manual by
1.8.16