28 #include "oneapi/tbb/task_arena.h" 45 void stripClusterChargeCut(
const std::vector<float>& stripClusterCharge, std::vector<bool>& mask)
const;
67 stripHitsToken_{consumes(iConfig.getParameter<
edm::InputTag>(
"stripHits"))},
68 stripClusterChargeToken_{consumes(iConfig.getParameter<
edm::InputTag>(
"stripHits"))},
69 eventOfHitsToken_{consumes(iConfig.getParameter<
edm::InputTag>(
"eventOfHits"))},
70 seedToken_{consumes(iConfig.getParameter<
edm::InputTag>(
"seeds"))},
73 putToken_{produces<MkFitOutputWrapper>()},
74 minGoodStripCharge_{
static_cast<float>(
75 iConfig.getParameter<
edm::ParameterSet>(
"minGoodStripCharge").getParameter<double>(
"value"))},
76 seedCleaning_{iConfig.getParameter<
bool>(
"seedCleaning")},
77 backwardFitInCMSSW_{iConfig.getParameter<
bool>(
"backwardFitInCMSSW")},
78 removeDuplicates_{iConfig.getParameter<
bool>(
"removeDuplicates")},
79 mkFitSilent_{iConfig.getUntrackedParameter<
bool>(
"mkFitSilent")},
80 limitConcurrency_{iConfig.getUntrackedParameter<
bool>(
"limitConcurrency")} {
88 if (
build ==
"bestHit") {
90 throw cms::Exception(
"Configuration") <<
"bestHit is temporarily disabled";
91 }
else if (
build ==
"standard") {
93 throw cms::Exception(
"Configuration") <<
"standard is temporarily disabled";
94 }
else if (
build ==
"cloneEngine") {
98 <<
"Invalid value for parameter 'buildingRoutine' " <<
build <<
", allowed are bestHit, standard, cloneEngine";
115 ->setComment(
"Valid values are: 'bestHit', 'standard', 'cloneEngine'");
117 "ESProduct that has the mkFit configuration parameters for this iteration");
118 desc.add(
"seedCleaning",
true)->setComment(
"Clean seeds within mkFit");
119 desc.add(
"removeDuplicates",
true)->setComment(
"Run duplicate removal within mkFit");
120 desc.add(
"backwardFitInCMSSW",
false)
121 ->setComment(
"Do backward fit (to innermost hit) in CMSSW (true) or mkFit (false)");
122 desc.addUntracked(
"mkFitSilent",
true)->setComment(
"Allows to enables printouts from mkFit with 'False'");
123 desc.addUntracked(
"limitConcurrency",
false)
125 "Use tbb::task_arena to limit the internal concurrency to 1; useful only for timing studies when measuring " 129 descCCC.
add<
double>(
"value");
130 desc.add(
"minGoodStripCharge", descCCC);
132 descriptions.
add(
"mkFitProducerDefault",
desc);
136 return std::make_unique<mkfit::MkBuilderWrapper>(
mkFitSilent_);
144 if (
seeds.seeds().empty()) {
156 const std::vector<bool>* pixelMaskPtr =
nullptr;
157 std::vector<bool> pixelMask;
158 std::vector<bool> stripMask(stripHits.hits().size(),
false);
162 pixelMask.resize(pixelContainerMask.size(),
false);
165 <<
" but pixel cluster mask has " << pixelContainerMask.refProd().id();
167 pixelContainerMask.copyMaskTo(pixelMask);
168 pixelMaskPtr = &pixelMask;
171 if (not stripHits.hits().empty()) {
173 if UNLIKELY (stripContainerMask.refProd().id() != stripHits.clustersID()) {
174 throw cms::Exception(
"LogicError") <<
"MkFitHitWrapper has strip cluster ID " << stripHits.clustersID()
175 <<
" but strip cluster mask has " << stripContainerMask.refProd().id();
177 stripContainerMask.copyMaskTo(stripMask);
184 auto seeds_mutable =
seeds.seeds();
187 auto lambda = [&]() {
191 {pixelMaskPtr, &stripMask},
192 streamCache(iID)->get(),
201 tbb::task_arena arena(1);
204 tbb::this_task_arena::isolate(
std::move(lambda));
211 if (mask.size() != stripClusterCharge.size()) {
212 throw cms::Exception(
"LogicError") <<
"Mask size (" << mask.size() <<
") inconsistent with number of hits (" 213 << stripClusterCharge.size() <<
")";
215 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
const bool backwardFitInCMSSW_
#define DEFINE_FWK_MODULE(type)
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
bool getData(T &iHolder) const
~MkFitProducer() override=default
ParameterDescriptionBase * add(U const &iLabel, T const &value)
const float minGoodStripCharge_
std::vector< Track > TrackVec
auto const & tracks
cannot be loose
void initializeForCMSSW()
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_