27 #include "oneapi/tbb/task_arena.h" 66 stripHitsToken_{consumes(iConfig.getParameter<
edm::InputTag>(
"stripHits"))},
67 stripClusterChargeToken_{consumes(iConfig.getParameter<
edm::InputTag>(
"stripHits"))},
68 eventOfHitsToken_{consumes(iConfig.getParameter<
edm::InputTag>(
"eventOfHits"))},
69 seedToken_{consumes(iConfig.getParameter<
edm::InputTag>(
"seeds"))},
72 putToken_{produces<MkFitOutputWrapper>()},
73 minGoodStripCharge_{
static_cast<float>(
74 iConfig.getParameter<
edm::ParameterSet>(
"minGoodStripCharge").getParameter<double>(
"value"))},
75 seedCleaning_{iConfig.getParameter<
bool>(
"seedCleaning")},
76 backwardFitInCMSSW_{iConfig.getParameter<
bool>(
"backwardFitInCMSSW")},
77 removeDuplicates_{iConfig.getParameter<
bool>(
"removeDuplicates")},
78 mkFitSilent_{iConfig.getUntrackedParameter<
bool>(
"mkFitSilent")},
79 limitConcurrency_{iConfig.getUntrackedParameter<
bool>(
"limitConcurrency")} {
87 if (
build ==
"bestHit") {
89 throw cms::Exception(
"Configuration") <<
"bestHit is temporarily disabled";
90 }
else if (
build ==
"standard") {
92 throw cms::Exception(
"Configuration") <<
"standard is temporarily disabled";
93 }
else if (
build ==
"cloneEngine") {
97 <<
"Invalid value for parameter 'buildingRoutine' " <<
build <<
", allowed are bestHit, standard, cloneEngine";
113 ->setComment(
"Valid values are: 'bestHit', 'standard', 'cloneEngine'");
115 "ESProduct that has the mkFit configuration parameters for this iteration");
116 desc.add(
"seedCleaning",
true)->setComment(
"Clean seeds within mkFit");
117 desc.add(
"removeDuplicates",
true)->setComment(
"Run duplicate removal within mkFit");
118 desc.add(
"backwardFitInCMSSW",
false)
119 ->setComment(
"Do backward fit (to innermost hit) in CMSSW (true) or mkFit (false)");
120 desc.addUntracked(
"mkFitSilent",
true)->setComment(
"Allows to enables printouts from mkFit with 'False'");
121 desc.addUntracked(
"limitConcurrency",
false)
123 "Use tbb::task_arena to limit the internal concurrency to 1; useful only for timing studies when measuring " 127 descCCC.
add<
double>(
"value");
128 desc.add(
"minGoodStripCharge", descCCC);
130 descriptions.
add(
"mkFitProducerDefault",
desc);
134 return std::make_unique<mkfit::MkBuilderWrapper>(
mkFitSilent_);
142 if (
seeds.seeds().empty()) {
154 const std::vector<bool>* pixelMaskPtr =
nullptr;
155 std::vector<bool> pixelMask;
156 std::vector<bool> stripMask(stripHits.hits().size(),
false);
160 pixelMask.resize(pixelContainerMask.size(),
false);
163 <<
" but pixel cluster mask has " << pixelContainerMask.refProd().id();
165 pixelContainerMask.copyMaskTo(pixelMask);
166 pixelMaskPtr = &pixelMask;
169 if (not stripHits.hits().empty()) {
171 if UNLIKELY (stripContainerMask.refProd().id() != stripHits.clustersID()) {
172 throw cms::Exception(
"LogicError") <<
"MkFitHitWrapper has strip cluster ID " << stripHits.clustersID()
173 <<
" but strip cluster mask has " << stripContainerMask.refProd().id();
175 stripContainerMask.copyMaskTo(stripMask);
182 auto seeds_mutable =
seeds.seeds();
185 auto lambda = [&]() {
189 {pixelMaskPtr, &stripMask},
190 streamCache(iID)->get(),
199 tbb::task_arena arena(1);
202 tbb::this_task_arena::isolate(
std::move(lambda));
209 if (
mask.size() != stripClusterCharge.size()) {
210 throw cms::Exception(
"LogicError") <<
"Mask size (" <<
mask.size() <<
") inconsistent with number of hits (" 211 << stripClusterCharge.size() <<
")";
213 for (
int i = 0,
end = stripClusterCharge.size();
i <
end; ++
i) {
edm::EDGetTokenT< edm::ContainerMask< edmNew::DetSetVector< SiStripCluster > > > stripMaskToken_
edm::EDGetTokenT< edm::ContainerMask< edmNew::DetSetVector< SiPixelCluster > > > pixelMaskToken_
T getParameter(std::string const &) const
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
const bool backwardFitInCMSSW_
const bool removeDuplicates_
const edm::EDPutTokenT< MkFitOutputWrapper > putToken_
constexpr bool isUninitialized() const noexcept
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
const edm::EDGetTokenT< std::vector< float > > stripClusterChargeToken_
const bool limitConcurrency_
void stripClusterChargeCut(const std::vector< float > &stripClusterCharge, std::vector< bool > &mask) const
void run_OneIteration(const TrackerInfo &trackerInfo, const IterationConfig &itconf, const EventOfHits &eoh, const std::vector< const std::vector< bool > *> &hit_masks, MkBuilder &builder, TrackVec &seeds, TrackVec &out_tracks, bool do_seed_clean, bool do_backward_fit, bool do_remove_duplicates)
const edm::EDGetTokenT< MkFitHitWrapper > stripHitsToken_
std::unique_ptr< mkfit::MkBuilderWrapper > beginStream(edm::StreamID) const override
#define DEFINE_FWK_MODULE(type)
~MkFitProducer() override=default
ParameterDescriptionBase * add(U const &iLabel, T const &value)
const float minGoodStripCharge_
std::vector< Track > TrackVec
void add(std::string const &label, ParameterSetDescription const &psetDescription)
const edm::EDGetTokenT< MkFitHitWrapper > pixelHitsToken_
void produce(edm::StreamID, edm::Event &iEvent, const edm::EventSetup &iSetup) const override
const edm::ESGetToken< mkfit::IterationConfig, TrackerRecoGeometryRecord > mkFitIterConfigToken_
const edm::ESGetToken< MkFitGeometry, TrackerRecoGeometryRecord > mkFitGeomToken_
const edm::EDGetTokenT< MkFitEventOfHits > eventOfHitsToken_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
MkFitProducer(edm::ParameterSet const &iConfig)
const edm::EDGetTokenT< MkFitSeedWrapper > seedToken_