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>(
72 iConfig.getParameter<
edm::ParameterSet>(
"minGoodStripCharge").getParameter<double>(
"value"))} {}
82 descCCC.
add<
double>(
"value");
83 desc.add(
"minGoodStripCharge", descCCC);
85 descriptions.
add(
"mkFitSiStripHitConverterDefault",
desc);
95 std::vector<float> clusterCharge;
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 <<
")";
T getParameter(std::string const &) const
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
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
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > ttopoToken_
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::EDPutTokenT< MkFitClusterIndexToHit > clusterIndexPutToken_
const edm::EDPutTokenT< std::vector< float > > clusterChargePutToken_
SiStripCluster const & amplitudes() const
const edm::ESGetToken< TransientTrackingRecHitBuilder, TransientRecHitRecord > ttrhBuilderToken_
const edm::EDPutTokenT< MkFitHitWrapper > wrapperPutToken_
#define DEFINE_FWK_MODULE(type)
MkFitSiStripHitConverter(edm::ParameterSet const &iConfig)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
const ConvertHitTraits convertTraits_
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void setClustersID(edm::ProductID id)
~MkFitSiStripHitConverter() override=default
std::vector< TrackingRecHit const * > & hits()
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)