22 class ConvertHitTraits {
24 ConvertHitTraits(
float minCharge) : minGoodStripCharge_(minCharge) {}
26 static constexpr
bool applyCCC() {
return true; }
30 bool passCCC(
float charge)
const {
return charge > minGoodStripCharge_; }
36 const float minGoodStripCharge_;
63 stripStereoRecHitToken_{consumes<SiStripRecHit2DCollection>(
iConfig.getParameter<
edm::InputTag>(
"stereoHits"))},
64 ttrhBuilderToken_{esConsumes<TransientTrackingRecHitBuilder, TransientRecHitRecord>(
66 ttopoToken_{esConsumes<TrackerTopology, TrackerTopologyRcd>()},
67 mkFitGeomToken_{esConsumes<MkFitGeometry, TrackerRecoGeometryRecord>()},
68 wrapperPutToken_{produces<MkFitHitWrapper>()},
69 clusterIndexPutToken_{produces<MkFitClusterIndexToHit>()},
70 clusterChargePutToken_{produces<std::vector<float>>()},
71 convertTraits_{
static_cast<float>(
78 desc.
add(
"stereoHits",
edm::InputTag{
"siStripMatchedRecHits",
"stereoRecHit"});
82 descCCC.
add<
double>(
"value");
83 desc.
add(
"minGoodStripCharge", descCCC);
85 descriptions.
add(
"mkFitSiStripHitConverterDefault", desc);
95 std::vector<float> clusterCharge;
97 auto convert = [&](
auto& hits) {
99 convertTraits_, hits, hitWrapper.
hits(), clusterIndexToHit.
hits(), clusterCharge, ttopo, ttrhBuilder, mkFitGeom);
105 if (not stripRphiHits.empty()) {
106 stripClusterID =
convert(stripRphiHits);
108 if (not stripStereoHits.empty()) {
109 auto stripStereoClusterID =
convert(stripStereoHits);
110 if (stripRphiHits.empty()) {
111 stripClusterID = stripStereoClusterID;
112 }
else if (stripClusterID != stripStereoClusterID) {
113 throw cms::Exception(
"LogicError") <<
"Encountered different cluster ProductIDs for strip RPhi hits ("
114 << stripClusterID <<
") and stereo (" << stripStereoClusterID <<
")";
const edm::EDGetTokenT< SiStripRecHit2DCollection > stripStereoRecHitToken_
void setupAsStrip(unsigned int id, int cpcm, int rows)
const edm::ESGetToken< MkFitGeometry, TrackerRecoGeometryRecord > mkFitGeomToken_
const edm::EDGetTokenT< SiStripRecHit2DCollection > stripRphiRecHitToken_
void produce(edm::StreamID, edm::Event &iEvent, const edm::EventSetup &iSetup) const override
#define DEFINE_FWK_MODULE(type)
SiStripCluster const & amplitudes() const
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)
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > ttopoToken_
const edm::EDPutTokenT< MkFitClusterIndexToHit > clusterIndexPutToken_
bool getData(T &iHolder) const
SiStripCluster const & stripCluster() const
const edm::EDPutTokenT< std::vector< float > > clusterChargePutToken_
const edm::ESGetToken< TransientTrackingRecHitBuilder, TransientRecHitRecord > ttrhBuilderToken_
const edm::EDPutTokenT< MkFitHitWrapper > wrapperPutToken_
bool get(ProductID const &oid, Handle< PROD > &result) const
MkFitSiStripHitConverter(edm::ParameterSet const &iConfig)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
const ConvertHitTraits convertTraits_
OrphanHandle< PROD > emplace(EDPutTokenT< PROD > token, Args &&...args)
puts a new product
T getParameter(std::string const &) const
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void setClustersID(edm::ProductID id)
~MkFitSiStripHitConverter() override=default
std::vector< TrackingRecHit const * > & hits()
OmniClusterRef const & firstClusterRef() const final
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)