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;
147 doTracks_(iConfig.exists(
"trajectories")),
148 doStrip_(iConfig.existsAs<
bool>(
"doStrip") ? iConfig.getParameter<
bool>(
"doStrip") :
true),
149 doPixel_(iConfig.existsAs<
bool>(
"doPixel") ? iConfig.getParameter<
bool>(
"doPixel") :
true),
150 mergeOld_(iConfig.exists(
"oldClusterRemovalInfo")),
151 clusterWasteSolution_(
true),
153 iConfig.existsAs<
bool>(
"doStripChargeCheck") ? iConfig.getParameter<
bool>(
"doStripChargeCheck") :
false),
155 iConfig.existsAs<
bool>(
"doPixelChargeCheck") ? iConfig.getParameter<
bool>(
"doPixelChargeCheck") :
false),
156 stripRecHits_(doStripChargeCheck_ ? iConfig.getParameter<
std::
string>(
"stripRecHits")
158 pixelRecHits_(doPixelChargeCheck_ ? iConfig.getParameter<
std::
string>(
"pixelRecHits")
161 if (iConfig.
exists(
"overrideTrkQuals"))
163 if (iConfig.
exists(
"clusterLessSolution"))
167 <<
"HITrackClusterRemover: Charge check asked without cluster collection ";
170 <<
"HITrackClusterRemover: Pixel cluster charge check not yet implemented";
173 produces<edmNew::DetSetVector<SiPixelCluster> >();
175 produces<edmNew::DetSetVector<SiStripCluster> >();
177 produces<ClusterRemovalInfo>();
189 readPSet(iConfig,
"Strip", 2, 3, 4, 5);
190 readPSet(iConfig,
"StripInner", 2, 3);
191 readPSet(iConfig,
"StripOuter", 4, 5);
198 bool usingCharge =
false;
202 <<
"HITrackClusterRemover: Missing configuration for detector with subDetID = " << (
i + 1);
203 if (
pblocks_[
i].usesCharge_ && !usingCharge) {
204 throw cms::Exception(
"Configuration Error") <<
"HITrackClusterRemover: Configuration for subDetID = " << (
i + 1)
205 <<
" uses cluster charge, which is not enabled.";
210 produces<edm::ContainerMask<edmNew::DetSetVector<SiPixelCluster> > >();
211 produces<edm::ContainerMask<edmNew::DetSetVector<SiStripCluster> > >();
215 if (iConfig.
exists(
"TrackQuality")) {
219 iConfig.
existsAs<
int>(
"minNumberOfLayersWithMeasBeforeFiltering")
220 ? iConfig.
getParameter<
int>(
"minNumberOfLayersWithMeasBeforeFiltering")
246 for (
size_t i = 0,
n = refs.size();
i <
n; ++
i) {
247 refs[
i] = oldRefs[refs[
i]];
251 template <
typename T>
254 const std::vector<uint8_t> &isGood,
260 auto output = std::make_unique<DSV>();
263 unsigned int countOld = 0;
264 unsigned int countNew = 0;
267 const T *firstOffset = &oldClusters.
data().front();
268 for (
typename DSV::const_iterator itdet = oldClusters.
begin(), enddet = oldClusters.
end(); itdet != enddet; ++itdet) {
274 uint32_t
id = oldDS.detId();
277 for (
typename DS::const_iterator it = oldDS.begin(), ed = oldDS.end(); it != ed; ++it) {
278 uint32_t
index = ((&*it) - firstOffset);
281 outds.push_back(*it);
283 refs.push_back(
index);
291 if (oldRefs !=
nullptr)
314 <<
"HITrackClusterRemover: strip cluster ref from Product ID = " << cluster.
id()
315 <<
" does not match with source cluster collection (ID = " <<
stripSourceProdID <<
")\n.";
322 if (
pblocks_[subdet - 1].cutOnStripCharge_ &&
356 <<
"HITrackClusterRemover: pixel cluster ref from Product ID = " << cluster.
id()
357 <<
" does not match with source cluster collection (ID = " <<
pixelSourceProdID <<
")\n.";
378 const type_info &hitType =
typeid(*hit);
397 <<
"Don't know how to handle " << hitType.name() <<
" on detid " << detid.
rawId() <<
"\n";
412 ProductID pixelOldProdID, stripOldProdID;
430 std::unique_ptr<ClusterRemovalInfo> cri;
446 cri->getOldClustersFrom(*oldRemovalInfo);
455 <<
"HITrackClusterRemover: " 458 <<
"\t but the *old* ClusterRemovalInfo " <<
labels.productInstance <<
" refers as 'new product ids' to " 461 <<
"NOTA BENE: when running HITrackClusterRemover with an old ClusterRemovalInfo the hits in the trajectory " 462 "MUST be already re-keyed.\n";
482 LogDebug(
"HITrackClusterRemover") <<
"to merge in, " << oldStrMask->
size() <<
" strp and " << oldPxlMask->
size()
497 std::vector<Handle<edm::ValueMap<int> > > quals;
506 if (!quals.empty()) {
507 int qual = (*(quals[0])).get(it++);
521 auto const &chi2sX5 =
track.extra()->chi2sX5();
523 auto hb =
track.recHitsBegin();
524 for (
unsigned int h = 0;
h <
track.recHitsSize();
h++) {
562 cri->setNewPixelClusters(newPixels);
568 cri->setNewStripClusters(newStrips);
585 LogDebug(
"HITrackClusterRemover") <<
"total strip to skip: " 591 LogDebug(
"HITrackClusterRemover") <<
"total pxl to skip: " ClusterRef cluster() const
void copyMaskTo(std::vector< bool > &) const
size_type dataSize() const
T getParameter(std::string const &) const
ProductID id() const
Accessor for product ID.
float minGoodPixelCharge_
void process(const TrackingRecHit *hit, unsigned char chi2, const TrackerGeometry *tg)
std::vector< data_type > DataContainer
static unsigned char toChi2x5(float chi2)
TrackQuality
track quality
SiStripModuleGeometry moduleGeometry() const
HITrackClusterRemover(const edm::ParameterSet &iConfig)
std::vector< edm::EDGetTokenT< edm::ValueMap< int > > > overrideTrkQuals_
bool exists(std::string const ¶meterName) const
checks if a parameter exists
OmniClusterRef const & stereoClusterRef() const
OmniClusterRef const & omniClusterRef() const
data_type const * data(size_t cell) const
std::vector< uint8_t > strips
static const unsigned int NumberOfParamBlocks
edm::ContainerMask< edmNew::DetSetVector< SiStripCluster > > StripMaskContainer
bool existsAs(std::string const ¶meterName, bool trackiness=true) const
checks if a parameter exists as a given type
OmniClusterRef const & monoClusterRef() const
key_type key() const
Accessor for product key.
const_iterator end(bool update=false) const
edm::EDGetTokenT< reco::ClusterRemovalInfo > oldRemovalInfo_
std::string stripRecHits_
edm::EDGetTokenT< StripMaskContainer > oldStrMaskToken_
float sensorThickness(const SiStripDetId &detid) const
edm::EDGetTokenT< reco::TrackCollection > tracks_
reco::TrackBase::TrackQuality trackQuality_
const SiPixelClusterRefProd & pixelNewRefProd() const
~HITrackClusterRemover() override
int minNumberOfLayersWithMeasBeforeFiltering_
float minGoodStripCharge_
#define DEFINE_FWK_MODULE(type)
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
bool getData(T &iHolder) const
bool clusterWasteSolution_
std::vector< uint32_t > Indices
static constexpr auto TOB
ProductID id() const
Accessor for product ID.
std::string pixelRecHits_
ParamBlock pblocks_[NumberOfParamBlocks]
void readPSet(const edm::ParameterSet &iConfig, const std::string &name, int id1=-1, int id2=-1, int id3=-1, int id4=-1, int id5=-1, int id6=-1)
Detector identifier class for the strip tracker.
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
edm::EDGetTokenT< PixelMaskContainer > oldPxlMaskToken_
static TrackQuality qualityByName(const std::string &name)
const_iterator begin(bool update=false) const
void mergeOld(reco::ClusterRemovalInfo::Indices &refs, const reco::ClusterRemovalInfo::Indices &oldRefs)
auto const & tracks
cannot be loose
edm::EDGetTokenT< edmNew::DetSetVector< SiStripCluster > > stripClusters_
constexpr uint32_t rawId() const
get the raw id
std::vector< bool > collectedStrips_
edm::EDGetTokenT< SiStripRecHit2DCollection > stereoRecHitToken_
edm::EDGetTokenT< SiStripRecHit2DCollection > rphiRecHitToken_
static constexpr auto TIB
edm::ContainerMask< edmNew::DetSetVector< SiPixelCluster > > PixelMaskContainer
std::unique_ptr< edmNew::DetSetVector< T > > cleanup(const edmNew::DetSetVector< T > &oldClusters, const std::vector< uint8_t > &isGood, reco::ClusterRemovalInfo::Indices &refs, const reco::ClusterRemovalInfo::Indices *oldRefs)
const GeomDetEnumerators::SubDetector geomDetSubDetector(int subdet) const
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > const tTrackerGeom_
SiStripRecHit2D originalHit() const
std::vector< uint8_t > pixels
ParamBlock(const edm::ParameterSet &iConfig)
ClusterStripRef cluster_strip() const
std::vector< bool > collectedPixels_
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
edm::ProductID stripSourceProdID
const SiStripClusterRefProd & stripRefProd() const
bool isTrackerPixel(GeomDetEnumerators::SubDetector m)
void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override
edm::EDGetTokenT< edmNew::DetSetVector< SiPixelCluster > > pixelClusters_
edm::ProductID pixelSourceProdID
const SiPixelClusterRefProd & pixelRefProd() const
const SiStripClusterRefProd & stripNewRefProd() const