58 maxChi2_(iConfig.getParameter<double>(
"maxChi2")),
86 int id1=-1,
int id2=-1,
int id3=-1,
int id4=-1,
int id5=-1,
int id6=-1) ;
96 std::unique_ptr<edmNew::DetSetVector<T> >
118 using namespace reco;
122 int id1,
int id2,
int id3,
int id4,
int id5,
int id6)
124 if (iConfig.
exists(name)) {
130 if (id2 != -1)
pblocks_[id2] = pblock;
131 if (id3 != -1)
pblocks_[id3] = pblock;
132 if (id4 != -1)
pblocks_[id4] = pblock;
133 if (id5 != -1)
pblocks_[id5] = pblock;
134 if (id6 != -1)
pblocks_[id6] = pblock;
140 doTracks_(iConfig.exists(
"trajectories")),
141 doStrip_(iConfig.existsAs<bool>(
"doStrip") ? iConfig.getParameter<bool>(
"doStrip") :
true),
142 doPixel_(iConfig.existsAs<bool>(
"doPixel") ? iConfig.getParameter<bool>(
"doPixel") :
true),
143 mergeOld_(iConfig.exists(
"oldClusterRemovalInfo")),
145 doStripChargeCheck_(iConfig.existsAs<bool>(
"doStripChargeCheck") ? iConfig.getParameter<bool>(
"doStripChargeCheck") :
false),
146 doPixelChargeCheck_(iConfig.existsAs<bool>(
"doPixelChargeCheck") ? iConfig.getParameter<bool>(
"doPixelChargeCheck") :
false),
151 if (iConfig.
exists(
"overrideTrkQuals"))
153 if (iConfig.
exists(
"clusterLessSolution"))
156 throw cms::Exception(
"Configuration Error") <<
"HITrackClusterRemover: Charge check asked without cluster collection ";
158 throw cms::Exception(
"Configuration Error") <<
"HITrackClusterRemover: Pixel cluster charge check not yet implemented";
172 readPSet(iConfig,
"Strip" ,2,3,4,5);
173 readPSet(iConfig,
"StripInner" ,2,3);
174 readPSet(iConfig,
"StripOuter" ,4,5);
181 bool usingCharge =
false;
183 if (!
pblocks_[
i].isSet_)
throw cms::Exception(
"Configuration Error") <<
"HITrackClusterRemover: Missing configuration for detector with subDetID = " << (
i+1);
184 if (
pblocks_[
i].usesCharge_ && !usingCharge) {
185 throw cms::Exception(
"Configuration Error") <<
"HITrackClusterRemover: Configuration for subDetID = " << (
i+1) <<
" uses cluster charge, which is not enabled.";
190 produces<edm::ContainerMask<edmNew::DetSetVector<SiPixelCluster> > >();
191 produces<edm::ContainerMask<edmNew::DetSetVector<SiStripCluster> > >();
195 if (iConfig.
exists(
"TrackQuality")){
199 iConfig.
getParameter<
int>(
"minNumberOfLayersWithMeasBeforeFiltering") : 0;
227 for (
size_t i = 0,
n = refs.size();
i <
n; ++
i) {
228 refs[
i] = oldRefs[refs[
i]];
234 std::unique_ptr<edmNew::DetSetVector<T> >
240 auto output = std::make_unique<DSV>();
243 unsigned int countOld=0;
244 unsigned int countNew=0;
247 const T * firstOffset = & oldClusters.
data().front();
248 for (
typename DSV::const_iterator itdet = oldClusters.
begin(), enddet = oldClusters.
end(); itdet != enddet; ++itdet) {
251 if (oldDS.empty())
continue;
253 uint32_t
id = oldDS.detId();
256 for (
typename DS::const_iterator it = oldDS.begin(), ed = oldDS.end(); it != ed; ++it) {
257 uint32_t
index = ((&*it) - firstOffset);
260 outds.push_back(*it);
262 refs.push_back(index);
267 if (outds.empty()) outds.abort();
270 if (oldRefs != 0)
mergeOld(refs, *oldRefs);
289 "HITrackClusterRemover: strip cluster ref from Product ID = " << cluster.
id() <<
290 " does not match with source cluster collection (ID = " <<
stripSourceProdID <<
")\n.";
297 for( std::vector<uint8_t>::const_iterator iAmp = cluster->amplitudes().begin(); iAmp != cluster->amplitudes().end(); ++iAmp){
330 "HITrackClusterRemover: pixel cluster ref from Product ID = " << cluster.
id() <<
331 " does not match with source cluster collection (ID = " <<
pixelSourceProdID <<
")\n.";
349 const type_info &hitType =
typeid(*hit);
366 }
else throw cms::Exception(
"NOT IMPLEMENTED") <<
"Don't know how to handle " << hitType.name() <<
" on detid " << detid.
rawId() <<
"\n";
384 ProductID pixelOldProdID, stripOldProdID;
403 std::unique_ptr<ClusterRemovalInfo> cri;
414 if ( (oldRemovalInfo->stripNewRefProd().id() == stripClusters.
id()) &&
415 (oldRemovalInfo->pixelNewRefProd().id() == pixelClusters.
id()) ) {
417 cri->getOldClustersFrom(*oldRemovalInfo);
419 pixelOldProdID = oldRemovalInfo->pixelRefProd().
id();
420 stripOldProdID = oldRemovalInfo->stripRefProd().
id();
426 throw cms::Exception(
"Inconsistent Data") <<
"HITrackClusterRemover: " <<
427 "Input collection product IDs are [pixel: " << pixelClusters.
id() <<
", strip: " << stripClusters.
id() <<
"] \n" <<
428 "\t but the *old* ClusterRemovalInfo " << labels.
productInstance <<
" refers as 'new product ids' to " <<
429 "[pixel: " << oldRemovalInfo->pixelNewRefProd().id() <<
", strip: " << oldRemovalInfo->stripNewRefProd().id() <<
"]\n" <<
430 "NOTA BENE: when running HITrackClusterRemover with an old ClusterRemovalInfo the hits in the trajectory MUST be already re-keyed.\n";
448 LogDebug(
"HITrackClusterRemover")<<
"to merge in, "<<oldStrMask->
size()<<
" strp and "<<oldPxlMask->
size()<<
" pxl";
463 std::vector<Handle<edm::ValueMap<int> > > quals;
469 for (
const auto &
track: *tracks) {
472 if ( quals.size()!=0) {
473 int qual=(*(quals[0])).
get(it++);
474 if ( qual < 0 ) {goodTk=
false;}
481 if ( !goodTk)
continue;
484 auto const & chi2sX5 =
track.extra()->chi2sX5();
485 assert(chi2sX5.size()==
track.recHitsSize());
486 auto hb =
track.recHitsBegin();
487 for(
unsigned int h=0;
h<
track.recHitsSize();
h++){
489 if (!
hit->isValid())
continue;
523 cri->setNewPixelClusters(newPixels);
528 cri->setNewStripClusters(newStrips);
T getParameter(std::string const &) const
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
const GeomDetEnumerators::SubDetector geomDetSubDetector(int subdet) const
const_iterator end(bool update=false) const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
size_type dataSize() const
bool existsAs(std::string const ¶meterName, bool trackiness=true) const
checks if a parameter exists as a given type
std::vector< edm::EDGetTokenT< edm::ValueMap< int > > > overrideTrkQuals_
float minGoodPixelCharge_
void process(const TrackingRecHit *hit, unsigned char chi2, const TrackerGeometry *tg)
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
std::vector< data_type > DataContainer
static unsigned char toChi2x5(float chi2)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
TrackQuality
track quality
#define DEFINE_FWK_MODULE(type)
OmniClusterRef const & stereoClusterRef() const
HITrackClusterRemover(const edm::ParameterSet &iConfig)
bool exists(std::string const ¶meterName) const
checks if a parameter exists
std::vector< uint8_t > strips
static const unsigned int NumberOfParamBlocks
edm::ContainerMask< edmNew::DetSetVector< SiStripCluster > > StripMaskContainer
key_type key() const
Accessor for product key.
void copyMaskTo(std::vector< bool > &) const
ProductID id() const
Accessor for product ID.
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
edm::EDGetTokenT< reco::ClusterRemovalInfo > oldRemovalInfo_
std::string stripRecHits_
uint32_t rawId() const
get the raw id
edm::EDGetTokenT< StripMaskContainer > oldStrMaskToken_
edm::EDGetTokenT< reco::TrackCollection > tracks_
reco::TrackBase::TrackQuality trackQuality_
ClusterStripRef cluster_strip() const
data_type const * data(size_t cell) const
int minNumberOfLayersWithMeasBeforeFiltering_
float minGoodStripCharge_
bool clusterWasteSolution_
OmniClusterRef const & monoClusterRef() const
int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
std::vector< uint32_t > Indices
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)
SiStripRecHit2D originalHit() const
Detector identifier class for the strip tracker.
OmniClusterRef const & omniClusterRef() const
edm::EDGetTokenT< PixelMaskContainer > oldPxlMaskToken_
static TrackQuality qualityByName(const std::string &name)
void mergeOld(reco::ClusterRemovalInfo::Indices &refs, const reco::ClusterRemovalInfo::Indices &oldRefs)
edm::EDGetTokenT< edmNew::DetSetVector< SiStripCluster > > stripClusters_
ClusterRef cluster() const
std::vector< bool > collectedStrips_
edm::EDGetTokenT< SiStripRecHit2DCollection > stereoRecHitToken_
edm::EDGetTokenT< SiStripRecHit2DCollection > rphiRecHitToken_
void labelsForToken(EDGetToken iToken, Labels &oLabels) const
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)
char const * productInstance
std::vector< uint8_t > pixels
float sensorThickness(const SiStripDetId &detid) const
ParamBlock(const edm::ParameterSet &iConfig)
DetId geographicalId() const
std::vector< bool > collectedPixels_
ModuleGeometry moduleGeometry() const
edm::ProductID stripSourceProdID
T const * product() const
bool isTrackerPixel(GeomDetEnumerators::SubDetector m)
const_iterator begin(bool update=false) const
void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override
edm::EDGetTokenT< edmNew::DetSetVector< SiPixelCluster > > pixelClusters_
edm::ProductID pixelSourceProdID