53 maxChi2_(iConfig.getParameter<double>(
"maxChi2")),
79 int id1=-1,
int id2=-1,
int id3=-1,
int id4=-1,
int id5=-1,
int id6=-1) ;
88 std::unique_ptr<edmNew::DetSetVector<T> >
105 using namespace reco;
109 int id1,
int id2,
int id3,
int id4,
int id5,
int id6)
111 if (iConfig.
exists(name)) {
117 if (id2 != -1)
pblocks_[id2] = pblock;
118 if (id3 != -1)
pblocks_[id3] = pblock;
119 if (id4 != -1)
pblocks_[id4] = pblock;
120 if (id5 != -1)
pblocks_[id5] = pblock;
121 if (id6 != -1)
pblocks_[id6] = pblock;
127 :
doTracks_(iConfig.exists(
"trajectories"))
128 ,
doStrip_ (iConfig.existsAs<bool>(
"doStrip") ? iConfig.getParameter<bool>(
"doStrip") :
true)
129 ,
doPixel_ (iConfig.existsAs<bool>(
"doPixel") ? iConfig.getParameter<bool>(
"doPixel") :
true)
132 ,
doStripChargeCheck_(iConfig.existsAs<bool>(
"doStripChargeCheck") ? iConfig.getParameter<bool>(
"doStripChargeCheck") :
false)
133 ,
doPixelChargeCheck_(iConfig.existsAs<bool>(
"doPixelChargeCheck") ? iConfig.getParameter<bool>(
"doPixelChargeCheck") :
false)
137 if (iConfig.
exists(
"oldClusterRemovalInfo"))
145 throw cms::Exception(
"Configuration Error") <<
"HLTTrackClusterRemoverNew: Charge check asked without cluster collection ";
147 throw cms::Exception(
"Configuration Error") <<
"HLTTrackClusterRemoverNew: Pixel cluster charge check not yet implemented";
157 readPSet(iConfig,
"Strip" , 2,3,4,5);
158 readPSet(iConfig,
"StripInner" ,2,3);
159 readPSet(iConfig,
"StripOuter" ,4,5);
166 bool usingCharge =
false;
168 if (!
pblocks_[
i].isSet_)
throw cms::Exception(
"Configuration Error") <<
"HLTTrackClusterRemoverNew: Missing configuration for detector with subDetID = " << (
i+1);
169 if (
pblocks_[
i].usesCharge_ && !usingCharge) {
170 throw cms::Exception(
"Configuration Error") <<
"HLTTrackClusterRemoverNew: Configuration for subDetID = " << (
i+1) <<
" uses cluster charge, which is not enabled.";
186 produces< edm::ContainerMask<edmNew::DetSetVector<SiPixelCluster> > >();
187 produces< edm::ContainerMask<edmNew::DetSetVector<SiStripCluster> > >();
199 for (
size_t i = 0,
n = refs.size();
i <
n; ++
i) {
200 refs[
i] = oldRefs[refs[
i]];
206 std::unique_ptr<edmNew::DetSetVector<T> >
212 auto output = std::make_unique<DSV>();
215 unsigned int countOld=0;
216 unsigned int countNew=0;
219 const T * firstOffset = & oldClusters.
data().front();
220 for (
typename DSV::const_iterator itdet = oldClusters.
begin(), enddet = oldClusters.
end(); itdet != enddet; ++itdet) {
223 if (oldDS.empty())
continue;
225 uint32_t
id = oldDS.detId();
228 for (
typename DS::const_iterator it = oldDS.begin(), ed = oldDS.end(); it != ed; ++it) {
229 uint32_t
index = ((&*it) - firstOffset);
232 outds.push_back(*it);
234 refs.push_back(index);
239 if (outds.empty()) outds.abort();
243 if (oldRefs != 0)
mergeOld(refs, *oldRefs);
250 "HLTTrackClusterRemoverNew: strip cluster ref from Product ID = " << clusterReg.
id() <<
251 " does not match with source cluster collection (ID = " <<
stripSourceProdID <<
")\n.";
271 if (chi2 >
pblocks_[subdet-1].maxChi2_)
return;
281 "HLTTrackClusterRemoverNew: pixel cluster ref from Product ID = " << cluster.
id() <<
282 " does not match with source cluster collection (ID = " <<
pixelSourceProdID <<
")\n.";
296 const type_info &hitType =
typeid(*hit);
330 }
else throw cms::Exception(
"NOT IMPLEMENTED") <<
"Don't know how to handle " << hitType.name() <<
" on detid " << detid.
rawId() <<
"\n";
348 ProductID pixelOldProdID, stripOldProdID;
374 LogDebug(
"TrackClusterRemover")<<
"to merge in, "<<oldStrMask->
size()<<
" strp and "<<oldPxlMask->
size()<<
" pxl";
387 for (std::vector<Trajectory>::const_iterator it = trajectories->begin(), ed = trajectories->end(); it != ed; ++it) {
389 const std::vector<TrajectoryMeasurement> &tms = tj.
measurements();
391 std::vector<TrajectoryMeasurement>::const_iterator itm, endtm;
392 for (itm = tms.begin(), endtm = tms.end(); itm != endtm; ++itm) {
411 auto const &
clusters = stripClusters->data();
412 for (
auto const & item : stripClusters->ids()) {
414 if (!item.isValid())
continue;
416 DetId detid = item.id;
418 if (!
pblocks_[subdet-1].cutOnStripCharge_)
continue;
422 for (
int i = item.offset;
i<item.offset+
int(item.size); ++
i) {
424 for (
auto cAmp :
clusters[
i].amplitudes() ) clusCharge+=cAmp;
T getParameter(std::string const &) const
edm::EDGetTokenT< edmNew::DetSetVector< SiStripCluster > > stripClusters_
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
static const unsigned int NumberOfParamBlocks
std::vector< bool > collectedPixels_
edm::EDGetTokenT< edmNew::DetSetVector< SiPixelCluster > > pixelClusters_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
OmniClusterRef const & stereoClusterRef() const
std::vector< uint8_t > pixels
bool exists(std::string const ¶meterName) const
checks if a parameter exists
key_type key() const
Accessor for product key.
void copyMaskTo(std::vector< bool > &) const
ProductID id() const
Accessor for product ID.
edm::EDGetTokenT< PixelMaskContainer > oldPxlMaskToken_
HLTTrackClusterRemoverNew(const edm::ParameterSet &iConfig)
edm::ContainerMask< edmNew::DetSetVector< SiStripCluster > > StripMaskContainer
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)
uint32_t rawId() const
get the raw id
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)
DataContainer const & measurements() const
void process(const TrackingRecHit *hit, float chi2, const TrackerGeometry *tg)
ParamBlock pblocks_[NumberOfParamBlocks]
data_type const * data(size_t cell) const
edm::EDGetTokenT< std::vector< Trajectory > > trajectories_
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::vector< bool > collectedRegStrips_
SiStripRecHit2D originalHit() const
OmniClusterRef const & omniClusterRef() const
ClusterRef cluster() const
void mergeOld(reco::ClusterRemovalInfo::Indices &refs, const reco::ClusterRemovalInfo::Indices &oldRefs)
~HLTTrackClusterRemoverNew()
bool isTrackerPixel(const GeomDetEnumerators::SubDetector m)
float minGoodStripCharge_
std::vector< uint8_t > strips
edm::ProductID stripSourceProdID
edm::ProductID id() const
void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override
ParamBlock(const edm::ParameterSet &iConfig)
DetId geographicalId() const
edm::ContainerMask< edmNew::DetSetVector< SiPixelCluster > > PixelMaskContainer
edm::ProductID pixelSourceProdID
T const * product() const
const_iterator begin(bool update=false) const
float minGoodPixelCharge_
edm::EDGetTokenT< StripMaskContainer > oldStrMaskToken_