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>();
264 const T *firstOffset = &oldClusters.
data().front();
265 for (
typename DSV::const_iterator itdet = oldClusters.
begin(), enddet = oldClusters.
end(); itdet != enddet; ++itdet) {
271 uint32_t
id = oldDS.detId();
274 for (
typename DS::const_iterator
it = oldDS.begin(), ed = oldDS.end();
it != ed; ++
it) {
275 uint32_t
index = ((&*
it) - firstOffset);
277 outds.push_back(*
it);
278 refs.push_back(
index);
286 if (oldRefs !=
nullptr)
309 <<
"HITrackClusterRemover: strip cluster ref from Product ID = " << cluster.
id()
310 <<
" does not match with source cluster collection (ID = " <<
stripSourceProdID <<
")\n.";
312 uint32_t subdet =
detid.subdetId();
317 if (
pblocks_[subdet - 1].cutOnStripCharge_ &&
333 uint32_t subdet =
detid.subdetId();
351 <<
"HITrackClusterRemover: pixel cluster ref from Product ID = " << cluster.
id()
352 <<
" does not match with source cluster collection (ID = " <<
pixelSourceProdID <<
")\n.";
373 const type_info &hitType =
typeid(*hit);
392 <<
"Don't know how to handle " << hitType.name() <<
" on detid " <<
detid.rawId() <<
"\n";
407 ProductID pixelOldProdID, stripOldProdID;
425 std::unique_ptr<ClusterRemovalInfo> cri;
441 cri->getOldClustersFrom(*oldRemovalInfo);
450 <<
"HITrackClusterRemover: " 453 <<
"\t but the *old* ClusterRemovalInfo " <<
labels.productInstance <<
" refers as 'new product ids' to " 456 <<
"NOTA BENE: when running HITrackClusterRemover with an old ClusterRemovalInfo the hits in the trajectory " 457 "MUST be already re-keyed.\n";
477 LogDebug(
"HITrackClusterRemover") <<
"to merge in, " << oldStrMask->
size() <<
" strp and " << oldPxlMask->
size()
492 std::vector<Handle<edm::ValueMap<int> > > quals;
501 if (!quals.empty()) {
502 int qual = (*(quals[0])).get(
it++);
516 auto const &chi2sX5 =
track.extra()->chi2sX5();
518 auto hb =
track.recHitsBegin();
519 for (
unsigned int h = 0;
h <
track.recHitsSize();
h++) {
557 cri->setNewPixelClusters(newPixels);
563 cri->setNewStripClusters(newStrips);
580 LogDebug(
"HITrackClusterRemover") <<
"total strip to skip: " 586 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_
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
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
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)
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)
edm::EDGetTokenT< edmNew::DetSetVector< SiStripCluster > > stripClusters_
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