CMS 3D CMS Logo

MkFitSiPixelHitConverter.cc
Go to the documentation of this file.
2 
6 
8 
10 
12 
17 
18 #include "convertHits.h"
19 
20 namespace {
21  struct ConvertHitTraits {
22  static constexpr bool applyCCC() { return false; }
23  static std::nullptr_t clusterCharge(const SiPixelRecHit& hit, DetId hitId) { return nullptr; }
24  static bool passCCC(std::nullptr_t) { return true; }
25  static void setDetails(mkfit::Hit& mhit, const SiPixelCluster& cluster, int shortId, std::nullptr_t) {
26  mhit.setupAsPixel(shortId, cluster.sizeX(), cluster.sizeY());
27  }
28  };
29 } // namespace
30 
32 public:
33  explicit MkFitSiPixelHitConverter(edm::ParameterSet const& iConfig);
34  ~MkFitSiPixelHitConverter() override = default;
35 
36  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
37 
38 private:
39  void produce(edm::StreamID, edm::Event& iEvent, const edm::EventSetup& iSetup) const override;
40 
47 };
48 
50  : pixelRecHitToken_{consumes<SiPixelRecHitCollection>(iConfig.getParameter<edm::InputTag>("hits"))},
51  ttrhBuilderToken_{esConsumes<TransientTrackingRecHitBuilder, TransientRecHitRecord>(
52  iConfig.getParameter<edm::ESInputTag>("ttrhBuilder"))},
53  ttopoToken_{esConsumes<TrackerTopology, TrackerTopologyRcd>()},
54  mkFitGeomToken_{esConsumes<MkFitGeometry, TrackerRecoGeometryRecord>()},
55  wrapperPutToken_{produces<MkFitHitWrapper>()},
56  clusterIndexPutToken_{produces<MkFitClusterIndexToHit>()} {}
57 
60 
61  desc.add("hits", edm::InputTag{"siPixelRecHits"});
62  desc.add("ttrhBuilder", edm::ESInputTag{"", "WithTrackAngle"});
63 
64  descriptions.addWithDefaultLabel(desc);
65 }
66 
68  const auto& ttrhBuilder = iSetup.getData(ttrhBuilderToken_);
69  const auto& ttopo = iSetup.getData(ttopoToken_);
70  const auto& mkFitGeom = iSetup.getData(mkFitGeomToken_);
71 
72  MkFitHitWrapper hitWrapper;
73  MkFitClusterIndexToHit clusterIndexToHit;
74 
75  std::vector<float> dummy;
76  auto pixelClusterID = mkfit::convertHits(ConvertHitTraits{},
78  hitWrapper.hits(),
79  clusterIndexToHit.hits(),
80  dummy,
81  ttopo,
82  ttrhBuilder,
83  mkFitGeom);
84 
85  hitWrapper.setClustersID(pixelClusterID);
86 
87  iEvent.emplace(wrapperPutToken_, std::move(hitWrapper));
88  iEvent.emplace(clusterIndexPutToken_, std::move(clusterIndexToHit));
89 }
90 
edm::StreamID
Definition: StreamID.h:30
convertHits.h
edm::ESInputTag
Definition: ESInputTag.h:87
MkFitHitWrapper::setClustersID
void setClustersID(edm::ProductID id)
Definition: MkFitHitWrapper.h:24
edm::EDGetTokenT
Definition: EDGetToken.h:33
edm::EDPutTokenT< MkFitHitWrapper >
TransientRecHitRecord.h
MkFitSiPixelHitConverter::ttrhBuilderToken_
const edm::ESGetToken< TransientTrackingRecHitBuilder, TransientRecHitRecord > ttrhBuilderToken_
Definition: MkFitSiPixelHitConverter.cc:42
MkFitSiPixelHitConverter
Definition: MkFitSiPixelHitConverter.cc:31
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
TrackerRecoGeometryRecord.h
MkFitSiPixelHitConverter::produce
void produce(edm::StreamID, edm::Event &iEvent, const edm::EventSetup &iSetup) const override
Definition: MkFitSiPixelHitConverter.cc:67
SiPixelCluster
Pixel cluster – collection of neighboring pixels above threshold.
Definition: SiPixelCluster.h:28
MkFitSiPixelHitConverter::clusterIndexPutToken_
const edm::EDPutTokenT< MkFitClusterIndexToHit > clusterIndexPutToken_
Definition: MkFitSiPixelHitConverter.cc:46
SiPixelRecHit
Our base class.
Definition: SiPixelRecHit.h:23
MkFitHitWrapper
Definition: MkFitHitWrapper.h:14
DetId
Definition: DetId.h:17
MakerMacros.h
SiPixelCluster::sizeY
int sizeY() const
Definition: SiPixelCluster.h:140
TrackerTopologyRcd.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
MkFitSiPixelHitConverter::mkFitGeomToken_
const edm::ESGetToken< MkFitGeometry, TrackerRecoGeometryRecord > mkFitGeomToken_
Definition: MkFitSiPixelHitConverter.cc:44
MkFitSiPixelHitConverter::ttopoToken_
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > ttopoToken_
Definition: MkFitSiPixelHitConverter.cc:43
MkFitSiPixelHitConverter::MkFitSiPixelHitConverter
MkFitSiPixelHitConverter(edm::ParameterSet const &iConfig)
Definition: MkFitSiPixelHitConverter.cc:49
edm::global::EDProducer
Definition: EDProducer.h:32
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
mkfit::convertHits
edm::ProductID convertHits(const Traits &traits, const HitCollection &hits, mkfit::HitVec &mkFitHits, std::vector< TrackingRecHit const * > &clusterIndexToHit, std::vector< float > &clusterChargeVec, const TrackerTopology &ttopo, const TransientTrackingRecHitBuilder &ttrhBuilder, const MkFitGeometry &mkFitGeom)
Definition: convertHits.h:25
SiPixelRecHitCollection.h
MkFitSiPixelHitConverter::~MkFitSiPixelHitConverter
~MkFitSiPixelHitConverter() override=default
edm::ParameterSet
Definition: ParameterSet.h:47
Event.h
MkFitClusterIndexToHit
Definition: MkFitClusterIndexToHit.h:8
MkFitClusterIndexToHit::hits
std::vector< TrackingRecHit const * > & hits()
Definition: MkFitClusterIndexToHit.h:12
iEvent
int iEvent
Definition: GenABIO.cc:224
edm::EventSetup
Definition: EventSetup.h:58
edm::ESGetToken< TransientTrackingRecHitBuilder, TransientRecHitRecord >
MkFitHitWrapper::hits
mkfit::HitVec & hits()
Definition: MkFitHitWrapper.h:27
edm::EventSetup::getData
bool getData(T &iHolder) const
Definition: EventSetup.h:127
MkFitClusterIndexToHit.h
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
eostools.move
def move(src, dest)
Definition: eostools.py:511
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
MkFitSiPixelHitConverter::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: MkFitSiPixelHitConverter.cc:58
ParameterSet.h
dummy
Definition: DummySelector.h:38
EDProducer.h
SiPixelCluster::sizeX
int sizeX() const
Definition: SiPixelCluster.h:137
MkFitSiPixelHitConverter::wrapperPutToken_
const edm::EDPutTokenT< MkFitHitWrapper > wrapperPutToken_
Definition: MkFitSiPixelHitConverter.cc:45
edm::Event
Definition: Event.h:73
MkFitSiPixelHitConverter::pixelRecHitToken_
const edm::EDGetTokenT< SiPixelRecHitCollection > pixelRecHitToken_
Definition: MkFitSiPixelHitConverter.cc:41
edm::InputTag
Definition: InputTag.h:15
hit
Definition: SiStripHitEffFromCalibTree.cc:88
Hit
SeedingHitSet::ConstRecHitPointer Hit
Definition: SeedGeneratorFromProtoTracksEDProducer.cc:34
edm::ConfigurationDescriptions::addWithDefaultLabel
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:87
MkFitGeometry.h
MkFitHitWrapper.h