46 maxChi2_(iConfig.getParameter<double>(
"maxChi2")),
63 int id1=-1,
int id2=-1,
int id3=-1,
int id4=-1,
int id5=-1,
int id6=-1) ;
72 std::auto_ptr<edmNew::DetSetVector<T> >
91 int id1,
int id2,
int id3,
int id4,
int id5,
int id6)
93 if (iConfig.
exists(name)) {
96 fill(pblocks_, pblocks_+NumberOfParamBlocks, pblock);
98 pblocks_[id1] = pblock;
99 if (id2 != -1) pblocks_[id2] = pblock;
100 if (id3 != -1) pblocks_[id3] = pblock;
101 if (id4 != -1) pblocks_[id4] = pblock;
102 if (id5 != -1) pblocks_[id5] = pblock;
103 if (id6 != -1) pblocks_[id6] = pblock;
109 trajectories_(iConfig.getParameter<
InputTag>(
"trajectories")),
110 doStrip_(iConfig.existsAs<bool>(
"doStrip") ? iConfig.getParameter<bool>(
"doStrip") :
true),
111 doPixel_(iConfig.existsAs<bool>(
"doPixel") ? iConfig.getParameter<bool>(
"doPixel") :
true),
112 stripClusters_(doStrip_ ? iConfig.getParameter<
InputTag>(
"stripClusters") :
InputTag(
"NONE")),
113 pixelClusters_(doPixel_ ? iConfig.getParameter<
InputTag>(
"pixelClusters") :
InputTag(
"NONE")),
119 if (iConfig.
exists(
"oldClusterRemovalInfo"))
133 readPSet(iConfig,
"Strip" ,2,3,4,5);
134 readPSet(iConfig,
"StripInner" ,2,3);
135 readPSet(iConfig,
"StripOuter" ,4,5);
142 bool usingCharge =
false;
144 if (!
pblocks_[
i].isSet_)
throw cms::Exception(
"Configuration Error") <<
"HLTTrackClusterRemover: Missing configuration for detector with subDetID = " << (
i+1);
145 if (
pblocks_[
i].usesCharge_ && !usingCharge) {
146 throw cms::Exception(
"Configuration Error") <<
"HLTTrackClusterRemover: Configuration for subDetID = " << (
i+1) <<
" uses cluster charge, which is not enabled.";
153 produces< edm::ContainerMask<edmNew::DetSetVector<SiPixelCluster> > >();
154 produces< edm::ContainerMask<edm::LazyGetter<SiStripCluster> > >();
166 for (
size_t i = 0,
n = refs.size();
i <
n; ++
i) {
167 refs[
i] = oldRefs[refs[
i]];
173 auto_ptr<edmNew::DetSetVector<T> >
179 auto_ptr<DSV>
output(
new DSV());
180 output->reserve(oldClusters.
size(), oldClusters.
dataSize());
182 unsigned int countOld=0;
183 unsigned int countNew=0;
186 const T * firstOffset = & oldClusters.
data().front();
187 for (
typename DSV::const_iterator itdet = oldClusters.
begin(), enddet = oldClusters.
end(); itdet != enddet; ++itdet) {
190 if (oldDS.empty())
continue;
192 uint32_t
id = oldDS.detId();
193 DSF outds(*output,
id);
195 for (
typename DS::const_iterator it = oldDS.begin(), ed = oldDS.end(); it != ed; ++it) {
196 uint32_t
index = ((&*it) - firstOffset);
199 outds.push_back(*it);
201 refs.push_back(index);
206 if (outds.empty()) outds.abort();
210 if (oldRefs != 0)
mergeOld(refs, *oldRefs);
216 "HLTTrackClusterRemover: strip cluster ref from Product ID = " << clusterReg.
id() <<
217 " does not match with source cluster collection (ID = " <<
stripSourceProdID <<
")\n.";
234 if (chi2 >
pblocks_[subdet-1].maxChi2_)
return;
245 "HLTTrackClusterRemover: pixel cluster ref from Product ID = " << cluster.
id() <<
246 " does not match with source cluster collection (ID = " <<
pixelSourceProdID <<
")\n.";
260 const type_info &hitType =
typeid(*hit);
277 }
else throw cms::Exception(
"NOT IMPLEMENTED") <<
"Don't know how to handle " << hitType.name() <<
" on detid " << detid.
rawId() <<
"\n";
295 ProductID pixelOldProdID, stripOldProdID;
320 LogDebug(
"TrackClusterRemover")<<
"to merge in, "<<oldStrMask->size()<<
" strp and "<<oldPxlMask->size()<<
" pxl";
332 for (vector<Trajectory>::const_iterator it = trajectories->begin(), ed = trajectories->end(); it != ed; ++it) {
334 const vector<TrajectoryMeasurement> &tms = tj.
measurements();
335 vector<TrajectoryMeasurement>::const_iterator itm, endtm;
336 for (itm = tms.begin(), endtm = tms.end(); itm != endtm; ++itm) {
340 process( hit, itm->estimate() );
344 std::auto_ptr<StripMaskContainer> removedStripClusterMask(
347 iEvent.
put( removedStripClusterMask );
349 std::auto_ptr<PixelMaskContainer> removedPixelClusterMask(
352 iEvent.
put( removedPixelClusterMask );
T getParameter(std::string const &) const
const_iterator begin() const
size_type dataSize() const
#define DEFINE_FWK_MODULE(type)
OmniClusterRef const & stereoClusterRef() const
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)
std::vector< uint8_t > strips
bool exists(std::string const ¶meterName) const
checks if a parameter exists
std::vector< uint8_t > pixels
edm::InputTag stripClusters_
std::vector< bool > collectedRegStrips_
edm::InputTag oldRemovalInfo_
uint32_t rawId() const
get the raw id
DataContainer const & measurements() const
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
static const unsigned int NumberOfParamBlocks
data_type const * data(size_t cell) const
edm::InputTag trajectories_
edm::InputTag pixelClusters_
const_iterator end() const
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
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
ParamBlock pblocks_[NumberOfParamBlocks]
void mergeOld(reco::ClusterRemovalInfo::Indices &refs, const reco::ClusterRemovalInfo::Indices &oldRefs)
OmniClusterRef const & omniClusterRef() const
ParamBlock(const edm::ParameterSet &iConfig)
ClusterRef cluster() const
key_type key() const
Accessor for product key.
std::vector< bool > collectedPixels_
HLTTrackClusterRemover(const edm::ParameterSet &iConfig)
edm::ProductID id() const
void produce(edm::Event &iEvent, const edm::EventSetup &iSetup)
edm::ProductID stripSourceProdID
std::auto_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)
ProductID id() const
Accessor for product ID.
void process(const TrackingRecHit *hit, float chi2)
DetId geographicalId() const
const SiStripRecHit2D & originalHit() const
~HLTTrackClusterRemover()
edm::ProductID pixelSourceProdID