45 maxChi2_(iConfig.getParameter<double>(
"maxChi2")),
62 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.";
150 produces<edmNew::DetSetVector<SiPixelClusterRefNew> >();
151 produces<edmNew::DetSetVector<SiStripRecHit1D::ClusterRegionalRef> >();
163 for (
size_t i = 0,
n = refs.size();
i <
n; ++
i) {
164 refs[
i] = oldRefs[refs[
i]];
170 auto_ptr<edmNew::DetSetVector<T> >
176 auto_ptr<DSV>
output(
new DSV());
177 output->reserve(oldClusters.
size(), oldClusters.
dataSize());
179 unsigned int countOld=0;
180 unsigned int countNew=0;
183 const T * firstOffset = & oldClusters.
data().front();
184 for (
typename DSV::const_iterator itdet = oldClusters.
begin(), enddet = oldClusters.
end(); itdet != enddet; ++itdet) {
187 if (oldDS.empty())
continue;
189 uint32_t
id = oldDS.detId();
190 DSF outds(*output,
id);
192 for (
typename DS::const_iterator it = oldDS.begin(), ed = oldDS.end(); it != ed; ++it) {
193 uint32_t
index = ((&*it) - firstOffset);
196 outds.push_back(*it);
198 refs.push_back(index);
203 if (outds.empty()) outds.abort();
207 if (oldRefs != 0)
mergeOld(refs, *oldRefs);
215 "HLTTrackClusterRemover: strip cluster ref from Product ID = " << clusterReg.
id() <<
216 " does not match with source cluster collection (ID = " <<
stripSourceProdID <<
")\n.";
223 "HLTTrackClusterRemover: strip cluster ref from Product ID = " << clusterReg.
id() <<
224 " does not match with source cluster collection (ID = " <<
stripSourceProdID <<
")\n.";
237 if (chi2 >
pblocks_[subdet-1].maxChi2_)
return;
248 "HLTTrackClusterRemover: pixel cluster ref from Product ID = " << cluster.
id() <<
249 " does not match with source cluster collection (ID = " <<
pixelSourceProdID <<
")\n.";
263 const type_info &hitType =
typeid(*hit);
280 }
else throw cms::Exception(
"NOT IMPLEMENTED") <<
"Don't know how to handle " << hitType.name() <<
" on detid " << detid.
rawId() <<
"\n";
298 ProductID pixelOldProdID, stripOldProdID;
319 for (vector<Trajectory>::const_iterator it = trajectories->begin(), ed = trajectories->end(); it != ed; ++it) {
321 const vector<TrajectoryMeasurement> &tms = tj.
measurements();
322 vector<TrajectoryMeasurement>::const_iterator itm, endtm;
323 for (itm = tms.begin(), endtm = tms.end(); itm != endtm; ++itm) {
327 process( hit, itm->estimate() );
342 LogDebug(
"TrackClusterRemover")<<
"to merge in, "<<oldStrRegRef->size()<<
" strp and "<<oldPxlRef->size()<<
" pxl";
347 uint32_t
id = itOld->detId();
354 for (std::set< SiStripRecHit1D::ClusterRegionalRef >::iterator topush = itskiped->second.begin();
355 topush!=itskiped->second.end();++topush){
359 itskiped->second.clear();
361 iEvent.
put( removedStripClsuterRegRefs );
365 uint32_t
id = itOld->detId();
370 for (
std::map<uint32_t, std::set< SiPixelRecHit::ClusterRef > >::iterator itskiped=
collectedPixel.begin();
373 for (std::set< SiPixelRecHit::ClusterRef >::iterator topush = itskiped->second.begin();
374 topush!=itskiped->second.end();++topush){
378 itskiped->second.clear();
380 iEvent.
put( removedPixelClsuterRefs );
T getParameter(std::string const &) const
void push_back(data_type const &d)
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
const_iterator begin() const
size_type dataSize() const
const SiStripRecHit2D * stereoHit() const
#define DEFINE_FWK_MODULE(type)
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
ClusterRegionalRef const & cluster_regional() const
std::vector< uint8_t > pixels
edm::InputTag stripClusters_
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.
std::map< uint32_t, std::set< SiStripRecHit1D::ClusterRegionalRef > > collectedRegStrip
static const unsigned int NumberOfParamBlocks
data_type const * data(size_t cell) const
edm::InputTag trajectories_
std::map< uint32_t, std::set< SiPixelRecHit::ClusterRef > > collectedPixel
edm::InputTag pixelClusters_
const_iterator end() 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)
ParamBlock(const edm::ParameterSet &iConfig)
ClusterRegionalRef const & cluster_regional() const
HLTTrackClusterRemover(const edm::ParameterSet &iConfig)
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 * monoHit() const
ClusterRef const & cluster() const
const SiStripRecHit2D & originalHit() const
~HLTTrackClusterRemover()
edm::ProductID pixelSourceProdID