48 maxChi2_(iConfig.getParameter<double>(
"maxChi2")),
74 int id1=-1,
int id2=-1,
int id3=-1,
int id4=-1,
int id5=-1,
int id6=-1) ;
83 std::auto_ptr<edmNew::DetSetVector<T> >
100 using namespace reco;
104 int id1,
int id2,
int id3,
int id4,
int id5,
int id6)
106 if (iConfig.
exists(name)) {
109 fill(pblocks_, pblocks_+NumberOfParamBlocks, pblock);
111 pblocks_[id1] = pblock;
112 if (id2 != -1) pblocks_[id2] = pblock;
113 if (id3 != -1) pblocks_[id3] = pblock;
114 if (id4 != -1) pblocks_[id4] = pblock;
115 if (id5 != -1) pblocks_[id5] = pblock;
116 if (id6 != -1) pblocks_[id6] = pblock;
122 : doTracks_(iConfig.exists(
"trajectories"))
123 , doStrip_ (iConfig.existsAs<bool>(
"doStrip") ? iConfig.getParameter<bool>(
"doStrip") :
true)
124 , doPixel_ (iConfig.existsAs<bool>(
"doPixel") ? iConfig.getParameter<bool>(
"doPixel") :
true)
126 , makeProducts_(
true)
127 , doStripChargeCheck_(iConfig.existsAs<bool>(
"doStripChargeCheck") ? iConfig.getParameter<bool>(
"doStripChargeCheck") :
false)
128 , doPixelChargeCheck_(iConfig.existsAs<bool>(
"doPixelChargeCheck") ? iConfig.getParameter<bool>(
"doPixelChargeCheck") :
false)
132 if (iConfig.
exists(
"oldClusterRemovalInfo"))
140 throw cms::Exception(
"Configuration Error") <<
"HLTTrackClusterRemoverNew: Charge check asked without cluster collection ";
142 throw cms::Exception(
"Configuration Error") <<
"HLTTrackClusterRemoverNew: Pixel cluster charge check not yet implemented";
152 readPSet(iConfig,
"Strip" , 2,3,4,5);
153 readPSet(iConfig,
"StripInner" ,2,3);
154 readPSet(iConfig,
"StripOuter" ,4,5);
161 bool usingCharge =
false;
163 if (!
pblocks_[
i].isSet_)
throw cms::Exception(
"Configuration Error") <<
"HLTTrackClusterRemoverNew: Missing configuration for detector with subDetID = " << (
i+1);
164 if (
pblocks_[
i].usesCharge_ && !usingCharge) {
165 throw cms::Exception(
"Configuration Error") <<
"HLTTrackClusterRemoverNew: Configuration for subDetID = " << (
i+1) <<
" uses cluster charge, which is not enabled.";
181 produces< edm::ContainerMask<edmNew::DetSetVector<SiPixelCluster> > >();
182 produces< edm::ContainerMask<edmNew::DetSetVector<SiStripCluster> > >();
194 for (
size_t i = 0,
n = refs.size();
i <
n; ++
i) {
195 refs[
i] = oldRefs[refs[
i]];
201 auto_ptr<edmNew::DetSetVector<T> >
207 auto_ptr<DSV>
output(
new DSV());
208 output->reserve(oldClusters.
size(), oldClusters.
dataSize());
210 unsigned int countOld=0;
211 unsigned int countNew=0;
214 const T * firstOffset = & oldClusters.
data().front();
215 for (
typename DSV::const_iterator itdet = oldClusters.
begin(), enddet = oldClusters.
end(); itdet != enddet; ++itdet) {
218 if (oldDS.empty())
continue;
220 uint32_t
id = oldDS.detId();
221 DSF outds(*output,
id);
223 for (
typename DS::const_iterator it = oldDS.begin(), ed = oldDS.end(); it != ed; ++it) {
224 uint32_t
index = ((&*it) - firstOffset);
227 outds.push_back(*it);
229 refs.push_back(index);
234 if (outds.empty()) outds.abort();
238 if (oldRefs != 0)
mergeOld(refs, *oldRefs);
245 "HLTTrackClusterRemoverNew: strip cluster ref from Product ID = " << clusterReg.
id() <<
246 " does not match with source cluster collection (ID = " <<
stripSourceProdID <<
")\n.";
266 if (chi2 >
pblocks_[subdet-1].maxChi2_)
return;
276 "HLTTrackClusterRemoverNew: pixel cluster ref from Product ID = " << cluster.
id() <<
277 " does not match with source cluster collection (ID = " <<
pixelSourceProdID <<
")\n.";
291 const type_info &hitType =
typeid(*hit);
325 }
else throw cms::Exception(
"NOT IMPLEMENTED") <<
"Don't know how to handle " << hitType.name() <<
" on detid " << detid.
rawId() <<
"\n";
343 ProductID pixelOldProdID, stripOldProdID;
366 LogDebug(
"TrackClusterRemover")<<
"to merge in, "<<oldStrMask->size()<<
" strp and "<<oldPxlMask->size()<<
" pxl";
379 for (std::vector<Trajectory>::const_iterator it = trajectories->begin(), ed = trajectories->end(); it != ed; ++it) {
381 const std::vector<TrajectoryMeasurement> &tms = tj.
measurements();
383 std::vector<TrajectoryMeasurement>::const_iterator itm, endtm;
384 for (itm = tms.begin(), endtm = tms.end(); itm != endtm; ++itm) {
389 process( hit, itm->estimate() );
403 auto const & clusters = stripClusters->data();
404 for (
auto const & item : stripClusters->ids()) {
406 if (!item.isValid())
continue;
410 if (!
pblocks_[subdet-1].cutOnStripCharge_)
continue;
414 for (
auto i = item.offset;
i<item.offset+
int(item.size); ++
i) {
416 for (
auto cAmp : clusters[
i].amplitudes() ) clusCharge+=cAmp;
427 std::auto_ptr<StripMaskContainer> removedStripClusterMask(
431 iEvent.
put( removedStripClusterMask );
433 std::auto_ptr<PixelMaskContainer> removedPixelClusterMask(
436 iEvent.
put( removedPixelClusterMask );
T getParameter(std::string const &) const
edm::EDGetTokenT< edmNew::DetSetVector< SiStripCluster > > stripClusters_
const_iterator end(bool update=false) const
size_type dataSize() const
static const unsigned int NumberOfParamBlocks
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)
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.
ProductID id() const
Accessor for product ID.
edm::EDGetTokenT< PixelMaskContainer > oldPxlMaskToken_
HLTTrackClusterRemoverNew(const edm::ParameterSet &iConfig)
edm::ContainerMask< edmNew::DetSetVector< SiStripCluster > > StripMaskContainer
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
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
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()
float minGoodStripCharge_
void process(const TrackingRecHit *hit, float chi2)
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
volatile std::atomic< bool > shutdown_flag false
edm::ContainerMask< edmNew::DetSetVector< SiPixelCluster > > PixelMaskContainer
edm::ProductID pixelSourceProdID
const_iterator begin(bool update=false) const
float minGoodPixelCharge_
edm::EDGetTokenT< StripMaskContainer > oldStrMaskToken_