CMS 3D CMS Logo

Phase2TrackerRecHits.cc
Go to the documentation of this file.
12 
17 
23 
26 
27 #include <vector>
28 #include <string>
29 
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:
39 };
40 
42  : token_(consumes<Phase2TrackerCluster1DCollectionNew>(conf.getParameter<edm::InputTag>("src"))),
43  cpeTag_(conf.getParameter<edm::ESInputTag>("Phase2StripCPE")) {
44  produces<Phase2TrackerRecHit1DCollectionNew>();
45 }
46 
48  // Get the Clusters
50  event.getByToken(token_, clusters);
51 
52  // load the cpe via the eventsetup
54  eventSetup.get<TkStripCPERecord>().get(cpeTag_, cpe);
55 
56  // Get the geometry
58  eventSetup.get<TrackerDigiGeometryRecord>().get(geomHandle);
59  const TrackerGeometry* tkGeom(&(*geomHandle));
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) {
76  cpe->localParameters(clusterRef, *geomDetUnit);
77 
78  // Create a persistent edm::Ref to the 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 
edm::StreamID
Definition: StreamID.h:30
edm::ESInputTag
Definition: ESInputTag.h:87
MessageLogger.h
TrackerGeometry.h
GeomDet
Definition: GeomDet.h:27
ESHandle.h
ESInputTag
TkStripCPERecord.h
Phase2TrackerRecHits::~Phase2TrackerRecHits
~Phase2TrackerRecHits() override
Definition: Phase2TrackerRecHits.cc:33
edm::EDGetTokenT
Definition: EDGetToken.h:33
edm
HLT enums.
Definition: AlignableModifier.h:19
TkStripCPERecord
Definition: TkStripCPERecord.h:13
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:735
Phase2TrackerRecHits::Phase2TrackerRecHits
Phase2TrackerRecHits(const edm::ParameterSet &conf)
Definition: Phase2TrackerRecHits.cc:41
Phase2TrackerRecHits::cpeTag_
edm::ESInputTag cpeTag_
Definition: Phase2TrackerRecHits.cc:38
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
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
Phase2TrackerRecHits::produce
void produce(edm::StreamID sid, edm::Event &event, const edm::EventSetup &eventSetup) const final
Definition: Phase2TrackerRecHits.cc:47
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
TrackerDigiGeometryRecord
Definition: TrackerDigiGeometryRecord.h:15
edm::ESHandle
Definition: DTSurvey.h:22
Phase2StripCPE.h
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
HLT_2018_cff.InputTag
InputTag
Definition: HLT_2018_cff.py:79016
edm::ParameterSet
Definition: ParameterSet.h:36
Event.h
TrackInfoProducer_cfi.rechits
rechits
Definition: TrackInfoProducer_cfi.py:9
ModuleDef.h
edm::EventSetup
Definition: EventSetup.h:57
DetSetVector.h
get
#define get
Phase2TrackerRecHits
Definition: Phase2TrackerRecHits.cc:30
InputTag.h
GeomDet.h
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:37
PixelGeomDetUnit.h
EventSetup.h
edmNew::DetSetVector::FastFiller
Definition: DetSetVectorNew.h:236
ConsumesCollector.h
ParameterSet.h
EDProducer.h
event
Definition: event.py:1
edm::Event
Definition: Event.h:73
hit
Definition: SiStripHitEffFromCalibTree.cc:88
Phase2TrackerRecHit1D
Definition: Phase2TrackerRecHit1D.h:10
TrackerGeometry
Definition: TrackerGeometry.h:14