57 maxChi2_(iConfig.getParameter<double>(
"maxChi2")),
101 const std::vector<uint8_t> &isGood,
121 using namespace reco;
128 fill(pblocks_, pblocks_ + NumberOfParamBlocks, pblock);
130 pblocks_[
id1] = pblock;
132 pblocks_[
id2] = pblock;
134 pblocks_[id3] = pblock;
136 pblocks_[id4] = pblock;
138 pblocks_[id5] = pblock;
140 pblocks_[id6] = pblock;
146 : doTracks_(iConfig.exists(
"trajectories")),
147 doStrip_(iConfig.existsAs<
bool>(
"doStrip") ? iConfig.getParameter<
bool>(
"doStrip") :
true),
148 doPixel_(iConfig.existsAs<
bool>(
"doPixel") ? iConfig.getParameter<
bool>(
"doPixel") :
true),
149 mergeOld_(iConfig.exists(
"oldClusterRemovalInfo")),
150 clusterWasteSolution_(
true),
152 iConfig.existsAs<
bool>(
"doStripChargeCheck") ? iConfig.getParameter<
bool>(
"doStripChargeCheck") :
false),
154 iConfig.existsAs<
bool>(
"doPixelChargeCheck") ? iConfig.getParameter<
bool>(
"doPixelChargeCheck") :
false),
155 stripRecHits_(doStripChargeCheck_ ? iConfig.getParameter<
std::
string>(
"stripRecHits")
157 pixelRecHits_(doPixelChargeCheck_ ? iConfig.getParameter<
std::
string>(
"pixelRecHits")
160 if (iConfig.
exists(
"overrideTrkQuals"))
162 if (iConfig.
exists(
"clusterLessSolution"))
166 <<
"HITrackClusterRemover: Charge check asked without cluster collection ";
169 <<
"HITrackClusterRemover: Pixel cluster charge check not yet implemented";
172 produces<edmNew::DetSetVector<SiPixelCluster> >();
174 produces<edmNew::DetSetVector<SiStripCluster> >();
176 produces<ClusterRemovalInfo>();
188 readPSet(iConfig,
"Strip", 2, 3, 4, 5);
189 readPSet(iConfig,
"StripInner", 2, 3);
190 readPSet(iConfig,
"StripOuter", 4, 5);
197 bool usingCharge =
false;
201 <<
"HITrackClusterRemover: Missing configuration for detector with subDetID = " << (
i + 1);
202 if (
pblocks_[
i].usesCharge_ && !usingCharge) {
203 throw cms::Exception(
"Configuration Error") <<
"HITrackClusterRemover: Configuration for subDetID = " << (
i + 1)
204 <<
" uses cluster charge, which is not enabled.";
209 produces<edm::ContainerMask<edmNew::DetSetVector<SiPixelCluster> > >();
210 produces<edm::ContainerMask<edmNew::DetSetVector<SiStripCluster> > >();
214 if (iConfig.
exists(
"TrackQuality")) {
218 iConfig.
existsAs<
int>(
"minNumberOfLayersWithMeasBeforeFiltering")
219 ? iConfig.
getParameter<
int>(
"minNumberOfLayersWithMeasBeforeFiltering")
245 for (
size_t i = 0,
n = refs.size();
i <
n; ++
i) {
246 refs[
i] = oldRefs[refs[
i]];
250 template <
typename T>
253 const std::vector<uint8_t> &isGood,
259 auto output = std::make_unique<DSV>();
262 unsigned int countOld = 0;
263 unsigned int countNew = 0;
266 const T *firstOffset = &oldClusters.
data().front();
267 for (
typename DSV::const_iterator itdet = oldClusters.
begin(), enddet = oldClusters.
end(); itdet != enddet; ++itdet) {
273 uint32_t
id = oldDS.detId();
276 for (
typename DS::const_iterator it = oldDS.begin(), ed = oldDS.end(); it != ed; ++it) {
277 uint32_t
index = ((&*it) - firstOffset);
280 outds.push_back(*it);
282 refs.push_back(
index);
290 if (oldRefs !=
nullptr)
313 <<
"HITrackClusterRemover: strip cluster ref from Product ID = " << cluster.
id()
314 <<
" does not match with source cluster collection (ID = " <<
stripSourceProdID <<
")\n.";
322 for (std::vector<uint8_t>::const_iterator iAmp = cluster->amplitudes().begin(); iAmp != cluster->amplitudes().end();
326 if (
pblocks_[subdet - 1].cutOnStripCharge_ &&
360 <<
"HITrackClusterRemover: pixel cluster ref from Product ID = " << cluster.
id()
361 <<
" does not match with source cluster collection (ID = " <<
pixelSourceProdID <<
")\n.";
382 const type_info &hitType =
typeid(*hit);
401 <<
"Don't know how to handle " << hitType.name() <<
" on detid " << detid.
rawId() <<
"\n";
416 ProductID pixelOldProdID, stripOldProdID;
435 std::unique_ptr<ClusterRemovalInfo> cri;
451 cri->getOldClustersFrom(*oldRemovalInfo);
460 <<
"HITrackClusterRemover: "
463 <<
"\t but the *old* ClusterRemovalInfo " <<
labels.productInstance <<
" refers as 'new product ids' to "
466 <<
"NOTA BENE: when running HITrackClusterRemover with an old ClusterRemovalInfo the hits in the trajectory "
467 "MUST be already re-keyed.\n";
487 LogDebug(
"HITrackClusterRemover") <<
"to merge in, " << oldStrMask->
size() <<
" strp and " << oldPxlMask->
size()
502 std::vector<Handle<edm::ValueMap<int> > > quals;
511 if (!quals.empty()) {
512 int qual = (*(quals[0])).get(it++);
526 auto const &chi2sX5 =
track.extra()->chi2sX5();
528 auto hb =
track.recHitsBegin();
529 for (
unsigned int h = 0;
h <
track.recHitsSize();
h++) {
567 cri->setNewPixelClusters(newPixels);
573 cri->setNewStripClusters(newStrips);
590 LogDebug(
"HITrackClusterRemover") <<
"total strip to skip: "
596 LogDebug(
"HITrackClusterRemover") <<
"total pxl to skip: "